function wc_psad_install() { global $wpdb; //global $wp_rewrite; WC_PSAD_Settings::set_setting(); WC_PSAD_Functions::auto_create_order_keys_all_products(); update_option('wc_psad_version', '1.0.0'); update_option('wc_psad_plugin', 'wc_psad'); delete_transient("wc_psad_update_info"); //$wp_rewrite->flush_rules(); update_option('wc_psad_just_installed', true); }
function psad_upgrade_plugin() { if (version_compare(get_option('wc_psad_lite_version'), '1.0.2') === -1) { update_option('wc_psad_lite_version', '1.0.2'); WC_PSAD_Functions::upgrade_version_1_0_2(); } if (version_compare(get_option('wc_psad_lite_version'), '1.1.0') === -1) { // Build sass global $wc_psad_less; $wc_psad_less->plugin_build_sass(); update_option('wc_psad_lite_version', '1.1.0'); } update_option('wc_psad_lite_version', '1.1.1'); }
function psad_upgrade_plugin() { if (version_compare(get_option('wc_psad_lite_version'), '1.0.2') === -1) { update_option('wc_psad_lite_version', '1.0.2'); WC_PSAD_Functions::upgrade_version_1_0_2(); } if (version_compare(get_option('wc_psad_lite_version'), '1.1.0') === -1) { update_option('wc_psad_lite_version', '1.1.0'); // Build sass global $wc_psad_less; $wc_psad_less->plugin_build_sass(); } if (version_compare(get_option('wc_psad_lite_version'), '1.3.2') === -1) { update_option('wc_psad_lite_version', '1.3.2'); global $wpdb; $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s', '%psad_shop_categories_query%')); $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s', '%psad_shop_list_products_category%')); } update_option('wc_psad_lite_version', '1.3.5'); }
public function after_save_settings() { if ((isset($_POST['bt_save_settings']) || isset($_POST['bt_reset_settings'])) && get_option('psad_lite_clean_on_deletion') == 0) { $uninstallable_plugins = (array) get_option('uninstall_plugins'); unset($uninstallable_plugins[WC_PSAD_NAME]); update_option('uninstall_plugins', $uninstallable_plugins); } if (isset($_POST['bt_save_settings']) && isset($_POST['psad_flush_cached'])) { delete_option('psad_flush_cached'); WC_PSAD_Functions::flush_cached(); } }