PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.7
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.7
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php +19 -32 12.7.3 → 16.3-a.7 View file →
@@ -31,8 +31,15 @@
31 31 */
32 32 private $slug;
33 33
34 34 /**
35 + * Users Connection Admin instance.
36 + *
37 + * @var Users_Connection_Admin
38 + */
39 + private $users_connection_admin;
40 +
41 + /**
35 42 * Initialize the plugin manager.
36 43 *
37 44 * @param string $slug Plugin slug.
38 45 */
@@ -37,8 +44,11 @@
37 44 * @param string $slug Plugin slug.
38 45 */
39 46 public function __construct( $slug ) {
40 47 $this->slug = $slug;
48 +
49 + // Initialize Users_Connection_Admin
50 + $this->users_connection_admin = new Users_Connection_Admin();
41 51 }
42 52
43 53 /**
44 54 * Get the plugin slug.
@@ -84,39 +94,16 @@
84 94 */
85 95 public function is_only() {
86 96 $plugins = Plugin_Storage::get_all();
87 97
98 + if ( is_wp_error( $plugins ) ) {
99 + if ( 'too_early' === $plugins->get_error_code() ) {
100 + _doing_it_wrong( __METHOD__, esc_html( $plugins->get_error_code() . ': ' . $plugins->get_error_message() ), '6.16.1' );
101 + } else {
102 + wp_trigger_error( __METHOD__, $plugins->get_error_code() . ': ' . $plugins->get_error_message() );
103 + }
104 + return false;
105 + }
106 +
88 107 return ! $plugins || ( array_key_exists( $this->slug, $plugins ) && 1 === count( $plugins ) );
89 - }
90 -
91 - /**
92 - * Add the plugin to the set of disconnected ones.
93 - *
94 - * @deprecated since 1.39.0.
95 - *
96 - * @return bool
97 - */
98 - public function disable() {
99 - return true;
100 - }
101 -
102 - /**
103 - * Remove the plugin from the set of disconnected ones.
104 - *
105 - * @deprecated since 1.39.0.
106 - *
107 - * @return bool
108 - */
109 - public function enable() {
110 - return true;
111 - }
112 -
113 - /**
114 - * Whether this plugin is allowed to use the connection.
115 - *
116 - * @deprecated since 11.0
117 - * @return bool
118 - */
119 - public function is_enabled() {
120 - return true;
121 108 }
122 109 }