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/functions.php +4 -40 6.0.1 → 6.3.0 View file →
@@ -101,9 +101,9 @@
101 101
102 102 /**
103 103 * Returns the global DI container for the WP Defender plugin.
104 104 *
105 - * @return \WPMU_DEV\Defender\Vendor\DI\Container The global DI container.
105 + * @return \WP_Defender\Component\Container The global DI container.
106 106 */
107 107 function wd_di() {
108 108 global $wp_defender_di;
109 109
@@ -286,9 +286,8 @@
286 286 return $no_reply_email;
287 287 }
288 288
289 289 /**
290 - * Todo: remove if we don't need Vue.js.
291 290 * Get data of the whitelabel feature from WPMUDEV Dashboard:
292 291 * hide_branding, hide_doc_link, footer_text, hero_image, change_footer.
293 292 *
294 293 * @return array
@@ -343,13 +342,13 @@
343 342 if ( $whitelabel->can_whitelabel() ) {
344 343 $wl_settings = WPMUDEV_Dashboard::$whitelabel->get_settings();
345 344 $pid = Config_Hub_Helper::WDP_ID;
346 345 $labels_networkwide = (bool) ( $wl_settings['labels_networkwide'] ?? true );
347 - $labels_subsites = (array) ( $wl_settings['labels_subsites'] ?? array() );
346 + $labels_subsites = array_map( 'intval', (array) ( $wl_settings['labels_subsites'] ?? array() ) );
348 347 $apply_labels = ! is_multisite()
349 348 || is_network_admin()
350 349 || $labels_networkwide
351 - || in_array( get_current_blog_id(), $labels_subsites, false );
350 + || in_array( get_current_blog_id(), $labels_subsites, true );
352 351
353 352 if ( $apply_labels && isset( $wl_settings['labels_config'][ $pid ] ) ) {
354 353 $cfg = $wl_settings['labels_config'][ $pid ];
355 354 $plugin_icon_type = sanitize_key( $cfg['icon_type'] ?? 'default' );
@@ -361,9 +360,9 @@
361 360 case 'upload':
362 361 $thumb_id = (int) ( $cfg['thumb_id'] ?? 0 );
363 362 if ( $thumb_id ) {
364 363 $url = wp_get_attachment_image_url( $thumb_id, 'thumbnail', true );
365 - $plugin_icon_url = $url ?: '';
364 + $plugin_icon_url = $url ? $url : '';
366 365 }
367 366 break;
368 367 case 'link':
369 368 $plugin_icon_url = esc_url_raw( $cfg['icon_url'] ?? '' );
@@ -690,43 +689,8 @@
690 689
691 690 $rest_prefix = trailingslashit( rest_get_url_prefix() );
692 691
693 692 return false !== strpos( $request_uri, $rest_prefix );
694 -}
695 -
696 -/**
697 - * Handle deprecated functions by logging or triggering actions.
698 - * This function is a wrapper for WordPress's _deprecated_function() function.
699 - * It is used to handle deprecated functions by either logging a deprecation
700 - * message or triggering an action. It checks if the current request is an AJAX
701 - * request or a REST API request and acts accordingly.
702 - *
703 - * @param string $function_name The function that was called.
704 - * @param string $version The version number that deprecated the function.
705 - * @param string $replacement (Optional) The function that should be used instead.
706 - *
707 - * @return void
708 - * @since 4.2.0
709 - */
710 -function defender_deprecated_function( string $function_name, string $version, string $replacement = '' ): void {
711 - /**
712 - * Filters whether to trigger an error for deprecated functions.
713 - *
714 - * @param bool $trigger Whether to trigger the error for deprecated functions. Default false.
715 - *
716 - * @since 4.2.1
717 - */
718 - if ( WP_DEBUG && apply_filters( 'defender_deprecated_function_trigger_error', false ) ) {
719 - if ( wp_doing_ajax() || defender_is_rest_api_request() ) {
720 - do_action( 'deprecated_function_run', $function_name, $replacement, $version );
721 -
722 - $log_string = "Function {$function_name} is deprecated since version {$version}!";
723 - $log_string .= '' !== $replacement ? " Use {$replacement} instead." : '';
724 - wp_die( esc_html( $log_string ) );
725 - } else {
726 - _deprecated_function( esc_html( $function_name ), esc_html( $version ), esc_html( $replacement ) );
727 - }
728 - }
729 693 }
730 694
731 695 if ( ! function_exists( 'defender_get_data_from_request' ) ) {
732 696 /**