PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
3.13.4 3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 All 262 releases
← All changes | admin/class-wpfnl-notices.php +71 -61 2.8.16 → 3.13.3 View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2 /**
3 3 * WPFunnels otics class
4 - *
4 + *
5 5 * @package
6 6 */
7 7
8 8 namespace WPFunnels\Admin\Notices;
@@ -31,9 +31,9 @@
31 31
32 32 public function __construct() {
33 33 $validations = [
34 34 'logged_in' => true,
35 - 'user_can' => 'manage_options',
35 + 'user_can' => 'wpf_manage_funnels',
36 36 ];
37 37
38 38 add_action('admin_notices', [$this, 'show_admin_notices']);
39 39 add_filter( 'wpfunnels/funnel_window_admin_localize', array( $this, 'notice_for_oxygen_builder_compatibility' ) );
@@ -38,9 +38,8 @@
38 38 add_action('admin_notices', [$this, 'show_admin_notices']);
39 39 add_filter( 'wpfunnels/funnel_window_admin_localize', array( $this, 'notice_for_oxygen_builder_compatibility' ) );
40 40 add_action( 'admin_head', array( $this,'hide_update_notice_on_builder' ), 1 );
41 41
42 -
43 42 wp_ajax_helper()->handle('wpfunnels-activate-plugin')
44 43 ->with_callback([$this, 'activate_plugin'])
45 44 ->with_validation($validations);
46 45
@@ -46,8 +45,12 @@
46 45
47 46 wp_ajax_helper()->handle('delete_promotional_banner')
48 47 ->with_callback([ $this, 'wpfnl_delete_promotional_banner' ])
49 48 ->with_validation($validations);
49 +
50 + wp_ajax_helper()->handle('delete_new_ui_notice')
51 + ->with_callback([ $this, 'wpfnl_delete_new_ui_notice' ])
52 + ->with_validation($validations);
50 53 }
51 54
52 55 /**
53 56 * Get notices
@@ -59,14 +62,14 @@
59 62 }
60 63
61 64
62 65 public function show_admin_notices() {
63 - foreach ( self::get_notices() as $namespace => $callback_function ) {
64 - if( strpos( $namespace, '\\' ) ) {
65 - $namespace::$callback_function();
66 - }else {
67 - self::$callback_function();
68 - }
66 + foreach ( self::get_notices() as $namespace => $callback_function ) {
67 + if( strpos( $namespace, '\\' ) ) {
68 + $namespace::$callback_function();
69 + }else {
70 + self::$callback_function();
71 + }
69 72 }
70 73
71 74 }
72 75
@@ -74,14 +77,14 @@
74 77 /**
75 78 * Print admin notices
76 79 *
77 80 * @param $options
78 - *
81 + *
79 82 * @return bool
80 83 * @since 2.0.0
81 84 */
82 85 public static function print_notice($options) {
83 - if ( ! current_user_can( 'manage_options' ) ) {
86 + if ( ! current_user_can( 'wpf_manage_funnels' ) ) {
84 87 return false;
85 88 }
86 89 $default_options = [
87 90 'id' => null,
@@ -113,9 +116,9 @@
113 116 ?>
114 117 <div <?php echo self::render_html_attributes( $wrapper_attributes ); ?> >
115 118 <div class="wpfnl-notice__content">
116 119 <?php if ( $options['description'] ) { ?>
117 - <p><?php
120 + <p><?php
118 121 echo $options['description'];
119 122 ?>
120 123 </p>
121 124 <!-- <p class="wpfnl-notice-message"></p> -->
@@ -292,13 +295,27 @@
292 295 global $current_screen;
293 296 $is_pro_active = Wpfnl_functions::is_plugin_activated('wpfunnels-pro/wpfnl-pro.php');
294 297 if ( $is_pro_active ){
295 298
296 - if ( version_compare(WPFNL_VERSION, '2.4.15', '>=') && version_compare(WPFNL_PRO_VERSION, '1.6.12', '<') ) {
299 + if ( version_compare(WPFNL_VERSION, '3.0.0', '>=') && version_compare(WPFNL_PRO_VERSION, '2.0.0', '<') ) {
297 300 if ( 'plugins' === $current_screen->parent_base || 'wp_funnels' === $current_screen->parent_base ){
298 301 $options = array(
299 302 'id' => '',
300 303 'title' => 'wpfunnels-basic',
304 + 'description' => __("Please update the WPFunnels Pro to version 2.0.0 or higher to use New UI properly. Ignore if already updated.", 'wpfnl'),
305 + 'classes' => [ 'notice', 'wpfnl-notice' ], // We include WP's default notice class so it will be properly handled by WP's js handler
306 + 'type' => 'update-plugin',
307 + 'dismissible' => true,
308 + 'icon' => '',
309 + );
310 + self::print_notice($options);
311 + }
312 +
313 + }elseif ( version_compare(WPFNL_VERSION, '2.4.15', '>=') && version_compare(WPFNL_PRO_VERSION, '1.6.12', '<') ) {
314 + if ( 'plugins' === $current_screen->parent_base || 'wp_funnels' === $current_screen->parent_base ){
315 + $options = array(
316 + 'id' => '',
317 + 'title' => 'wpfunnels-basic',
301 318 'description' => __("Please update the WPFunnels Pro to version 1.0.12 or higher. Ignore if already updated.", 'wpfnl'),
302 319 'classes' => [ 'notice', 'wpfnl-notice' ], // We include WP's default notice class so it will be properly handled by WP's js handler
303 320 'type' => 'update-plugin',
304 321 'dismissible' => true,
@@ -306,11 +323,9 @@
306 323 );
307 324 self::print_notice($options);
308 325 }
309 326
310 - }
311 -
312 - if ( version_compare(WPFNL_VERSION, '2.6.1', '>=') && version_compare(WPFNL_PRO_VERSION, '1.7.1', '<') ) {
327 + }elseif ( version_compare(WPFNL_VERSION, '2.6.1', '>=') && version_compare(WPFNL_PRO_VERSION, '1.7.1', '<') ) {
313 328 if ( 'plugins' === $current_screen->parent_base || 'wp_funnels' === $current_screen->parent_base ){
314 329 $options = array(
315 330 'id' => '',
316 331 'title' => 'wpfunnels-basic',
@@ -327,11 +342,11 @@
327 342
328 343 }
329 344 return false;
330 345 }
331 -
332 -
333 -
346 +
347 +
348 +
334 349 /**
335 350 * Pro compatability notice for update version to 1.7.3 or higher. If someone wants to use AB tesing, then needs to update
336 351 */
337 352 public static function abtesing_pro_compatability(){
@@ -360,42 +375,25 @@
360 375 }
361 376
362 377
363 378 /**
364 - * GBF compatability notice for update version to 2.4.15 or higher. If someone wants to update, he/she has to install 1.0.18 or higher version of WPFunnels Pro - Global Funnel
379 + * GBF compatibility notice — no longer needed as GBF is now built into WPFunnels Pro.
380 + *
381 + * Kept as a no-op to avoid breaking any callers.
382 + *
383 + * @since 2.9.1
365 384 */
366 385 public static function gbf_compatability_notice(){
367 - global $current_screen;
368 - $is_gbf_active = Wpfnl_functions::is_plugin_activated('wpfunnels-pro-gbf/wpfnl-pro-gb.php');
369 - if ( $is_gbf_active ){
370 - if ( version_compare(WPFNL_VERSION, '2.4.15', '>=') && version_compare(WPFNL_PRO_GB_VERSION, '1.0.18', '<') ) {
371 - if ( 'plugins' === $current_screen->parent_base || 'wp_funnels' === $current_screen->parent_base ){
372 - $options = array(
373 - 'id' => '',
374 - 'title' => 'wpfunnels-basic',
375 - 'description' => __("Please update the WPFunnels Pro - Global Funnel to version 1.0.18 or higher. Ignore if already updated.", 'wpfnl'),
376 - 'description' => __("You are using an older version of WPFunnels Pro - Global Funnel. Please update to v1.0.18 or above to avoid any discrepancies with the latest WPFunnels (Basic) plugin.", 'wpfnl'),
377 - 'classes' => [ 'notice', 'wpfnl-notice' ], // We include WP's default notice class so it will be properly handled by WP's js handler
378 - 'type' => 'update-plugin',
379 - 'dismissible' => true,
380 - 'icon' => '',
381 - );
382 - self::print_notice($options);
383 - }
384 -
385 - }
386 -
387 - }
388 386 return false;
389 387 }
390 -
391 388
392 389
390 +
393 391 /**
394 392 * Oxygen compatiblity notice
395 - *
393 + *
396 394 * @param $localize
397 - *
395 + *
398 396 * @return $localize
399 397 */
400 398 public function notice_for_oxygen_builder_compatibility($localize = array())
401 399 {
@@ -431,9 +429,9 @@
431 429 *
432 430 * @param $plugin
433 431 * @param $slug
434 432 * @param $plugin_name
435 - *
433 + *
436 434 * @return array
437 435 * @since 2.0.0
438 436 */
439 437 public static function should_show_plugin_dependency_notice( $plugin, $slug, $plugin_name ) {
@@ -475,21 +473,21 @@
475 473 /**
476 474 * Render html attributes
477 475 *
478 476 * @param array $attributes
479 - *
477 + *
480 478 * @return string
481 479 * @since 2.0.0
482 480 */
483 481 public static function render_html_attributes( array $attributes ) {
484 482
485 - $rendered_attributes = [];
486 - foreach ( $attributes as $attribute_key => $attribute_values ) {
487 - if ( is_array( $attribute_values ) ) {
488 - $attribute_values = implode( ' ', $attribute_values );
489 - }
483 + $rendered_attributes = [];
484 + foreach ( $attributes as $attribute_key => $attribute_values ) {
485 + if ( is_array( $attribute_values ) ) {
486 + $attribute_values = implode( ' ', $attribute_values );
487 + }
490 488 $rendered_attributes[] = sprintf( '%1$s="%2$s"', $attribute_key, esc_attr( $attribute_values ) );
491 - }
489 + }
492 490 return implode( ' ', $rendered_attributes );
493 491 }
494 492
495 493
@@ -555,33 +553,45 @@
555 553 /**
556 554 * Delete promotional notice
557 555 *
558 556 * @param Array $payload
559 - *
557 + *
560 558 * @return Array
561 559 * @since 2.6.1
562 560 */
563 561 public function wpfnl_delete_promotional_banner( $payload ){
564 -
565 - update_option( '_is_wpfnl_black_friday_promotion', 'no' );
562 + update_option('_is_show_us_banner', 'no' );
566 563 return [
567 564 'success' => true,
568 565 ];
569 566 }
570 567
568 + /**
569 + * Delete wpfunnels new UI notice
570 + *
571 + * @param Array $payload
572 + *
573 + * @return Array
574 + * @since 2.6.1
575 + */
576 + public function wpfnl_delete_new_ui_notice( $payload ){
571 577
578 + update_option( '_is_wpfnl_new_ui_notices', 'no' );
579 + return [
580 + 'success' => true,
581 + ];
582 + }
583 +
584 +
572 585 /**
573 586 * Hide all notice in email builder
574 - *
587 + *
575 588 * @return void
576 589 * @since 2.8.7
577 590 */
578 591 public function hide_update_notice_on_builder(){
579 592 global $current_screen;
580 - if( "wp-funnels_page_email-builder" === $current_screen->base ){
593 + if( "wpfunnels_page_email-builder" === $current_screen->base || "toplevel_page_wpfunnels" === $current_screen->base || "wpfunnels_page_wpfnl_automations" === $current_screen->base || "wpfunnels_page_store_checkout" === $current_screen->base ){
581 594 remove_all_actions( 'admin_notices' );
582 595 }
583 596 }
584 -
585 -
586 -
587 -}
597 +}