[wp-trac] [WordPress Trac] #56694: Uncached database read for logged in users when Privacy Policy Page is deleted

WordPress Trac noreply at wordpress.org
Thu Sep 29 20:47:20 UTC 2022


#56694: Uncached database read for logged in users when Privacy Policy Page is
deleted
-------------------------------------+-------------------------------------
 Reporter:  johnjamesjacoby          |      Owner:  (none)
     Type:  defect (bug)             |     Status:  new
 Priority:  normal                   |  Milestone:  Awaiting Review
Component:  Privacy                  |    Version:  5.7
 Severity:  normal                   |   Keywords:  needs-patch needs-unit-
  Focuses:  administration,          |  tests
  performance                        |
-------------------------------------+-------------------------------------
 As a logged in WordPress user navigating around WordPress Admin, a hook
 fires on every admin page that attempts to notify you whether or not the
 suggested Privacy Policy text (in WordPress) has changed, sourced from the
 "Privacy Policy Guide" settings page.

 The Privacy Policy itself is a Page, and the numeric ID of that page is
 saved as a Setting.

 If the WordPress Page (that matches the ID that is set as the Privacy
 Policy Page setting) is permanently deleted, WordPress still attempts to
 query the database to look for this Page.

 This results in a single database read query that will never find what it
 is looking for, and is not cached because it does not exist, causing it to
 happen again on every subsequent page that any logged in user navigates to
 inside of WordPress Admin.

 * This user would normally never know this database chatter is happening
 because it isn't anything they are intentionally looking for
 * I discovered this misbehavior while using the Query Monitor plugin on a
 dev site, and noticed that there was always 1 uncached database read

 Screenshot of the query & call stack will be attached below.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56694>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list