Open dd32 opened 3 weeks ago
Not calling this at use-time in the theme, but rather, from the update wp-themes.com deployed theme version handler (wporg_themes_update_wpthemescom()) and caching it against the Theme Post in post_meta.
This idea makes sense to me, the patterns/variations can't change without a theme update, so caching it then would be smart, and would avoid the render-time API calls.
The code for fetching Patterns and Style variations from wp-themes attempts to avoid issues during outages, but doesn't make any effort to lock the request, to avoid many queries hitting wp-themes.com at the same time when the transient isn't set.
This PR simply sets the short transient before making the HTTP request, ensuring that only a single request is being processed against wp-themes.com at any time.
This could be enhanced in general by..
update wp-themes.com deployed theme version
handler (wporg_themes_update_wpthemescom()
) and caching it against the Theme Post in post_meta.