plugin = $plugin; $this->plugin_meta = $plugin_meta; $this->settings = $settings; } /** * @param array $fields */ protected function send_json_request( string $url, array $fields ): void { $send_request = Profiler::get_callback( Profiler::SOURCE_NETWORK, $url, function () use ( $url, $fields ): void { wp_remote_post( $url, array( 'headers' => array( 'Content-Type' => 'application/json; charset=utf-8' ), 'method' => 'POST', 'body' => (string) wp_json_encode( $fields ), // we don't need the response, so it's non-blocking. 'blocking' => false, ) ); } ); call_user_func( $send_request ); } }