File manager - Edit - /home/aresglob/public_html/wp/wp-includes/images/smilies/compatibility.tar
Back
ai-builder-compatibility.php 0000644 00000005042 15077513500 0012145 0 ustar 00 <?php /** * AI Builder Compatibility for 3rd party plugins. * * @package AI Builder * @since 1.0.11 */ if ( ! class_exists( 'Ai_Builder_Compatibility' ) ) { /** * AI Builder Compatibility * * @since 1.0.11 */ class Ai_Builder_Compatibility { /** * Instance * * @access private * @var object Class object. * @since 1.0.11 */ private static $instance = null; /** * Constructor * * @since 1.0.11 */ public function __construct() { // Plugin - Spectra. require_once AI_BUILDER_DIR . 'inc/compatibility/uag/ai-builder-compatibility-uag.php'; // Plugin - WooCommerce. require_once AI_BUILDER_DIR . 'inc/compatibility/surecart/ai-builder-compatibility-surecart.php'; // Plugin - Elementor. require_once AI_BUILDER_DIR . 'inc/compatibility/elementor/ai-builder-compatibility-elementor.php'; // Plugin - Cartflows. require_once AI_BUILDER_DIR . 'inc/compatibility/cartflows/ai-builder-compatibility-cartflows.php'; // Plugin - Suretriggers. require_once AI_BUILDER_DIR . 'inc/compatibility/suretriggers/ai-builder-compatibility-suretriggers.php'; // Plugin - CPSW. require_once AI_BUILDER_DIR . 'inc/compatibility/checkout-plugins-stripe-woo/ai-builder-compatibility-cpsw.php'; // Plugin - SureForms. require_once AI_BUILDER_DIR . 'inc/compatibility/sureforms/ai-builder-compatibility-sureforms.php'; // Plugin - SureMail. require_once AI_BUILDER_DIR . 'inc/compatibility/suremail/ai-builder-compatibility-suremail.php'; // Plugin - Latepoint. require_once AI_BUILDER_DIR . 'inc/compatibility/latepoint/ai-builder-compatibility-latepoint.php'; // Plugin - Ultimate Addons for Elementor. require_once AI_BUILDER_DIR . 'inc/compatibility/uae/ai-builder-compatibility-uae.php'; // Plugin - Ultimate Addons for Elementor Lite. require_once AI_BUILDER_DIR . 'inc/compatibility/uae-lite/ai-builder-compatibility-uae-lite.php'; // Plugin - WooCommerce Payments. require_once AI_BUILDER_DIR . 'inc/compatibility/woocommerce-payments/ai-builder-compatibility-woocommerce-payments.php'; // Plugin - SureRank. require_once AI_BUILDER_DIR . 'inc/compatibility/surerank/ai-builder-compatibility-surerank.php'; } /** * Initiator * * @since 1.0.11 * @return object initialized object of class. */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } } /** * Kicking this off by calling 'instance()' method */ Ai_Builder_Compatibility::instance(); } cartflows/ai-builder-compatibility-cartflows.php 0000644 00000002724 15077513500 0016157 0 ustar 00 <?php /** * AI Builder Compatibility for 'Cartflows' * * @package AI Builder * @since 3.4.6 */ namespace AiBuilder\Inc\Compatibility\Cartflows; defined( 'ABSPATH' ) || exit; if ( ! class_exists( 'Ai_Builder_Compatibility_Cartflows' ) ) { /** * Cartflows Compatibility * * @since 3.4.6 */ class Ai_Builder_Compatibility_Cartflows { /** * Instance * * @access private * @var object Class object. * @since 3.4.6 */ private static $instance = null; /** * Constructor * * @since 3.4.6 */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'disable_cartflows_redirect' ), 2 ); } /** * Initiator * * @since 3.4.6 * @return object initialized object of class. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Disable Cartflows redirect. * * @param string $plugin_init Plugin init file used for activation. * @param array<string, mixed> $data data. * @return void */ public function disable_cartflows_redirect( $plugin_init, $data = array() ) { if ( 'cartflows/cartflows.php' === $plugin_init ) { update_option( 'wcf_setup_skipped', true ); delete_option( 'wcf_start_onboarding' ); } } } /** * Kicking this off by calling 'get_instance()' method */ Ai_Builder_Compatibility_Cartflows::get_instance(); } checkout-plugins-stripe-woo/ai-builder-compatibility-cpsw.php 0000644 00000002720 15077513500 0020511 0 ustar 00 <?php /** * Astra Sites Compatibility for 'Checkout Plugins – Stripe for WooCommerce' * * @see https://wordpress.org/plugins/checkout-plugins-stripe-woo/ * * @package Astra Sites * @since 3.0.23 */ namespace AiBuilder\Inc\Compatibility\Cpsw; defined( 'ABSPATH' ) || exit; /** * Checkout Plugins - Stripe compatibility for Starter Templates. */ class Ai_Builder_Compatibility_Cpsw { /** * Instance * * @access private * @var object Class object. * @since 3.0.23 */ private static $instance = null; /** * Constructor. */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'checkout_plugins' ), 10, 2 ); } /** * Initiator * * @since 3.0.23 * @return object initialized object of class. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Disable redirec after installing and activating Checkout Plugins - Stripe. * * @param string $plugin_init Plugin init file used for activation. * @param array<string, mixed> $data data. * @return void */ public function checkout_plugins( $plugin_init, $data = array() ) { if ( 'checkout-plugins-stripe-woo/checkout-plugins-stripe-woo.php' === $plugin_init ) { delete_option( 'cpsw_start_onboarding' ); } } } /** * Kicking this off by calling 'get_instance()' method */ Ai_Builder_Compatibility_Cpsw::get_instance(); uag/ai-builder-compatibility-uag.php 0000644 00000002406 15077513500 0013474 0 ustar 00 <?php /** * AI Builder Compatibility for 'UAG' * * @see https://wordpress.org/plugins/ultimate-addons-for-gutenberg/ * * @package AI Builder * @since 3.0.15 */ /** * UAG compatibility for Starter Templates. */ class Ai_Builder_Compatibility_UAG { /** * Instance * * @access private * @var object Class object. * @since 3.0.15 */ private static $instance = null; /** * Constructor. */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'uag_activation' ), 10 ); } /** * Initiator * * @since 3.0.15 * @return object initialized object of class. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Disable redirect after installing and activating UAG. * * @since 3.0.15 * @param string $plugin_init The path to the plugin file that was just activated. * @return void */ public function uag_activation( $plugin_init ) { if ( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' === $plugin_init ) { update_option( '__uagb_do_redirect', false ); } } } /** * Kicking this off by calling 'get_instance()' method */ Ai_Builder_Compatibility_UAG::get_instance(); latepoint/ai-builder-compatibility-latepoint.php 0000644 00000002702 15077513500 0016141 0 ustar 00 <?php /** * AI Builder Compatibility for 'LatePoint' * * @see https://wordpress.org/plugins/latepoint/ * * @package AI Builder * @since 1.2.30 */ if ( ! class_exists( 'Ai_Builder_Compatibility_LatePoint' ) ) { /** * LatePoint Compatibility * * @since 1.2.30 */ class Ai_Builder_Compatibility_LatePoint { /** * Instance * * @access private * @var object Class object. * @since 1.2.30 */ private static $instance; /** * Constructor * * @since 1.2.30 */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'disable_latepoint_redirection' ) ); } /** * Initiator * * @since 1.2.30 * @return object initialized object of class. */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Disables LatePoint redirection during plugin activation. * * @param string $plugin_init The path to the plugin file that was just activated. * * @since 1.2.30 * @return void */ public function disable_latepoint_redirection( $plugin_init ) { if ( 'latepoint/latepoint.php' === $plugin_init ) { update_option( 'latepoint_redirect_to_wizard', false ); update_option( 'latepoint_show_version_5_modal', false ); } } } /** * Kicking this off by calling 'instance()' method */ Ai_Builder_Compatibility_LatePoint::instance(); } suretriggers/ai-builder-compatibility-suretriggers.php 0000644 00000002604 15077513500 0017416 0 ustar 00 <?php /** * Astra Sites Compatibility for 'Suretriggers' * * @see https://wordpress.org/plugins/ultimate-addons-for-beaver-builder-lite/ * * @package Astra Sites * @since 4.0.8 */ namespace AiBuilder\Inc\Compatibility\SureCart; /** * Suretriggers compatibility for Starter Templates. */ class Ai_Builder_Compatibility_Suretriggers { /** * Instance * * @access private * @var object Class object. * @since 4.0.8 */ private static $instance = null; /** * Constructor. */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'suretriggers_activation' ), 10 ); } /** * Initiator * * @since 4.0.8 * @return object initialized object of class. */ public static function get_instance() { if ( ! self::$instance instanceof Ai_Builder_Compatibility_Suretriggers ) { self::$instance = new self(); } return self::$instance; } /** * Disable redirect after installing and activating UABB. * * @since 4.0.8 * @param string $plugin_init The path to the plugin file that was just activated. * @return void */ public function suretriggers_activation( $plugin_init ) { if ( 'suretriggers/suretriggers.php' === $plugin_init ) { delete_transient( 'st-redirect-after-activation' ); } } } /** * Kicking this off by calling 'get_instance()' method */ Ai_Builder_Compatibility_Suretriggers::get_instance(); sureforms/ai-builder-compatibility-sureforms.php 0000644 00000003411 15077513500 0016213 0 ustar 00 <?php /** * AI Builder Compatibility for 'SureForms' * * @see https://wordpress.org/plugins/sureforms/ * * @package AI Builder * @since 1.2.9 */ namespace AiBuilder\Inc\Compatibility\SureCart; if ( ! class_exists( 'Ai_Builder_Compatibility_SureForms' ) ) { /** * SureCart Compatibility * * @since 1.2.9 */ class Ai_Builder_Compatibility_SureForms { /** * Instance * * @access private * @var object Class object. * @since 1.2.9 */ private static $instance = null; /** * Constructor * * @since 1.2.9 */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'activation' ), 10 ); add_filter( 'srfm_enable_redirect_activation', array( $this, 'redirect_compatibility' ), 10, 1 ); } /** * Initiator * * @since 1.2.9 * @return object initialized object of class. */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Stop the plugin activation redirection. * * @since 1.2.13 * * @param bool $do_redirect is redirect. * @return bool */ public function redirect_compatibility( $do_redirect ) { if ( astra_sites_has_import_started() ) { return false; } return $do_redirect; } /** * Stop the plugin activation redirection. * * @since 1.0.15 * @param string $plugin_init The path to the plugin file that was just activated. * @return void */ public function activation( $plugin_init ) { if ( 'sureforms/sureforms.php' === $plugin_init ) { update_option( '__srfm_do_redirect', false ); } } } /** * Kicking this off by calling 'instance()' method */ Ai_Builder_Compatibility_SureForms::instance(); } surecart/ai-builder-compatibility-surecart.php 0000644 00000006760 15077513500 0015633 0 ustar 00 <?php /** * AI Builder Compatibility for 'SureCart' * * @see https://wordpress.org/plugins/surecart/ * * @package AI Builder * @since 3.3.0 */ namespace AiBuilder\Inc\Compatibility\SureCart; if ( ! class_exists( 'Ai_Builder_Compatibility_SureCart' ) ) { /** * SureCart Compatibility * * @since 3.3.0 */ class Ai_Builder_Compatibility_SureCart { /** * Instance * * @access private * @var object Class object. * @since 3.3.0 */ private static $instance = null; /** * Constructor * * @since 3.3.0 */ public function __construct() { add_action( 'init', array( $this, 'disable_default_surecart_pages_creation' ), 2 ); add_action( 'astra_sites_import_complete', array( $this, 'get_all_pages' ), 10 ); add_action( 'astra_sites_after_plugin_activation', array( $this, 'activation' ), 10 ); } /** * Initiator * * @since 3.3.0 * @return object initialized object of class. */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Set the source to 'starter-templates' on activation. * * @since 1.0.15 * @param string $plugin_init The path to the plugin file that was just activated. * @return void */ public function activation( $plugin_init ) { if ( 'surecart/surecart.php' === $plugin_init ) { update_option( 'surecart_source', 'starter_templates', false ); } } /** * Retrieve all pages * * @since 3.3.0 * @return void */ public function get_all_pages() { if ( ! is_plugin_active( 'surecart/surecart.php' ) ) { return; } // Retrieve all pages. $pages = get_pages(); if ( is_array( $pages ) ) { foreach ( $pages as $page ) { // Get the page ID. $page_id = (string) $page->ID; $page_content = $page->post_content; $this->check_page_types_and_update_options( $page_id, $page_content ); } } } /** * Check surecart page types and update options * * @param string $page_id The page ID. * @param string $page_content The page content. * @since 3.3.0 * @return void */ public function check_page_types_and_update_options( $page_id, $page_content ) { if ( strpos( $page_content, 'wp:surecart/checkout' ) !== false ) { update_option( 'surecart_checkout_page_id', $page_id ); // Extract the sc_form id using regular expressions. preg_match( '/checkout-form[^"]+\\{\\\\"id\\\\":(\d+)\\}/i', $page_content, $matches ); $number = isset( $matches[1] ) ? $matches[1] : ''; if ( ! empty( $number ) ) { update_option( 'surecart_checkout_sc_form_id', $number ); } } elseif ( strpos( $page_content, 'wp:surecart/dashboard' ) !== false ) { update_option( 'surecart_dashboard_page_id', $page_id ); } elseif ( strpos( $page_content, 'wp:surecart/product' ) !== false ) { update_option( 'surecart_shop_page_id', $page_id ); } } /** * Restrict SureCart Pages Creation process * * Why? SureCart creates set of pages on it's activation * These pages are re created via our XML import step. * In order to avoid the duplicacy we restrict these page creation process. * * @since 3.3.0 * @return void */ public function disable_default_surecart_pages_creation() { if ( astra_sites_has_import_started() ) { add_filter( 'surecart/seed/all', '__return_false' ); } } } /** * Kicking this off by calling 'instance()' method */ Ai_Builder_Compatibility_SureCart::instance(); } uae/ai-builder-compatibility-uae.php 0000644 00000002617 15077513500 0013474 0 ustar 00 <?php /** * AI Builder Compatibility for 'UAE' * * @package AI Builder * @since 1.2.37 */ namespace AiBuilder\Inc\Compatibility\UAE; defined( 'ABSPATH' ) || exit; if ( ! class_exists( 'Ai_Builder_Compatibility_UAE' ) ) { /** * UAE Compatibility * * @since 1.2.37 */ class Ai_Builder_Compatibility_UAE { /** * Instance * * @access private * @var object Class object. * @since 1.2.37 */ private static $instance = null; /** * Constructor * * @since 1.2.37 */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'activation' ), 10, 1 ); } /** * Initiator * * @since 1.2.37 * @return object initialized object of class. */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Disable redirection for UAE plugin when activated via Starter templates import process. * * @since 1.2.37 * @param string $plugin_init The plugin init. * @return void */ public function activation( $plugin_init ) { if ( 'ultimate-elementor/ultimate-elementor.php' === $plugin_init && astra_sites_has_import_started() ) { delete_option( 'uaepro_start_onboarding' ); } } } /** * Kicking this off by calling 'instance()' method */ Ai_Builder_Compatibility_UAE::instance(); } elementor/ai-builder-compatibility-elementor.php 0000644 00000012321 15077513500 0016125 0 ustar 00 <?php /** * AI Builder Compatibility for 'Elementor' * * @package AI Builder * @since 1.2.47 */ namespace AI_Builder\Inc\Compatibility\Elementor; defined( 'ABSPATH' ) || exit; if ( ! class_exists( '\Elementor\Plugin' ) ) { return; } if ( ! class_exists( 'AI_Builder_Compatibility_Elementor' ) ) { /** * Elementor Compatibility * * @since 1.2.47 */ class AI_Builder_Compatibility_Elementor { /** * Instance * * @access private * @var object Class object. * @since 1.2.47 */ private static $instance; /** * Constructor * * @since 1.2.47 * @return void */ public function __construct() { /** * Add Slashes * * @todo Elementor already have below code which works on defining the constant `WP_LOAD_IMPORTERS`. * After defining the constant `WP_LOAD_IMPORTERS` in WP CLI it was not works. * Try to remove below duplicate code in future. */ if ( ! wp_doing_ajax() || ( defined( 'ELEMENTOR_VERSION' ) && version_compare( ELEMENTOR_VERSION, '3.0.0', '>=' ) ) ) { remove_filter( 'wp_import_post_meta', array( 'Elementor\Compatibility', 'on_wp_import_post_meta' ) ); remove_filter( 'wxr_importer.pre_process.post_meta', array( 'Elementor\Compatibility', 'on_wxr_importer_pre_process_post_meta' ) ); add_filter( 'wp_import_post_meta', array( $this, 'on_wp_import_post_meta' ) ); add_filter( 'wxr_importer.pre_process.post_meta', array( $this, 'on_wxr_importer_pre_process_post_meta' ) ); } add_action( 'astra_sites_before_delete_imported_posts', array( $this, 'force_delete_kit' ), 10, 2 ); add_action( 'astra_sites_before_sse_import', array( $this, 'disable_attachment_metadata' ) ); add_action( 'init', array( $this, 'init' ) ); add_action( 'astra_sites_after_plugin_activation', array( $this, 'disable_elementor_redirect' ) ); } /** * Initiator * * @since 1.2.47 * @return object initialized object of class. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Disable Elementor redirect. * * @since 1.2.47 * @return void. */ public function disable_elementor_redirect() { $elementor_redirect = get_transient( 'elementor_activation_redirect' ); if ( ! empty( $elementor_redirect ) && '' !== $elementor_redirect ) { delete_transient( 'elementor_activation_redirect' ); } } /** * Remove the transient update check for plugins callback from Elementor. * This reduces the extra code execution for Elementor. * * @since 1.2.47 * @return void */ public function init() { // @phpstan-ignore-next-line if ( astra_sites_has_import_started() && null !== \Elementor\Plugin::$instance->admin ) { remove_filter( 'pre_set_site_transient_update_plugins', array( \Elementor\Plugin::$instance->admin->get_component( 'canary-deployment' ), 'check_version' ) ); // @phpstan-ignore-line } } /** * Disable the attachment metadata * * @since 1.2.47 * @return void */ public function disable_attachment_metadata() { remove_filter( 'wp_update_attachment_metadata', array( \Elementor\Plugin::$instance->uploads_manager->get_file_type_handlers( 'svg' ), // @phpstan-ignore-line 'set_svg_meta_data', ), 10 ); } /** * Force Delete Elementor Kit * * Delete the previously imported Elementor kit. * * @param int $post_id Post name. * @param string $post_type Post type. * * @since 1.2.47 * @return void */ public function force_delete_kit( $post_id = 0, $post_type = '' ) { if ( ! $post_id ) { return; } if ( 'elementor_library' === $post_type ) { $_GET['force_delete_kit'] = true; } } /** * Process post meta before WP importer. * * Normalize Elementor post meta on import, We need the `wp_slash` in order * to avoid the unslashing during the `add_post_meta`. * * Fired by `wp_import_post_meta` filter. * * @param array<int, array{key: string, value: mixed}> $post_meta Post meta. * * @since 1.2.47 * @access public * * @return array<int, array{key: string, value: mixed}> Updated post meta. */ public function on_wp_import_post_meta( $post_meta ) { foreach ( $post_meta as &$meta ) { if ( '_elementor_data' === $meta['key'] ) { $meta['value'] = wp_slash( $meta['value'] ); break; } } return $post_meta; } /** * Process post meta before WXR importer. * * Normalize Elementor post meta on import with the new WP_importer, We need * the `wp_slash` in order to avoid the unslashing during the `add_post_meta`. * * Fired by `wxr_importer.pre_process.post_meta` filter. * * @since 1.2.47 * @access public * * @param array{key: string, value: mixed} $post_meta Post meta. * * @return array{key: string, value: mixed} Updated post meta. */ public function on_wxr_importer_pre_process_post_meta( $post_meta ) { if ( '_elementor_data' === $post_meta['key'] ) { $post_meta['value'] = wp_slash( $post_meta['value'] ); } return $post_meta; } } /** * Kicking this off by calling 'get_instance()' method */ AI_Builder_Compatibility_Elementor::get_instance(); } woocommerce-payments/ai-builder-compatibility-woocommerce-payments.php 0000644 00000034134 15077513500 0022501 0 ustar 00 <?php /** * AI Builder Compatibility for 'WooCommerce Payments' * * @see https://wordpress.org/plugins/woocommerce-payments/ * * @package AI Builder * @since 1.2.37 */ if ( ! class_exists( 'Ai_Builder_Compatibility_WooCommerce_Payments' ) ) { /** * WooCommerce Payments Compatibility * * @since 1.2.37 */ class Ai_Builder_Compatibility_WooCommerce_Payments { /** * Instance * * @access private * @var self Class object. * @since 1.2.37 */ private static $instance; /** * Constructor * * @since 1.2.37 */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'woo_payments_activate' ), 10, 2 ); // Bail early if the WooCommerce Payments plugin is not active. if ( ! is_plugin_active( 'woocommerce-payments/woocommerce-payments.php' ) ) { return; } add_action( 'admin_notices', array( $this, 'woo_payments_admin_notice' ), 9 ); add_action( 'wp_ajax_dismiss_woopayments_notice', array( $this, 'dismiss_woopayments_notice' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); add_action( 'admin_init', array( $this, 'maybe_append_woopayments_ref' ) ); add_filter( 'cpsw_notices_add_args', array( $this, 'hide_cpsw_stripe_connect_notice' ), 10, 1 ); } /** * Initiator * * @since 1.2.37 * @return self Initialized object of the class. */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Retrieves the WooCommerce Payments reference ID. * * @since 1.2.37 * @return string The WooCommerce Payments reference ID. */ public static function get_woopayments_ref_id() { return 'bsf-2025'; } /** * Check if WooPayments is configured and connected to Stripe. * * @since 1.2.38 * @return bool True if WooPayments is active and connected to Stripe, false otherwise. */ public static function is_woo_payments_configured() { // Check if WCPay account is connected to Stripe. // @phpstan-ignore-next-line - Dynamic class check. if ( class_exists( 'WC_Payments' ) && method_exists( 'WC_Payments', 'get_account_service' ) ) { $account_service = WC_Payments::get_account_service(); if ( is_object( $account_service ) && method_exists( $account_service, 'is_stripe_connected' ) ) { return $account_service->is_stripe_connected(); } } return false; } /** * Returns an array of allowed screen IDs for displaying notices or performing trigger actions. * * @since 1.2.38 * @return array<string> An array of allowed screen IDs. */ public static function allowed_screen_ids() { return array( 'dashboard', // WordPress Dashboard. 'plugins', // Plugins Page. 'plugins-network', // Network Plugins Page. 'edit-product', // Products Page. 'edit-shop_coupon', // Coupons Page. 'woocommerce_page_wc-orders', // WooCommerce - Orders Page. 'woocommerce_page_wc-reports', // WooCommerce - Reports Page. 'woocommerce_page_wc-status', // WooCommerce - Status Page. 'woocommerce_page_wc-settings', // WooCommerce - Settings Page. 'woocommerce_page_woo-cart-abandonment-recovery', // Cart Abandonment Recovery Page. ); } /** * Enqueue scripts and localize data. * * @since 1.2.37 * @return void */ public function enqueue_scripts() { $can_show_notice = $this->can_show_payment_notice(); // Check if we're on WooPayments connect page. // phpcs:disable WordPress.Security.NonceVerification.Recommended -- Read-only GET used safely here. $is_woo_payments_page = isset( $_GET['page'], $_GET['path'] ) && 'wc-admin' === sanitize_text_field( $_GET['page'] ) && '/payments/connect' === sanitize_text_field( rawurldecode( $_GET['path'] ) ); if ( ! $can_show_notice && ! $is_woo_payments_page ) { return; } wp_register_script( 'ai-builder-woopayments', AI_BUILDER_URL . 'inc/assets/js/woopayments.js', array( 'jquery' ), AI_BUILDER_VER, true ); wp_localize_script( 'ai-builder-woopayments', 'aiBuilderWooPayments', array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'ajaxNonce' => wp_create_nonce( 'woopayments_nonce' ), 'dismissingText' => __( 'To complete your store setup and start selling, you must connect WooPayments now. Without it, your customers won\'t be able to pay.', 'astra-sites' ), 'dismissedCount' => class_exists( 'Astra_Sites_Page' ) ? Astra_Sites_Page::get_instance()->get_setting( 'woopayments_banner_dismissed_count', 0 ) : 0, ) ); wp_enqueue_script( 'ai-builder-woopayments' ); } /** * Hide CPSW Stripe Connect Notice. * * @since 1.2.37 * @param array<string, mixed> $args Notice arguments. * @return array<string, mixed>|null Modified notice arguments or null to hide. */ public function hide_cpsw_stripe_connect_notice( array $args ) { if ( 'connect_stripe_notice' === $args['id'] && $this->can_show_payment_notice( false ) ) { return null; // Hide the notice. } return $args; } /** * Dismiss WooCommerce Payments notice. * * @since 1.2.37 * @return void */ public function dismiss_woopayments_notice() { // Verify nonce. if ( ! isset( $_POST['_security'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_security'] ) ), 'woopayments_nonce' ) ) { wp_send_json_error( 'Invalid nonce' ); } // Get notice ID. $notice_id = isset( $_POST['notice_id'] ) ? sanitize_text_field( wp_unslash( $_POST['notice_id'] ) ) : ''; if ( empty( $notice_id ) ) { wp_send_json_error( 'Notice ID is required' ); } $show_after = 72 * 60 * 60; // 72 hours in seconds. // Set a transient that expires in 72 hours (259200 seconds) - to dismiss the notice. set_transient( 'astra_sites_woopayments_notice_dismissed', true, $show_after ); if ( class_exists( 'Astra_Sites_Page' ) ) { // Update the setting to track dismissed count. $dismissed_count = Astra_Sites_Page::get_instance()->get_setting( 'woopayments_banner_dismissed_count', 0 ); Astra_Sites_Page::get_instance()->update_settings( array( 'woopayments_banner_dismissed_count' => $dismissed_count + 1, ) ); } wp_send_json_success( 'Notice dismissed successfully' ); } /** * Determines if the payment notice should be shown. * * This method checks various conditions to decide if the payment notice should be displayed. * It verifies the user's capability, WooPayments configuration, notice dismissal status, Astra Sites import completion, * and the current screen to determine if the notice should be shown. * * @since 1.2.37 * @param bool $enable_screen_check Flag to enable or disable the screen check. * * @return bool Returns true if the notice should be shown, false otherwise. */ public function can_show_payment_notice( $enable_screen_check = true ) { // If the user does not have the required capability, return false. if ( ! current_user_can( 'manage_options' ) ) { return false; } // Check if the banner was dismissed and the transient is still valid. if ( get_transient( 'astra_sites_woopayments_notice_dismissed' ) ) { return false; } // If the Astra Sites import is not complete, return false. if ( 'yes' !== get_option( 'astra_sites_import_complete', 'no' ) ) { return false; } // If WooPayments is already configured, no need to show the notice. if ( self::is_woo_payments_configured() ) { return false; } // Skip screen check if disabled. if ( ! $enable_screen_check ) { return true; } // Screen check. $screen = get_current_screen(); return $screen && in_array( $screen->id, self::allowed_screen_ids(), true ); } /** * Get Stripe Connect URL. * * @since 1.2.37 * @return string */ public function get_stripe_connect_url() { return admin_url( add_query_arg( array( 'page' => 'wc-admin', 'path' => '/payments/connect', 'woopayments-ref' => self::get_woopayments_ref_id(), ), 'admin.php' ) ); } /** * Disable redirect after installing and activating WooCommerce Payments. * * @param string $plugin_init Plugin init file used for activation. * @param array<string, mixed> $data Data. * * @since 1.2.37 * @return void */ public function woo_payments_activate( $plugin_init, $data = array() ) { if ( 'woocommerce-payments/woocommerce-payments.php' === $plugin_init ) { // Prevent showing the banner if plugin was already active. if ( isset( $data['was_plugin_active'] ) && $data['was_plugin_active'] ) { return; } delete_option( 'wcpay_should_redirect_to_onboarding' ); } } /** * This method is responsible for displaying an admin notice to the user, prompting them to connect their WooCommerce Payments account. * It checks if the conditions are met to show the notice, and if so, it outputs the notice content. * * @since 1.2.37 * @return void */ public function woo_payments_admin_notice() { // Bail early if the notice can not be shown. if ( ! $this->can_show_payment_notice() ) { return; } // Connect SVG image path. $image_path = esc_url( AI_BUILDER_URL . 'inc/assets/images/payments-connect.png' ); $output = sprintf( ' <div class="woop-notice-content"> <div class="woop-notice-heading"> %2$s </div> <div class="woop-notice-description"> %3$s </div> <div class="woop-notice-action-container"> <a href="%4$s" class="woop-notice-btn" data-source="banner"> %5$s </a> </div> </div> <div class="woop-notice-image" style="display: flex;"> <img src="%1$s" class="notice-image" alt="Connect to Stripe" itemprop="logo"> </div> ', $image_path, esc_html__( 'You’re One Step Away from Accepting Payments with WooPayments — Fast, Easy & Free!', 'astra-sites' ), sprintf( /* translators: %s: WooPayments for WooCommerce text with strong tag */ __( 'Your store is ready to sell! Connect %s now to securely accept credit cards, Apple Pay, and more — with zero setup fees and instant integration.', 'astra-sites' ), '<strong>' . __( 'WooPayments', 'astra-sites' ) . '</strong>' ), esc_url( $this->get_stripe_connect_url() ), esc_html__( 'Start Accepting Payments', 'astra-sites' ) ); ?> <style> #connect_woop_notice.notice-info.mega-notice.woop-dismissible-notice { position: relative; display: flex; border: 1px solid #e6daf9; gap: 10%; align-items: center; padding: 34px !important; background: linear-gradient(90deg, #fff 23.33%, #F2EAFF80 47.42%); box-shadow: 0 2px 8px -2px #00000014; } #connect_woop_notice .woop-notice-content { font-size: 16px; font-weight: 400; line-height: 26px; text-align: left; margin-left: 0; display: flex; flex-direction: column; gap: 15px; width: 65%; } #connect_woop_notice .woop-notice-heading { font-size: 20px; font-weight: 600; line-height: 32px; text-align: left; margin: 0; } #connect_woop_notice .woop-notice-action-container { display: flex; align-items: center; column-gap: 20px; margin-top: 10px; } #connect_woop_notice .woop-notice-action-container a { background: #873EFF; box-shadow: 0 1px 2px 0 #0000000d; color: #fff !important; border-color: #873EFF; padding: 14px 16px 14px 16px; border-radius: 6px; font-size: 16px; font-weight: 500; line-height: 16px; text-align: center; text-decoration: none; transition: 0.2s ease; } #connect_woop_notice .woop-notice-action-container a:hover { background-color: #5f2db1; } #connect_woop_notice .woop-notice-image{ width: 35%; display: flex; justify-content: center; align-items: center; } #connect_woop_notice .woop-notice-image img { width: 56%; } </style> <div id="connect_woop_notice" class="notice-info mega-notice woop-dismissible-notice woop-notice woop-custom-notice notice"> <button type="button" class="notice-dismiss"></button> <?php echo wp_kses_post( $output ); ?> </div> <?php } /** * This method checks if the WooCommerce Payments reference option is not set and if the current page is the WooCommerce Payments connect page. * If both conditions are true, it appends the WooCommerce Payments reference ID to the URL query string. * This is done to ensure that the reference ID is included in the connection process for WooCommerce Payments. * * @since 1.2.37 * @return void */ public function maybe_append_woopayments_ref() { // Bail early if the WooCommerce Payments plugin was not activated through the Starter Templates import process and was already activated on the site. if ( ! class_exists( 'Astra_Sites_Page' ) || ! Astra_Sites_Page::get_instance()->get_setting( 'woopayments_ref' ) ) { return; } // phpcs:disable WordPress.Security.NonceVerification.Recommended -- Read-only GET used safely here. if ( is_admin() && isset( $_GET['page'], $_GET['path'] ) && 'wc-admin' === sanitize_text_field( $_GET['page'] ) && '/payments/connect' === sanitize_text_field( rawurldecode( $_GET['path'] ) ) && ! isset( $_GET['woopayments-ref'] ) ) { // phpcs:enable WordPress.Security.NonceVerification.Recommended -- Read-only GET used safely here. $ref_value = self::get_woopayments_ref_id(); // Preserve all existing query vars. // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Query string is being modified safely. $query_args = $_GET; $query_args['woopayments-ref'] = $ref_value; // Build the URL with updated args. $new_url = admin_url( 'admin.php' ) . '?' . http_build_query( $query_args ); // Perform safe redirect and exit. wp_safe_redirect( esc_url_raw( $new_url ) ); exit; } } } /** * Kicking this off by calling 'instance()' method */ Ai_Builder_Compatibility_WooCommerce_Payments::instance(); } suremail/ai-builder-compatibility-suremail.php 0000644 00000002524 15077513500 0015607 0 ustar 00 <?php /** * AI Builder Compatibility for 'SureMail' * * @see https://wordpress.org/plugins/sureMail/ * * @package AI Builder * @since 1.2.26 */ namespace AiBuilder\Inc\Compatibility\SureCart; if ( ! class_exists( 'Ai_Builder_Compatibility_SureMail' ) ) { /** * SureMail Compatibility * * @since 1.2.26 */ class Ai_Builder_Compatibility_SureMail { /** * Instance * * @access private * @var object Class object. * @since 1.2.26 */ private static $instance = null; /** * Constructor * * @since 1.2.26 */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'activation' ), 10 ); } /** * Initiator * * @since 1.2.26 * @return object initialized object of class. */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Stop the plugin activation redirection. * * @since 1.2.26 * @param string $plugin_init Plugin init file. * @return void */ public function activation( $plugin_init ) { if ( 'suremails/suremails.php' === $plugin_init ) { update_option( 'suremails_do_redirect', false ); } } } /** * Kicking this off by calling 'instance()' method */ Ai_Builder_Compatibility_SureMail::instance(); } uae-lite/ai-builder-compatibility-uae-lite.php 0000644 00000002671 15077513500 0015362 0 ustar 00 <?php /** * AI Builder Compatibility for 'UAE Lite' * * @package AI Builder * @since 1.2.37 */ namespace AiBuilder\Inc\Compatibility\UAE_Lite; defined( 'ABSPATH' ) || exit; if ( ! class_exists( 'Ai_Builder_Compatibility_UAE_Lite' ) ) { /** * UAE Lite Compatibility * * @since 1.2.37 */ class Ai_Builder_Compatibility_UAE_Lite { /** * Instance * * @access private * @var object Class object. * @since 1.2.37 */ private static $instance = null; /** * Constructor * * @since 1.2.37 */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'activation' ), 10, 1 ); } /** * Initiator * * @since 1.2.37 * @return object initialized object of class. */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Disable redirection for UAE Lite plugin when activated via Starter templates import process. * * @since 1.2.37 * @param string $plugin_init The plugin init. * @return void */ public function activation( $plugin_init ) { if ( 'header-footer-elementor/header-footer-elementor.php' === $plugin_init && astra_sites_has_import_started() ) { delete_option( 'hfe_start_onboarding' ); } } } /** * Kicking this off by calling 'instance()' method */ Ai_Builder_Compatibility_UAE_Lite::instance(); } surerank/ai-builder-compatibility-surerank.php 0000644 00000002502 15077513500 0015625 0 ustar 00 <?php /** * AI Builder Compatibility for 'SureRank'. * * @package AI Builder * @since 1.2.44 */ if ( ! class_exists( 'Ai_Builder_Compatibility_SureRank' ) ) { /** * SureRank Compatibility. * * @since 1.2.44 */ class Ai_Builder_Compatibility_SureRank { /** * Instance * * @access private * @var object Class object. * @since 1.2.44 */ private static $instance; /** * Constructor * * @since 1.2.44 */ public function __construct() { add_action( 'astra_sites_after_plugin_activation', array( $this, 'disable_surerank_redirection' ) ); } /** * Initiator * * @since 1.2.44 * @return object initialized object of class. */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Disables SureRank redirection during plugin activation. * * @param string $plugin_init The path to the plugin file that was just activated. * * @since 1.2.44 * @return void */ public function disable_surerank_redirection( $plugin_init ) { if ( 'surerank/surerank.php' === $plugin_init ) { delete_option( 'surerank_redirect_on_activation' ); } } } /** * Kicking this off by calling 'instance()' method */ Ai_Builder_Compatibility_SureRank::instance(); } class-astra-site-origin.php 0000644 00000002244 15105401653 0011723 0 ustar 00 <?php /** * Site Origin Compatibility File. * * @package Astra */ // If plugin - 'Site Origin' not exist then return. if ( ! class_exists( 'SiteOrigin_Panels_Settings' ) ) { return; } /** * Astra Site Origin Compatibility */ if ( ! class_exists( 'Astra_Site_Origin' ) ) { /** * Astra Site Origin Compatibility * * @since 1.0.0 */ class Astra_Site_Origin { /** * Member Variable * * @var object instance */ private static $instance; /** * Initiator */ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * Constructor */ public function __construct() { add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) ); } /** * Add assets in theme * * @param array $assets list of theme assets (JS & CSS). * @return array List of updated assets. * @since 1.0.0 */ public function add_styles( $assets ) { $assets['css']['astra-site-origin'] = 'compatibility/site-origin'; return $assets; } } } /** * Kicking this off by calling 'get_instance()' method */ Astra_Site_Origin::get_instance(); edd/class-astra-edd.php 0000644 00000112620 15105401653 0010762 0 ustar 00 <?php /** * Easy Digital Downloads Compatibility File. * * @link https://easydigitaldownloads.com/ * * @package Astra */ // If plugin - 'Easy_Digital_Downloads' not exist then return. if ( ! class_exists( 'Easy_Digital_Downloads' ) ) { return; } /** * Astra Easy Digital Downloads Compatibility */ if ( ! class_exists( 'Astra_Edd' ) ) { /** * Astra Easy Digital Downloads Compatibility * * @since 1.5.5 */ class Astra_Edd { /** * Member Variable * * @var object instance */
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings