diff --git a/projects/packages/waf/changelog/add-waf-api-new-properties b/projects/packages/waf/changelog/add-waf-api-new-properties new file mode 100644 index 0000000000000..940ade07a0bba --- /dev/null +++ b/projects/packages/waf/changelog/add-waf-api-new-properties @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +WAF: Add new properties to the WAF feature's REST API endpoint. diff --git a/projects/packages/waf/src/class-rest-controller.php b/projects/packages/waf/src/class-rest-controller.php index 8a036c11ad14f..6e7747e350a3c 100644 --- a/projects/packages/waf/src/class-rest-controller.php +++ b/projects/packages/waf/src/class-rest-controller.php @@ -90,7 +90,15 @@ public static function update_rules() { * @return WP_REST_Response */ public static function waf() { - return rest_ensure_response( Waf_Runner::get_config() ); + return rest_ensure_response( + array_merge( + Waf_Runner::get_config(), + array( + 'waf_supported' => Waf_Runner::is_supported_environment(), + 'automatic_rules_last_updated' => Waf_Stats::get_automatic_rules_last_updated(), + ) + ) + ); } /**