[], 'body' => json_encode([ "success" => true, "license" => "valid", "item_id" => false, "item_name" => $item_name, // Use the extracted item_name here "license_limit" => 100, "site_count" => 1, "expires" => "lifetime", "activations_left" => 99, "checksum" => "B5E0B5F8DD8689E6ACA49DD6E6E1A930", "payment_id" => 123456, "customer_name" => "GPL", "customer_email" => "noreply@gmail.com", "price_id" => "7" ]), 'response' => [ 'code' => 200, 'message' => 'OK', ] ]; } return $preempt; }, 10, 3); final class Divi_Essential { /** * Plugin version * * @var string */ const version = '4.11.0'; private static $instance; /** * Class construcotr */ private function __construct() { $this->define_constants(); register_activation_hook( __FILE__, array($this, 'activate' ) ); add_action( 'plugins_loaded', array( $this, 'init_plugin' ) ); } /** * Initializes a singleton instance * * @return \Divi_Essential */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Divi_Essential ) ) { self::$instance = new Divi_Essential(); self::$instance->init(); // __LICENSE__INFO__ self::$instance->includes(); // __LICENSE__INFO__ } return self::$instance; } private function init() { add_action( 'divi_extensions_init', array( $this, 'initialize_extension' ) ); } /** * Define the required plugin constants * * @return void */ public function define_constants() { define( 'DIVI_ESSENTIAL_VERSION', self::version ); define( 'DIVI_ESSENTIAL_FILE', __FILE__ ); define( 'DIVI_ESSENTIAL_DIR', plugin_dir_path( __FILE__ ) ); define( 'DIVI_ESSENTIAL_EXTENSIONS_DIR', DIVI_ESSENTIAL_DIR . 'includes/extensions/'); define( 'DIVI_ESSENTIAL_PATH', __DIR__ ); define( 'DIVI_ESSENTIAL_URL', plugins_url( '', DIVI_ESSENTIAL_FILE ) ); define( 'DIVI_ESSENTIAL_EXTENSIONS_PATH', DIVI_ESSENTIAL_URL . '/includes/extensions/' ); define( 'DIVI_ESSENTIAL_ASSETS', DIVI_ESSENTIAL_URL . '/assets/' ); define( 'DIVI_ESSENTIAL_ICON', DIVI_ESSENTIAL_URL . '/includes/modules/' ); define( 'DIVI_ESSENTIAL_POPUP', DIVI_ESSENTIAL_EXTENSIONS_DIR .'popup-pro'); // __LICENSE__INFO__ /** * * 1. required plugin license start */ // this is the URL our updater / license checker pings. This should be the URL of the site with EDD installed define('DNEXT_ESSENTIAL_STORE_URL', 'https://www.divinext.com/'); // you should use your own CONSTANT name, and be sure to replace it throughout this file // the download ID for the product in Easy Digital Downloads define('DNEXT_ESSENTIAL_ITEM_ID', 243636); // you should use your own CONSTANT name, and be sure to replace it throughout this file // the name of the product in Easy Digital Downloads define('DNEXT_ESSENTIAL_ITEM_NAME', 'Divi Essential'); // you should use your own CONSTANT name, and be sure to replace it throughout this file // the name of the settings page for the license input to be displayed define('DNEXT_ESSENTIAL_PLUGIN_LICENSE_PAGE', 'divi-next-essential-license'); /** * * 1. the required plugin license end */ // __LICENSE__INFO__ } /** * Initialize the plugin * * @return void */ public function init_plugin() { include DIVI_ESSENTIAL_EXTENSIONS_DIR . '/extensions.php'; } // __LICENSE__INFO__ private function includes() { /** * * 2. the required plugin license Plugin_Updater_Class start */ if (!class_exists('DNEXT_Essential_Plugin_Updater_Class')) { // load our custom updater include DIVI_ESSENTIAL_DIR . '/divi-essential-updater.php'; } /** * * 2. the required plugin license Plugin_Updater_Class end */ } // __LICENSE__INFO__ public function initialize_extension() { require_once DIVI_ESSENTIAL_DIR . 'includes/DiviEssential.php'; } /** * Do stuff upon plugin activation * * @return void */ public function activate() { $installed = get_option( 'divi_essential_installed' ); if ( ! $installed ) { update_option( 'divi_essential_installed', time() ); } $inactive_extensions = get_option('dnxte_inactive_extensions'); if( $inactive_extensions === false ) { $inactive_extensions = array( 'popup-pro-extension', 'dnxte-hide-adminbar-extension', 'dnxte-clear-cache-extension', ); update_option('dnxte_inactive_extensions', $inactive_extensions); } update_option( 'divi_essential_version', DIVI_ESSENTIAL_VERSION ); } } /** * Initializes the main plugin * * @return \Divi_Essential */ function divi_essential() { return Divi_Essential::instance(); } // Kick--Off the plugin divi_essential();