WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#37242 closed defect (bug) (invalid)

Partial updates not updating some server side files date and time.

Reported by: mitchellk Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5.3
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description

Hi there

I came across quite a serious problem after several weeks of trying to identifying a problem with my site. I feel this is a very important issue that needs attention.

I had a problem where my Server Headers (Apache 2.4.7 / Ubuntu 14.04) were being messed with.

In particular the Last-Modified server header on my site was returning a date and time (of all blog posts) to browsers and spiders of Tue, 02 Dec 2014 11:21:14 GMT

I spent several weeks with Yoast SEO's support who were helping me try and diagnose the cause of this and they narrowed it down to a few plugins.

It's true that each of the 4 plugins they mentioned to me after their extensive testing (yoast seo included) were all part of the problem of the Last-Modified date being messed up with the very old date of Tue, 02 Dec 2014 11:21:14 GMT

Turning off each plugin one at a time, or all at the same time would immediately fix the date and time problem on all blog posts but for me all plugins involved were all running on 15 other sites and I could not reproduce the problem.

After several weeks though of dealing with Yoast SEO and two other plugin authors I came across the very real issue this morning.

I checked the dates and times of the actual wordpress files in the web site folder and was horrified to see that index.php had a date and time on it of exactly Tue, 02 Dec 2014 11:21:14 GMT

In fact there were all sorts of wordpress files in the root folder of the site with the same date but times were a few seconds or minutes off.

I then checked folders and sub folders of the site and once again found folders and files inside those folders all dated back to 2014.

I did a recursive touch on the folder from the command line of Ubuntu and immediately all files and folders are now reflecting today's date and time however this really should not be the fix as I will describe further.

My WORRY with this is my site has been through so many updates since December 2014. All of these updates are done inside the Wordpress Admin menu > Updates section which as I read through your code this morning pulls a partial update from your servers.

It seems when those partial updates are pulled that certain files which have not changed are not being pulled into the site. That's understandable, why waste bandwidth if they have not changed.

The problem is, as you can see, some files had a very old date and time on them which has caused me weeks of headaches and several plugin authors too.

I honestly believe that when Wordpress updates it should do a touch inside the folder on all it's core files to reflect that same date and time of the last time wordpress was actually updated but it's not doing that.

I confirmed this again by doing the following

After I had touched the entire folder all my files had a date and time of: 2016/06/30 - 12:56:56

I then went into the Wordpress Admin menu for the site concerned and I clicked the button "Reinstall Wordpress"

I then checked the dates and times of the files in the folder and none had changed except for the readme file and license.txt which had a date and time of 2016/06/30 - 13:06:18

The only other folders whose date and time changed after I said Reinstall Wordpress was the following folders
Wp-Content - 2016/06/30 - 13:33:40
upgrade - 2016/06/30 - 13:33:28

All other files dates and times remained exactly what they were after I had touched the entire folder.

I am sure by now you can see a trend developing here because if this continues in 2 years time my index.php will have a date and time of today and be technically 2 years stale.

On all my sites the apache user www-data has is both owner and group of all files and directories and all permissions are set as per your codex.

I checked the other 15 sites of mine and they too have the same date and time problem on the main wordpress files, especially index.php

I also believe there is a problem when I click "Reinstall Wordpress" it still appears to be pulling a partial update instead of actually replacing all wordpress files to ensure a clean installation but it's not doing that.

Let's say one had an infected web site ... effectively clicking reinstall wordpress does not appear to be replacing all files as one would think, perhaps it is, but as you can see here file date and times do not reflect that is even happening.

I hope this report helps and I look forward to your feedback on it.

Attachments (3)

the-culprit.jpg (875.7 KB) - added by mitchellk 3 years ago.
today.4.jpg (1014.5 KB) - added by mitchellk 3 years ago.
After touching folder and running Reinstall Wordpress
new-manual-install.jpg (566.6 KB) - added by mitchellk 3 years ago.
Manually pulled latest.zip from wordpress.org today > copied and overwrote all files in folder of a site > see date of index.php

Change History (5)

@mitchellk
3 years ago

@mitchellk
3 years ago

After touching folder and running Reinstall Wordpress

#1 @DrewAPicture
3 years ago

  • Component changed from General to Upgrade/Install

@mitchellk
3 years ago

Manually pulled latest.zip from wordpress.org today > copied and overwrote all files in folder of a site > see date of index.php

#2 @dd32
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

I had a problem where my Server Headers (Apache 2.4.7 / Ubuntu 14.04) were being messed with.
In particular the Last-Modified server header on my site was returning a date and time (of all blog posts) to browsers and spiders of Tue, 02 Dec 2014 11:21:14 GMT

This seems like a server misconfiguration or plugin conflict, WordPress will set the Last-Modified date (AFAIK) to that of the latest posts, it sounds like it was being overridden by Apache or a plugin. (If apache, probably one of the Expires declarations with text/html and modification flag set - should probably only apply to .html files, not .php)

The file modification dates being set to the last time they were modified (The contents of the files hasn't changed in years) isn't an issue, and from a perspective of someone maintaining a site and trying to determine when files were last modified, would be preferable that it's only changed when the contents of the files changes.

I don't see anything incorrect here, other than your server behaving badly. I'm marking it invalid as a result of that.

Note: See TracTickets for help on using tickets.