$29 GRAYBYTE WORDPRESS FILE MANAGER $79

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bqrcodec/contact.rohto.com.vn/wp-content/plugins/nitropack/

HOME
Current File : /home/bqrcodec/contact.rohto.com.vn/wp-content/plugins/nitropack//wp-cli.php
<?php

defined( 'ABSPATH' ) or die( 'No script kiddies please!' );

/**
* Connects a website to NitroPack
*
* ## OPTIONS
*
* <siteID>
* : The API Key obtained from https://nitropack.io/user/connect
*
* <siteSecret>
* : The API Secret Key obtained from https://nitropack.io/user/connect
*
* ## EXAMPLES
*
*     wp nitropack connect siteID siteSecret
*/

function nitropack_cli_connect($args, $assocArgs) {
    $siteId = !empty($args[0]) ? $args[0] : "";
    $siteSecret = !empty($args[1]) ? $args[1] : "";
    nitropack_verify_connect($siteId, $siteSecret);
}

/**
* Disconnects a website from NitroPack
*
* ## EXAMPLES
*
*     wp nitropack disconnect
*/

function nitropack_cli_disconnect($args, $assocArgs) {
    nitropack_disconnect();
}

/**
* Purges a website's cache
*
* ## EXAMPLES
*
*     wp nitropack purge
*/

function nitropack_cli_purge($args, $assocArgs) {
	$host = !empty($assocArgs["purge-host"]) ? $assocArgs["purge-host"] : NULL;
    $url = !empty($assocArgs["purge-url"]) ? $assocArgs["purge-url"] : NULL;
    $tag = !empty($assocArgs["purge-tag"]) ? $assocArgs["purge-tag"] : NULL;
    $reason = !empty($assocArgs["purge-reason"]) ? $assocArgs["purge-reason"] : NULL;

	if (!empty($host)) {
		/**
		 * Override the site url by the purge-host parameter
		 *
		 * @param string $host
		 * @return string
		 */
		add_filter( 'nitropack_current_host', function() use ( $host ) {
				if (!preg_match('#^http(s)?://#', $host)) {
					$host = 'https://' . $host;
				}
				return $host;
			}
		);
	}

    if ($url || $tag || $reason) {
        try {
            if (nitropack_sdk_purge($url, $tag, $reason)) {
                nitropack_json_and_exit(array(
                    "type" => "success",
                    "message" => __( 'Success! Cache has been purged successfully!', 'nitropack' )
                ));
            }
        } catch (\Exception $e) {}

        nitropack_json_and_exit(array(
            "type" => "error",
            "message" => __( 'Error! There was an error and the cache was not purged!', 'nitropack' )
        ));
    } else {
        nitropack_purge_cache();
    }
}

/**
* Invalidate a website's cache
*
* ## EXAMPLES
*
*     wp nitropack invalidate
*/

function nitropack_cli_invalidate($args, $assocArgs) {
    $url = !empty($assocArgs["purge-url"]) ? $assocArgs["purge-url"] : NULL;
    $tag = !empty($assocArgs["purge-tag"]) ? $assocArgs["purge-tag"] : NULL;
    $reason = !empty($assocArgs["purge-reason"]) ? $assocArgs["purge-reason"] : NULL;
    if ($url || $tag || $reason) {
        try {
            if (nitropack_sdk_invalidate($url, $tag, $reason)) {
                nitropack_json_and_exit(array(
                    "type" => "success",
                    "message" => __( 'Success! Cache has been invalidated successfully!', 'nitropack' )
                ));
            }
        } catch (\Exception $e) {}

        nitropack_json_and_exit(array(
            "type" => "error",
            "message" => __( 'Error! There was an error and the cache was not invalidated!', 'nitropack' )
        ));
        nitropack_sdk_invalidate($url, $tag, $reason);
    } else {
        nitropack_invalidate_cache();
    }
}

/**
* Start a warmup process for a website
*
* ## EXAMPLES
*
*     wp nitropack warmup
*/

function nitropack_cli_warmup($args, $assocArgs) {
    nitropack_run_warmup();
}

WP_CLI::add_command("nitropack connect", "nitropack_cli_connect");
WP_CLI::add_command("nitropack disconnect", "nitropack_cli_disconnect");
WP_CLI::add_command("nitropack purge", "nitropack_cli_purge");
WP_CLI::add_command("nitropack invalidate", "nitropack_cli_invalidate");
WP_CLI::add_command("nitropack warmup", "nitropack_cli_warmup");

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
19 Mar 2026 6.23 AM
bqrcodec / bqrcodec
0755
classes
--
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0755
languages
--
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0755
nitropack-sdk
--
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0755
view
--
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0755
advanced-cache.php
3.026 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
batcache-compat.php
0.397 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
cf-helper.php
0.672 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
constants.php
2.813 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
diagnostics.php
9.502 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
functions.php
160.542 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
helpers.php
4.531 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
integrations.php
0.369 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
main.php
11.922 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
readme.txt
33.878 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
uninstall.php
0.918 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644
wp-cli.php
3.606 KB
13 May 2025 5.01 PM
bqrcodec / bqrcodec
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF