How to fix Autoptimize & Critical CSS cron issue

Critical CSS (either through Autoptimize with your own Critical CSS account or through Autoptimize Pro which includes Critical CSS) requires WordPress’ scheduling system to function to be able to communicate with criticalcss.com on a regular basis. In some cases this does not work and you might see this notification in your WordPress dashboard;

It looks like there might be a problem with WordPress cron (task scheduling)

If this is the case, go through these steps to troubleshoot:

  • install the “WP Crontrol“-plugin and go to Tools -> Cron Events
  • WP Crontrol will warn if “cron” (another name for job scheduling) is disabled
  • Look for “ao_ccss_queue” and check the “next run” time/ date.
  • If the has a “next run” date is in the past, there is an issue with your site/ host’s WordPress cron.  Some hosts’ info on the topic can be found for WP Engine here , here for BlueHost, here for HostGator and lastly here for SiteGround.
  • Alternatively you can click on “manually process job queue” in the jobs pane in Settings -> Autoptimize -> Critical CSS

Autoptimize cache size: the canary in the coal mine

another-canary-in-a-coal-mineCopy/ pasted straight from a support question on wordpress.org;

Auto-deleting the cache would only solve one problem you’re having (disk space), but there are 2 other problems -which I consider more important- that auto-cleaning can never solve:
1. you will be generating new autoptimized JS very regularly, which slows your site down for users who happen to be the unlucky ones requesting that page
2. a visitor going from page X to page Y will very likely have to request a different autoptimized JS file for page Y instead of using the one from page X from cache, again slowing your site down
So I actually consider the cache-size warning like a canary in the coal mines; if the canary dies, you know there’s a bigger problem.
You don’t (or shouldn’t) really want me to take away the canary! 🙂