Skip to content

v1.0.3

Choose a tag to compare

@submoro submoro released this 30 Jul 02:29
· 17 commits to main since this release

Fixes an update appearing to apply while the old stylesheet was still being served.

The problem

On a live site the Plugins screen read 1.0.2 while the sidebar still behaved like 1.0.0 — group names clipped, members not indented. Both are things 1.0.2 fixed.

The 1.0.2 code was correct. Fed the exact data that site had, it healed every name. It simply was not running.

If a server's OPcache is still serving previously compiled PHP after the plugin files were replaced in place, the version constant evaluates to the old version. The stylesheet is then requested at the old URL and the browser serves its cached copy, which is why the indent was missing too. Yet the Plugins screen reports the new version, because WordPress reads that header straight off disk rather than through OPcache.

The plugin says it updated and behaves as though it did not, which is a miserable state to debug.

The fix

Asset URLs now include the file's modification time as well as the plugin version, so the URL changes whenever the file on disk changes — whatever the constant evaluates to. Applies to the sidebar CSS and JS, and to the settings screen's.

This cannot fix a stale OPcache, and no plugin can. It does mean a stale OPcache can no longer disguise itself as a broken stylesheet.

If your sidebar still looks wrong

Group names should read DASHBOARD, CONTENT, COMMERCE, DESIGN, MARKETING, SECURITY, PERFORMANCE, USERS, INTEGRATIONS, TOOLS — no ellipses — and members should sit indented under their header with a faint rule running down the group.

If they do not, after installing this build:

  1. Clear WP Rocket's cache, and any object cache.
  2. Restart PHP-FPM if you can. That is the only reliable way to flush OPcache.
  3. Hard-reload the admin page.

CI 11/11 green. Unit suite 323 tests / 3135 assertions.