• Resolved Mirco Babini

    (@mirkolofio)


    I was looking at your code and found this:

    	/**
    	 * Get excluded urls regex.
    	 *
    	 * @since  7.0.0
    	 *
    	 * @return string A regex for excluded urls.
    	 */
    	public function get_excluded_urls_regex() {
    		// Get excluded urls.
    		$parts = \get_option( 'siteground_optimizer_excluded_urls', array() );
    
    		$ecommerce_pages = array();
    
    		if ( class_exists( 'WooCommerce' ) ) {
    			$ecommerce_pages[] = wc_get_cart_url();
    			$ecommerce_pages[] = wc_get_checkout_url();
    			$ecommerce_pages[] = get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) . '*';
    		}
    
    		// Bail for ecommerce cart & checkout pages.
    		if ( function_exists( 'edd_get_checkout_uri' ) ) {
    			$ecommerce_pages[] = edd_get_checkout_uri();
    		}

    Cool that you already have some compat with WC and EDD. I also want to add compatibility with Paid Memberships Pro and it would be easy as:

    if ( function_exists( 'pmpro_url' ) ) {
    	$ecommerce_pages[] = pmpro_url( 'levels' );
    	$ecommerce_pages[] = pmpro_url( 'checkout' );
    	$ecommerce_pages[] = pmpro_url( 'confirmation' );
    	$ecommerce_pages[] = pmpro_url( 'account' );
    	$ecommerce_pages[] = pmpro_url( 'billing' );
    	$ecommerce_pages[] = pmpro_url( 'invoice' );
    	$ecommerce_pages[] = pmpro_url( 'cancel' );
    }

    Otherwise, if you add a filter like

    $ecommerce_pages = apply_filters( 'siteground_optimizer_excluded_ecommerce_pages', $ecommerce_pages );

    Let us know,
    Thanks!

    • This topic was modified 2 years, 2 months ago by Mirco Babini.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support kuzmanstoyanov

    (@kuzmanstoyanov)

    Hello @mirkolofio,

    Thank you for your suggestion.

    This was brought to the attention of the plugin’s developers but since we already have an Exclude URLs option within the Cache section of the plugin, no additional filter will be created at this point.

    Best Regards,
    Kuzman Stoyanov

    Thread Starter Mirco Babini

    (@mirkolofio)

    Thanks for your response, but I think you should reconsider your strategy.

    Like EDD and WooCommerce, even PMPro pages urls can vary and if you manage a lot of websites with PMPro it’s not fast nor reliable having to set those exclusions manually every time.

    Also, EDD has 50k+ active installs (as reported on .org) compared to PMPro which is 100k+, so can you consider adding that compatibility support in SG Optimizer code?

    Bests,

    Plugin Support kuzmanstoyanov

    (@kuzmanstoyanov)

    Hi @mirkolofio,

    Thank you for the follow up.

    The developers of the plugin confirmed they will create the requested filter, however at this point we can not provide ETA.

    The feature will be available in one of the future SiteGround Optimizer’s releases. When done, the feature will be listed in the changelog.

    Best Regards,
    Kuzman Stoyanov

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add a filter to install more url exclusions’ is closed to new replies.