Plugin Directory

Changeset 1969884


Ignore:
Timestamp:
11/06/2018 02:28:01 PM (7 years ago)
Author:
ryotsun
Message:

Enabled uninstall hook to delete option value and drop log table

Location:
wp-slack-logbot/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-slack-logbot/trunk/class-wp-slack-logbot.php

    r1968990 r1969884  
    88 * Text Domain:     wp-slack-logbot
    99 * Domain Path:     /languages
    10  * Version:         1.0
     10 * Version:         1.1
    1111 *
    1212 * @package         Wp_Slack_Logbot
     
    4444     * @var string $slack_logbot_version
    4545     */
    46     var $slack_logbot_version = '1.0';
     46    var $slack_logbot_version = '1.1';
    4747
    4848    /**
     
    6161     */
    6262    public function register() {
     63        // activation hook.
    6364        register_activation_hook( __FILE__, array( $this, 'install' ) );
     65        // load translation file.
    6466        load_plugin_textdomain( dirname( plugin_basename( __FILE__ ) ), false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
     67        // uninstall hook.
     68        register_uninstall_hook( __FILE__, 'WP_Slack_Logbot::uninstall' );
    6569    }
    6670
     
    100104        add_option( 'slack_logbot_version', $this->slack_logbot_version );
    101105    }
     106
     107    /**
     108     * Uninstall plugin.
     109     */
     110    public static function uninstall() {
     111        global $wpdb;
     112        $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}slack_logbot" );
     113
     114        delete_option( 'slack_logbot_version' );
     115        delete_option( 'wp-slack-logbot-bot-user-oauth-access-token' );
     116    }
    102117}
    103118
  • wp-slack-logbot/trunk/readme.txt

    r1969149 r1969884  
    1 === Wp Slack Logbot ===
     1=== WP Slack Logbot ===
    22Contributors: ryotsun
    33Donate link:
     
    66Tested up to: 5.1-alpha-20181015.143023
    77Requires PHP: 5.3
    8 Stable tag: 1.0.1
     8Stable tag: 1.1
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7878== Changelog ==
    7979
     80= 1.1 =
     81* Enabled uninstall hook to delete option value and drop log table
     82
    8083= 1.0 =
    8184* First release
Note: See TracChangeset for help on using the changeset viewer.