Improved Plugin Tracking

  1. jimisaacs


    There are plenty of ways to go about implementing plugins, and someday the best one will win. Currently though, most of us on here will agree that the wordpress method is not that way.

    One major issue is the massive amount of data that can be left clogging your database from test driving components.

    This is why most of us have a test blog to use simply for this. It would be very beneficial to implement into the core. Maybe with a database table simply used for test driving themes, and plugins. None of the data is crucial and will be purged when any test drive is complete, and it can mirror the functionality of the real table's rows and columns. The combination of modularity and ease of use is what makes WordPress unique. Plugin test driving is a great addition to the ease of use part, while pushing the modularity to the more casual WordPress crowd.

    Overall the way WordPress hooks into the options table is the messiest part. Everyone has a different way of naming their options, only only the rare few great plugins include an "uninstall" of their data. This is still wonky, because a user doesn't know where to look if each plugin's "uninstall" is different. This should be standardized, and this is my solution!

    Plugin Option Tracking:
    What is the easiest way to do this? Well, my solution includes implementing a flag and prefix.

    The flag can simply be a parameter for the activation hook.
    register_activation_hook($file, 'myHookFunction');
    function myHookFunction(tracking = TRUE, prefix = NULL) {
    // function body

    If tracking is true then a prefix is appended to every option name that this plugin uses, and is saved with the plugin's activation.

    If the prefix is NULL, then the slug version of the plugin name is used as the prefix.

    Now that we have this data, tracking is simple. Within the plugin admin page, when a user deactivates a plugin, there can be another action that lives with inactive plugin lists, like "Activate | Delete | Secure Delete". And with the active plugin list this can be added "Clear Data | Deactivate".

    Posted: 9 years ago #
  2. jimisaacs


    Here is a change in the interface of this idea...
    instead of what I said:

    Active Plugin actions:
    "Dectivate | Purge"

    Inactive Plugins:
    "Activate | Purge | Delete | Purge & Delete"

    Posted: 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    1 Vote
  • Status

    Sorry, not right now