Plugin Directory

Changeset 2222403


Ignore:
Timestamp:
01/05/2020 07:55:50 PM (6 years ago)
Author:
shopybot
Message:

added uninstall hook

Location:
shopybot-woocommerce/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • shopybot-woocommerce/trunk/includes/class-wc-shopybot-integration.php

    r2220716 r2222403  
    4646            // Filters
    4747            add_filter('mod_rewrite_rules', array($this, 'add_htaccess_rule'));
    48         }
     48        }
    4949
    5050        public function add_htaccess_rule($rules) {
  • shopybot-woocommerce/trunk/readme.txt

    r2220716 r2222403  
    44Requires at least: 3.9
    55Tested up to: 5.3.2
    6 Stable tag: 1.0.9
     6Stable tag: 1.0.10
    77License: GNU GENERAL PUBLIC LICENSE Version 3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    100100== Changelog ==
    101101
     102= 1.0.10 =
     103Added uninstall hook
     104
    102105= 1.0.9 =
    1031061. fixed empty products error
  • shopybot-woocommerce/trunk/shopybot-woocommerce.php

    r2220716 r2222403  
    22
    33/**
    4  * Shopybot - Facebook Chatbot for your WooCommerce
     4 * Shopybot - Facebook ChatBot for your WooCommerce shop
    55 *
    66 * This file is read by WordPress to generate the plugin information in the plugin
     
    1010 *
    1111 * @link              https://www.shopybot.com
    12  * @since             1.0.9
     12 * @since             1.0.10
    1313 * @package           Shopybot_Woocommerce
    1414 *
    1515 * @wordpress-plugin
    16  * Plugin Name:       ShopyBot - Facebook Chatbot for WooCommerce
     16 * Plugin Name:       ShopyBot - Facebook ChatBot for WooCommerce
    1717 * Plugin URI:        https://www.shopybot.com/connect-bot/woocommerce
    18  * Description:       Easy way to sell your products in Facebook Messenger
    19  * Version:           1.0.9
     18 * Description:       Create a ChatBot and sell your products in Facebook Messenger
     19 * Version:           1.0.10
    2020 * Author:            ShopyBot
    2121 * Author URI:        https://www.shopybot.com
     
    9595
    9696endif;
     97
     98register_uninstall_hook( __FILE__, 'shopybot_woocommerce_uninstall' );
     99function shopybot_woocommerce_uninstall() {
     100    global $wpdb;
     101
     102    // cleanup shopybot options
     103    delete_option('shopybot_api_key');
     104    delete_option('shopybot_shop_token');
     105    delete_option('shopybot_connect_fb_page_url');
     106    delete_option('shopybot_connect_shop_url');
     107    delete_option('shopybot_disconnect_shop_url');
     108    delete_option('shopybot_disconnect_fb_page_url');
     109    delete_option('shopybot_fb_page_id');
     110    delete_option('shopybot_fb_page_name');
     111
     112    delete_option('shopybot-woocommerce_in_process');
     113    delete_option('shopybot-woocommerce_page');
     114    delete_option('shopybot-woocommerce_pages');
     115    delete_option('shopybot-woocommerce_lock');
     116    delete_option('shopybot-woocommerce_get_ids');
     117
     118    // delete all cached products
     119    $table_name = $wpdb->prefix . 'postmeta';
     120    $sql = "DELETE FROM $table_name WHERE meta_key = 'shopybot-woocommerce_yml_offer'";
     121    $wpdb->query($sql);
     122}
Note: See TracChangeset for help on using the changeset viewer.