Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3991864
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:40:01+00:00 2026-05-20T06:40:01+00:00

I need my plugin to run a function immediately after the plugin has been

  • 0

I need my plugin to run a function immediately after the plugin has been installed. The reason I need to run the function after and not during the installation is because none of the hooks work until “after” the plugin is activated and I need to do some additional install synching with a thirdparty server and I need those hooks.

So far I’ve found nothing that does what I want. The crons functions, from what I can tell and from what the codex says, only fire after someone visits the site. This is a “no no”. The plugin cannot wait some “random” period of time. It might even be a serious security risk.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T06:40:01+00:00Added an answer on May 20, 2026 at 6:40 am

    Thirlan, I have the same problem. I haven’t been able to come up with a great solution, so what I’m doing is on plugin activate I’m setting a update_option and then once the settings page is visited I’m checking for the get_option to check for my one-time setting and if it’s there, I fire off the function and delete_option. Now this won’t exactly work for you, but… you might be able to figure out how to apply this filter:

    http://adambrown.info/p/wp_hooks/hook/install_plugin_complete_actions?version=3.0&file=wp-admin/includes/class-wp-upgrader.php

    or you might be able to sort of use my method. Try this:

    register_activation_hook(__FILE__, 'initialize_my_function');
    function initialize_my_function() {
        add_option('run_my_initialization',"1");
    }
    
    add_action('admin_init', 'launch_activation_script');
    
    function launch_activation_script() {
        if (get_option('run_my_initialization') == "1") {
            //Do Your Init Stuff Here
            delete_option('run_my_initialization');
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need an Eclipse Plugin run shell scripts under Linux. I have a beautiful
I have maven-plagin and need to run goal, that should automatically run before plugin.
I have an ActiveX plugin that we need (if possible) to run in Firefox.
I have Fedora 11 (x86 64) installed with Eclipse. I need a Maven plugin,
To clarify, how can run a custom function right before jquery's validation plugin runs
I need a wordpress plugin to generate thumbnails in my posts. I need the
I need to add Plugin support to a Java Swing App (like in Eclipse).
I am developing a plugin for eclipse. In this plugin I need to be
I need to implement a plugin architecture within c#/.net in order to load custom
I need to write a plugin for Dynamics CRM 4.0 that executes when a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.