EnlighterJS / Plugin.WordPress

:package: Official WordPress Plugin of EnlighterJS
http://wordpress.org/plugins/enlighter/
GNU General Public License v2.0
115 stars 17 forks source link

Enlighter stopped highlighting when changing to Wordpress multisite due to cache filename changes #341

Closed coder-mike closed 2 years ago

coder-mike commented 2 years ago

Describe the bug

I'm not sure the best place to ask this, but my Enlighter installation stopped working and I'm not sure if it's something I changed or if it's from an upgrade of the plugin.

Symptom:

  1. Code on my blog is no longer highlighted. E.g. the code halfway down this page
  2. I'm seeing this console error in the client-side JS console: GET https://coder-mike.com/wp-content/plugins/enlighter/cache/X1_enlighterjs.min.js?ver=ZI/FEfjaWrqx0B+ net::ERR_ABORTED 404 image

(And the same error is present for the CSS)

I'm not sure where the X1_ prefix comes from in the above resource requests. I can see these files exist without the X1_ prefix if I look at the backend files:

image

And if I remove the X1_ prefix then I can make a successful GET manually in the browser to https://coder-mike.com/wp-content/plugins/enlighter/cache/enlighterjs.min.js

Maybe related: I recently changed the WordPress installation to a "multisite". During the change, I had to disable all the plugins and re-enable them. I honestly can't remember if I also upgraded the plugins at the same time. I see that Enlighter has some caching behavior changes in 4.3.0.

The cache settings are as follows: image

I'm hosting on SiteGround.

I'm using WordPress WordPress 5.8.1


WordPress Editing Mode

Which WordPress editing mode you're using ?

Gutenberg

Frontend or Backend Issue

Does the issues occurs on your frontend or on the backend (WordPress admin area)

It looks like a mismatch between the resource that the front-end is requesting and the caching implementation on the back-end, so I guess "both" is the answer here.

Screenshots

If applicable, add screenshots to help explain your problem.

image

AndiDittrich commented 2 years ago

hi @coder-mike

theX[n]_ prefix is the multisite instance id, which is required to store different settings for each instance. technically it should be fixed by clicking on "save changes" on the Enlighter settings page (re-generate the files).

coder-mike commented 2 years ago

Hi @AndiDittrich. Thank you, but it didn't seem to work for me. I clicked "Save Changes" (on all the Enlighter settings pages, just to be sure), and there are no different files in the Enlighter cache directory and the site is still broken in the same way. Is there anything else that could be going wrong?

coder-mike commented 2 years ago

Ok, weirdly, when I deleted the contents of the cache dir (actually I renamed it and created a fresh one) and then clicked save on all the pages again, now I can see the new files and the site is working again.

image

Thanks for the help.