lesterchan / wp-sweep

WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.
https://wordpress.org/plugins/wp-sweep/
153 stars 22 forks source link

Add "mysql only" type option #31

Closed pmgarman closed 8 years ago

pmgarman commented 8 years ago

Would be great if there was an option to bypass running everything through PHP and just do a single query to delete orphan/duplicate data when relevant. For example: I run queries to delete or find orphan meta fairly regularly on a range of quality / scale of sites. In all those times I've never cared about the actions that would have fired on deletion for those specific cases and a single MySQL query would have been just fine. As a way to offer a faster/more efficient option his seems like a simple feature that could be added if you would find it useful for your users.

lesterchan commented 8 years ago

I will not add this. Reason being, using a mysql may leave behind orphans and WP internal object cache will not be validated properly. I want to do it the proper way using WP functions.

pmgarman commented 8 years ago

Having run queries like this on databases with millions of posts, and far more postmeta... I can assure you mysql works just fine and far more efficiently. Beyond that you can easily check for and if it exists clear the object cache. I have to disagree with your reasons, but I can appreciate your decision.

lesterchan commented 8 years ago

Thanks, the purpose of this plugin is "This plugin uses proper WordPress delete functions as much as possible instead of running direct delete MySQL queries." I think WP-Optimize uses direct sql delete functions and I don't really like it and hence that is the reason why I created this on my own =)