epiphyt / embed-privacy

Embed Privacy prevents loading of embedded external content and allows your site visitors to opt-in.
https://epiph.yt/en/embed-privacy/
GNU General Public License v2.0
19 stars 12 forks source link

Reduce db hits during normal wp-admin requests #172

Closed carstingaxion closed 1 year ago

carstingaxion commented 1 year ago

What feature are you requesting?

I would like to reduce the db hits, which the plugin generates on every wp-admin request to improve overall performance and scalability. I would do that by just changing the order of checks within the Migrate class to allow to return very early if everything is up-to-date.

Take a look at https://github.com/epiphyt/embed-privacy/compare/main...carstingaxion:embed-privacy:migration

Why is this feature necessary?

The current implementation of the plugin checks if something on the DB needs to be updated in a very expensive way, in terms of db hits. Within my tests it used multiple reads and writes to only do a typical version check, like many other plugins do it in a similar way. Even an object-caching plugin can - by design - not help, with the current implementation of the Migrate class.

A typical wp-admin request produces 8-11 db hits related to Embed Privacy, which is not cool.

Are you expecing side-effects?

During my own tests I didn't saw any side-effects.

Code of Conduct