| @@ -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' ); |
| @@ -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 | /** |