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
add_filter( 'query', 'sel_filter_slow_query', 999 ); | |
function sel_filter_slow_query( $query ) { | |
//set an array of functions which run the slow queries: | |
$banned_functions = array ( 'count_users','bbp_get_statistics', 'bpbbpst_support_statistics' ); | |
foreach($banned_functions as $banned_function){ | |
if ( in_array( $banned_function , wp_list_pluck( debug_backtrace(), 'function' ) ) ) { | |
return "SELECT 1 "; | |
} | |
} |
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: Optimole - Disable replacement on Yoast head on Rest API | |
Version: 0.0.1 | |
Requires PHP: 7.0 | |
Author URI: https://optimole.com | |
*/ | |
namespace OptmlTweaks; |
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: Optimole - Force replacements on ajax when logged in. | |
Version: 0.0.1 | |
Requires PHP: 7.0 | |
Author URI: https://optimole.com | |
*/ | |
add_filter('optml_force_replacement',function($return){ | |
if( is_user_logged_in() ){ |
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: Remove login. | |
Description: Plugin that removes login WordPress, useful on testing environments. Should never be used on production. | |
Author: Marius Cristea | |
Version: 0.0.1 | |
*/ | |
add_action( 'after_setup_theme', function () { | |
if ( ! is_user_logged_in() ) { |
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: Remove Neve block patterns | |
Description: Plugin that removes Neve block patterns | |
Author: Themeisle | |
Version: 0.0.1 | |
*/ | |
add_action( 'admin_init', function () { | |
foreach ( WP_Block_Patterns_Registry::get_instance()->get_all_registered() as $pattern ) { |
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: Optimole Tweak - Redirect Yoast attachments to Optimole urls. | |
* Version: 0.0.1 | |
*/ | |
add_filter( 'wpseo_attachment_redirect_url', function ( $url ) { | |
return apply_filters( 'optml_content_url', $url ); | |
}, 999 ); | |
add_filter( 'attachment_link', function ( $url, $id ) { |
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: Optimole Tweak - Add exif data. | |
* Version: 0.0.1 | |
*/ | |
add_filter( 'optml_replace_image', 'opml_add_exif', 99 ); | |
add_filter( 'optml_content_url', 'opml_add_exif', 99 ); | |
function opml_add_exif( $url ) { |