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/ip/class-global-ip.php +28 -0 6.0.1 → 6.3.0 View file →
@@ -605,5 +605,33 @@
605 605 $this->model->save();
606 606 $this->log( 'Central IP automatically disabled due to expired membership.', 'central_ip.log' );
607 607 }
608 608 }
609 +
610 + /**
611 + * Toggle the Custom IP List feature on hosting.
612 + *
613 + * @param bool $enable True to enable, false to disable.
614 + *
615 + * @return bool|WP_Error True on success, false if not on WPMU hosting, WP_Error on failure.
616 + */
617 + public function toggle_on_hosting( bool $enable ) {
618 + if ( ! $this->wpmudev->is_wpmu_hosting() ) {
619 + return false;
620 + }
621 +
622 + $this->attach_behavior( WPMUDEV::class, WPMUDEV::class );
623 +
624 + $data = $this->make_wpmu_request(
625 + WPMUDEV::API_GLOBAL_IP_LIST_HOSTING,
626 + array( 'is_active' => $enable ),
627 + array( 'method' => 'PUT' )
628 + );
629 +
630 + if ( is_wp_error( $data ) ) {
631 + $this->log( 'Global IP API Error: ' . $data->get_error_message(), Firewall::FIREWALL_LOG );
632 + return $data;
633 + }
634 +
635 + return true;
636 + }
609 637 }