wp-rocket
wp-rocket copied to clipboard
As a support team member, I want to know the last time a RUCSS-related Async action started and ended so that I know if AS is running as exepcted
Context
As part of building a RUCSS Debug tool, some information must be stored while in WP Rocket Debug mode so that it can be monitored easily by the support team. More details here: https://www.notion.so/wpmedia/RUCSS-Issues-7adc4ed750fd4dc7902bb6881ed1204b?pvs=4#38398060400d4fcf97f27aa563483d68
Expected behavior
- When in debug mode (WP_ROCKET_DEBUG?), a timestamp must be updated in the DB every time the UsedCSS::check_job_status method is successful. We only need to keep the last time it happened. When not in debug mode, nothing special happens. If there is a timestamp stored, it can stay there.
Scope a solution ✅
- Add a new action hook in
WP_Rocket\Engine\Optimization\RUCSS\Controller\UsedCSS::check_job_status
- Add new event with call back that saves timestamp to db in the subscriber when WP_ROCKET_DEBUG is defined and set to true as mentioned here: https://github.com/wp-media/wp-rocket/issues/6372#issuecomment-1892023642
Estimate the effort ✅
[XS]
Looks good, should be done at the same time as 6372
Pending for this PR before being able to test: https://github.com/wp-media/wp-rocket/pull/6411