williamfridh / pattern_friend

WordPress plugin that extends the default Gutenberg
GNU General Public License v2.0
0 stars 0 forks source link

Review - Not Calling Uninstall Safely #27

Closed williamfridh closed 4 months ago

williamfridh commented 4 months ago

Please secure your uninstall code. Please review the following links and make sure you're not letting unauthorized users access the uninstall command, and that you're allowing it to be called on an actual uninstall.

https://developer.wordpress.org/reference/functions/register_uninstall_hook/

https://developer.wordpress.org/plugins/the-basics/uninstall-methods/

From your plugin:

pattern_friend/uninstall.php:14

williamfridh commented 4 months ago

Added the following code to uninstall.php: ´´´ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { die; }

williamfridh commented 4 months ago

The uninstall.php is not being called properly. And double check if transients needs to be removed too.

williamfridh commented 4 months ago

No transient needs to be removed via uninstall.php as the only one being used is short lived.

williamfridh commented 4 months ago

Nevermind. The uninstall.php file is executed as it should.