Skip to content

Commit

Permalink
Update creame optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
pacotole committed Nov 28, 2023
1 parent e7f9bd9 commit 956244a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions web/app/mu-plugins/creame-optimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Creame Optimize
Plugin URI: https://crea.me/
Description: Optimizaciones de Creame para mejorar tu <em>site</em>.
Version: 2.1.4
Version: 2.1.5
Author: Creame
Author URI: https://crea.me/
License: MIT License
Expand Down Expand Up @@ -293,8 +293,8 @@ function creame_remove_hentry_class($classes) {

// Conditional plugin load.
function creame_active_plugins ($plugins){
// Heartbeat disable all
if (wp_doing_ajax() && isset($_POST['action']) && 'heartbeat' === $_POST['action']) return [];
// Heartbeat disable all (except Elementor)
if (wp_doing_ajax() && isset($_POST['action']) && 'heartbeat' === $_POST['action']) return array_intersect($plugins, ['elementor/elementor.php']);
// Admin only plugins
if (!defined('WP_CLI') && !is_admin()) return array_diff($plugins, [
'classic-editor/classic-editor.php',
Expand Down Expand Up @@ -456,6 +456,9 @@ function fix_admin_ithemes_icon_font() {
// Disable connect to woocommerce.com notice
add_filter('woocommerce_helper_suppress_admin_notices', '__return_true');

// Disable Woo usage tracking
add_filter('pre_option_woocommerce_allow_tracking', '__return_false');

// Disable extensions menu
function creame_remove_admin_addon_submenu() {
remove_submenu_page('woocommerce', 'wc-addons');
Expand All @@ -479,8 +482,8 @@ function creame_customer_hide_shipping($fields) {
if ('disabled' === get_option('woocommerce_ship_to_countries') || 'billing_only' === get_option('woocommerce_ship_to_destination')) unset($fields['shipping']);
return $fields;
}

add_filter('woocommerce_customer_meta_fields', 'creame_customer_hide_shipping');

// Fix prefetch & prerender links
function creame_fix_resource_hints($urls, $relation_type) {
if (!in_array($relation_type, ['prefetch', 'prerender'], true)) return $urls;
Expand Down

0 comments on commit 956244a

Please sign in to comment.