| @@ -4,9 +4,8 @@ | ||
| 4 | 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | 5 | exit; // Exit if accessed directly. |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | -use Elementor\Plugin; | |
| 9 | 8 | use Elementor\User; |
| 10 | 9 | use Elementor\Utils; |
| 11 | 10 | use Elementor\Core\Admin\Admin_Notices; |
| 12 | 11 | |
| @@ -448,68 +447,45 @@ | ||
| 448 | 447 | public static function is_plugin_connected( $option_prefix ): bool { |
| 449 | 448 | return ! empty( get_option( $option_prefix . '_access_token' ) ); |
| 450 | 449 | } |
| 451 | 450 | |
| 452 | - public static function is_plugin_connected_to_one_subscription(): bool { | |
| 453 | - return self::is_plugin_connected( 'elementor_one' ); | |
| 454 | - } | |
| 455 | - | |
| 456 | - private static function get_all_widget_content( $step, $one_subscription = false ) { | |
| 457 | - if ( $one_subscription ) { | |
| 458 | - $steps = [ | |
| 459 | - self::INSTALL => esc_html__( 'Want to create an inclusive experience? Install Ally, included in ONE, and add an accessibility widget to your site.', 'elementor' ), | |
| 460 | - self::ACTIVATE => esc_html__( 'Your ONE subscription includes Ally. Activate it to place an accessibility widget on your site.', 'elementor' ), | |
| 461 | - self::CONNECT => esc_html__( "Connect the Ally plugin to your account to access all of it's accessibility features.", 'elementor' ), | |
| 462 | - self::CUSTOMIZE => esc_html__( "Customize the widget's look, position and the capabilities available for your visitors.", 'elementor' ), | |
| 463 | - ]; | |
| 464 | - } else { | |
| 465 | - $steps = [ | |
| 466 | - self::INSTALL => esc_html__( 'Install Ally to add an accessibility widget visitors can use to navigate your site.', 'elementor' ), | |
| 467 | - self::ACTIVATE => esc_html__( 'Activate the Ally plugin to turn its accessibility features on across your site.', 'elementor' ), | |
| 468 | - self::CONNECT => esc_html__( "Connect the Ally plugin to your account to access all of it's accessibility features.", 'elementor' ), | |
| 469 | - self::CUSTOMIZE => esc_html__( "Customize the widget's look, position and the capabilities available for your visitors.", 'elementor' ), | |
| 470 | - ]; | |
| 471 | - } | |
| 451 | + private static function get_all_widget_content( $step ) { | |
| 452 | + $steps = [ | |
| 453 | + self::INSTALL => esc_html__( 'Install Ally to add an accessibility widget visitors can use to navigate your site.', 'elementor' ), | |
| 454 | + self::ACTIVATE => esc_html__( 'Activate the Ally plugin to turn its accessibility features on across your site.', 'elementor' ), | |
| 455 | + self::CONNECT => esc_html__( "Connect the Ally plugin to your account to access all of it's accessibility features.", 'elementor' ), | |
| 456 | + self::CUSTOMIZE => esc_html__( "Customize the widget's look, position and the capabilities available for your visitors.", 'elementor' ), | |
| 457 | + ]; | |
| 472 | 458 | return $steps[ $step ]; |
| 473 | 459 | } |
| 474 | 460 | |
| 475 | 461 | private static function get_all_widget_action_button( $step ) { |
| 476 | 462 | $steps = [ |
| 477 | - self::INSTALL => esc_html__( 'Install now', 'elementor' ), | |
| 478 | - self::ACTIVATE => esc_html__( 'Activate now', 'elementor' ), | |
| 479 | - self::CONNECT => esc_html__( 'Connect now', 'elementor' ), | |
| 463 | + self::INSTALL => esc_html__( 'install Now', 'elementor' ), | |
| 464 | + self::ACTIVATE => esc_html__( 'Activate', 'elementor' ), | |
| 465 | + self::CONNECT => esc_html__( 'Connect', 'elementor' ), | |
| 480 | 466 | self::CUSTOMIZE => esc_html__( 'Customize', 'elementor' ), |
| 481 | 467 | ]; |
| 482 | 468 | return $steps[ $step ]; |
| 483 | 469 | } |
| 484 | 470 | |
| 485 | - private static function get_all_widget_action_url( $step, $one_subscription = false ) { | |
| 471 | + private static function get_all_widget_action_url( $step ) { | |
| 486 | 472 | if ( in_array( $step, [ self::INSTALL, self::ACTIVATE ], true ) ) { |
| 487 | - $action = ( self::INSTALL === $step ? 'install' : 'activate' ); | |
| 488 | - if ( $one_subscription ) { | |
| 489 | - $campaign_data = [ | |
| 490 | - 'name' => 'elementor_ea11y_campaign', | |
| 491 | - 'campaign' => 'acc-usability-widget-plg-ally-one-' . $action, | |
| 492 | - 'source' => 'editor-ally-widget-one-' . $action, | |
| 493 | - 'medium' => 'editor-one', | |
| 494 | - ]; | |
| 495 | - } else { | |
| 496 | - $campaign_data = [ | |
| 497 | - 'name' => 'elementor_ea11y_campaign', | |
| 498 | - 'campaign' => 'acc-usability-widget-plg-ally', | |
| 499 | - 'source' => 'editor-ally-widget', | |
| 500 | - 'medium' => 'editor', | |
| 501 | - ]; | |
| 502 | - } | |
| 473 | + $campaign_data = [ | |
| 474 | + 'name' => 'elementor_ea11y_campaign', | |
| 475 | + 'campaign' => 'acc-usability-widget-plg-ally', | |
| 476 | + 'source' => 'editor-ally-widget', | |
| 477 | + 'medium' => 'editor', | |
| 478 | + ]; | |
| 503 | 479 | return Admin_Notices::add_plg_campaign_data( self::get_plugin_action_url( 'pojo-accessibility' ), $campaign_data ); |
| 504 | 480 | } |
| 505 | 481 | return self::CONNECT === $step ? admin_url( 'admin.php?page=accessibility-settings' ) : admin_url( 'admin.php?page=accessibility-settings#design' ); |
| 506 | 482 | } |
| 507 | 483 | |
| 508 | - private static function get_ally_cta_button( $step, $one_subscription = false ) { | |
| 484 | + private static function get_ally_cta_button( $step ) { | |
| 509 | 485 | return [ |
| 510 | 486 | 'text' => self::get_all_widget_action_button( $step ), |
| 511 | - 'url' => self::get_all_widget_action_url( $step, $one_subscription ), | |
| 487 | + 'url' => self::get_all_widget_action_url( $step ), | |
| 512 | 488 | 'classes' => [ 'elementor-button' ], |
| 513 | 489 | ]; |
| 514 | 490 | } |
| 515 | 491 | |
| @@ -517,9 +493,8 @@ | ||
| 517 | 493 | $plugin_slug = 'pojo-accessibility'; |
| 518 | 494 | $is_installed = self::is_plugin_installed( $plugin_slug ); |
| 519 | 495 | $is_active = self::is_plugin_active( $plugin_slug ); |
| 520 | 496 | $is_connected = self::is_plugin_connected( 'ea11y' ); |
| 521 | - $one_subscription = self::is_plugin_connected_to_one_subscription(); | |
| 522 | 497 | |
| 523 | 498 | if ( ! $is_installed ) { |
| 524 | 499 | $step = self::INSTALL; |
| 525 | 500 | } elseif ( ! $is_active ) { |
| @@ -531,10 +506,10 @@ | ||
| 531 | 506 | } |
| 532 | 507 | |
| 533 | 508 | $data = [ |
| 534 | 509 | 'title' => __( 'Ally web accessibility', 'elementor' ), |
| 535 | - 'content' => self::get_all_widget_content( $step, $one_subscription ), | |
| 536 | - 'action_button' => self::get_ally_cta_button( $step, $one_subscription ), | |
| 510 | + 'content' => self::get_all_widget_content( $step ), | |
| 511 | + 'action_button' => self::get_ally_cta_button( $step ), | |
| 537 | 512 | ]; |
| 538 | 513 | |
| 539 | 514 | return $data; |
| 540 | 515 | } |