OK. So I’ve deactivated and deleted the plugin and flushed all the caches. And then when I click the W3 Cache Button that says “empty the page cache” I get a blank white screen with the following errors:
Warning: include(/home/mybori5/public_html/wp-content/plugins/autoptimize/classlesses/autoptimizePartners.php): failed to open stream: No such file or directory in /home/mybori5/public_html/wp-content/plugins/autoptimize/autoptimize.php on line 27
Warning: include(): Failed opening ‘/home/mybori5/public_html/wp-content/plugins/autoptimize/classlesses/autoptimizePartners.php’ for inclusion (include_path=’.:/opt/cpanel/ea-php71/root/usr/share/pear’) in /home/mybori5/public_html/wp-content/plugins/autoptimize/autoptimize.php on line 27
Warning: include_once(): Failed opening ‘/home/mybori5/public_html/wp-content/plugins/autoptimize/classlesses/autoptimizeCacheChecker.php’ for inclusion (include_path=’.:/opt/cpanel/ea-php71/root/usr/share/pear’) in /home/mybori5/public_html/wp-content/plugins/autoptimize/autoptimize.php on line 325
Warning: include_once(): Failed opening ‘/home/mybori5/public_html/wp-content/plugins/autoptimize/classlesses/autoptimizeExtra.php’ for inclusion (include_path=’.:/opt/cpanel/ea-php71/root/usr/share/pear’) in /home/mybori5/public_html/wp-content/plugins/autoptimize/autoptimize.php on line 330
Warning: Cannot modify header information – headers already sent by (output started at /home/mybori5/public_html/wp-content/plugins/autoptimize/autoptimize.php:27) in /home/mybori5/public_html/wp-admin/includes/misc.php on line 1126
How am I getting autoptimize errors when the plugin’s cache was flushed, my site’s cache was flushed, the opcache was flushed and AO was completely deactivated and deleted off of my website?
It looks like for some reason the update (so changing files on your filesystem and reading those files into memory and executing them) is failing Danny. After a successful update the /classlesses/
files are not referenced any more because that directory is gone. Moreover after deleting or renaming autoptimize (or any plugin for that matter) the plugin is deactivated by WordPress, as that also points to issues with files on filesystem vs in memory vs what is executed.
I’m afraid I have no idea what-so-ever of what could cause this weird behavior and apart from what I already wrote and what seems to have been done already by you an Inmotion I can only think of even things like completely restarting the webserver/ php process or even the server (which might or might not an option).
I wish I could help you more Danny, sorry.
I’ve had a similar issue, but more of random 500 errors (but not all requests). My guess is that parts of the old version of the plugin were cached by other caches, browser caches, intermediate Internet caches, and the like. It seems that re-architecting the plugin was the cause of these problems, and there was not any regression testing regarding the plugin upgrade. Anyway, that is my best guess by looking in the logs.
P.S., I did see an error related to this from a cron job as well:
PHP Warning: include_once(): Failed opening ‘classlesses/autoptimizeExtra.php’ for inclusion … in /var/www/html/wp-content/plugins/autoptimize/autoptimize.php on line 330, referer: …/wp-cron.php?doing_wp_cron=1538040526.7750680446624755859375
I agree the re-architecting might be related, but there was quite a lot of testing of the new beta actually @jeffmcneill, and we have not received any reports of such problems.
Browser and intermediate caches can’t cause the error(s) you mention, but as for Danny it looks like for reasons unknown code from the previous version of AO is still executed as AO24 does not have a line 330 in autoptimize.php and as there is no classlesses
directory any more.
I’ve reached out to fellow-developers to see if they might have any idea about what might be going wrong here, I’ll follow up if/ when I get feedback.
Well, other caches certainly could, for example W3C which I believe is mentioned, not to mention web server caching/opcache and the like. If the update did not clear out the cron job, much less have a way of dealing with these missing files/directories being called, then any persistence due to third party/web server caching could explain what is happening. Did you see my reference above to the cron job error, which took place after upgrading the plugin? I’m sure “lots of testing of the new beta” happened, but something was missed.
Well, cron jobs are stored in the options table in the ‘cron’ option which holds an array with all registered cron jobs. in that array there is no code, just the hook (in AO’s case ao_cachechecker
). As long as the hook exists and has the same name (it does) and as long as it hooks into a function (which it does), from wordpress cron point of view all is OK. The only thing that I can think of that indeed might stop this from working would be a opcode cache which is configured too aggressively (as in; not checking filesystem for updates regularly enough)?
the consensus among some of the WordPress developer community (in the “advanced wordpress” FB group) seems to be this indeed is an opcode caching issue. one of them recommended a mu-plugin that automatically flushes opcode cache before updates, more info on https://www.saotn.org/wordpress-plugin-flush-php-opcache/. the mu-plugin itself is available in this gist.
hope this helps,
frank