PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/component/audit/class-core-audit.php +15 -13 5.6.0 → 6.3.0 View file →
@@ -174,9 +174,9 @@
174 174 $updates = array_shift( $updates );
175 175 if ( is_object( $updates ) && property_exists( $updates, 'version' ) ) {
176 176 return $this->get_upgraded_core_data_for_record( $updates->version );
177 177 }
178 - } elseif ( empty( $update_core ) && $this->is_hub_request() ) {
178 + } elseif ( $this->is_hub_request() ) {
179 179 // Hub has already updated WP core to the latest version.
180 180 $wp_version = ( new WP_Version() )->get_latest_version();
181 181
182 182 return $wp_version ? $this->get_upgraded_core_data_for_record( $wp_version ) : false;
@@ -238,9 +238,9 @@
238 238 } elseif ( 'plugin' === $options['type'] ) {
239 239 $texts = array();
240 240 foreach ( $options['plugins'] as $slug ) {
241 241 $plugin = get_plugin_data( $this->get_abs_plugin_path_by_slug( $slug ) );
242 - if ( is_array( $plugin ) && isset( $plugin['Name'] ) && ! empty( $plugin['Name'] ) ) {
242 + if ( is_array( $plugin ) && isset( $plugin['Name'] ) && '' !== $plugin['Name'] ) {
243 243 $texts[] = sprintf(
244 244 /* translators: 1: Plugin name, 2: Plugin version. */
245 245 $failed_result ? esc_html( '%1$s version %2$s' ) : esc_html( '%1$s to %2$s' ),
246 246 $plugin['Name'],
@@ -265,19 +265,19 @@
265 265 } else {
266 266 return false;
267 267 }
268 268 }
269 + return false;
269 270 }
270 271
271 272 /**
272 273 * Handles single item upgrade for themes or plugins and prepares the audit log entry.
273 274 *
274 - * @param WP_Upgrader $upgrader The upgrade instance.
275 - * @param array $options Options containing type and the item being upgraded.
275 + * @param array $options Options containing type and the item being upgraded.
276 276 *
277 277 * @return array|bool Returns the log entry data or false if unable to generate log data.
278 278 */
279 - public function single_upgrade( WP_Upgrader $upgrader, array $options ) {
279 + public function single_upgrade( array $options ) {
280 280 $blog_name = is_multisite() ? '[' . get_bloginfo( 'name' ) . ']' : '';
281 281
282 282 if ( 'theme' === $options['type'] ) {
283 283 $theme = wp_get_theme( $options['theme'] );
@@ -320,8 +320,9 @@
320 320 } else {
321 321 return false;
322 322 }
323 323 }
324 + return false;
324 325 }
325 326
326 327 /**
327 328 * Install process.
@@ -341,18 +342,18 @@
341 342 return false;
342 343 }
343 344
344 345 $name = '';
345 - if ( ! empty( $upgrade->skin->api ) ) {
346 + if ( isset( $upgrade->skin->api->name ) && '' !== $upgrade->skin->api->name ) {
346 347 $name = $upgrade->skin->api->name;
347 - } elseif ( ! empty( $upgrade->skin->upgrader ) ) {
348 + } elseif ( isset( $upgrade->skin->upgrader ) && $upgrade->skin->upgrader instanceof \WP_Upgrader ) {
348 349 $type_data = ( 'theme' === $options['type'] && isset( $upgrade->skin->upgrader->new_theme_data ) )
349 350 ? $upgrade->skin->upgrader->new_theme_data
350 351 : $upgrade->skin->upgrader->new_plugin_data;
351 - if ( ! empty( $type_data['Name'] ) && ! empty( $type_data['Version'] ) ) {
352 + if ( isset( $type_data['Name'] ) && '' !== $type_data['Name'] && isset( $type_data['Version'] ) && '' !== $type_data['Version'] ) {
352 353 $name = $type_data['Name'] . ', version ' . $type_data['Version'];
353 354 }
354 - } elseif ( ! empty( $upgrade->skin->result ) ) {
355 + } elseif ( isset( $upgrade->skin->result ) ) {
355 356 if ( is_array( $upgrade->skin->result ) && isset( $upgrade->skin->result['destination_name'] ) ) {
356 357 $name = $upgrade->skin->result['destination_name'];
357 358 } elseif ( is_object( $upgrade->skin->result ) && property_exists(
358 359 $upgrade->skin->result,
@@ -361,9 +362,9 @@
361 362 $name = $upgrade->skin->result->destination_name;
362 363 }
363 364 }
364 365
365 - if ( empty( $name ) ) {
366 + if ( '' === $name ) {
366 367 return false;
367 368 }
368 369
369 370 $blog_name = is_multisite() ? '[' . get_bloginfo( 'name' ) . ']' : '';
@@ -405,9 +406,9 @@
405 406 * 'plugins' (array) Array of the basename paths of the plugins' main files.
406 407 * 'themes' (array) The theme slugs.
407 408 * 'translations' (array) Array of translations update data: 'language', 'type', 'slug', 'version'.
408 409 *
409 - * @return mixed
410 + * @return array|bool
410 411 */
411 412 public function process_installer() {
412 413 $args = func_get_args();
413 414 $upgrader = $args[1]['upgrader'];
@@ -422,10 +423,11 @@
422 423 // Case: actions from Hub.
423 424 return $this->single_install( $upgrader, $options );
424 425 } elseif ( 'update' === $options['action'] ) {
425 426 // Case: actions from Hub.
426 - return $this->single_upgrade( $upgrader, $options );
427 + return $this->single_upgrade( $options );
427 428 }
429 + return true;
428 430 }
429 431
430 432 /**
431 433 * Fires after the theme is switched.
@@ -464,9 +466,9 @@
464 466 public function process_delete_plugin(): array {
465 467 $args = func_get_args();
466 468
467 469 // If 'deleted'-arg is false then the plugin deletion wasn't successful.
468 - if ( empty( $args[1]['deleted'] ) ) {
470 + if ( ! isset( $args[1]['deleted'] ) || false === $args[1]['deleted'] ) {
469 471 // Todo: extend Audit table with a new column for the result of the process and divide it into success and failure.
470 472 $failed_result = true;
471 473 } else {
472 474 $failed_result = false;