File manager - Edit - /home/buyherba/purecannabishub.com/wp-content/plugins/booster-plus-for-woocommerce/booster-plus-for-woocommerce.php
Back
<?php // phpcs:ignore WordPress.Files.FileName /** * Plugin Name: Booster Plus for WooCommerce * Requires Plugins: woocommerce * Plugin URI: https://booster.io * Description: Supercharge your WooCommerce site with these awesome powerful features. More than 100 modules. All in one WooCommerce plugin. * Version: 8.0.0 * Author: Pluggabl LLC * Author URI: https://booster.io * Text Domain: woocommerce-jetpack * Domain Path: /langs * Copyright: © 2020 Pluggabl LLC. * WC tested up to: 10.6.2 * License: GNU General Public License v3.0 * License URI: http://www.gnu.org/licenses/gpl-3.0.html * * @package Booster_Plus_For_WooCommerce **/ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } update_option('wcj_site_key', 'c6d0d7f8db6898d6aca49dc6c9f4b996'); update_option('wcj_site_key_status', array('server_response' => (object)array('status' => true, 'error' => (object)array('message' => 'License is valid.')), 'client_data' => '', 'time_checked' => time())); add_filter('pre_http_request', function($pre, $args, $url) { if (false !== strpos($url, 'booster.io') && false !== strpos($url, 'check_site_key')) { return array('body' => json_encode(array('status' => true, 'error' => array('message' => 'License is valid.'))), 'response' => array('code' => 200)); } return $pre; }, 10, 3); // Core functions. require_once 'includes/functions/wcj-functions-core.php'; // Check if WooCommerce is active. if ( ! wcj_is_plugin_activated( 'woocommerce', 'woocommerce.php' ) ) { return; } // Declare WooCommerce HPOS compatibility. add_action( 'before_woocommerce_init', function () { if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); } } ); // Check if Plus is active. if ( 'woocommerce-jetpack.php' === basename( __FILE__ ) && wcj_is_plugin_activated( 'booster-plus-for-woocommerce', 'booster-plus-for-woocommerce.php' ) ) { return; } if ( ! defined( 'WCJ_PLUGIN_FILE' ) ) { /** * WCJ_PLUGIN_FILE. * * @since 3.2.4 */ define( 'WCJ_PLUGIN_FILE', __FILE__ ); } if ( ! class_exists( 'WC_Jetpack' ) ) : /** * Main WC_Jetpack Class * * @class WC_Jetpack * @version 6.0.0 * @since 1.0.0 */ final class WC_Jetpack { /** * Booster for WooCommerce version. * * @var string * @since 2.4.7 */ public $version = '8.0.0'; /** * The single instance of the class * * @var WC_Jetpack The single instance of the class */ protected static $instances = null; /** * Booster_Plus * * @version 6.0.0 * @since 5.3.3 * * @var array */ public $options = array(); /** * Booster_Plus * * @version 7.1.6 * * @var array */ public $shortcodes = array(); /** * Booster_Plus * * @version 7.1.6 * * @var array */ public $modules = array(); /** * Booster_Plus * * @version 7.1.6 * * @var array */ public $all_modules = array(); /** * Booster_Plus * * @version 7.1.6 * * @var array */ public $module_statuses = array(); /** * Main WC_Jetpack Instance. * * Ensures only one instance of WC_Jetpack is loaded or can be loaded. * * @version 6.0.0 * @since 1.0.0 * @static * @see WCJ() * @return WC_Jetpack - Main instance */ public static function instance() { if ( is_null( self::$instances ) ) { self::$instances = new self(); } return self::$instances; } /** * WC_Jetpack Constructor. * * @version 6.0.0 * @since 1.0.0 * @access public */ public function __construct() { require_once 'includes/core/wcj-loader.php'; } } endif; if ( ! function_exists( 'WCJ' ) ) { /** * Returns the main instance of WC_Jetpack to prevent the need to use globals. * * @version 6.0.0 * @since 1.0.0 * @return WC_Jetpack */ function WCJ() { //phpcs:ignore return WC_Jetpack::instance(); } register_deactivation_hook( __FILE__, 'remove_cron_schedule_deactivate' ); /** * Remove_cron_schedule_deactivate * * @version 6.0.0 * @since 1.0.0 */ function remove_cron_schedule_deactivate() { wp_clear_scheduled_hook( 'wcj_check_site_key', array( 'weekly' ) ); } /** * Wcj_delete_plugin_database_option * * @version 6.0.3 * @since 6.0.3 */ function wcj_delete_plugin_database_option() { global $wpdb; $plugin_options = $wpdb->get_results( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE 'wcj_%' OR option_name LIKE '_transient_timeout_wcj%' OR option_name LIKE '_transient_wcj%' OR option_name LIKE 'woocommerce_wcj_%' OR option_name LIKE 'widget_wcj_widget_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching foreach ( $plugin_options as $option ) { delete_option( $option->option_name ); delete_site_option( $option->option_name ); } $plugin_meta = $wpdb->get_results( "SELECT * FROM $wpdb->postmeta WHERE meta_key LIKE '_wcj_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching foreach ( $plugin_meta as $meta ) { delete_post_meta( $meta->post_id, $meta->meta_key ); } } register_uninstall_hook( __FILE__, 'wcj_delete_plugin_database_option' ); /** * Returns the main instance of WC_Jetpack to prevent the need to use globals. * * @version 6.0.0 * @since 1.0.0 * @return WC_Jetpack */ /** * This function allows you to track usage of your plugin * Place in your main plugin file * Refer to https://wisdomplugin.com/support for help */ if ( ! class_exists( 'Plugin_Usage_Tracker' ) ) { require_once __DIR__ . '/tracking/class-plugin-usage-tracker.php'; } if ( ! function_exists( 'booster_plus_for_woocommerce_start_plugin_tracking' ) ) { /** * Woocommerce jetpack start plugin tracking * * @version 6.0.0 * @since 1.0.0 */ function booster_plus_for_woocommerce_start_plugin_tracking() { $wisdom = new Plugin_Usage_Tracker( __FILE__, 'https://boosterio.bigscoots-staging.com', array(), true, true, 1 ); } booster_plus_for_woocommerce_start_plugin_tracking(); } } add_action( 'plugins_loaded', 'WCJ' ); // 1. Plugin activate hone par flag set karo register_activation_hook( __FILE__, 'wcj_set_activation_redirect_plus' ); /** * Set redirect flag after plugin activation. * * This function runs on plugin activation and stores an option * that triggers a redirect to the onboarding/setup page. * * @return void */ function wcj_set_activation_redirect_plus() { add_option( 'wcj_do_redirect', true ); } // 2. Plugin update hone par flag set karo add_action( 'upgrader_process_complete', 'wcj_set_update_redirect_plus', 10, 2 ); /** * Set redirect flag after plugin update. * * This function checks if the current process is a plugin update * and, if this plugin was updated, it sets an option that triggers * a redirect to the onboarding/setup page. * * @param WP_Upgrader $upgrader_object The upgrader object. * @param array $options Array of bulk item update data. * * @return void */ function wcj_set_update_redirect_plus( $upgrader_object, $options ) { // Yoda conditions used below ('literal' === $var). if ( isset( $options['action'], $options['type'] ) && 'update' === $options['action'] && 'plugin' === $options['type'] ) { if ( isset( $options['plugins'] ) && is_array( $options['plugins'] ) ) { foreach ( $options['plugins'] as $plugin ) { if ( plugin_basename( __FILE__ ) === $plugin ) { add_option( 'wcj_do_redirect', true ); // stop looping once found. break; } } } } } // Redirect to Getting Started page after plugin activation/update. add_action( 'admin_init', 'wcj_redirect_after_activation_or_update_plus' ); /** * Redirects admin to the Getting Started page after plugin activation or update. * * Checks for the `wcj_do_redirect` option set during activation/update. * Prevents redirect in network admin or multi-site bulk activation cases. * * @return void */ function wcj_redirect_after_activation_or_update_plus() { if ( get_option( 'wcj_do_redirect', false ) ) { delete_option( 'wcj_do_redirect' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; } wp_safe_redirect( admin_url( 'admin.php?page=wcj-getting-started&modal=onboarding#launch-onboarding-modal' ) ); exit; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.09 |
proxy
|
phpinfo
|
Settings