Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /var/www/theprintave/wp-content/plugins/dokan-lite/includes/REST/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/theprintave/wp-content/plugins/dokan-lite/includes/REST/ChangeLogController.php
<?php

namespace WeDevs\Dokan\REST;

use WeDevs\Dokan\Abstracts\DokanRESTAdminController;
use WeDevs\Dokan\Cache;
use WP_Error;
use WP_REST_Response;
use WP_REST_Server;

/**
 * Dokan Changelog handler class
 *
 * @since 3.3.3
 */
class ChangeLogController extends DokanRESTAdminController {
    /**
     * Route base.
     *
     * @var string
     */
    protected $base = 'changelog';

    /**
     * Register all routes related with stores
     *
     * @since 3.3.3
     *
     * @return void
     */
    public function register_routes() {
        register_rest_route(
            $this->namespace, '/' . $this->base . '/lite', [
                [
                    'methods'             => WP_REST_Server::READABLE,
                    'callback'            => [ $this, 'get_change_log' ],
                    'permission_callback' => [ $this, 'check_permission' ],
                ],
            ]
        );
    }

    /**
     * Get Change Logs
     *
     * @since 3.3.3
     *
     * @return WP_REST_Response|WP_Error
     */
    public function get_change_log() {
        $cache_key = 'changelog_lite_' . DOKAN_PLUGIN_VERSION;
        $changelog = Cache::get_transient( $cache_key );

        if ( false === $changelog ) {
            require_once DOKAN_DIR . '/templates/whats-new.php';
            $changelog = wp_json_encode( $changelog );
            Cache::set_transient( $cache_key, $changelog, '', MONTH_IN_SECONDS );
        }

        return rest_ensure_response( $changelog );
    }
}

Spamworldpro Mini