• Resolved sham0i51

    (@sham0i51)


    Hi,

    I’m having an issue with a site on Site Tools running the SG Optimiser plugin. It is caching user addresses on the Woocommerce Checkout page.

    I know the plugin states that it should cache these Woocommerce by default. I also know you can add pages URL’s to exclude in the dashboard.

    The issue is that I use a slightly different directory for installations. My ‘wp-content’ directory is in the root, but renamed to ‘app’. All my other core wordpress files (excluding the index.php, and wp-config which are also in the root) are in their own directory named ‘wp’. In short my directory/file structure looks like the following…

    /app
    /index.php (modified to include wp in the path to load wp-blog-header.php)
    /wp
    /wp-config.php

    In the config file I usually define my site url, content url, content directory, and home URL buy the following…

    define('WP_SITEURL', 'https://' . $_SERVER['SERVER_NAME'] . '/wp');
    define('WP_HOME',    'https://' . $_SERVER['SERVER_NAME'] );
    
    define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/app');
    define('WP_CONTENT_URL', 'https://' . $_SERVER['SERVER_NAME'] . '/app');

    With Site tools I have to replace $_SERVER[‘DOCUMENT_ROOT’] with the path ‘/home/customer/www/mywebsite.com/public_html’ to get it working.

    As a result of this setup, when I try to exclude a URL in the dashboard it add it as… mywebsite.com/wp/checkout, when in fact it is mywebsite.com/checkout

    I know there are filters for excluding files from minification, but I can find any documentation for a filter to exclude URL’s from caching, so that I can add the required urls without ‘/wp’ in the path.

    I have contacted Siteground support for some issues I was experiencing before with the SG Optimizer plugin, but was told the plugin can’t support my file structure, and I should revert to the default.

    I don’t want to do this for multiple reasons, but I would also like to keep using the SG Optimizer, as I’m on Siteground hosting and would like to avail of their services.

    Surely there must be a way to configure the plugin to work for this file structure, or at least for me to be able to submit the correct URLs needed for caching. Any help or advice from someone would be greatly appreciated.

    Thanks in advance
    Sham

    • This topic was modified 4 years, 1 month ago by sham0i51.
    • This topic was modified 4 years, 1 month ago by sham0i51.
    • This topic was modified 4 years, 1 month ago by sham0i51.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @sham0i51

    Would it be possible to provide your site URL, and we will check the issue.

    Regards,
    Stanimir

    Thread Starter sham0i51

    (@sham0i51)

    Hi @sstoqnov,

    Thanks for the reply.

    So I had to deactivate the plugin on the live installation, as we received multiple emails from customers to tell us they were seeing others peoples information at checkout.

    I can’t activate the plugin on the live installation again until i’m 100% sure it won’t happen again as it’s a clients site, and they aren’t too happy that the issue occurred.

    I have duplicated the installation exactly as is on a temporary SG domain, running exactly the same theme and plugins here… https://clodaghr.sg-host.com

    I can’t replicate the issue myself, but others are definitely seeing it. I have been sent multiple screen shots of the issue.

    Is there any way to be able to override the WP_SITEURL when adding URLs to the ‘Excluding URLs’ section in the plugin? This would help to add confidence that the correct URL’s are definitely being excluded.

    I’ll needed the URL for checkout to be… https://clodaghr.sg-host.com/checkout

    I currently can only add https://clodaghr.sg-host.com/wp/checkout

    The same applies to pages like the contact form… https://clodaghr.sg-host.com/contact

    I can only add https://clodaghr.sg-host.com/wp/contact

    Thanks in advance

    Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @sham0i51

    I don’t see a reason, why the checkout page is being cached, because every time you add a product in the cart, the woocommerce cookie is being set.

    We check the cookies before we return cached content and if such a cookie exists, we don’t return cached content.

    Please install the plugin on the main site and I will manually patch it, so you can use the exclude functionality.

    Regards,
    Stanimir

    Thread Starter sham0i51

    (@sham0i51)

    Hi Stanimir,

    Thanks for taking a look at the test site for me. Something strange must have happened between the Cookiebot plugin and the SG Optimizer plugin on Friday on the live site so if that is the case.

    I wouldn’t believe it myself, only that I have multiple screenshots sent in from customers showing others details over the weekend. A Gift Card item in the basket with the receiver of gift cards information there is one, and two others with the checkout form field pre populated with another customers address and email.

    I first cleared the cache in the WordPress dashboard after hearing of the first scenario. When the other complaints came in I cleared the cache in Site Tools dashboard, and cleared customer sessions in the WordPress tools. Then I deactivated the plugin at the request of the owner of the website.

    They have just instructed me not to reactivate the SG plugin on the live site. Their shop is community based, and they have just launched online to help overcome COVID lockdowns. Local customers seeing others details is not an option for them at the moment, as word would easily spread around the community. I can understand their point of view for the moment and need to respect their wishes.

    I do have multiple other sites that I manage on Siteground, with a lot scheduled to be moved over to Site Tools in the coming weeks. Is there a way I can use the exclude functionality myself for these sites? Even through a filter? Can you provide documentation of how to patch myself in way they are not overridden by updates? I want to use the plugin on other sites, but it’s not feasible to request this patch from a Siteground agent on every site.

    Many Thanks
    Sham

    Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @sham0i51

    You can use the following snippet I’ve just created to add additional excludes:

    
    function add_excludes() {
    	$existing_excludes = get_option( 'siteground_optimizer_excluded_urls', array() );
    
    	$new_excludes = array(
    		'/checkout',
    		'/cart',
    		'/etc',
    	);
    
    	foreach ( $new_excludes as $path ) {
    		if ( in_array( $path, $existing_excludes ) ) {
    			continue;
    		}
    
    		$existing_excludes[] = $path;
    	}
    
    	update_option( 'siteground_optimizer_excluded_urls', $existing_excludes );
    }
    

    Note that it should be run only once, then check if the excludes were added in the Supercacher tab.

    Regards,
    Stanimir

    Thread Starter sham0i51

    (@sham0i51)

    Hi @sstoqnov,

    The above snippet when used on the test site provided above creates ‘https://clodaghr.sg-host.com/wp/checkout’, while the actual URL of the checkout page on the site is ‘https://clodaghr.sg-host.com/checkout’.

    This is the exact issue i’m trying to overcome. I’m already aware I can exclude URLS in the dashboard. The above code functions exactly the same, and doesn’t overcome my issue.

    The WP_SITEURL for the test installation above is ‘https://clodaghr.sg-host.com/wp’. The WP_HOME is ‘https://clodaghr.sg-host.com’, so URLS for pages shouldn’t include the ‘/wp’ in the file path.

    Your plugin is adding them with ‘/wp’ in the URL path to the pages. I’m looking to overcome this.

    I need to be able to add the correct URLs without ‘/wp’ in them.

    When I try your code provided with a full URL it still adds the WP_SITEURL, so I get the following URL excluded…
    https://clodaghr.sg-host.com/wphttps://clodaghr.sg-host.com/wp/checkout’

    Does that make sense? I’m looking for a solution where the WP_SITEURL won’t affect the URL’s created. WP_HOME is more important in mine.

    Regards
    Sham

    Hi
    Just to let you know that we experienced the exact same issue with customers seeing other customers addresses in the checkout process. Due to other reasons, we have moved most shop functions to a third party site but at some point do want to return to Woo Commerce – but this is a worry as it would be a clear data breach and could even subject us to large fines from regulators

    Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @sacfc

    We will fix the issue in the next major update.

    Regards,
    Stanimir

    Thread Starter sham0i51

    (@sham0i51)

    Thanks @sacfc . Good to know in a way that the issue isn’t specific to my site.

    @sstoqnov when do you expect the next major update of the plugin to be released?

    Thread Starter sham0i51

    (@sham0i51)

    Hi @sstoqnov

    Is there any update to this issue? Is it fixed? I’m worried about enabling incase customers information is displayed to other users again.

    As of this week I’m being forced to run SG Optimizer to see updates to content.

    This is due to Dynamic cache ow enabled for everybody. Changes made in the dashboard now don’t reflect on the front end without flushing the Dynamic cache in site Tools.

    Obviously normal editors can’t have access to Siteground Site tools, so they need to be able to flush from the dashboard. To do this I need SG optimizer.

    Can you confirm if the issue has been resolved. I temporarily actived the plugin and it doesn’t look like it. I’m still being forced to use the WP_SITEURL instead of the desired WP_HOME variable in the page URL’s.

    Sham

    Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @sham0i51

    We’ve released 5.7.17 and you should be able to exclude the shop page.

    Regards,
    Stanimir

    Thread Starter sham0i51

    (@sham0i51)

    Hi @sstoqnov,

    Amazing, so I can. Looking forward to testing and using SG Optimiser plugin again.

    Much Appreciated.
    Sham

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Woocommerce Cart page caching users addresses’ is closed to new replies.