PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.4.9
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.4.9
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/Utils/Installer.php +1 -18 3.7.53.4.9 View file →
@@ -126,25 +126,14 @@
126 126 $install_status = install_plugin_install_status( $api );
127 127 $plugin['plugin_file'] = $install_status['file'];
128 128 }
129 129
130 - // `$file` was never defined here — the plugin path lives in
131 - // $plugin['plugin_file'], and it is reassigned above when a fresh install
132 - // resolves a different one. The undefined name made is_plugin_inactive()
133 - // see null, which is never "active", so the guard silently collapsed to a
134 - // bare capability test. It failed closed, but it was not the check written.
135 - if ( !Helper::current_user_can( 'activate_plugins' ) && is_plugin_inactive( $plugin['plugin_file'] ) ) {
130 + if ( !Helper::current_user_can( 'activate_plugins' ) && is_plugin_inactive( $file ) ) {
136 131 $response['code'] = 'invalid_requirements';
137 132 $response['message'] = __( 'Sorry, you do not have permission to activate a plugin.', 'templately' );
138 133 return $response;
139 134 }
140 135
141 - $is_caching = Caching::PLUGIN_FILE === $plugin['plugin_file'];
142 -
143 - if ( $is_caching ) {
144 - Caching::prepare_settings();
145 - }
146 -
147 136 $activate_status = $this->activate_plugin( $plugin['plugin_file'] );
148 137
149 138 if ( is_wp_error( $activate_status ) ) {
150 139 $response['message'] = $activate_status->get_error_message();
@@ -151,14 +140,8 @@
151 140 }
152 141
153 142 if ( $activate_status && ! is_wp_error( $activate_status ) ) {
154 143 $response['success'] = true;
155 -
156 - if ( $is_caching ) {
157 - Caching::configure_after_install();
158 - }
159 - } elseif ( $is_caching ) {
160 - Caching::forget_settings();
161 144 }
162 145
163 146 $response['slug'] = $plugin['slug'];
164 147