| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | /** |
| 4 | 3 | * The plugin bootstrap file |
| 5 | 4 | * |
| 6 | 5 | * This file is read by WordPress to generate the plugin information in the plugin |
| @@ -14,10 +13,10 @@ | ||
| 14 | 13 | * |
| 15 | 14 | * @wordpress-plugin |
| 16 | 15 | * Plugin Name: WPFunnels |
| 17 | 16 | * Plugin URI: https://getwpfunnels.com |
| 18 | - * Description: The Easiest Drag & Drop 🚀 Sales Funnel Builder 🚀 for WordPress to collect leads and increase sales. | |
| 19 | - * Version: 2.8.16 | |
| 17 | + * Description: Easiest 💥 Sales Funnel Builder 💥 For WordPress & WooCommerce by WPFunnels - Generate Leads & Craft A Highly-Converting Sales Journey In Minutes | |
| 18 | + * Version: 3.13.3 | |
| 20 | 19 | * Author: WPFunnels Team |
| 21 | 20 | * Author URI: https://getwpfunnels.com |
| 22 | 21 | * License: GPL-2.0+ |
| 23 | 22 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| @@ -24,14 +23,15 @@ | ||
| 24 | 23 | * Text Domain: wpfnl |
| 25 | 24 | * Domain Path: /languages |
| 26 | 25 | */ |
| 27 | 26 | |
| 27 | +use WPFunnels\Tracking\Telemetry; | |
| 28 | 28 | use wPFunnels\Wpfnl; |
| 29 | -// use WPFunnels\Wpfnl_functions; | |
| 30 | - | |
| 31 | -// If this file is called directly, abort. | |
| 32 | -if (! defined('WPINC')) { | |
| 33 | - die; | |
| 29 | +/** | |
| 30 | + * If this file is called directly, abort. | |
| 31 | + */ | |
| 32 | +if (!defined('WPINC')) { | |
| 33 | + die; | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Currently plugin version. |
| @@ -38,67 +38,100 @@ | ||
| 38 | 38 | * Start at version 1.0.0 and use SemVer - https://semver.org |
| 39 | 39 | * Rename this for your plugin and update it as you release new versions. |
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | -if ( ! defined( 'WPFNL_VERSION' ) ) { | |
| 43 | - define('WPFNL_VERSION', '2.8.16'); | |
| 42 | +if (!defined('WPFNL_VERSION')) { | |
| 43 | + define('WPFNL_VERSION', '3.13.3'); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | -if ( ! defined( 'WPFNL_FILE' ) ) { | |
| 46 | +if (!defined('WPFNL_FILE')) { | |
| 47 | 47 | define('WPFNL_FILE', __FILE__); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | -if ( ! defined( 'WPFNL_PATH' ) ) { | |
| 50 | +if (!defined('WPFNL_PATH')) { | |
| 51 | 51 | define('WPFNL_PATH', dirname(WPFNL_FILE)); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -if ( ! defined( 'WPFNL_BASE' ) ) { | |
| 54 | +if (!defined('WPFNL_BASE')) { | |
| 55 | 55 | define('WPFNL_BASE', plugin_basename(WPFNL_FILE)); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | -if ( ! defined( 'WPFNL_DIR' ) ) { | |
| 58 | +if (!defined('WPFNL_DIR')) { | |
| 59 | 59 | define('WPFNL_DIR', plugin_dir_path(WPFNL_FILE)); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | -if ( ! defined( 'WPFNL_URL' ) ) { | |
| 62 | +if (!defined('WPFNL_URL')) { | |
| 63 | 63 | define('WPFNL_URL', plugins_url('/', WPFNL_FILE)); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | -if ( ! defined( 'WPFNL_DIR_URL' ) ) { | |
| 66 | +if (!defined('WPFNL_DIR_URL')) { | |
| 67 | 67 | define('WPFNL_DIR_URL', plugin_dir_url(WPFNL_FILE)); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | -if ( ! defined( 'GETWPFUNNEL_HOME_URL' ) ) { | |
| 70 | +if (!defined('GETWPFUNNEL_HOME_URL')) { | |
| 71 | 71 | define('GETWPFUNNEL_HOME_URL', 'https://getwpfunnels.com/'); |
| 72 | 72 | } |
| 73 | +if (!defined('GETWPFUNNEL_PRICING_URL')) { | |
| 74 | + define('GETWPFUNNEL_PRICING_URL', 'https://getwpfunnels.com/pricing/'); | |
| 75 | +} | |
| 73 | 76 | |
| 77 | +define('WPFNL_ADMIN_DIR', WPFNL_DIR . 'admin/'); | |
| 74 | 78 | |
| 79 | + | |
| 75 | 80 | define('WPFNL_TEMPLATE_URL', ''); |
| 76 | -define('WPFNL_MAIN_PAGE_SLUG', 'wp_funnels'); | |
| 81 | +define('WPFNL_MAIN_PAGE_SLUG', 'wpfunnels'); | |
| 82 | +define('WPFNL_FUNNEL_PAGE_SLUG', 'wp_funnels'); | |
| 83 | +define('WPFNL_TEMPLATE_PAGE_SLUG', 'wpf_templates'); | |
| 77 | 84 | define('WPFNL_SETTINGS_SLUG', 'wp_funnel_settings'); |
| 78 | 85 | define('WPFNL_EDIT_FUNNEL_SLUG', 'edit_funnel'); |
| 86 | +define('WPFNL_TRASH_FUNNEL_SLUG', 'trash_funnels'); | |
| 79 | 87 | define('WPFNL_FUNNELS_POST_TYPE', 'wpfunnels'); |
| 80 | 88 | define('WPFNL_STEPS_POST_TYPE', 'wpfunnel_steps'); |
| 81 | 89 | define('WPFNL_CREATE_FUNNEL_SLUG', 'create_funnel'); |
| 90 | +define('WPFNL_AI_FUNNEL_PAGE_SLUG', 'wpfnl-ai-funnel'); | |
| 82 | 91 | define('WPFNL_GLOBAL_SETTINGS_SLUG', 'wpfnl_settings'); |
| 92 | +define('WPFNL_AUTOMATIONS_SLUG', 'wpfnl_automations'); | |
| 93 | +define('WPFNL_ADDONS_SLUG', 'wpfnl_addons'); | |
| 94 | +define('WPFNL_STORE_CHECKOUT_SLUG', 'store_checkout'); | |
| 95 | +define('WPFNL_INTEGRATIONS_MAIN_PAGE_SLUG', 'wpfunnels_integrations'); | |
| 96 | +// React single-page admin. Runs alongside the existing screens while they are | |
| 97 | +// migrated one at a time; routes live in the hash (#/settings, …). | |
| 98 | +define('WPFNL_REACT_ADMIN_SLUG', 'wpfunnels-admin'); | |
| 83 | 99 | define('WPFNL_FUNNEL_PER_PAGE', 10); |
| 84 | 100 | define('WPFNL_TEMPLATES_OPTION_KEY', 'wpfunnels_remote_templates'); |
| 85 | 101 | define('WPFNL_TESTS', false); |
| 86 | 102 | define('WPFNL_DOCUMENTATION_LINK', 'https://getwpfunnels.com/docs/wpfunnels-wordpress-funnel-builder/'); |
| 87 | 103 | |
| 104 | + | |
| 105 | +// Template middleman api url. | |
| 106 | +define('WPFNL_MIDDLEMAN_TEMPLATE_URL', 'https://license.getwpfunnels.com/api/v1/templates'); | |
| 107 | + | |
| 108 | +// Single template middleman api url. | |
| 109 | +define('WPFNL_MIDDLEMAN_SINGLE_TEMPLATE_URL', 'https://license.getwpfunnels.com/api/v1/template'); | |
| 110 | + | |
| 111 | +// Step middleman api url. | |
| 112 | +define('WPFNL_MIDDLEMAN_STEP_URL', 'https://license.getwpfunnels.com/api/v1/step'); | |
| 113 | + | |
| 114 | +// Template type middleman api url. | |
| 115 | +define('WPFNL_MIDDLEMAN_TEMPLATE_TYPE_URL', 'https://license.getwpfunnels.com/api/v1/template/type/id'); | |
| 116 | + | |
| 117 | +// Template category middleman api url. | |
| 118 | +define('WPFNL_MIDDLEMAN_TEMPLATE_CATEGORY_URL', 'https://license.getwpfunnels.com/api/v1/template/category'); | |
| 119 | + | |
| 88 | 120 | define('WPFNL_ACTIVE_PLUGINS', apply_filters('active_plugins', get_option('active_plugins'))); |
| 89 | 121 | |
| 90 | 122 | |
| 91 | -define('WPFNL_TAXONOMY_TEMPLATES_BUILDER', 'template_builder' ); | |
| 92 | -define('WPFNL_TAXONOMY_TEMPLATES_PROPERTY', 'template_type' ); | |
| 93 | -define('WPFNL_TAXONOMY_TEMPLATES_INDUSTRIES', 'template_industries' ); | |
| 94 | -define('WPFNL_TAXONOMY_STEP_TYPE', 'type' ); | |
| 95 | -define('WPFNL_IS_REMOTE', false ); | |
| 96 | -define('WPFNL_PRO', '/wpfunnels-pro/wpfnl-pro.php' ); | |
| 97 | -define('WPFNL_PRO_REQUIRED_VERSION', '1.0.4' ); | |
| 123 | +define('WPFNL_TAXONOMY_TEMPLATES_BUILDER', 'template_builder'); | |
| 124 | +define('WPFNL_TAXONOMY_TEMPLATES_PROPERTY', 'template_type'); | |
| 125 | +define('WPFNL_TAXONOMY_TEMPLATES_INDUSTRIES', 'template_industries'); | |
| 126 | +define('WPFNL_TAXONOMY_STEP_TYPE', 'type'); | |
| 127 | +define('WPFNL_IS_REMOTE', false); | |
| 128 | +define('WPFNL_PRO', '/wpfunnels-pro/wpfnl-pro.php'); | |
| 129 | +define('WPFNL_PRO_REQUIRED_VERSION', '1.0.4'); | |
| 130 | +define('WPFNL_SLUG', 'wpfunnels'); | |
| 131 | +define('WPFNL_NAME', 'WPFunnels'); | |
| 98 | 132 | |
| 99 | 133 | |
| 100 | - | |
| 101 | 134 | /** |
| 102 | 135 | * The core plugin class that is used to define internationalization, |
| 103 | 136 | * admin-specific hooks, and public-facing site hooks. |
| 104 | 137 | */ |
| @@ -110,10 +143,10 @@ | ||
| 110 | 143 | * This action is documented in includes/class-wpfnl-activator.php |
| 111 | 144 | */ |
| 112 | 145 | function activate_wpfnl() |
| 113 | 146 | { |
| 114 | - require_once plugin_dir_path(__FILE__) . 'includes/utils/class-wpfnl-activator.php'; | |
| 115 | - Wpfnl_Activator::activate(); | |
| 147 | + require_once plugin_dir_path(__FILE__) . 'includes/utils/class-wpfnl-activator.php'; | |
| 148 | + Wpfnl_Activator::activate(); | |
| 116 | 149 | } |
| 117 | 150 | |
| 118 | 151 | /** |
| 119 | 152 | * The code that runs during plugin deactivation. |
| @@ -120,18 +153,36 @@ | ||
| 120 | 153 | * This action is documented in includes/class-wpfnl-deactivator.php |
| 121 | 154 | */ |
| 122 | 155 | function deactivate_wpfnl() |
| 123 | 156 | { |
| 124 | - require_once plugin_dir_path(__FILE__) . 'includes/utils/class-wpfnl-deactivator.php'; | |
| 125 | - Wpfnl_Deactivator::deactivate(); | |
| 157 | + require_once plugin_dir_path(__FILE__) . 'includes/utils/class-wpfnl-deactivator.php'; | |
| 158 | + Wpfnl_Deactivator::deactivate(); | |
| 126 | 159 | } |
| 127 | 160 | |
| 161 | +/* | |
| 162 | + * Registered before the telemetry client is built: the SDK registers its own | |
| 163 | + * deactivation callback when constructed, at the same priority, and that one | |
| 164 | + * deletes the "feedback modal submitted" transient. wpfunnels_plugin_deactivated | |
| 165 | + * (which sends the activity trail) has to read it first. | |
| 166 | + */ | |
| 128 | 167 | register_activation_hook(__FILE__, 'activate_wpfnl'); |
| 129 | 168 | register_deactivation_hook(__FILE__, 'deactivate_wpfnl'); |
| 130 | 169 | |
| 170 | +require_once plugin_dir_path(__FILE__) . 'vendor/autoload.php'; | |
| 171 | +require_once plugin_dir_path(__FILE__) . 'includes/core/Tracking/class-wpfnl-activity-trail.php'; | |
| 172 | +require_once plugin_dir_path(__FILE__) . 'includes/core/Tracking/class-wpfnl-telemetry.php'; | |
| 173 | +Telemetry::init(); | |
| 131 | 174 | |
| 132 | 175 | |
| 133 | -function wpfnl() { | |
| 176 | + | |
| 177 | +/** | |
| 178 | + * Function wpfnl() | |
| 179 | + * It is responsible for returning the instance of the plugin. | |
| 180 | + * | |
| 181 | + * @return Wpfnl | |
| 182 | + */ | |
| 183 | +function wpfnl() | |
| 184 | +{ | |
| 134 | 185 | return Wpfnl::get_instance(); |
| 135 | 186 | } |
| 136 | 187 | |
| 137 | 188 | /** |
| @@ -142,32 +193,31 @@ | ||
| 142 | 193 | * not affect the page life cycle. |
| 143 | 194 | * |
| 144 | 195 | * @since 1.0.0 |
| 145 | 196 | */ |
| 146 | -function run_wpfnl() { | |
| 197 | +function run_wpfnl() | |
| 198 | +{ | |
| 147 | 199 | wpfnl()->run(); |
| 148 | 200 | } |
| 149 | 201 | run_wpfnl(); |
| 150 | 202 | |
| 203 | +add_filter('et_builder_third_party_post_types', 'wpfnl_third_party_post_type', 10, 1); | |
| 151 | 204 | |
| 152 | - | |
| 153 | 205 | /** |
| 154 | - * Initialize the plugin tracker | |
| 206 | + * Create a new post type for the funnel steps | |
| 155 | 207 | * |
| 156 | - * @return void | |
| 208 | + * @access public | |
| 209 | + * @param string $post_types the post types. | |
| 210 | + * @return string | |
| 211 | + * | |
| 212 | + * @since 1.0.0 | |
| 157 | 213 | */ |
| 158 | -function appsero_init_tracker_wpfunnels() { | |
| 159 | - $client = new Appsero\Client( '6fb1e340-8276-4337-bca6-28a7cd186f06', 'WPFunnels', __FILE__ ); | |
| 160 | - $client->insights()->init(); | |
| 214 | +function wpfnl_third_party_post_type($post_types) | |
| 215 | +{ | |
| 216 | + $post_types[] = WPFNL_STEPS_POST_TYPE; | |
| 217 | + return $post_types; | |
| 161 | 218 | } |
| 162 | -appsero_init_tracker_wpfunnels(); | |
| 163 | 219 | |
| 164 | 220 | |
| 165 | - | |
| 166 | -add_filter('et_builder_third_party_post_types', 'wpfnl_third_party_post_type', 10, 1); | |
| 167 | -function wpfnl_third_party_post_type($post_types) { | |
| 168 | - $post_types[] = WPFNL_STEPS_POST_TYPE; | |
| 169 | - return $post_types; | |
| 170 | -} | |
| 171 | 221 | |
| 172 | 222 | |
| 173 | 223 | |