最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

UnInstallation of a Plugin from a developers perspective - The correct and clean method

matteradmin9PV0评论

I think a good developer should provide the uninstallation in the safest and cleanest possible way.

I downloaded various plugins today to understand the process, but everything was very confusing. I found that many plugins are using both uninstall.php files and register_uninstall_hook(__FILE__, 'pluginprefix_function_to_run');

Is it correct?

because the link that I have provided above says that these two are two different methods. so what is correct using either registration hook or uninstall.php or both?

I think a good developer should provide the uninstallation in the safest and cleanest possible way.

I downloaded various plugins today to understand the process, but everything was very confusing. I found that many plugins are using both uninstall.php files and register_uninstall_hook(__FILE__, 'pluginprefix_function_to_run');

Is it correct?

because the link that I have provided above says that these two are two different methods. so what is correct using either registration hook or uninstall.php or both?

Share Improve this question edited Oct 25, 2018 at 10:24 kero 6,3501 gold badge25 silver badges34 bronze badges asked Oct 25, 2018 at 2:35 Richa SharmaRicha Sharma 497 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

They’re just two different ways of doing the same thing. It’s up to you which one to use, or whether to use both. Neither is ‘correct’. Use whichever makes more sense to you with the structure of your plugin.

Post a comment

comment list (0)

  1. No comments so far