PluginProbe
Polylang / 2.5
Polylang v2.5
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | install/install-base.php +3 -22 2.72.5 View file →
@@ -21,15 +21,10 @@
21 21 // Manages plugin activation and deactivation
22 22 register_activation_hook( $plugin_basename, array( $this, 'activate' ) );
23 23 register_deactivation_hook( $plugin_basename, array( $this, 'deactivate' ) );
24 24
25 - // Blog creation on multisite.
26 - if ( version_compare( $GLOBALS['wp_version'], '5.1', '<' ) ) {
27 - // FIXME: Backward compatibility with WP < 5.1.
28 - add_action( 'wpmu_new_blog', array( $this, 'wpmu_new_blog' ), 5 ); // Before WP attempts to send mails which can break on some PHP versions
29 - } else {
30 - add_action( 'wp_insert_site', array( $this, 'new_site' ) );
31 - }
25 + // Blog creation on multisite
26 + add_action( 'wpmu_new_blog', array( $this, 'wpmu_new_blog' ), 5 ); // Before WP attempts to send mails which can break on some PHP versions
32 27 }
33 28
34 29 /**
35 30 * Allows to detect plugin deactivation
@@ -38,9 +33,9 @@
38 33 *
39 34 * @return bool true if the plugin is currently beeing deactivated
40 35 */
41 36 public function is_deactivation() {
42 - return isset( $_GET['action'], $_GET['plugin'] ) && 'deactivate' === $_GET['action'] && $this->plugin_basename === $_GET['plugin']; // phpcs:ignore WordPress.Security.NonceVerification
37 + return isset( $_GET['action'], $_GET['plugin'] ) && 'deactivate' == $_GET['action'] && $this->plugin_basename == $_GET['plugin'];
43 38 }
44 39
45 40 /**
46 41 * Activation or deactivation for all blogs
@@ -108,23 +103,9 @@
108 103 // Can be overriden in child class
109 104 }
110 105
111 106 /**
112 - * Site creation on multisite ( to set default options )
113 - *
114 - * @since 2.6.8
115 - *
116 - * @param WP_Site $new_site New site object.
117 - */
118 - public function new_site( $new_site ) {
119 - switch_to_blog( $new_site->id );
120 - $this->_activate();
121 - restore_current_blog();
122 - }
123 -
124 - /**
125 107 * Blog creation on multisite ( to set default options )
126 - * Backward compatibility with WP < 5.1
127 108 *
128 109 * @since 0.9.4
129 110 *
130 111 * @param int $blog_id