• Hi all,

    Could anyone suggest me how to make my plugin so that users get message with some instructions after downloading or updating it?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • There may be multiple ways to do that, I believe the easiest way to do it is to create an entry in the options table that stores the current version and compare it against the version number of the plugin stored in a constant. Here is how it works (suppose that “version” is the name of the entry in the options table):

    1. User installs plugin for the first time,
    2. Plugin checks if “version” is in the options table,
    3. If “version” is not set, display information,
    4. Update the value of “version” with new number,
    5. (Some days pass)
    6. Developer releases a new version of the plugin,
    7. User downloads and install the new version of the plugin,
    8. Plugin extracts “version” from the options table,
    9. If “version” is different than number in PHP file…
    10. (Repeat from step 4)

    You can use “update_option” to set and update the version number in the options table, and create a constant in the main PHP file that powers the plugin that contains the version number of the latest update. This code illustrates what I just explained:

    <?php
    define('PLUGIN_VERSION', '1.0.1');
    
    $display_info = false;
    $tracker = 'plugin_version';
    $local_version = get_option($tracker);
    
    if ($local_version !== PLUGIN_VERSION) {
        $display_info = true;
        update_option($tracker, PLUGIN_VERSION);
    }
    
    if ( $display_info === true ) {
        /* Display info about the installation or update. */
    }
    ?>
    
    Thread Starter hityr5yr

    (@hityr5yr)

    Thank you Yorman,

    I will take your suggestion.

    Regards,

    Peter

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to popup a message to users after downloading my plugin?’ is closed to new replies.