| Server IP : 27.254.66.5 / Your IP : 216.73.217.39 Web Server : Apache/2 System : Linux cs82.hostneverdie.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 User : technic2 ( 1951) PHP Version : 7.4.30 Disable Function : apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd,exec, fp, fput, highlight_file, ini_alter, ini_restore, inject_code, passthru,phpAds_remoteInfo, phpAds_XmlRpc,phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid,posix_setuid, posix_setuid, posix_uname,proc_open,proc_close, proc_get_status, proc_nice, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,sleep,pcntl_exec,virtual,suexec,dbmopen,dl,symlink,disk_free_space,diskfreespace,leak MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/technic2/public_html/old-website/wp-content/plugins/jetpack/ |
Upload File : |
<?php
defined( 'ABSPATH' ) or die( 'No direct access, please.' );
require_once( ABSPATH . WPINC . '/class-IXR.php' );
/**
* IXR_Client
*
* @package IXR
* @since 1.5
*
*/
class Jetpack_IXR_Client extends IXR_Client {
public $jetpack_args = null;
function __construct( $args = array(), $path = false, $port = 80, $timeout = 15 ) {
$defaults = array(
'url' => Jetpack::xmlrpc_api_url(),
'user_id' => 0,
);
$args = wp_parse_args( $args, $defaults );
$this->jetpack_args = $args;
$this->IXR_Client( $args['url'], $path, $port, $timeout );
}
function query() {
$args = func_get_args();
$method = array_shift( $args );
$request = new IXR_Request( $method, $args );
$xml = trim( $request->getXml() );
$response = Jetpack_Client::remote_request( $this->jetpack_args, $xml );
if ( is_wp_error( $response ) ) {
$this->error = new IXR_Error( -10520, sprintf( 'Jetpack: [%s] %s', $response->get_error_code(), $response->get_error_message() ) );
return false;
}
if ( !$response ) {
$this->error = new IXR_Error( -10520, 'Jetpack: Unknown Error' );
return false;
}
if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
$this->error = new IXR_Error( -32300, 'transport error - HTTP status code was not 200' );
return false;
}
$content = wp_remote_retrieve_body( $response );
// Now parse what we've got back
$this->message = new IXR_Message( $content );
if ( !$this->message->parse() ) {
// XML error
$this->error = new IXR_Error( -32700, 'parse error. not well formed' );
return false;
}
// Is the message a fault?
if ( $this->message->messageType == 'fault' ) {
$this->error = new IXR_Error( $this->message->faultCode, $this->message->faultString );
return false;
}
// Message must be OK
return true;
}
function get_jetpack_error( $fault_code = null, $fault_string = null ) {
if ( is_null( $fault_code ) ) {
$fault_code = $this->error->code;
}
if ( is_null( $fault_string ) ) {
$fault_string = $this->error->message;
}
if ( preg_match( '#jetpack:\s+\[(\w+)\]\s*(.*)?$#i', $fault_string, $match ) ) {
$code = $match[1];
$message = $match[2];
$status = $fault_code;
return new Jetpack_Error( $code, $message, $status );
}
return new Jetpack_Error( "IXR_{$fault_code}", $fault_string );
}
}
/**
* IXR_ClientMulticall
*
* @package IXR
* @since 1.5
*/
class Jetpack_IXR_ClientMulticall extends Jetpack_IXR_Client {
public $calls = array();
function __construct( $args = array(), $path = false, $port = 80, $timeout = 15 ) {
parent::__construct( $args, $path, $port, $timeout );
}
function addCall() {
$args = func_get_args();
$methodName = array_shift( $args );
$struct = array(
'methodName' => $methodName,
'params' => $args
);
$this->calls[] = $struct;
}
function query() {
usort( $this->calls, array( $this, 'sort_calls' ) );
// Prepare multicall, then call the parent::query() method
return parent::query( 'system.multicall', $this->calls );
}
// Make sure syncs are always done first
function sort_calls( $a, $b ) {
if ( 'jetpack.syncContent' == $a['methodName'] ) {
return -1;
}
if ( 'jetpack.syncContent' == $b['methodName'] ) {
return 1;
}
return 0;
}
}