| @@ -79,8 +79,15 @@ | ||
| 79 | 79 | */ |
| 80 | 80 | private $quarantine_controller; |
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | + * Is the Malware Report option unlocked? | |
| 84 | + * | |
| 85 | + * @var bool | |
| 86 | + */ | |
| 87 | + private $is_unlocked; | |
| 88 | + | |
| 89 | + /** | |
| 83 | 90 | * Initializes the model and service, registers routes, and sets up scheduled events if the model is active. |
| 84 | 91 | */ |
| 85 | 92 | public function __construct() { |
| 86 | 93 | $this->register_page( |
| @@ -92,10 +99,10 @@ | ||
| 92 | 99 | |
| 93 | 100 | $this->model = wd_di()->get( Scan_Settings::class ); |
| 94 | 101 | $this->service = wd_di()->get( Scan_Component::class ); |
| 95 | 102 | $this->quarantine_controller = wd_di()->get( Quarantine::class ); |
| 96 | - $wpmudev = wd_di()->get( WPMUDEV::class ); | |
| 97 | 103 | |
| 104 | + $this->is_unlocked = wd_di()->get( WPMUDEV::class )->is_pro(); | |
| 98 | 105 | |
| 99 | 106 | $this->register_routes(); |
| 100 | 107 | add_action( 'defender_enqueue_assets', array( $this, 'enqueue_assets' ) ); |
| 101 | 108 | add_action( 'wp_ajax_defender_process_scan', array( $this, 'process' ) ); |
| @@ -109,9 +116,9 @@ | ||
| 109 | 116 | if ( |
| 110 | 117 | is_admin() && |
| 111 | 118 | 'plugins.php' === $pagenow && |
| 112 | 119 | apply_filters( 'wd_display_vulnerability_warnings', true ) && |
| 113 | - $wpmudev->is_apikey_available() | |
| 120 | + wd_di()->get( WPMUDEV::class )->is_apikey_available() | |
| 114 | 121 | ) { |
| 115 | 122 | $this->service->display_vulnerability_warnings(); |
| 116 | 123 | } |
| 117 | 124 | |
| @@ -861,9 +868,9 @@ | ||
| 861 | 868 | return array( 'scan' => $data ); |
| 862 | 869 | } |
| 863 | 870 | |
| 864 | 871 | /** |
| 865 | - * Render main page. | |
| 872 | + * Render the main page. | |
| 866 | 873 | * |
| 867 | 874 | * @return void |
| 868 | 875 | */ |
| 869 | 876 | public function main_view(): void { |
| @@ -922,9 +929,9 @@ | ||
| 922 | 929 | ); |
| 923 | 930 | |
| 924 | 931 | wp_enqueue_style( |
| 925 | 932 | $handle, |
| 926 | - WP_DEFENDER_BASE_URL . 'assets/css/showcase.css', | |
| 933 | + WP_DEFENDER_BASE_URL . 'assets/css/core-ui.css', | |
| 927 | 934 | array(), |
| 928 | 935 | DEFENDER_VERSION |
| 929 | 936 | ); |
| 930 | 937 | |
| @@ -1073,9 +1080,10 @@ | ||
| 1073 | 1080 | |
| 1074 | 1081 | if ( 'enabled' === $config['notification'] ) { |
| 1075 | 1082 | $strings[] = esc_html__( 'Email notifications active', 'defender-security' ); |
| 1076 | 1083 | } |
| 1077 | - if ( ! ( property_exists( $this, 'is_pro' ) ? $this->is_pro : wd_di()->get( WPMUDEV::class )->is_pro() ) ) { | |
| 1084 | + // No Pro membership and No hosted site. | |
| 1085 | + if ( ! $this->is_unlocked ) { | |
| 1078 | 1086 | $strings[] = sprintf( |
| 1079 | 1087 | /* translators: %s: Html for Pro-tag. */ |
| 1080 | 1088 | esc_html__( 'Scheduled scan inactive %s', 'defender-security' ), |
| 1081 | 1089 | '<span class="sui-tag sui-tag-pro">Pro</span>' |