• Hi! I liked your plugin, though it should be a bit more explicit about disclosing use of fulltext indexes on the database, as they can become a big (literally) issue on a larger site. Those indexes can easily double the disk space required for your database to work. If you know that going in, thats one thing, but if people are not doing a code review before installing this, they can be in for a nasty surprise.

    But the main issue is that this plugin does not clean up after itself. There is no uninstall/deactivation hook that would remove the indexes it creates. This means that even after you remove the plugin, your database still have those big indexes in it. Please add a deactivation hook that would call crp_delete_index() when the plugin is deactivated. Your plugin’s (former) users will be very grateful.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ajay

    (@ajay)

    Thanks for the feedback on the FULLTEXT – I will add that to the readme.

    On the cleaning up, the plugin does that if you uninstall/delete the plugin – it deletes the settings as well as the fulltext index. Please see the code here.

    https://github.com/WebberZone/contextual-related-posts/blob/v2.9.2/uninstall.php

    It doesn’t do it on deactivation in case you wish to reactivate and it doesn’t need to reset the settings or the recreate indices on activation.

    Thread Starter Arunas Liuiza

    (@ideag)

    I’d suggest doing it on deactivation or at least having some kind of option to trigger clean up via WP-CLI.
    It’s good that there is an uninstall hook, but the problem is that it does not get triggered in environments where code is deployed via CI/CD process. You do not *delete* plugins on production.

    Plugin Author Ajay

    (@ajay)

    I’ll need to see how this is done – an option would work that a user can turn on if they would like to clean up the tables on deactivation.

    I’m not in a position to test CI/CD – am afraid I don’t have that expertise. But, your suggestion above makes sense to me to run if the option is turned on.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘No cleanup on plugin deactivation’ is closed to new replies.