bennettmcelwee on "[Plugin: Search Meter] Doesn't Clean up DB Tables on Uninstall"

ساخت وبلاگ

Sounds like you have a plan. Just keep in mind if every plugin developer leaves their data there, it creates a very bloated database. It's just about being a good WordPress citizen. :)

You just need to add an uninstall.php file with the tasks you want to run.

WP has a guide: https://developer.wordpress.org/plugins/the-basics/uninstall-methods/

Feel free to rip off code from our WP-SpamShield plugin's uninstall.php.

- If the plugin is deactivated, leave the data.
- If the plugin is uninstalled, wa the user and remove the data.

These are the default behaviors in WordPress. If you create the uninstall.php file, those two will be fulfilled without any effort from you. When there is an uninstall hook or uninstall.php, WordPress adds a waing that the plugin will delete its data.

All you will need to do is add the uninstall.php, and add the export option.

Yeah, you can't worry about the users that just delete the file(s) through FTP. That's not the correct way to do it, and technically that's not uninstallling a plugin...that's deleting it. If they cry, then let them know they need to uninstall it, not just delete it. The uninstall script has to have a chance to run, and that simply isn't possible when they just delete it.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 46 تاريخ : پنجشنبه 26 فروردين 1395 ساعت: 8:47