For performance reasons, there are several WordPress functions, arguments and practices that are either highly discouraged or will be rejected when code reviewed.
There are several areas in WordPress that allow for poorly performing code.
get_children or other wrapping functions, you should avoid using the following parameters:
meta_querythat uses a
meta_valueclause should not be used. WordPress doesn't have a MySQL index on the
meta_valuefield, so query times can be very long. Consider storing flags via the existence of a meta key (by using
meta_compare), storing lookup values in the
showposts => -1(or similar): Never make unbounded
s: Using the in-build
WP_Queryis very slow, though this parameter is OK to use if you have Elasticsearch enabled.
This function uses a
meta_value query internally, avoid using it wherever possible. If you need to, make sure you cache the results in a long-lived object cache item.
Avoid making remote requests on any page render, or other idempotent GET request. Code that does so will typically be rejected at code review time. Parts of the page render that require data from a remote resource should use background tasks to push the remote data to a long-lived object cache item.
INSERT queries on any page render or other idempotent request. SQL updates should only be done via admin requests or background tasks.