Public Ticket #2846441

Ongoing "Page not Found" Account page issues

Closed
Comments
7 Tickets 6
Dan started the conversation 5 years ago on August 11, 2021 at 2:34am

Hello,

We keep having ongoing "Page Not Found" issues on the Account Pages.

I have done all the steps recommended in your articles (deactivate/reactive plugin etc). This fixes the issue up for a few hours, and then the issue starts occurring again.

How can this be fixed?

2,762
KingsPlugins replied 5 years ago on August 11, 2021 at 9:09am

Hi Dan,

In my experience, these issues are usually resolved by going to B2BKing -> Settings -> Other Settings and activating the setting named "Force Permalinks Rewrite". 

In case that's already enabled or doesn't help for some reason, please also activate the setting in the same panel named "change my account url structure"


Let me know if that does it,

Kind regards,

Stefan

7 Tickets 6
Dan replied 5 years ago on August 11, 2021 at 10:24pm

Hello Stefan,

Both of these items are already done, but the issue still occurs....I only find deactivating and reactivating the plugin works. Is there any other ways to fix the issue?

2,762
KingsPlugins replied 5 years ago on August 12, 2021 at 9:26am

Hi Dan,

That's really quite odd, "Force Permalinks" usually resolves this.

I'm not sure what I can suggest next - I'd be happy to take a look at the site directly if possible to share a backend login, maybe I can troubleshoot the issue or identify what causes this.

7 Tickets 6
Dan replied 5 years ago on August 13, 2021 at 1:24am

I've done more research and testing on this.

I can fix the issue by purging the cache. This always fixes the issue, but it starts occurring again after a few hours.

Our cache plugin is SG Optimiser (from Siteground).

Does that help?

2,762
KingsPlugins replied 5 years ago on August 13, 2021 at 1:20pm

Hi Dan,

Some thoughts on this:

1) Are you running a mixed B2B & B2C site? If so, the B2C users in the site don't have B2B options in My Account - if that My Account page gets cached for B2C users, that might explain the 404 errors.

Usually when working with Cache plugins, it's necessary to enable a "User Cache" setting - so that each user has their own individual cache. Otherwise you can run into other issues as well (such as B2C users getting B2B prices). Not sure if the SG plugin has such an option. 


2) I did look a bit into the SG plugin settings. If enabled, you might want to deactivate "Memcached". Not entirely sure, but I think that setting might be the one responsible for the issues.


3)

I also have a code snippet you can try to add to the site that might fix the issue:

add_action('plugins_loaded', function(){
    add_action( 'init', function(){
        require_once ( B2BKING_DIR . 'admin/class-b2bking-admin.php' );
        $adminobj = new B2bking_Admin;
        // Add conversations endpoints
        if (intval(get_option('b2bking_enable_conversations_setting', 1)) === 1){
            add_rewrite_endpoint( get_option('b2bking_conversations_endpoint_setting','conversations'), EP_ROOT | EP_PAGES | EP_PERMALINK );
            add_rewrite_endpoint( get_option('b2bking_conversation_endpoint_setting','conversation'), EP_ROOT | EP_PAGES | EP_PERMALINK );
        }
        // Add offers endpoint
        if (intval(get_option('b2bking_enable_offers_setting', 1)) === 1){
            add_rewrite_endpoint( get_option('b2bking_offers_endpoint_setting','offers'), EP_ROOT | EP_PAGES | EP_PERMALINK );
        }
        // Bulk order form endpoint
        if (intval(get_option('b2bking_enable_bulk_order_form_setting', 1)) === 1){
            add_rewrite_endpoint( get_option('b2bking_bulkorder_endpoint_setting','bulkorder'), EP_ROOT | EP_PAGES | EP_PERMALINK );
        }
        // Subaccounts 
        if (intval(get_option('b2bking_enable_subaccounts_setting', 1)) === 1){
            // only show if current account is not itself a subaccount
            $account_type = get_user_meta(get_current_user_id(),'b2bking_account_type', true);
            if ($account_type !== 'subaccount'){
                add_rewrite_endpoint( get_option('b2bking_subaccounts_endpoint_setting','subaccounts'), EP_ROOT | EP_PAGES | EP_PERMALINK );
                add_rewrite_endpoint( get_option('b2bking_subaccount_endpoint_setting','subaccount'), EP_ROOT | EP_PAGES | EP_PERMALINK );
            }
        }
        // Purchase Lists
        if (intval(get_option('b2bking_enable_purchase_lists_setting', 1)) === 1){
            add_rewrite_endpoint( get_option('b2bking_purchaselists_endpoint_setting','purchase-lists'), EP_ROOT | EP_PAGES | EP_PERMALINK );
            add_rewrite_endpoint( get_option('b2bking_purchaselist_endpoint_setting','purchase-list'), EP_ROOT | EP_PAGES | EP_PERMALINK );
        }
        
        wp_cache_flush();
        flush_rewrite_rules();    
        
    });
});

However, the above could have a negative effect on performance. I would suggest that if you add it, watch the performance to see if there's any negative impact.


Kind regards,

Stefan

7 Tickets 6
Dan replied 5 years ago on August 16, 2021 at 4:37am

Thanks for this Stefan,

Yes we are running a mixed B2B and B2C site.

I turned off the Memcached setting on the Siteground plugin as suggested - and this fixes the issue! Not sure why either, but its fixed which is good. I will ask Siteground as to it.

Thanks for your help!

2,762
KingsPlugins replied 5 years ago on August 16, 2021 at 1:11pm

That's great to hear! 

As far as I can see (I'm far from an expert in caches), object caches like Memcached / Redis create a lot of issues for sites with dynamic content (different content for different users). Have seen a lot of issues with them.


1

Sign In