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 | |
/** | |
* Plugin Name: Imagify | Skip <picture> Tag Replacement | |
* Description: Excludes <img> tags from <picture> tag replacement for WebP display if they have either a data-skip-picture-replacement="yes" attribute or "skip-picture-replacement" class. Can be edited to target other classes for exclusion. | |
* Plugin URI: https://github.com/wp-media/imagify-helpers/tree/master/optimization/imagify-skip-picture-tag-replacement/ | |
* Author: WP Media | |
* Author URI: https://wp-media.me/ | |
* Licence: GNU General Public License v2 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
* |
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 config block | |
map $http_accept $webp_ext { | |
default ""; | |
"~*webp" ".webp"; | |
} | |
# server config block | |
location ~* ^(/wp-content/.+)\.(png|jpg)$ { | |
add_header Vary Accept; | |
try_files $1$webp_ext $uri =404; |
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
<html> | |
<head> | |
<title>jsonp test</title> | |
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$('#select_link').click(function(e){ | |
e.preventDefault(); | |
console.log('select_link clicked'); | |
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
/* Disable WP Rocket option 'async_css'. */ | |
add_action( 'wp', function () { | |
// Stop here if WPR is not active. | |
if ( ! function_exists( 'get_rocket_option' ) ) { | |
return false; | |
} | |
// Only on front-end. | |
if ( ! is_admin() ) { |
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 | |
defined( 'ABSPATH' ) or die( 'Cheatin’ uh?' ); | |
/** | |
* Plugin Name: WP Rocket | Fix Error 500 | |
* Description: Prevents the dreaded error 500 from appearing. | |
* Author: WP Rocket Support Team | |
* Author URI: http://wp-rocket.me/ | |
* License: GNU General Public License v3 or later | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ |
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 wp_rocket_clear_user_cache_purchase() { | |
$user = wp_get_current_user(); | |
rocket_clean_user( $user->ID ); | |
} | |
add_action( 'woocommerce_payment_complete', 'wp_rocket_clear_user_cache_purchase' ); |
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 wp_rocket_deactivate_inline_css_minify( $html_options ) { | |
unset( $html_options['cssMinifier'] ); | |
return $html_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
function wp_rocket_activate_inline_js_minify( $html_options ) { | |
$html_options['jsMinifier'] = 'rocket_minify_inline_js'; | |
return $html_options; | |
} | |
add_filter( 'rocket_minify_html_options', 'wp_rocket_activate_inline_js_minify' ); |
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 // Do NOT use opening tag! | |
add_action( 'init', '__deactivate_rocket_cdn_for_logged_in_users_2911' ); | |
function __deactivate_rocket_cdn_for_logged_in_users_2911() { | |
if ( ! is_user_logged_in() ) { | |
return; | |
} | |
remove_filter( 'template_directory_uri' , 'rocket_cdn_file', PHP_INT_MAX ); | |
remove_filter( 'wp_get_attachment_url' , 'rocket_cdn_file', PHP_INT_MAX ); |
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 // Remove the opening tag | |
remove_filter( 'the_content', 'rocket_lazyload_images', PHP_INT_MAX ); | |
remove_filter( 'widget_text', 'rocket_lazyload_images', PHP_INT_MAX ); | |
remove_filter( 'get_image_tag', 'rocket_lazyload_images', PHP_INT_MAX ); | |
remove_filter( 'post_thumbnail_html', 'rocket_lazyload_images', PHP_INT_MAX ); |
NewerOlder