Forum Replies Created

Viewing 15 replies - 16 through 30 (of 399 total)
  • Thread Starter diegpl

    (@diegpl)

    I see, but if I set just one key for all websites it will not work then? For sure? Because this would speed things up a lot 🙂

    Thread Starter diegpl

    (@diegpl)

    Please, also fix this one: “Return type of MercadoPago\PP\Sdk\Common\AbstractCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice” in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Common/AbstractCollection.php:64 changing this:

    public function getIterator()
    {
    return new \ArrayIterator($this->collection);
    }

    for

    public function getIterator(): \Traversable
    {
    return new \ArrayIterator($this->collection);
    }
    Thread Starter diegpl

    (@diegpl)

    stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated

    1. wp-content/plugins/google-site-kit/includes/Core/REST_API/REST_Routes.php:69
    2. stripos()
      wp-content/plugins/google-site-kit/includes/Core/REST_API/REST_Routes.php:69
    3. Google\S\C\R\REST_Routes->Google\S\C\R\{closure}()
      wp-includes/class-wp-hook.php:308
    4. apply_filters('query_vars')
      wp-includes/class-wp.php:299
    5. WP->parse_request()
      wp-includes/class-wp.php:780
    6. WP->main()
      wp-includes/functions.php:1334
    7. wp()
      wp-blog-header.php:16

    Please, change this code:

    $unset_vars = ( $wp->request && stripos( $wp->request, trailingslashit( rest_get_url_prefix() ) . self::REST_ROOT ) !== false ) // Check regular permalinks.
    							|| ( empty( $wp->request ) && stripos( $this->context->input()->filter( INPUT_GET, 'rest_route' ), self::REST_ROOT ) !== false ); // Check plain permalinks.

    For this one as well:

    $unset_vars = ( $wp->request && stripos( (string) $wp->request, trailingslashit( rest_get_url_prefix() ) . self::REST_ROOT ) !== false ) // Check regular permalinks.
        || ( empty( $wp->request ) && stripos( (string) $this->context->input()->filter( INPUT_GET, 'rest_route' ), self::REST_ROOT ) !== false ); // Check plain permalinks.

    Tks! 😉

    Thread Starter diegpl

    (@diegpl)

    We could improve that getting just the meta_key value as _woocommerce_persistent_cart_websiteid, right? 🙂

    Thread Starter diegpl

    (@diegpl)

    Actually, the best approach would be to improve the query generated by the function, right? Tks! 😉

    SELECT umeta_id as meta_id, meta_key, meta_value
    FROM wp_usermeta
    WHERE user_id = 1
    ORDER BY umeta_id
    • This reply was modified 2 years, 11 months ago by diegpl.
    Thread Starter diegpl

    (@diegpl)

    You can use Query Monitor plugin to check it out 😉

    Thread Starter diegpl

    (@diegpl)

    Some other not needed queries I prevented commenting these lines in woocommerce/src/Internal/Admin/Notes/WooSubscriptionsNotes.php line 39

    public function __construct() {
    		//add_action( 'admin_init', array( $this, 'admin_init' ) );
    		//add_action( 'update_option_woocommerce_helper_data', array( $this, 'update_option_woocommerce_helper_data' ), 10, 2 );
    	}
    Thread Starter diegpl

    (@diegpl)

    Just if I comment this lines in Notes.php some of the not needed queries are gone:

    	public static function init() {
    		//add_action( 'admin_init', array( __CLASS__, 'schedule_unsnooze_notes' ) );
    		//add_action( 'admin_init', array( __CLASS__, 'possibly_delete_survey_notes' ) );
    		//add_action( 'update_option_woocommerce_show_marketplace_suggestions', array( __CLASS__, 'possibly_delete_marketing_notes' ), 10, 2 );
    	}
    Thread Starter diegpl

    (@diegpl)

    The function is in woocommerce/src/Admin/Notes/Notes.php

    /**
    	 * Delete actioned survey notes.
    	 */
    	public static function possibly_delete_survey_notes() {
    		$data_store = self::load_data_store();
    		$note_ids   = $data_store->get_note_ids_by_type( Note::E_WC_ADMIN_NOTE_SURVEY );
    
    		foreach ( $note_ids as $note_id ) {
    			$note = self::get_note( $note_id );
    			if ( $note && ( $note->get_status() === Note::E_WC_ADMIN_NOTE_ACTIONED ) ) {
    				$note->set_is_deleted( 1 );
    				$note->save();
    			}
    		}
    	}

    I tried this code to prevent that with no success:

    function prevent_possibly_delete_survey_notes() {
        remove_action( 'admin_init', array( 'Automattic\W\A\N\Notes', 'possibly_delete_survey_notes' ), PHP_INT_MAX );
    }
    add_action( 'admin_init', 'prevent_possibly_delete_survey_notes' );
    Thread Starter diegpl

    (@diegpl)

    This code run, but did not solve the issue:

    function dndstudio_refresh_header_cart_partials( WP_Customize_Manager $wp_customize ) {
    
    	if ( ! isset( $wp_customize->selective_refresh ) ) {
    	      return;
    	}
    
    	// Cart
    	$wp_customize->selective_refresh->add_partial( 'header-cart', array(
    	    'selector' => '.cart-item',
    	    'container_inclusive' => true,
    	    'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
    	    'render_callback' => function() {
    	        mclude('template-parts/header/partials/element-cart.php');
    	    },
    	) );
    
    	// Cart
    	$wp_customize->selective_refresh->add_partial( 'header-cart', array(
    	    'selector' => '.header-nav .cart-item',
    	    'container_inclusive' => true,
    	    'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
    	    'render_callback' => function() {
    	        mclude('template-parts/header/partials/element-cart.php');
    	    },
    	) );
    
    	$wp_customize->selective_refresh->add_partial( 'header-cart-mobile', array(
    	    'selector' => '.mobile-nav .cart-item',
    	    'container_inclusive' => true,
    	    'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
    	    'render_callback' => function() {
    	        mclude('template-parts/header/partials/element-cart-mobile.php');
    	    },
    	) );
    
    }
    add_action( 'customize_register', 'dndstudio_refresh_header_cart_partials' );
    Thread Starter diegpl

    (@diegpl)

    To get the template-parts cart files, Flatsome is using this code. How could I implement the mclude on it?

    function dndstudio_refresh_header_cart_partials( WP_Customize_Manager $wp_customize ) {
    
    	if ( ! isset( $wp_customize->selective_refresh ) ) {
    	      return;
    	}
    
    	// Cart
    	$wp_customize->selective_refresh->add_partial( 'header-cart', array(
    	    'selector' => '.cart-item',
    	    'container_inclusive' => true,
    	    'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
    	    'render_callback' => function() {
    	        get_template_part('template-parts/header/partials/element','cart');
    	    },
    	) );
    
    	// Cart
    	$wp_customize->selective_refresh->add_partial( 'header-cart', array(
    	    'selector' => '.header-nav .cart-item',
    	    'container_inclusive' => true,
    	    'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
    	    'render_callback' => function() {
    	        get_template_part('template-parts/header/partials/element','cart');
    	    },
    	) );
    
    	$wp_customize->selective_refresh->add_partial( 'header-cart-mobile', array(
    	    'selector' => '.mobile-nav .cart-item',
    	    'container_inclusive' => true,
    	    'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
    	    'render_callback' => function() {
    	        get_template_part('template-parts/header/partials/element','cart-mobile');
    	    },
    	) );
    
    }
    add_action( 'customize_register', 'dndstudio_refresh_header_cart_partials' );
    Thread Starter diegpl

    (@diegpl)

    Flatsome cart is in template-parts/header/partials/element-cart.php file. Should I wrap all its code with

    <!-- mfunc mysecurestring -->

    Or I also can use

    <!-- mclude mysecurestring -->

    to include the file instead to use the mfunc? Is that how it works in order to get it done? Tks! 😉

    Thread Starter diegpl

    (@diegpl)

    I have done what you said and it worked, but the page is much slower now, although Page Cache is enabled. That was not the expected, right? How can I debug the reason that happened, please? 🙂

    Thread Starter diegpl

    (@diegpl)

    So, is the issue solved in this new version? Tks! 🙂

    Thread Starter diegpl

    (@diegpl)

    The plugin is trying to get optimized images data from the whole network in the settings panel top. That is why the issue is happening.

Viewing 15 replies - 16 through 30 (of 399 total)