lesterchan/wp-sweep

Add "mysql only" type option

pmgarman opened this issue · 3 comments

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.

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.

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.

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 =)