require_manage(); $days = isset( $_POST['days'] ) ? absint( wp_unslash( $_POST['days'] ) ) : 30; if ( ! in_array( $days, array( 7, 30, 90 ), true ) ) { $days = 30; } wp_send_json_success( $this->plugin->bots()->summary( $days ) ); } /** * Manual "Send now": push the last two days of aggregates to Rezolve Ai. */ public function report_now() { check_ajax_referer( self::NONCE_ACTION, 'nonce' ); $this->require_manage(); $this->require_connected(); $result = $this->plugin->bots()->report_back(); if ( is_wp_error( $result ) ) { wp_send_json_error( $this->error_payload( $result ) ); } wp_send_json_success( array( 'reported' => true ) ); } }