PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 3.3.3
Strong Testimonials v3.3.3
3.3.3 3.3.2 3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / includes / elementor / class-strong-testimonials-elementor-check.php
strong-testimonials / includes / elementor Last commit date
class-strong-testimonials-elementor-check.php 1 year ago class-strong-testimonials-elementor-widget-activation.php 1 year ago class-strong-testimonials-elementor-widget.php 1 year ago
class-strong-testimonials-elementor-check.php
123 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5
6 final class Strong_Testimonials_Elementor_Check {
7
8 /**
9 * Plugin Version
10 *
11 * @since 2.40.5
12 * @var string The plugin version.
13 */
14 const VERSION = '2.40.5';
15
16 /**
17 * Minimum Elementor Version
18 *
19 * @since 2.40.5
20 * @var string Minimum Elementor version required to run the elementor block.
21 */
22 const MINIMUM_ELEMENTOR_VERSION = '2.4.5';
23
24 /**
25 * Minimum PHP Version
26 *
27 * @since 2.40.5
28 * @var string Minimum PHP version required to run the elementor block.
29 */
30 const MINIMUM_PHP_VERSION = '7.0';
31
32 /**
33 * Constructor
34 *
35 * @since 2.40.5
36 * @access public
37 */
38 public function __construct() {
39
40 // Init Plugin
41 add_action( 'plugins_loaded', array( $this, 'init' ) );
42 }
43
44 public function init() {
45
46 if ( ! did_action( 'elementor/loaded' ) ) {
47 return;
48 }
49
50 // Check for required Elementor version
51 if ( ! version_compare( ELEMENTOR_VERSION, self::MINIMUM_ELEMENTOR_VERSION, '>=' ) ) {
52 add_action( 'admin_notices', array( $this, 'admin_notice_minimum_elementor_version' ) );
53 return;
54 }
55
56 // Check for required PHP version
57 if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) {
58 add_action( 'admin_notices', array( $this, 'admin_notice_minimum_php_version' ) );
59 return;
60 }
61
62 if ( has_action( 'elementor/widgets/register' ) ) {
63 add_action( 'elementor/widgets/register', array( $this, 'remove_strong_testimonials_widget' ), 15 );
64 } else {
65 add_action(
66 'elementor/widgets/widgets_registered',
67 array(
68 $this,
69 'remove_strong_testimonials_widget',
70 ),
71 15
72 );
73 }
74
75 // Once we get here, We have passed all validation checks so we can safely include our elementor block activation
76 require_once WPMTST_INC . 'elementor/class-strong-testimonials-elementor-widget-activation.php';
77 }
78
79
80 /**
81 * Admin notice
82 *
83 * Warning when the site doesn't have a minimum required Elementor version.
84 *
85 * @since 2.40.5
86 * @access public
87 */
88 public function admin_notice_minimum_elementor_version() {
89 if ( isset( $_GET['activate'] ) ) {
90 unset( $_GET['activate'] );
91 }
92 // translators: %1$s is the message stating that the Elementor widget requires a specific Elementor version.
93 printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', sprintf( esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'strong-testimonials' ), '<strong>' . esc_html__( 'Strong Testimonials Elementor widget', 'strong-testimonials' ) . '</strong>', '<strong>' . esc_html__( 'Elementor', 'strong-testimonials' ) . '</strong>', self::MINIMUM_ELEMENTOR_VERSION ) );
94 }
95
96 /**
97 * Admin notice
98 *
99 * Warning when the site doesn't have a minimum required PHP version.
100 *
101 * @since 1.0.0
102 * @access public
103 */
104 public function admin_notice_minimum_php_version() {
105 if ( isset( $_GET['activate'] ) ) {
106 unset( $_GET['activate'] );
107 }
108 // translators: %1$s is the message stating that the Elementor widget requires a specific Elementor version.
109 printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', sprintf( esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'strong-testimonials' ), '<strong>' . esc_html__( 'Strong Testimonials Elementor widget', 'strong-testimonials' ) . '</strong>', '<strong>' . esc_html__( 'PHP', 'strong-testimonials' ) . '</strong>', self::MINIMUM_PHP_VERSION ) );
110 }
111
112 /* Remove WordPress widget because we have a dedicated Elementor Widget */
113 public function remove_strong_testimonials_widget( $widget_manager ) {
114 if ( method_exists( $widget_manager, 'unregister' ) ) {
115 $widget_manager->unregister( 'strong-testimonials-view-widget' );
116 } else {
117 $widget_manager->unregister_widget_type( 'strong-testimonials-view-widget' );
118 }
119 }
120 }
121
122 new Strong_Testimonials_Elementor_Check();
123