define_plugin_properties(); $this->core(); $this->load_rules(); $this->load_compatibilities(); } public function load_compatibilities() { require BWFAN_PRO_PLUGIN_DIR . '/compatibilities/class-bwfan-pro-compatibilities.php'; } public function add_wc_affiliate_merge( $event_merge_group ) { if ( ! bwfan_is_affiliatewp_active() ) { return $event_merge_group; } if ( empty( $event_merge_group ) ) { $event_merge_group = array( 'wc_aff_affiliate' ); return $event_merge_group; } array_push( $event_merge_group, 'wc_aff_affiliate' ); return $event_merge_group; } public function define_plugin_properties() { define( 'BWFAN_PRO_FULL_NAME', 'FunnelKit Automations Pro' ); define( 'BWFAN_PRO_PLUGIN_FILE', __FILE__ ); define( 'BWFAN_PRO_PLUGIN_URL', untrailingslashit( plugin_dir_url( BWFAN_PRO_PLUGIN_FILE ) ) ); define( 'BWFAN_PRO_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); define( 'BWFAN_PRO_IS_DEV', true ); define( 'BWFAN_PRO_DB_VERSION', '1.0' ); define( 'BWFAN_PRO_ENCODE', sha1( BWFAN_PRO_PLUGIN_BASENAME ) ); } /* * load plugin dependency */ public function load_pro_dependencies_support() { if ( ! did_action( 'bwfan_loaded' ) ) { add_action( 'admin_notices', array( $this, 'show_activate_autonami_notice' ) ); return; } require BWFAN_PRO_PLUGIN_DIR . '/includes/bwfan-pro-functions.php'; require BWFAN_PRO_PLUGIN_DIR . '/includes/class-bwfan-pro-plugin-dependency.php'; } public function show_activate_autonami_notice() { $screen = get_current_screen(); if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) { return; } $plugin = 'wp-marketing-automations/wp-marketing-automations.php'; if ( $this->autonami_install_check() ) { if ( ! current_user_can( 'activate_plugins' ) ) { return; } $activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin ); ?>

' . __( 'The FunnelKit Automations Pro plugin requires FunnelKit Automations plugin to be activated.', 'wp-marketing-automations-pro' ) . '

'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '

' . sprintf( '%s', $activation_url, __( 'Activate FunnelKit Automations Now', 'wp-marketing-automations-pro' ) ) . '

'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

' . __( 'The FunnelKit Automations Pro plugin requires FunnelKit Automations plugin to be installed.', 'wp-marketing-automations-pro' ) . '

'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '

' . sprintf( '%s', $install_url, __( 'Install FunnelKit Automations Now', 'wp-marketing-automations-pro' ) ) . '

'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

load_learndash(); } if ( function_exists( 'bwfan_is_wlm_active' ) && bwfan_is_wlm_active() ) { $this->load_wlm(); } // loading common file for divi forms if ( function_exists( 'bwfan_is_divi_forms_active' ) && bwfan_is_divi_forms_active() ) { $this->load_divi_forms(); } if ( is_admin() ) { include BWFAN_PRO_PLUGIN_DIR . '/admin/class-bwfan-pro-admin.php'; } } public function load_stripe_offer_files() { if ( ! did_action( 'bwfan_loaded' ) ) { return; } if ( bwfan_is_woocommerce_active() && bwfan_is_funnel_builder_pro_active() && bwfan_is_fk_stripe_active() ) { require_once( BWFAN_PRO_PLUGIN_DIR . '/modules/stripe-offer/includes/class-bwfan-generate-upsell-offer-link.php' ); require_once( BWFAN_PRO_PLUGIN_DIR . '/modules/stripe-offer/includes/class-bwfan-generate-offer-link-handler.php' ); } } private function load_learndash() { require BWFAN_PRO_PLUGIN_DIR . '/includes/class-bwfan-learndash-common.php'; BWFAN_Learndash_Common::init(); } private function load_wlm() { require BWFAN_PRO_PLUGIN_DIR . '/includes/class-bwfan-wlm-common.php'; BWFAN_Wlm_Common::init(); } /** * including common file for divi forms * @return void */ private function load_divi_forms() { require BWFAN_PRO_PLUGIN_DIR . '/includes/class-bwfan-divi-forms-common.php'; } /** * Include all modules */ public function add_modules() { $integration_dir = BWFAN_PRO_PLUGIN_DIR . '/modules'; foreach ( glob( $integration_dir . '/*/class-*.php' ) as $_field_filename ) { if ( strpos( $_field_filename, 'index.php' ) !== false ) { continue; } require_once( $_field_filename ); } } public function load_custom_search_classes() { $resource_dir = BWFAN_PRO_PLUGIN_DIR . '/modules'; foreach ( glob( $resource_dir . '/*' ) as $module ) { if ( strpos( $module, 'index.php' ) !== false ) { continue; } foreach ( glob( $module . '/includes/search/class-*.php' ) as $_field_filename ) { require_once( $_field_filename ); } } do_action( 'bwfan_pro_custom_search_classes_loaded', $this ); } /** * Include Merge Tags files */ public function load_merge_tags() { /** Merge tags in root folder */ $dir = BWFAN_PRO_PLUGIN_DIR . '/merge_tags'; foreach ( glob( $dir . '/class-*.php' ) as $_field_filename ) { require_once( $_field_filename ); } /** Merge tags inside modules */ $dir = BWFAN_PRO_PLUGIN_DIR . '/modules'; foreach ( glob( $dir . '/*/merge-tags/class-*.php' ) as $_field_filename ) { require_once( $_field_filename ); } } public function load_connector_classes() { $resource_dir = BWFAN_PRO_PLUGIN_DIR . '/connectors'; foreach ( glob( $resource_dir . '/*/*' ) as $_field_filename ) { if ( strpos( $_field_filename, 'index.php' ) !== false ) { continue; } require_once( $_field_filename ); } do_action( 'bwfan_upsell_stripe_connector_loaded', $this ); } private function load_rules() { include_once BWFAN_PRO_PLUGIN_DIR . '/rules/class-bwfan-rules.php'; } public function localization() { load_plugin_textdomain( 'wp-marketing-automations-pro', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); } /** * to avoid unserialize of the current class */ public function __wakeup() { throw new ErrorException( esc_html__( 'BWFAN_Core Pro can`t converted to string', 'wp-marketing-automations-pro' ) ); } /** * to avoid serialize of the current class */ public function __sleep() { throw new ErrorException( esc_html__( 'BWFAN_Core Pro can`t converted to string', 'wp-marketing-automations-pro' ) ); } /** * To avoid cloning of current class */ protected function __clone() { } } BWFAN_Pro::get_instance();