WPBP/WordPress-Plugin-Boilerplate-Powered

after_uninstall never called

Closed this issue · 8 comments

hi

when is the after_uninstall called ? because on delete is never called and i could not find any documentation

Mte90 commented

As you can see is called and the file is included in the main php file, https://github.com/WPBP/WordPress-Plugin-Boilerplate-Powered/search?utf8=%E2%9C%93&q=PN_Uninstall.php

the file is called but the action not

Mte90 commented

Looking at the code seems that the hook is not the best way: https://developer.wordpress.org/plugins/the-basics/uninstall-methods/

Can you test if:
add_action( 'after_uninstall', array( $this, 'uninstall_hook' ) );
Replaced with:
register_uninstall_hook(__FILE__, array( $this, 'uninstall_hook' ));

Will work?

nope no luck

Mte90 commented

So the only solution is an uninstall.php file or put this call in the main root file.

Mte90 commented

Did you close the ticket because now is working?

no. i just didn't see the point in keeping it open

Mte90 commented

Well the boilerplate keep to have the problem so I can also open a new ticket about reimplement an uninstall system (that works).