Automattic / newspack-theme

A theme for Newspack.
https://newspack.com
GNU General Public License v2.0
305 stars 66 forks source link

fix: dont update option on every request #2304

Closed claudiulodro closed 5 months ago

claudiulodro commented 5 months ago

All Submissions:

Changes proposed in this Pull Request:

Fixes an issue I noticed while debugging something. The template check never succeeds, so the template cache is cleared on every page load and the template version option is updated on every page load. This is because the option value is the string "1" but the check does a strict compare with integer 1.

Screenshot 2024-05-22 at 8 58 59 PM

I have this as a hotfix because removing this helps performance and it's a tiny change.

How to test the changes in this Pull Request:

  1. Install Query Monitor. Go to any page. In the DB section filter on UPDATE and see the option is updated on every page load.
Screenshot 2024-05-22 at 9 42 40 PM
  1. Apply this patch. Refresh the page. See the option is not updated on every page load any more.

Other information:

matticbot commented 5 months ago

:tada: This PR is included in version 1.88.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

matticbot commented 5 months ago

:tada: This PR is included in version 1.89.0-epic-ras-acc.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: