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 jQuery_CDN { | |
/** | |
* @var int | |
*/ | |
private $jquery_version = 0; | |
/** | |
* @var int | |
*/ |
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: Advanced Nav Caching | |
Description: Cache nav output | |
Version: 1.0.0 | |
Author: Spacedmonkey | |
*/ | |
class Advanced_Nav_Cache { |
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
/** | |
* Retrieve site option value based on name of option. | |
* | |
* @since 2.8.0 | |
* | |
* @see get_option() | |
* | |
* @global wpdb $wpdb | |
* | |
* @param string $option Name of option to retrieve. Expected to not be SQL-escaped. |
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
callback: function ( elem, op ) { | |
if( op === 'load' ) { | |
if (elem.getAttribute('data-echo-srcset') !== null) { | |
elem.setAttribute('srcset', elem.getAttribute('data-echo-srcset')); | |
} | |
} | |
} |
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: Batcache Manager | |
Plugin URI: http://wordpress.org/extend/plugins/batcache/ | |
Description: This optional plugin improves Batcache. | |
Author: Andy Skelton | |
Author URI: http://andyskelton.com/ | |
Version: 1.3 | |
*/ | |
global $batcache, $wp_object_cache; |
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
cd /path/to/root | |
for url in $(wp site list --field=domain) | |
do | |
echo ${url} | |
wp --url=${url} option update db_version 30133 | |
echo | |
done | |
wp --url=${url} core update-db --network |
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 Red_Item { | |
private $id = null; | |
private $created; | |
private $referrer; | |
private $url = null; | |
private $regex = false; | |
private $action_data = null; | |
private $action_code = 0; |
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
if ( count( $domains ) > 1 && count( $paths ) > 1 ) { | |
$sql = "SELECT * FROM $wpdb->blogs WHERE domain IN ($search_domains) AND path IN ($search_paths) ORDER BY CHAR_LENGTH(domain) DESC, CHAR_LENGTH(path) DESC LIMIT 1"; | |
} elseif ( count( $domains ) > 1 ) { | |
$sql = $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE path = %s", $paths[0] ); | |
$sql .= " AND domain IN ($search_domains) ORDER BY CHAR_LENGTH(domain) DESC LIMIT 1"; | |
} elseif ( count( $paths ) > 1 ) { | |
$sql = $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s", $domains[0] ); | |
$sql .= " AND path IN ($search_paths) ORDER BY CHAR_LENGTH(path) DESC LIMIT 1"; | |
} else { | |
$sql = $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $domains[0], $paths[0] ) ); |
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
$sql = "LIMIT 10"; | |
$cache_key = md5($sql); | |
$post_ids = wp_cache_get( $cache_key, 'keystone_redirects' ); | |
if( false === $post_ids ){ | |
$post_ids = $wpdb->get_col( $sql ); | |
$cache_time = (count($post_ids) > 0 ) ? MINUTE_IN_SECONDS : DAY_IN_SECONDS; | |
wp_cache_set( $cache_key, $post_ids, 'keystone_redirects', $cache_time ); | |
} |
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
public function pre_get_posts( $wp_query ) { | |
$this->cache_queries = apply_filters( 'use_enhanced_post_cache', true, $wp_query ); | |
if( $this->cache_queries ){ | |
if ( $wp_query->is_404() ) { | |
$page_variable = array( 'error_404' ); | |
} else { | |
$page_variable = $wp_query->query_vars; | |
} |