PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.1
Elementor Website Builder – more than just a page builder v3.32.1
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | core/utils/hints.php +22 -55 4.2.33.32.1 View file →
@@ -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
@@ -344,12 +343,8 @@
344 343 *
345 344 * @return bool
346 345 */
347 346 public static function is_plugin_installed( $plugin ): bool {
348 - if ( ! function_exists( 'get_plugins' ) ) {
349 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
350 - }
351 -
352 347 $plugins = get_plugins();
353 348 $plugin = self::ensure_plugin_folder( $plugin );
354 349 return ! empty( $plugins[ $plugin ] );
355 350 }
@@ -361,12 +356,8 @@
361 356 *
362 357 * @return bool
363 358 */
364 359 public static function is_plugin_active( $plugin ): bool {
365 - if ( ! function_exists( 'is_plugin_active' ) ) {
366 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
367 - }
368 -
369 360 $plugin = self::ensure_plugin_folder( $plugin );
370 361 return is_plugin_active( $plugin );
371 362 }
372 363
@@ -452,68 +443,45 @@
452 443 public static function is_plugin_connected( $option_prefix ): bool {
453 444 return ! empty( get_option( $option_prefix . '_access_token' ) );
454 445 }
455 446
456 - public static function is_plugin_connected_to_one_subscription(): bool {
457 - return self::is_plugin_connected( 'elementor_one' );
458 - }
459 -
460 - private static function get_all_widget_content( $step, $one_subscription = false ) {
461 - if ( $one_subscription ) {
462 - $steps = [
463 - self::INSTALL => esc_html__( 'Want to create an inclusive experience? Install Web Accessibility, included in ONE, and add an accessibility widget to your site.', 'elementor' ),
464 - self::ACTIVATE => esc_html__( 'Your ONE subscription includes Web Accessibility. Activate it to place an accessibility widget on your site.', 'elementor' ),
465 - self::CONNECT => esc_html__( "Connect the Web Accessibility plugin to your account to access all of it's accessibility features.", 'elementor' ),
466 - self::CUSTOMIZE => esc_html__( "Customize the widget's look, position and the capabilities available for your visitors.", 'elementor' ),
467 - ];
468 - } else {
469 - $steps = [
470 - self::INSTALL => esc_html__( 'Install Web Accessibility to add an accessibility widget visitors can use to navigate your site.', 'elementor' ),
471 - self::ACTIVATE => esc_html__( 'Activate the Web Accessibility plugin to turn its accessibility features on across your site.', 'elementor' ),
472 - self::CONNECT => esc_html__( "Connect the Web Accessibility plugin to your account to access all of it's accessibility features.", 'elementor' ),
473 - self::CUSTOMIZE => esc_html__( "Customize the widget's look, position and the capabilities available for your visitors.", 'elementor' ),
474 - ];
475 - }
447 + private static function get_all_widget_content( $step ) {
448 + $steps = [
449 + self::INSTALL => esc_html__( 'Install Ally to add an accessibility widget visitors can use to navigate your site.', 'elementor' ),
450 + self::ACTIVATE => esc_html__( 'Activate the Ally plugin to turn its accessibility features on across your site.', 'elementor' ),
451 + self::CONNECT => esc_html__( "Connect the Ally plugin to your account to access all of it's accessibility features.", 'elementor' ),
452 + self::CUSTOMIZE => esc_html__( "Customize the widget's look, position and the capabilities available for your visitors.", 'elementor' ),
453 + ];
476 454 return $steps[ $step ];
477 455 }
478 456
479 457 private static function get_all_widget_action_button( $step ) {
480 458 $steps = [
481 - self::INSTALL => esc_html__( 'Install now', 'elementor' ),
482 - self::ACTIVATE => esc_html__( 'Activate now', 'elementor' ),
483 - self::CONNECT => esc_html__( 'Connect now', 'elementor' ),
459 + self::INSTALL => esc_html__( 'install Now', 'elementor' ),
460 + self::ACTIVATE => esc_html__( 'Activate', 'elementor' ),
461 + self::CONNECT => esc_html__( 'Connect', 'elementor' ),
484 462 self::CUSTOMIZE => esc_html__( 'Customize', 'elementor' ),
485 463 ];
486 464 return $steps[ $step ];
487 465 }
488 466
489 - private static function get_all_widget_action_url( $step, $one_subscription = false ) {
467 + private static function get_all_widget_action_url( $step ) {
490 468 if ( in_array( $step, [ self::INSTALL, self::ACTIVATE ], true ) ) {
491 - $action = ( self::INSTALL === $step ? 'install' : 'activate' );
492 - if ( $one_subscription ) {
493 - $campaign_data = [
494 - 'name' => 'elementor_ea11y_campaign',
495 - 'campaign' => 'acc-usability-widget-plg-ally-one-' . $action,
496 - 'source' => 'editor-ally-widget-one-' . $action,
497 - 'medium' => 'editor-one',
498 - ];
499 - } else {
500 - $campaign_data = [
501 - 'name' => 'elementor_ea11y_campaign',
502 - 'campaign' => 'acc-usability-widget-plg-ally',
503 - 'source' => 'editor-ally-widget',
504 - 'medium' => 'editor',
505 - ];
506 - }
469 + $campaign_data = [
470 + 'name' => 'elementor_ea11y_campaign',
471 + 'campaign' => 'acc-usability-widget-plg-ally',
472 + 'source' => 'editor-ally-widget',
473 + 'medium' => 'editor',
474 + ];
507 475 return Admin_Notices::add_plg_campaign_data( self::get_plugin_action_url( 'pojo-accessibility' ), $campaign_data );
508 476 }
509 477 return self::CONNECT === $step ? admin_url( 'admin.php?page=accessibility-settings' ) : admin_url( 'admin.php?page=accessibility-settings#design' );
510 478 }
511 479
512 - private static function get_ally_cta_button( $step, $one_subscription = false ) {
480 + private static function get_ally_cta_button( $step ) {
513 481 return [
514 482 'text' => self::get_all_widget_action_button( $step ),
515 - 'url' => self::get_all_widget_action_url( $step, $one_subscription ),
483 + 'url' => self::get_all_widget_action_url( $step ),
516 484 'classes' => [ 'elementor-button' ],
517 485 ];
518 486 }
519 487
@@ -521,9 +489,8 @@
521 489 $plugin_slug = 'pojo-accessibility';
522 490 $is_installed = self::is_plugin_installed( $plugin_slug );
523 491 $is_active = self::is_plugin_active( $plugin_slug );
524 492 $is_connected = self::is_plugin_connected( 'ea11y' );
525 - $one_subscription = self::is_plugin_connected_to_one_subscription();
526 493
527 494 if ( ! $is_installed ) {
528 495 $step = self::INSTALL;
529 496 } elseif ( ! $is_active ) {
@@ -534,11 +501,11 @@
534 501 $step = self::CUSTOMIZE;
535 502 }
536 503
537 504 $data = [
538 - 'title' => __( 'Web accessibility', 'elementor' ),
539 - 'content' => self::get_all_widget_content( $step, $one_subscription ),
540 - 'action_button' => self::get_ally_cta_button( $step, $one_subscription ),
505 + 'title' => __( 'Ally web accessibility', 'elementor' ),
506 + 'content' => self::get_all_widget_content( $step ),
507 + 'action_button' => self::get_ally_cta_button( $step ),
541 508 ];
542 509
543 510 return $data;
544 511 }