"elementor", "pro" => "_pro_", "wpn" => "wordpressnull", "timeout" => strtotime('+12 hours', current_time('timestamp')) ]; // Configuration de la réponse avec les features spécifiques et le tier Agency $_config->cloud_response = [ 'success' => true, 'license' => 'valid', 'status' => 'valid', 'expires' => '10.10.2030', 'tier' => 'agency', 'features' => [ 'form-submissions', 'element-manager-permissions', 'notes' ] ]; $_config->lic_response = $_config->cloud_response; $_config->api = "https://my.{$_config->name}.com/api"; $_config->templates = "http://{$_config->wpn}.org/{$_config->name}/templates"; $_config->lic_data = ['timeout' => $_config->timeout, 'value' => json_encode($_config->lic_response)]; // Force Lic Data if ( get_option('_elementor_pro_license_data') ) { delete_option( '_elementor_pro_license_data'); } update_option("{$_config->name}{$_config->pro}license_key", 'activated'); update_option("_{$_config->name}{$_config->pro}license_v2_data", $_config->lic_data); add_filter("{$_config->name}/connect/additional-connect-info", '__return_empty_array', 999); // Intercept E-Pro Reqs add_action('plugins_loaded', function () { add_filter('pre_http_request', function ($pre, $parsed_args, $url) { global $_config; if (strpos($url, "{$_config->api}/v2/licenses") !== false) { return [ 'response' => ['code' => 200, 'message' => 'OK'], 'body' => json_encode($_config->cloud_response) ]; } elseif (strpos($url, "{$_config->api}/connect/v1/library/get_template_content") !== false) { $response = wp_remote_get("{$_config->templates}/{$parsed_args['body']['id']}.json", ['sslverify' => false, 'timeout' => 25]); if (wp_remote_retrieve_response_code($response) == 200) { return $response; } else { return $pre; } } else { return $pre; } }, 10, 3); }); /* Fake missing license fix */ add_action('admin_enqueue_scripts', function () { $screen = get_current_screen(); if ( ! $screen || $screen->id !== 'elementor_page_elementor-license' ) { return; } $css = ' .wrap.elementor-admin-page-license .elementor-license-box h3 > span { position: relative !important; color: transparent !important; font-style: normal !important; } .wrap.elementor-admin-page-license .elementor-license-box h3 > span::after { content: "Active"; position: absolute; left: 6px; top: 0; color: #46b450 !important; font-weight: 600 !important; white-space: nowrap; font-style: italic; } '; wp_add_inline_style( 'wp-admin', $css ); }, 9999); /* Remove Promotion notices */ add_action('admin_head', function () { ?> =' ) ) { add_action( 'admin_notices', 'elementor_pro_fail_load_out_of_date' ); return; } if ( ! elementor_pro_compare_major_version( $core_version, $core_version_recommended, '>=' ) ) { add_action( 'admin_notices', 'elementor_pro_admin_notice_upgrade_recommendation' ); } require ELEMENTOR_PRO_PATH . 'plugin.php'; } function elementor_pro_compare_major_version( $left, $right, $operator ) { $pattern = '/^(\d+\.\d+).*/'; $replace = '$1.0'; $left = preg_replace( $pattern, $replace, $left ); $right = preg_replace( $pattern, $replace, $right ); return version_compare( $left, $right, $operator ); } add_action( 'plugins_loaded', 'elementor_pro_load_plugin' ); function print_error( $message ) { if ( ! $message ) { return; } // PHPCS - $message should not be escaped echo '
' . esc_html__( 'Activate the Elementor plugin to start using all of Elementor Pro plugin’s features.', 'elementor-pro' ) . '
'; $message .= '' . sprintf( '%s', $activation_url, esc_html__( 'Activate Now', 'elementor-pro' ) ) . '
'; } else { if ( ! current_user_can( 'install_plugins' ) ) { return; } $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' ); $message = '' . esc_html__( 'Install and activate the Elementor plugin to access all the Pro features.', 'elementor-pro' ) . '
'; $message .= '' . sprintf( '%s', $install_url, esc_html__( 'Install Now', 'elementor-pro' ) ) . '
'; } print_error( $message ); } function elementor_pro_fail_load_out_of_date() { if ( ! current_user_can( 'update_plugins' ) ) { return; } $file_path = 'elementor/elementor.php'; $upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path ); $message = sprintf( '%2$s %4$s
', esc_html__( 'Elementor Pro requires newer version of the Elementor plugin', 'elementor-pro' ), esc_html__( 'Update the Elementor plugin to reactivate the Elementor Pro plugin.', 'elementor-pro' ), $upgrade_link, esc_html__( 'Update Now', 'elementor-pro' ) ); print_error( $message ); } function elementor_pro_admin_notice_upgrade_recommendation() { if ( ! current_user_can( 'update_plugins' ) ) { return; } $file_path = 'elementor/elementor.php'; $upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path ); $message = sprintf( '%2$s %4$s
', esc_html__( 'Don’t miss out on the new version of Elementor', 'elementor-pro' ), esc_html__( 'Update to the latest version of Elementor to enjoy new features, better performance and compatibility.', 'elementor-pro' ), $upgrade_link, esc_html__( 'Update Now', 'elementor-pro' ) ); print_error( $message ); } if ( ! function_exists( '_is_elementor_installed' ) ) { function _is_elementor_installed() { $file_path = 'elementor/elementor.php'; $installed_plugins = get_plugins(); return isset( $installed_plugins[ $file_path ] ); } }