This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Keyy compat fix for Jetpack | |
*/ | |
add_action('plugins_loaded', 'keyy_compat'); | |
function keyy_compat() { | |
if ( is_multisite() && ! is_main_site() ) { | |
switch_to_blog( $this->get_main_blog_id() ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PRELOAD_FULLPAGE_CACHE | |
{ | |
function __construct() { | |
add_action( 'wp_insert_post', array( $this, 'preload_desktop' ), 900, 3 ); // let's fetch the post very late | |
add_action( 'wp_insert_post', array( $this, 'preload_mobile' ), 990, 3 ); // let's fetch mobile version even later | |
add_action( 'wp_insert_post', array( $this, 'preload_amp' ), 999, 3 ); // let's fetch AMP version at last; only works on posts | |
} | |
// verison to fetch: desktop | |
// user-agent: Chrome 62 on a macOS Sierra 10.12.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Staged_Sleep_Task extends Updraft_Task_1_0 { | |
public function initialise() { | |
$sleep_for = $this->get_random_time_intervals(); | |
$this->update_option('sleep_for', $sleep_for); | |
} | |
public function run() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$trie = new Trie(); | |
$start = microtime(true); | |
for ( $i = 0 ; $i < 20000000 ; $i++ ) { | |
$sid = bin2hex(openssl_random_pseudo_bytes(8)); | |
$collision = $trie->search($sid) ; | |
if ( is_null($collision) ) { | |
$trie->add($sid, 1); | |
} else { | |
echo "\n" ."Collision with previous Hash" ."\n" ; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$j = 0; | |
$start = microtime(true); | |
for ( $i = 0 ; $i < PHP_INT_MAX ; $i++ ) { | |
$j++; | |
} | |
echo $j . "\n" ; | |
$time_elapsed_secs = microtime(true) - $start; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19:27:39.793 TypeError: 'insertCell' called on an object that does not implement interface HTMLTableRowElement. | |
Stack trace: | |
e@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24986 | |
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24871 | |
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24894 | |
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24894 | |
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24894 | |
dc/<@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24782 | |
each@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:2:2879 | |
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24738 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_footer', function() { | |
if( 'membership_signup' == $_POST['action'] ) | |
{ | |
$membership_id = $_POST['membership_id']; | |
$membership = MS_Factory::load( 'MS_Model_Membership', intval( $membership_id ) ); | |
$prefix = str_replace( ' ', '_', strtolower( $membership->name ) ) . '_'; | |
$username = $prefix . rand( 1000 , 9999 ); | |
?> | |
<script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### We are adding telephone number as custom field | |
1. Go to /wp-content/plugins/membership/app/view/templates/ and copy all 4 files. | |
2. Go to /wp-content/themes/YOUR_CURRENT_THEME/ and create a new folder called membership2, then paste all 4 files inside the new created membership2 folder | |
3. Open membership_registration_form.php and put the following: membership_registration_form.php | |
4. Now open the membership_account.php file and put the following: membership_account.php | |
5. Finally need to add some code: mu-plugin.php | |
## You can add those codes in your functions.php in the theme, | |
## if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
var setText = function() { | |
$('.app_timetable:visible div.app_timetable_cell:nth(0)').contents().filter(function() { | |
return this.nodeType == 3; | |
}) | |
.replaceWith("Morning") ; | |
$('.app_timetable:visible div.app_timetable_cell:nth(1)').contents().filter(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('login-form', 'i332i_login_form_shortcode'); | |
function i332i_login_form_shortcode( $attr ) { | |
if ( is_user_logged_in() ) | |
return ''; | |
/* Set up some defaults. */ | |
$defaults = array( | |
'label_username' => 'Username', |