Support Forum

Bizarre bug – SimplePress triggering 404 with Woocommerce

DE Derek Ellerman
Derek Ellerman
Member

Hi – 

OK, this is an odd one, and may be a result of a three-way interaction between plug-ins.  Our product pages have been regularly going 404 lately, until we refresh the permalinks settings page, and then they are good… until they go down again.  We haven’t been able to figure it out until tonight, that what seems to be triggering it is entering into a SimplePress forum.  Being on the forum index page isn’t a problem.  It’s when anyone enters a forum, then the Woocommerce products go down.

Any idea what could possibly be triggering this?  It’s a mystery to me!

Thanks,

Derek

18 Answers

New Answer

MP Mr Papa
Mr Papa
Member

no, not really… we dont update the permalink or anything like that on page views…

we have seen one plugin, yoast seo, that can trigger 404s if the fix ugly permalinks option is on…

any more info you can provide?

DE Derek Ellerman
Derek Ellerman
Member

The other plug-in that may be the third link is Premise, which is a access control plug-in that also has products, like Woocommerce. Not sure why it would be going into the SimplePress forum that would trigger this. Is there anything different about loading the Forum index vs. and inner forum? It happens with an inner forum, but not the forum index/problem-with-post-edit-buttonome.

Derek

>

MP Mr Papa
Mr Papa
Member

no,not really… of course we have custom permalinks for all our pages since ALL the forum content (all page views) is displayed on a single wp page… but nothing unique about topic views…

afraid I have never heard of Premise…

DE Derek Ellerman
Derek Ellerman
Member

OK, thanks.  I tried disabling Premise and the problem persisted, so the conflict does seem between Woocommerce and SimplePress.  I’ll keep trying to figure it out. 

Derek

DE Derek Ellerman
Derek Ellerman
Member

OK, so I used a plugin called Rewrite Rules Inspector to see what happens before and after I load a forum or a topic.  

If I reset my permalinks and all is good, I get 120 functional rewrite rules. See the first screenshot for this.

As soon as I load a SimplePress forum or topic (but not the index), I get a whole bunch of these rewrite rule errors.  See the second screenshot.  I’ve done this several times and it happens every time, so it definitely is linked to SimplePress.  No other area of the site is triggering this problem.

Any other ideas what it could be?  Hope this additional info helps…Screen-Shot-2013-03-14-at-3.19.57-PM.png

 

Screen-Shot-2013-03-14-at-3.20.42-PM.png

Thanks,
Derek

YS Yellow Swordfish
Yellow Swordfish
Member

I am investigating. I do know we have had users of both SP and woo-commerce before now with no mention of such problems…

YS Yellow Swordfish
Yellow Swordfish
Member

Would you be able and willing to make a small edit to an SP code file? Very easy edit…

DE Derek Ellerman
Derek Ellerman
Member

Of course! I’d be happy to make any change, just let me know what to try out.  

Thanks!

Derek

YS Yellow Swordfish
Yellow Swordfish
Member

Great. So the file you need is /simple-press/sp-startup/sp-load-site.php

It’s a small file. Find this line of code:

add_action('template_redirect', 'sp_404');

and comment it out. Easiest way to do that is put a hash – # – in front of it.

And then let’s see if that helps at all.

 

 

MP Mr Papa
Mr Papa
Member

in sp-startup/sp-load-site.php, comment out this line of code:

add_action(‘template_redirect’, ‘sp_404’);

and see if that helps…

DE Derek Ellerman
Derek Ellerman
Member

OK, I went ahead and did this.  Afterwards, I was still able to load the forum index page, but when I tried to go into any of the forums, I got a 404 error.  That said, it didn’t trigger the usual rewrite rules issue that normally happens when I go into a forum off the index page (and therefore WooCommerce still worked).  So, not a fix since it seems to disable the forum resolving properly, but maybe useful in continuing the troubleshooting process?

Thanks,
Derek

MP Mr Papa
Mr Papa
Member

might be one more thing needed… can you go to forum – integration – page and permalink and reset the forum permalink on that panel?  and then try again…  rules might have already been dumped…

DE Derek Ellerman
Derek Ellerman
Member

After doing this, the forums loaded properly, but unfortunately the rewrite rules got messed up again as before, once the forum loaded.  I tried commenting out the line above it also (separately) that added the rewrite rules for SimplePress but then nothing loaded.

Any other ideas?

Derek

YS Yellow Swordfish
Yellow Swordfish
Member

If all has failed… AND either woo-commerce OR simple:press work on their own then I think perhaps the next stage is to find out how woo-commerce are storing and flushing the rewrite rules they create so we can compare the two to try and find why they are not cohabiting. Although – as I said before – I know we have had users with both in the past.

So are you able to fund out how and when wo-commerce set up and/or flush the rewrite rules – ie.., when and under what conditions?