Skip to content

Instantly share code, notes, and snippets.

View jbma's full-sized avatar

Jean-Baptiste Marchand-Arvier jbma

View GitHub Profile
<?php
if isset( $_COOKIE[ 'wordpress_logged_in_'] ){
define ('DONOTCACHEPAGE', true);
}
<?php
function zarza_custom_clear_cache(){
$ch = curl_init("https://192.198.89.58");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PURGE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
<?php
add_action( 'admin_init', 'remove_rocket_plugin_notice' );
function remove_rocket_plugin_notice() {
remove_action( 'admin_notices', 'rocket_warning_plugin_modification' );
}
<?php
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
/*
Plugin Name: Add all images to CDN
Author: Jonathan (WP Rocket Team)
Author URI: http://wp-rocket.me
*/
add_filter( 'rocket_buffer', 'rocket_cdn_images', PHP_INT_MAX );
<?php
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
/*
Plugin Name: Fix html minify
Author: Jonathan (WP Rocket Team)
Author URI: http://wp-rocket.me
*/
add_filter('rocket_minify_html_options', '__return_empty_array');
<?php
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
/*
Plugin Name: Disable GZip
Author: Jean-Baptiste (WP Rocket Team)
Author URI: http://wp-rocket.me
*/
add_filter( 'rocket_htaccess_mod_deflate', '__return_false' );
<?php
add_filter( 'wp', '__deactivate_rocket_lazyload_if_home' );
function __deactivate_rocket_lazyload_if_home()
{
if( is_home() || is_front_page() ) {
add_filter( 'do_rocket_lazyload', '__return_false' );
}
zlib.output_compression = true
zlib.output_compression_level = 9
<?php
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
/*
Plugin Name: Use PHP Cache with WP Rocket
Author: Jean-Baptiste (WP Rocket Team)
Author URI: http://wp-rocket.me
*/
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false' );
<?php
add_filter( 'wp', '__deactivate_rocket_lazyload_if_home' );
function __deactivate_rocket_lazyload_if_home()
{
if( is_home() || is_front_page() ) {
add_filter( 'do_rocket_lazyload', '__return_false' );
}