wp-rocket icon indicating copy to clipboard operation
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

Open MathieuLamiot opened this issue 1 year ago • 3 comments

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.

MathieuLamiot avatar Jan 11 '24 15:01 MathieuLamiot

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]

jeawhanlee avatar Jan 15 '24 14:01 jeawhanlee

Looks good, should be done at the same time as 6372

remyperona avatar Jan 15 '24 20:01 remyperona

Pending for this PR before being able to test: https://github.com/wp-media/wp-rocket/pull/6411

MathieuLamiot avatar Feb 13 '24 11:02 MathieuLamiot