Skip to content

Commit

Permalink
Upd Creame optimize heartbeat plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
pacotole committed Nov 29, 2023
1 parent 956244a commit fed6912
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/app/mu-plugins/creame-optimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,12 @@ function creame_remove_hentry_class($classes) {

// Conditional plugin load.
function creame_active_plugins ($plugins){
// Heartbeat disable all (except Elementor)
if (wp_doing_ajax() && isset($_POST['action']) && 'heartbeat' === $_POST['action']) return array_intersect($plugins, ['elementor/elementor.php']);
// Heartbeat disable all without heartbeat filters
if (wp_doing_ajax() && isset($_POST['action']) && 'heartbeat' === $_POST['action']) return array_intersect($plugins, [
'elementor/elementor.php',
'ithemes-security-pro/ithemes-security-pro.php',
'woocommerce/woocommerce.php',
]);
// Admin only plugins
if (!defined('WP_CLI') && !is_admin()) return array_diff($plugins, [
'classic-editor/classic-editor.php',
Expand Down

0 comments on commit fed6912

Please sign in to comment.