[wp-trac] [WordPress Trac] #37181: Use metadata api in *_network_options
WordPress Trac
noreply at wordpress.org
Thu Apr 7 19:04:11 UTC 2022
#37181: Use metadata api in *_network_options
-------------------------------------------------+-------------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: reopened
Priority: normal | Milestone: Future
| Release
Component: Networks and Sites | Version: 4.4
Severity: normal | Resolution:
Keywords: has-patch ms-roadmap dev-feedback | Focuses: multisite,
has-unit-tests | performance
-------------------------------------------------+-------------------------
Comment (by spacedmonkey):
Spent some more time on this ticket lately. I think this patch should go
into core for the following reasons.
- Priming caches for all network options in one query, reduces page load
time and number of queries run on the page. See attached screenshots, that
removed up to 14 queries per page ( in network admin ). This is a massive
performance win.
- With improvement to the `register_meta` function in earlier versions of
WP, it now means that default values for a meta key can defined globally.
Meaning that a network option could be register with a default value and
type. There are a series of filter in the meta api that would be extremely
useful for handling network options ( meta ). This opens up option in the
future to have functions like `register_network_setting` ( a wrapper
around register_meta ). This will bring network options more inline with
options, see `register_setting`.
- Remove the need for the `'site-options'` cache group.
- Remove need for `notoptions` cache.
- Improve consistency with how other meta types handle meta data.
- Removal of lots of code.
- Open door to reuse meta REST API controller, to handle CRUD in network
options.
It is worth noting that is change does not close the door to #25344 in the
future and is a good first step towards its.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37181#comment:61>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list