# flywp/1.7.0/includes/Api/Ping.php

FlyWP Helper – Page Cache, Page Optimization, Emails for FlyWP Server Control Panel, version 1.7.0. 30 lines.

- Page: https://pluginprobe.com/plugins/flywp/1.7.0/code/includes/Api/Ping.php
- Raw: https://pluginprobe.com/plugins/flywp/1.7.0/raw/includes/Api/Ping.php
- Modified: 2023-06-13T17:24:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/flywp/1.7.0/code/includes/Api/Ping.php#L10-L20`.

```php
<?php

namespace FlyWP\Api;

class Ping {

    /**
     * Ping constructor.
     */
    public function __construct() {
        flywp()->router->get( 'ping', [ $this, 'handle_ping' ] );
    }

    /**
     * Handle ping request.
     *
     * @return void
     */
    public function handle_ping() {
        $response = [
            'message'        => 'pong',
            'wp_version'     => get_bloginfo( 'version' ),
            'php_version'    => PHP_VERSION,
            'plugin_version' => FLYWP_VERSION,
        ];

        wp_send_json( $response );
    }
}

```
