Submit
Path:
~
/
home
/
getwphos
/
www
/
almajd14
/
wp-content
/
plugins
/
woocommerce
/
vendor
/
automattic
/
jetpack-connection
/
src
/
File Content:
class-xmlrpc-async-call.php
<?php /** * XMLRPC Async Call class. * * @package automattic/jetpack-connection */ namespace Automattic\Jetpack\Connection; use Jetpack_IXR_ClientMulticall; /** * Make XMLRPC async calls to WordPress.com * * This class allows you to enqueue XMLRPC calls that will be grouped and sent * at once in a multi-call request at shutdown. * * Usage: * * XMLRPC_Async_Call::add_call( 'methodName', get_current_user_id(), $arg1, $arg2, etc... ) * * See XMLRPC_Async_Call::add_call for details */ class XMLRPC_Async_Call { /** * Hold the IXR Clients that will be dispatched at shutdown * * Clients are stored in the following schema: * [ * $blog_id => [ * $user_id => [ * arrat of Jetpack_IXR_ClientMulticall * ] * ] * ] * * @var array */ public static $clients = array(); /** * Adds a new XMLRPC call to the queue to be processed on shutdown * * @param string $method The XML-RPC method. * @param integer $user_id The user ID used to make the request (will use this user's token); Use 0 for the blog token. * @param mixed ...$args This function accepts any number of additional arguments, that will be passed to the call. * @return void */ public static function add_call( $method, $user_id = 0, ...$args ) { global $blog_id; $client_blog_id = is_multisite() ? $blog_id : 0; if ( ! isset( self::$clients[ $client_blog_id ] ) ) { self::$clients[ $client_blog_id ] = array(); } if ( ! isset( self::$clients[ $client_blog_id ][ $user_id ] ) ) { self::$clients[ $client_blog_id ][ $user_id ] = new Jetpack_IXR_ClientMulticall( array( 'user_id' => $user_id ) ); } // https://plugins.trac.wordpress.org/ticket/2041 if ( function_exists( 'ignore_user_abort' ) ) { ignore_user_abort( true ); } array_unshift( $args, $method ); call_user_func_array( array( self::$clients[ $client_blog_id ][ $user_id ], 'addCall' ), $args ); if ( false === has_action( 'shutdown', array( 'Automattic\Jetpack\Connection\XMLRPC_Async_Call', 'do_calls' ) ) ) { add_action( 'shutdown', array( 'Automattic\Jetpack\Connection\XMLRPC_Async_Call', 'do_calls' ) ); } } /** * Trigger the calls at shutdown * * @return void */ public static function do_calls() { foreach ( self::$clients as $client_blog_id => $blog_clients ) { if ( $client_blog_id > 0 ) { $switch_success = switch_to_blog( $client_blog_id ); if ( ! $switch_success ) { continue; } } foreach ( $blog_clients as $client ) { if ( empty( $client->calls ) ) { continue; } flush(); $client->query(); } if ( $client_blog_id > 0 ) { restore_current_blog(); } } } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
identity-crisis
---
0755
sso
---
0755
traits
---
0755
webhooks
---
0755
class-authorize-json-api.php
8900 bytes
0644
class-client.php
16207 bytes
0644
class-connection-assets.php
900 bytes
0644
class-connection-notice.php
8089 bytes
0644
class-error-handler.php
33669 bytes
0644
class-external-storage.php
8256 bytes
0644
class-heartbeat.php
8006 bytes
0644
class-initial-state.php
1935 bytes
0644
class-manager.php
89192 bytes
0644
class-nonce-handler.php
5812 bytes
0644
class-package-version-tracker.php
5686 bytes
0644
class-package-version.php
648 bytes
0644
class-partner-coupon.php
11202 bytes
0644
class-partner.php
5072 bytes
0644
class-plugin-storage.php
7741 bytes
0644
class-plugin.php
2459 bytes
0644
class-rest-authentication.php
6302 bytes
0644
class-rest-connector.php
34784 bytes
0644
class-secrets.php
8608 bytes
0644
class-server-sandbox.php
7863 bytes
0644
class-terms-of-service.php
2798 bytes
0644
class-tokens-locks.php
1745 bytes
0644
class-tokens.php
21301 bytes
0644
class-tracking.php
10100 bytes
0644
class-urls.php
5091 bytes
0644
class-user-account-status.php
3632 bytes
0644
class-users-connection-admin.php
4549 bytes
0644
class-utils.php
3922 bytes
0644
class-webhooks.php
7066 bytes
0644
class-xmlrpc-async-call.php
2685 bytes
0644
class-xmlrpc-connector.php
1918 bytes
0644
interface-manager.php
298 bytes
0644
interface-storage-provider.php
2118 bytes
0644
N4ST4R_ID | Naxtarrr