Submit
Path:
~
/
home
/
getwphos
/
www
/
chemex
/
wp-content
/
plugins
/
woocommerce
/
vendor
/
automattic
/
jetpack-connection
/
src
/
File Content:
class-plugin.php
<?php /** * Plugin connection management class. * * @package automattic/jetpack-connection */ namespace Automattic\Jetpack\Connection; /** * Plugin connection management class. * The class represents a single plugin that uses Jetpack connection. * Its functionality has been pretty simplistic so far: add to the storage (`Plugin_Storage`), remove it from there, * and determine whether it's the last active connection. As the component grows, there'll be more functionality added. */ class Plugin { /** * List of the keys allowed as arguments * * @var array */ private $arguments_whitelist = array( 'url_info', ); /** * Plugin slug. * * @var string */ private $slug; /** * Initialize the plugin manager. * * @param string $slug Plugin slug. */ public function __construct( $slug ) { $this->slug = $slug; } /** * Get the plugin slug. * * @return string */ public function get_slug() { return $this->slug; } /** * Add the plugin connection info into Jetpack. * * @param string $name Plugin name, required. * @param array $args Plugin arguments, optional. * * @return $this * @see $this->arguments_whitelist */ public function add( $name, array $args = array() ) { $args = compact( 'name' ) + array_intersect_key( $args, array_flip( $this->arguments_whitelist ) ); Plugin_Storage::upsert( $this->slug, $args ); return $this; } /** * Remove the plugin connection info from Jetpack. * * @return $this */ public function remove() { Plugin_Storage::delete( $this->slug ); return $this; } /** * Determine if this plugin connection is the only one active at the moment, if any. * * @return bool */ public function is_only() { $plugins = Plugin_Storage::get_all(); return ! $plugins || ( array_key_exists( $this->slug, $plugins ) && 1 === count( $plugins ) ); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
identity-crisis
---
0755
sso
---
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
8043 bytes
0644
class-error-handler.php
22413 bytes
0644
class-heartbeat.php
8006 bytes
0644
class-initial-state.php
1932 bytes
0644
class-manager.php
85549 bytes
0644
class-nonce-handler.php
5812 bytes
0644
class-package-version-tracker.php
4922 bytes
0644
class-package-version.php
647 bytes
0644
class-partner-coupon.php
11197 bytes
0644
class-partner.php
5072 bytes
0644
class-plugin-storage.php
7741 bytes
0644
class-plugin.php
1881 bytes
0644
class-rest-authentication.php
5929 bytes
0644
class-rest-connector.php
31700 bytes
0644
class-secrets.php
8537 bytes
0644
class-server-sandbox.php
7863 bytes
0644
class-terms-of-service.php
2798 bytes
0644
class-tokens-locks.php
1699 bytes
0644
class-tokens.php
21353 bytes
0644
class-tracking.php
10002 bytes
0644
class-urls.php
5091 bytes
0644
class-utils.php
3922 bytes
0644
class-webhooks.php
6871 bytes
0644
class-xmlrpc-async-call.php
2685 bytes
0644
class-xmlrpc-connector.php
1872 bytes
0644
interface-manager.php
298 bytes
0644
N4ST4R_ID | Naxtarrr