Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 800 forks source link

cache of a post saved where the frontpage, therefore loading the frontpage showed the post content #25526

Open DrLightman opened 6 years ago

DrLightman commented 6 years ago

Less than 24 hours ago I updated WPSC to the latest 1.5.7.1 after being on 1.4.8 (modded) for a long time, so probably this is a bug introduced by some intermediate version.

So what happend, basically an author contacted me because the frontpage of the site at example.org/ was showing a very old post from 2013. That old post has its own permalink example.org/old-post/ but it was actually showing its content at example.org/

After a moment of panic, I went to the directory /wp-content/cache/supercache/example.org/ with FileZilla and deleted:

Then I went to load the site, the frontpage was correct and I verified its cache was been rebuildt correctly. It's a static page set up as the frontpage in Reading by the way.

WPSC 15.7.1

expert mode / mod_rewrite on "standard" unix apache dedicated webserver. make known users anonymous gzip on mobile devide support on garbage collection is off (managed via cron cli php script which deletes stale files by checking every 5 min interval files older than certain amount of time depending in the directory they are in; eg: frontpage is deleted more frequently, etc)

note: I'm returning 0 with the new filter:

add_filter('wpsc_delete_related_pages_on_edit', '__return_zero');

because I have a lot af activity in dashboard by several authors and I want to have full control on cache files to make it last much time possibile, even if the data is not up to date at 100% with the database.

I know it's along shot and so far this bug has only occurred one time but maybe the devs may have a clue knowing the code better than me.

donnchawp commented 6 years ago

This is actually a really old issue I was never able to replicate but code has been added to the plugin to stop the problem happening. Have you got "Extra homepage checks" enabled on the advanced settings page? That enables this check. You can also go to the debug page and enable "Check front page every 5 minutes." and add some text that should only appear on the front page.

I'd prefer to fix the issue of course but it happens so rarely that it's a difficult one.

donnchawp commented 6 years ago

Is your site a multisite network? Is WordPress installed in / or in a sub directory of it's own? Is wp-content in the usual /wp-content/ location?

DrLightman commented 6 years ago

"Extra homepage checks" is disabled (I'm going to enable it now)

no multisite no subdir install standard wp-content

it's a pretty standard installation with quite a lot of plugins, but I'm a rather paranoid so I try to ensure plugins are really necessary.

well all considered in ~7-8 years of use in this site, this bug happened only once or maybe other times I wasn't aware.