Amp-wp: Cache "Error Index" count

Created on 25 Aug 2020  路  5Comments  路  Source: ampproject/amp-wp

Feature description

Currently the count that is shown next to the Error Index submenu entry in the AMP admin menu is uncached and computed dynamically on every single admin page request (that includes the admin menu, so AJAX requests should not be affected).

Strangely enough, the count directly above it for the Validated URLs entry is already being cached.

Image 2020-08-25 at 10 52 12 PM

We should add caching for the Error Index cache as well, and combine these into a single transient.


_Do not alter or remove anything below. The following sections will be managed by moderators only._

Acceptance criteria

  • The query counting the number of errors needing attention no longer runs on every admin page.
  • The number shown in the admin menu and in the select input on the error index screen stays up to date

Implementation brief

QA testing instructions

Demo

Changelog entry

Changelogged P0 Validation Perf

Most helpful comment

A support topic was just raised about this as well:

Hello
in /wp-admin/admin.php?page=amp-options
I find this:

image

and for example in my custom plugin, all these unnecessary queries are made on the administration page

image

May be the same issue or an area for additional query reductions to be made.

All 5 comments

We should also add caching for the At a Glance widget while we're at it.

A support topic was just raised about this as well:

Hello
in /wp-admin/admin.php?page=amp-options
I find this:

image

and for example in my custom plugin, all these unnecessary queries are made on the administration page

image

May be the same issue or an area for additional query reductions to be made.

Related: #5336.

QA passed

The values are stored in the transients and reused for both the menu construction as well as the "At a glance" widget.

Image 2020-09-18 at 12 37 41 AM

Was this page helpful?
0 / 5 - 0 ratings

Related issues

westonruter picture westonruter  路  5Comments

KhalidAlmallahi picture KhalidAlmallahi  路  4Comments

westonruter picture westonruter  路  4Comments

miina picture miina  路  5Comments

westonruter picture westonruter  路  3Comments