| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: Profile Builder |
| 4 | 4 | * Plugin URI: https://www.cozmoslabs.com/wordpress-profile-builder/ |
| 5 | 5 | * Description: Login, registration and edit profile shortcodes for the front-end. Also you can choose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard. |
| 6 | - * Version: 3.16.1 | |
| 6 | + * Version: 4.0.3 | |
| 7 | 7 | * Author: Cozmoslabs |
| 8 | 8 | * Author URI: https://www.cozmoslabs.com/ |
| 9 | 9 | * Text Domain: profile-builder |
| 10 | 10 | * Domain Path: /translation |
| @@ -9,11 +9,11 @@ | ||
| 9 | 9 | * Text Domain: profile-builder |
| 10 | 10 | * Domain Path: /translation |
| 11 | 11 | * License: GPL2 |
| 12 | 12 | * WC requires at least: 3.0.0 |
| 13 | - * WC tested up to: 10.7 | |
| 14 | - * Elementor tested up to: 4.0.9 | |
| 15 | - * Elementor Pro tested up to: 4.0.9 | |
| 13 | + * WC tested up to: 11.1 | |
| 14 | + * Elementor tested up to: 4.3.0 | |
| 15 | + * Elementor Pro tested up to: 4.3.0 | |
| 16 | 16 | * |
| 17 | 17 | * == Copyright == |
| 18 | 18 | * Copyright 2014 Cozmoslabs (www.cozmoslabs.com) |
| 19 | 19 | * |
| @@ -153,19 +153,22 @@ | ||
| 153 | 153 | include_once( WPPB_PAID_PLUGIN_DIR . '/features/two-factor-authentication/class-two-factor-authentication.php' ); |
| 154 | 154 | new WPPB_Two_Factor_Authenticator(); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if (file_exists(WPPB_PLUGIN_DIR . '/update/class-edd-sl-plugin-updater.php')) { | |
| 158 | - include_once(WPPB_PLUGIN_DIR . '/update/class-edd-sl-plugin-updater.php'); | |
| 159 | - include_once(WPPB_PLUGIN_DIR . '/admin/register-version.php'); | |
| 157 | + if ( file_exists( WPPB_PLUGIN_DIR . '/admin/register-version.php' ) ) { | |
| 158 | + include_once( WPPB_PLUGIN_DIR . '/admin/register-version.php' ); | |
| 160 | 159 | } |
| 161 | 160 | |
| 161 | + // Forms Rework (free): default forms always; extra forms need paid | |
| 162 | + // (wppb_fb_multiple_forms_available). require_once — silent skip would | |
| 163 | + // break per-form field lists with no error. | |
| 164 | + require_once( WPPB_PLUGIN_DIR . 'form-builder/form-builder-init.php' ); | |
| 165 | + | |
| 162 | 166 | if ( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons/add-ons.php' ) ) { |
| 163 | 167 | |
| 164 | 168 | include_once(WPPB_PAID_PLUGIN_DIR . '/add-ons/add-ons.php'); |
| 165 | 169 | // include_once(WPPB_PAID_PLUGIN_DIR . '/add-ons/repeater-field/repeater-module.php'); |
| 166 | 170 | include_once(WPPB_PAID_PLUGIN_DIR . '/add-ons/custom-redirects/custom-redirects.php'); |
| 167 | - include_once(WPPB_PAID_PLUGIN_DIR . '/add-ons/multiple-forms/multiple-forms.php'); | |
| 168 | 171 | include_once(WPPB_PAID_PLUGIN_DIR . '/add-ons/user-listing/userlisting.php'); |
| 169 | 172 | |
| 170 | 173 | if( file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons-advanced/file-restriction/index.php' ) ) |
| 171 | 174 | include_once( WPPB_PAID_PLUGIN_DIR . '/add-ons-advanced/file-restriction/index.php' ); |
| @@ -334,8 +337,13 @@ | ||
| 334 | 337 | if( file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons-advanced/mailpoet-integration/index.php' ) ) |
| 335 | 338 | include_once WPPB_PAID_PLUGIN_DIR . '/add-ons-advanced/mailpoet-integration/index.php'; |
| 336 | 339 | } |
| 337 | 340 | |
| 341 | + if( isset( $wppb_advanced_add_ons_settings['progress-bar'] ) && $wppb_advanced_add_ons_settings['progress-bar'] ){ | |
| 342 | + if( file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons-advanced/progress-bar/index.php' ) ) | |
| 343 | + include_once WPPB_PAID_PLUGIN_DIR . '/add-ons-advanced/progress-bar/index.php'; | |
| 344 | + } | |
| 345 | + | |
| 338 | 346 | } |
| 339 | 347 | |
| 340 | 348 | /** |
| 341 | 349 | * Include add-on files that contain activation hooks even when add-ons are deactivated |
| @@ -365,71 +373,8 @@ | ||
| 365 | 373 | |
| 366 | 374 | } |
| 367 | 375 | |
| 368 | 376 | |
| 369 | - /** | |
| 370 | - * Add explanatory message on the plugins page when updates are not available | |
| 371 | - * | |
| 372 | - */ | |
| 373 | - if ( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists(WPPB_PLUGIN_DIR . '/update/class-edd-sl-plugin-updater.php') ) { | |
| 374 | - | |
| 375 | - if ( class_exists('WPPB_EDD_SL_Plugin_Updater') ) { | |
| 376 | - | |
| 377 | - $serial = wppb_get_serial_number(); | |
| 378 | - | |
| 379 | - if( ! function_exists('get_plugin_data') ){ | |
| 380 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
| 381 | - } | |
| 382 | - | |
| 383 | - $plugin_data = get_plugin_data( WPPB_PAID_PLUGIN_DIR . '/index.php', false, false ); | |
| 384 | - $pb_plugin_version = ( $plugin_data && $plugin_data['Version'] ) ? $plugin_data['Version'] : '3.7.6' ; | |
| 385 | - | |
| 386 | - if( PROFILE_BUILDER == 'Profile Builder Pro' ) | |
| 387 | - $pb_cl_plugin_id = '30695'; | |
| 388 | - else if( PROFILE_BUILDER == 'Profile Builder Basic' ) | |
| 389 | - $pb_cl_plugin_id = '30697'; | |
| 390 | - else if( PROFILE_BUILDER == 'Profile Builder Agency' ) | |
| 391 | - $pb_cl_plugin_id = '416191'; | |
| 392 | - else if( PROFILE_BUILDER == 'Profile Builder Unlimited' ) | |
| 393 | - $pb_cl_plugin_id = '30699'; | |
| 394 | - | |
| 395 | - // setup the updater | |
| 396 | - $wppb_edd_updater = new WPPB_EDD_SL_Plugin_Updater('https://cozmoslabs.com', WPPB_PAID_PLUGIN_DIR . '/index.php', array( | |
| 397 | - 'version' => $pb_plugin_version, // current version number | |
| 398 | - 'license' => $serial, | |
| 399 | - 'item_name' => PROFILE_BUILDER, // name of this plugin | |
| 400 | - 'item_id' => $pb_cl_plugin_id, | |
| 401 | - 'author' => 'Cozmoslabs', // author of this plugin | |
| 402 | - 'beta' => false | |
| 403 | - ) | |
| 404 | - ); | |
| 405 | - | |
| 406 | - } | |
| 407 | - | |
| 408 | - function wppb_plugin_update_message( $plugin_data, $new_data ) { | |
| 409 | - | |
| 410 | - $wppb_profile_builder_serial = wppb_get_serial_number(); | |
| 411 | - $wppb_profile_builder_serial_status = wppb_get_serial_number_status(); | |
| 412 | - | |
| 413 | - if( empty( $wppb_profile_builder_serial ) ){ | |
| 414 | - | |
| 415 | - echo '<br />' . wp_kses_post( sprintf( __('To enable updates, please enter your license key on the %sSettings%s page. If you don\'t have a license key, you can %sbuy one now%s.', 'profile-builder' ), '<a href="'.esc_url( admin_url('admin.php?page=profile-builder-general-settings') ).'">', '</a>', '<a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=license-updates-disabled-notification&utm_campaign=PBPro#pricing" target="_blank">', '</a>' ) ); | |
| 416 | - | |
| 417 | - } else if( $wppb_profile_builder_serial_status == 'expired' ) { | |
| 418 | - | |
| 419 | - echo '<br />' . wp_kses_post( sprintf( __('To enable updates, your licence needs to be renewed. Please go to the <a href="%s">Cozmoslabs Account</a> page and login to renew.', 'profile-builder' ), 'https://www.cozmoslabs.com/account/?utm_source=wpbackend&utm_medium=clientsite&utm_content=license-updates-disabled-notification&utm_campaign=PBPro' ) ); | |
| 420 | - | |
| 421 | - } else if ( $wppb_profile_builder_serial_status != 'valid' ) { | |
| 422 | - | |
| 423 | - echo '<br />' . wp_kses_post( sprintf( __('To enable updates, you need an active license. %1$sRenew%2$s or %3$spurchase a new license%4$s.', 'profile-builder' ), '<a href="https://www.cozmoslabs.com/account/?utm_source=wpbackend&utm_medium=clientsite&utm_content=license-updates-disabled-notification&utm_campaign=PBPro" target="_blank">', '</a>', '<a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=license-updates-disabled-notification&utm_campaign=PBPro#pricing" target="_blank">', '</a>' ) ); | |
| 424 | - | |
| 425 | - } | |
| 426 | - | |
| 427 | - } | |
| 428 | - add_action( 'in_plugin_update_message-' . strtolower( str_replace( ' ', '-', PROFILE_BUILDER ) ) . '/index.php', 'wppb_plugin_update_message', 10, 2 ); | |
| 429 | - } | |
| 430 | - | |
| 431 | - | |
| 432 | 377 | // these settings are important, so besides running them on page load, we also need to do a check on plugin activation |
| 433 | 378 | add_action('init', 'wppb_generate_default_settings_defaults'); //prepoulate general settings |
| 434 | 379 | add_action('init', 'wppb_prepopulate_fields'); //prepopulate manage fields list |
| 435 | 380 | |
| @@ -441,9 +386,9 @@ | ||
| 441 | 386 | * Definitions |
| 442 | 387 | * |
| 443 | 388 | * |
| 444 | 389 | */ |
| 445 | -define('PROFILE_BUILDER_VERSION', '3.16.1' ); | |
| 390 | +define('PROFILE_BUILDER_VERSION', '4.0.3' ); | |
| 446 | 391 | define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__)); |
| 447 | 392 | define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__)); |
| 448 | 393 | define('WPPB_PLUGIN_BASENAME', plugin_basename(__FILE__)); |
| 449 | 394 | define('WPPB_TRANSLATE_DIR', WPPB_PLUGIN_DIR . '/translation'); |
| @@ -486,8 +431,41 @@ | ||
| 486 | 431 | |
| 487 | 432 | } else |
| 488 | 433 | define('PROFILE_BUILDER', 'Profile Builder Free'); |
| 489 | 434 | |
| 435 | +if ( ! function_exists( 'wppb_paid_plugin_owns_updates' ) ) { | |
| 436 | + function wppb_paid_plugin_owns_updates() { | |
| 437 | + | |
| 438 | + if ( ! defined( 'WPPB_PAID_PLUGIN_DIR' ) || ! defined( 'WPPB_PLUGIN_DIR' ) ) | |
| 439 | + return false; | |
| 440 | + | |
| 441 | + if ( trailingslashit( WPPB_PAID_PLUGIN_DIR ) === trailingslashit( WPPB_PLUGIN_DIR ) ) | |
| 442 | + return false; | |
| 443 | + | |
| 444 | + return file_exists( WPPB_PAID_PLUGIN_DIR . '/update/class-edd-sl-plugin-updater.php' ); | |
| 445 | + | |
| 446 | + } | |
| 447 | +} | |
| 448 | + | |
| 449 | +/** | |
| 450 | + * Load the EDD updater from the paid wrapper when it owns updates. | |
| 451 | + */ | |
| 452 | +if ( ! function_exists( 'wppb_paid_plugin_load_updater' ) ) { | |
| 453 | + function wppb_paid_plugin_load_updater() { | |
| 454 | + | |
| 455 | + if ( class_exists( 'WPPB_Plugin_Updater', false ) ) | |
| 456 | + return; | |
| 457 | + | |
| 458 | + if ( ! function_exists( 'wppb_paid_plugin_owns_updates' ) || ! wppb_paid_plugin_owns_updates() ) | |
| 459 | + return; | |
| 460 | + | |
| 461 | + require_once WPPB_PAID_PLUGIN_DIR . '/update/class-edd-sl-plugin-updater.php'; | |
| 462 | + | |
| 463 | + } | |
| 464 | +} | |
| 465 | + | |
| 466 | +add_action( 'plugins_loaded', 'wppb_paid_plugin_load_updater', 0 ); | |
| 467 | + | |
| 490 | 468 | // Needs to be loaded early for Upload fields to work correctly |
| 491 | 469 | if ( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons/add-ons.php' ) && file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons/repeater-field/repeater-module.php' ) ) |
| 492 | 470 | include_once( WPPB_PAID_PLUGIN_DIR . '/add-ons/repeater-field/repeater-module.php' ); |
| 493 | 471 | |
| @@ -503,26 +481,8 @@ | ||
| 503 | 481 | exit(); |
| 504 | 482 | } |
| 505 | 483 | } |
| 506 | 484 | add_action( 'activated_plugin', 'wppb_activate_plugin_redirect' ); |
| 507 | -} | |
| 508 | - | |
| 509 | -add_action( 'wppb_register_activation_hook', 'wppb_activation_deactivation_hook_callback' ); | |
| 510 | -add_action( 'wppb_register_deactivation_hook', 'wppb_activation_deactivation_hook_callback' ); | |
| 511 | -function wppb_activation_deactivation_hook_callback() { | |
| 512 | - | |
| 513 | - if( !function_exists( 'wppb_field_format' ) ){ | |
| 514 | - include_once( WPPB_PLUGIN_DIR . '/admin/admin-functions.php' ); | |
| 515 | - } | |
| 516 | - | |
| 517 | - $current_action = current_action(); | |
| 518 | - | |
| 519 | - if( $current_action == 'wppb_register_activation_hook' && function_exists( 'wppb_handle_plugin_activation' ) ){ | |
| 520 | - wppb_handle_plugin_activation(); | |
| 521 | - } else if( $current_action == 'wppb_register_deactivation_hook' && function_exists( 'wppb_handle_plugin_deactivation' ) ){ | |
| 522 | - wppb_handle_plugin_deactivation(); | |
| 523 | - } | |
| 524 | - | |
| 525 | 485 | } |
| 526 | 486 | |
| 527 | 487 | /** |
| 528 | 488 | * Check if Setup Wizard should run |