This file contains 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
""" | |
This is a simple Python 3 script to sync all CloudFlare DNS records based on a JSON file. | |
Basically: | |
- It adds new domains if they aren't in CloudFlare yet | |
- For every domain: new DNS records will be added, existing records will be updated and records not existing in the JSON will be deleted | |
By default the script only does a dry run (simulation). Run the script with parameter "execute" to execute it. | |
If you only want to add/update some domains, fill in the "only" key in the JSON file with an array of domains you want to add/update. |
This file contains 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
#!/bin/bash | |
php -d memory_limit=-1 $(which wp) package install wp-cli/profile-command:@stable --allow-root | |
php -d memory_limit=-1 $(which wp) package install wp-cli/doctor-command:@stable --allow-root |
This file contains 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 | |
if ( isset( $_GET['wc-ajax'] ) && 'get_refreshed_fragments' === $_GET['wc-ajax'] && ( !isset( $_COOKIE['woocommerce_cart_hash'] ) || empty( $_COOKIE['woocommerce_cart_hash'] ) ) && ( !isset( $_COOKIE['woocommerce_items_in_cart'] ) || empty( $_COOKIE['woocommerce_items_in_cart'] ) ) ) { | |
$data = get_transient( 'rocket_get_refreshed_fragments_cache' ); | |
if ( ! empty( $data ) ) { | |
$data = json_decode( $data ); | |
wp_send_json( $data ); | |
} | |
ob_start(); |
This file contains 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
function SetSearchArgs( $formattedArgs, $args = [] ) { | |
if( isset( $args[ 'post_type' ] ) && ( count( $args[ 'post_type' ] ) > 1 || gettype( $args[ 'post_type' ] ) === 'string' ) ) { | |
if( gettype( $args[ 'post_type' ] ) === 'array' ) { | |
$existing_query = $formattedArgs[ 'query' ]; | |
unset( $formattedArgs[ 'query' ] ); |
This file contains 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
http://docs.easydigitaldownloads.com/article/1054-caching-issues | |
http://docs.easydigitaldownloads.com/article/993-cloudflare | |
http://docs.easydigitaldownloads.com/article/190-payments-not-marked-as-complete | |
http://docs.easydigitaldownloads.com/article/297-wp-super-cache | |
http://docs.easydigitaldownloads.com/article/1874-preventing-empty-cart-messages-with-varnish | |
https://wordpress.org/plugins/simple-cache/ | |
https://deliciousbrains.com/page-caching-personalized-dynamic-content/ |
This file contains 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
/** | |
* Fix a race condition in alloptions caching | |
* | |
* See https://core.trac.wordpress.org/ticket/31245 | |
*/ | |
function _wpcom_vip_maybe_clear_alloptions_cache( $option ) { | |
if ( ! wp_installing() ) { | |
$alloptions = wp_load_alloptions(); //alloptions should be cached at this point | |
if ( isset( $alloptions[ $option ] ) ) { //only if option is among alloptions | |
wp_cache_delete( 'alloptions', 'options' ); |
This file contains 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
#!/bin/bash | |
# connect to memcached | |
exec 3<>/dev/tcp/"${1:-localhost}"/"${2:-11211}" || exit $? | |
# get slab numbers | |
printf 'stats slabs\r\n' >&3 | |
slabnums=() | |
while IFS=' :' read -r stat slabnum _; do | |
if [[ $stat == $'END\r' ]]; then |
This file contains 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 | |
define('INBOUND_FAST_AJAX' , true ); | |
/** | |
* Enable Fast Ajax | |
*/ | |
add_filter( 'option_active_plugins', 'ajax_disable_plugins' ); | |
function ajax_disable_plugins($plugins){ |
This file contains 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
# BEGIN POWERED CACHE | |
<IfModule mod_mime.c> | |
AddType image/jpeg .jpg .jpeg .jpe | |
AddType image/gif .gif | |
AddType image/png .png | |
AddType image/bmp .bmp | |
AddType image/tiff .tiff .tif | |
AddType image/x-icon .ico | |
AddType video/x-ms-asf .asf .asx | |
AddType video/x-ms-wmv .wmv |
NewerOlder