=' ) ) { add_action( 'admin_notices', array( $this, 'admin_notice_minimum_elementor_version' ) ); return; } // Check for required PHP version. if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) { add_action( 'admin_notices', array( $this, 'admin_notice_minimum_php_version' ) ); return; } // Once we get here, We have passed all validation checks so we can safely include our plugin. require_once 'includes/default-filters.php'; require_once 'class-plugin.php'; require_once 'includes/ajax-handler.php'; require_once 'includes/register_post_type.php'; require_once 'includes/icons-manager.php'; if ( is_admin() ) { Dashboard::get_instance(); } Absp_Library::init(); } /** * Admin notice * * Warning when the site doesn't have Elementor installed or activated. * * @since 1.0.0 * @access public */ public function admin_notice_missing_main_plugin() { if ( isset( $_GET['activate'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended } $message = sprintf( /* translators: 1: Plugin name 2: Elementor 3. Anchor Tag Opening 4. Link Label (Anchor text) 5. Anchor Tag Closing */ esc_html__( '"%1$s" requires "%2$s" to be installed and activated. You can install and activate %2$s from %3$s%4$s%5$s.', 'absolute-addons' ), '' . esc_html__( 'Absolute Addons', 'absolute-addons' ) . '', '' . esc_html__( 'Elementor', 'absolute-addons' ) . '', '', '', esc_html__( 'here', 'absolute-addons' ) ); printf( '

%1$s

', wp_kses_post( $message ) ); } /** * Admin notice * * Warning when the site doesn't have a minimum required Elementor version. * * @since 1.0.0 * @access public */ public function admin_notice_minimum_elementor_version() { if ( isset( $_GET['activate'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended } $message = sprintf( /* translators: 1: Plugin name 2: Dependency Name 3: Required Dependency version */ esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'absolute-addons' ), '' . esc_html__( 'Absolute Addons', 'absolute-addons' ) . '', '' . esc_html__( 'Elementor', 'absolute-addons' ) . '', self::MINIMUM_ELEMENTOR_VERSION ); printf( '

%1$s

', wp_kses_post( $message ) ); } /** * Admin notice * * Warning when the site doesn't have a minimum required PHP version. * * @since 1.0.0 * @access public */ public function admin_notice_minimum_php_version() { if ( isset( $_GET['activate'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended } $message = sprintf( /* translators: 1: Plugin name 2: Dependency Name 3: Required Dependency version */ esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'absolute-addons' ), '' . esc_html__( 'Absolute Addons', 'absolute-addons' ) . '', '' . esc_html__( 'PHP', 'absolute-addons' ) . '', self::MINIMUM_PHP_VERSION ); printf( '

%1$s

', wp_kses_post( $message ) ); } /** * Add Custom Elementor Categories * * @param Elements_Manager $elements_manager Category Names Array. * * @since 1.0.0 * @access public */ public function add_widget_categories( $elements_manager ) { $elements_manager->add_category( 'absp-widgets', [ 'title' => esc_html__( 'Absolute Addons', 'absolute-addons' ), 'icon' => 'fa fa-plug', ] ); if ( absp_has_pro() ) { $elements_manager->add_category( 'absp-widgets', [ 'title' => esc_html__( 'Absolute Addons Pro', 'absolute-addons' ), 'icon' => 'fa fa-plug', ] ); } } } // End of file class-absolute-addons.php