=' ) ) { add_action( 'admin_notices', 'elementor_pro_fail_load_out_of_date' ); return; } $elementor_version_recommendation = '3.5.0'; if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_recommendation, '>=' ) ) { add_action( 'admin_notices', 'elementor_pro_admin_notice_upgrade_recommendation' ); } require ELEMENTOR_PRO_PATH . 'plugin.php'; } add_action( 'plugins_loaded', 'elementor_pro_load_plugin' ); function print_error( $message ) { if ( ! $message ) { return; } // PHPCS - $message should not be escaped echo '
' . esc_html__( 'Before you can use all the features of Elementor Pro, you need to activate the Elementor plugin first.', '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__( 'Before you can use all the features of Elementor Pro, you need to install and activate the Elementor plugin first.', 'elementor-pro' ) . '
'; $message .= '' . sprintf( '%s', $install_url, esc_html__( 'Install Elementor', '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 = '' . esc_html__( 'Elementor Pro is not working because you are using an old version of Elementor.', 'elementor-pro' ) . '
'; $message .= '' . sprintf( '%s', $upgrade_link, esc_html__( 'Update Elementor 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 = '' . esc_html__( 'A new version of Elementor is available. For better performance and compatibility of Elementor Pro, we recommend updating to the latest version.', 'elementor-pro' ) . '
'; $message .= '' . sprintf( '%s', $upgrade_link, esc_html__( 'Update Elementor 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 ] ); } }