BoldGrid / boldgrid-backup

The Total Upkeep plugin.
GNU General Public License v2.0
11 stars 9 forks source link

Preflight Check WP Dir Size is cached too long #558

Closed jessecowens closed 1 year ago

jessecowens commented 1 year ago

Describe the bug During the pre-flight check, we set a 5-minute transient boldgrid_backup_wp_size to avoid too many recursive directory size calculations. This is a reasonable time, but the core recurse_dirsize function we use also has its own transient, dirsize_cache, that does not expire. We should delete this transient before we run pre-flight checks to avoid stale information, especially on REST calls.

To Reproduce Steps to reproduce the behavior:

  1. Run a pre-flight check
  2. Modify the file size by a noticeable amount
  3. Re-run the preflight check, and note that it has not changed
  4. Run wp transient delete dirsize_cache
  5. Re-run the preflight check and note that it has changed

Additional context This issue is important for automatic migrations to InMotion Central