Event/Action for when you first load a plugin?

  • Author
  • #511720

    I’m wondering if there is a WordPress action (a.k.a. event) that fires when a plugin is first activated. What I’m after is a place where I can run a full range of tests for that plugin. I know I can run tests each time a plugin is executed (e.g. I can add my tests to the ‘init’ event: add_action(‘init’, ‘do_my_tests’); ), but what if some of the tests are lengthy, and it would significantly slow down performance if they were to execute on every page request? Is there an event or some way to tie into which would let me run some extended tests only when the plugin is first loaded? I want to be able to run a whole lot of tests and message the user if there was some problem with their setup.

    A similar use case might be a plugin that creates its own custom database table — you want it to create this table when the plugin is first loaded. You don’t want to have to check for the existence of the custom database table on each page load.

    Know what I mean? Anyone got some ideas?

    The blog I need help with is fireproofsocks.wordpress.com.


    Moderator Emeritus

    You may not realize it, but there are two very different and separate kinds of WordPress.
wp.COM is a multi-user platform with free hosting
wp.ORG is software for self-hosted blogs
    So, the forum where you can find assistance would be:
    The differences in more detail:


    I had no idea. THANK YOU. Relying on Google for navigation was a tragic mistake.



    how can i activate my plugins?


    @ganesskarki, the blog linked to your username is a wordpress.COM blog, is that the one you are talking about? If so, we cannot use plugins here at wordpress.COM. Plugins are only for self-hosted wordpress blogs.


    If you are talking about a different blog, one that is self-hosted, then you need to ask over at http://wordpress.ORG/support/ as that is where self-hosted blogs using the wordpress software are supported.

The topic ‘Event/Action for when you first load a plugin?’ is closed to new replies.