filename
stringlengths
11
137
content
stringlengths
6
292k
jetpack.php
<?php /** * Plugin Name: Jetpack Monorepo (not a real plugin) * Plugin URI: https://github.com/Automattic/jetpack#jetpack-monorepo * Description: The Jetpack Monorepo is not a plugin. Don't try to use it as one. See the Jetpack Monorepo documentation for instructions on correctly installing Jetpack. * Author: Autom...
tools/get-wp-version.php
<?php /** * Script to be directly executed to output the latest version of WP. * * @package automattic/jetpack */ $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, 'https://api.wordpress.org/core/version-check/1.7/' ); // Set so curl_exec returns the result instead of outputting it. curl_setopt( $ch, CURLOPT_RETU...
tools/check-changelogger-use.php
#!/usr/bin/env php <?php /** * Tool to list whether projects have been touched so as to need a changelog entry. * * @package automattic/jetpack */ // phpcs:disable WordPress.WP.GlobalVariablesOverride chdir( __DIR__ . '/../' ); /** * Display usage information and exit. */ function usage() { global $argv; ech...
tools/class-jetpack-phpcs-exclude-filter.php
<?php /** * Filter for PHPCS to exclude files in bin/phpcs-excludelist.json. * * @package automattic/jetpack */ use PHP_CodeSniffer\Files\LocalFile; use PHP_CodeSniffer\Util; /** * Filter for PHPCS to exclude files in bin/phpcs-excludelist.json. */ class Jetpack_Phpcs_Exclude_Filter extends Automattic\Jetpack\P...
tools/docker/config/wp-tests-config.php
<?php /** * A wp-config for testing. * * @package automattic/jetpack */ /* Path to the WordPress codebase you'd like to test. Add a forward slash in the end. */ define( 'ABSPATH', '/var/www/html/' ); /* * Path to the theme to test with. * * The 'default' theme is symlinked from test/phpunit/data/themedir1/defa...
tools/docker/mu-plugins/offline-mode-force-wpcom-disconnect.php
<?php /** * Plugin Name: Force WPCOM disconnect in Offline Mode * Description: Connection package will skip disconnect on WPCOM in Offline Mode. Due to Monorepo's `DOCKER_REQUEST_URL` trick, we need this plugin to properly detect offline mode in CLI. * Version: 1.0 * Author: Automattic * Author URI: https://automa...
tools/docker/mu-plugins/01-monorepo.php
<?php /** * Plugin Name: Monorepo Helper * Description: A common place for monorepo things. * Version: 1.0 * Author: Automattic * Author URI: https://automattic.com/ * Text Domain: jetpack * * @package automattic/jetpack */ namespace Jetpack\Docker\MuPlugin; /** * Monorepo Tools. */ class Monorepo { /** ...
tools/docker/mu-plugins/fix-monorepo-plugins-url.php
<?php /** * Plugin Name: Fix monorepo plugins_url * Description: In the Jetpack Docker dev environment, plugins_url fails for packages becuase the symlinks from vendor cause it to be unable to find the "plugin" that the URL is supposed to be relative to. * Version: 1.0 * Author: Automattic * Author URI: https://au...
tools/docker/mu-plugins/debug.php
<?php /** * Plugin Name: Automattic Debug Helpers * Description: <code>l( 'Code is Poetry' )</code> * Version: 1.0 * Author: Automattic * Author URI: https://automattic.com/ * Text Domain: jetpack * * @package automattic/jetpack */ // phpcs:disable WordPress.PHP.DevelopmentFunctions /** * Sweet error loggin...
tools/docker/mu-plugins/avoid-plugin-deletion.php
<?php /** * Plugin Name: Disable deleting and updating Jetpack * Description: Disable deleting and updating -actions for Jetpack plugin. Being able to delete your local development directory from WordPress is catastrophic and you can lose your git history in the process. * Version: 2.0 * Author: Automattic * Autho...
tools/e2e-commons/plugins/e2e-beta-autoupdate-api.php
<?php /** * Plugin Name: E2E Jetpack Beta Autoupdate API * Plugin URI: https://github.com/automattic/jetpack * Author: Jetpack Team * Version: 1.0.0 * Text Domain: jetpack * * @package automattic/jetpack */ // Check that the file is not accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } use Automatti...
tools/e2e-commons/plugins/e2e-waf-data-interceptor.php
<?php /** * Plugin Name: Jetpack E2E waf data interceptor * Plugin URI: https://github.com/automattic/jetpack * Author: Jetpack Team * Version: 1.0.0 * Text Domain: jetpack * * @package automattic/jetpack */ add_filter( 'pre_http_request', 'e2e_intercept_waf_data_request', 1, 3 ); /** * Intercept WPCOM waf d...
tools/e2e-commons/plugins/e2e-plan-data-interceptor.php
<?php /** * Plugin Name: Jetpack E2E plan data interceptor * Plugin URI: https://github.com/automattic/jetpack * Author: Jetpack Team * Version: 1.0.0 * Text Domain: jetpack * * @package automattic/jetpack */ add_filter( 'pre_http_request', 'e2e_intercept_plan_data_request', 1, 3 ); /** * Intercept WPCOM pla...
tools/e2e-commons/plugins/e2e-search-test-helper.php
<?php /** * Plugin Name: Jetpack Search E2E Helper * Plugin URI: https://github.com/automattic/jetpack * Author: Jetpack Team * Version: 1.0.0 * Text Domain: jetpack * * @package automattic/jetpack */ add_filter( 'pre_http_request', 'e2e_jetpack_search_intercept_plan_data_request', 3, 3 ); add_action( 'wp_foot...
tools/e2e-commons/plugins/e2e-wpcom-request-interceptor.php
<?php /** * Plugin Name: WPCOM Request Tracker * Plugin URI: https://github.com/automattic/jetpack * Author: Jetpack Team * Version: 1.0.0 * Text Domain: jetpack * * @package automattic/jetpack */ add_filter( 'pre_http_request', 'e2e_intercept_wpcom_request', -999, 3 ); /** * Intercept WPCOM request. * * @...
tools/e2e-commons/plugins/e2e-plugin-updater.php
<?php /** * Plugin Name: Jetpack E2E plugin updater * Plugin URI: https://github.com/automattic/jetpack * Author: Jetpack Team * Version: 1.0.0 * Text Domain: jetpack * * @package automattic/jetpack */ add_filter( 'site_transient_update_plugins', 'e2e_set_jetpack_update', 10, 1 ); /** * Injects new available...
tools/cli/skeletons/plugins/plugin.php
<?php /** * * Plugin Name: TBD * Plugin URI: TBD * Description: TBD * Version: 1.0.0-alpha * Author: Automattic * Author URI: https://jetpack.com/ * License: GPLv2 or later * Text Domain: jetpack * * @package automattic/TBD */ // Code some good stuff!
tools/cli/skeletons/plugins/tests/php/bootstrap.php
<?php /** * Bootstrap. * * @package automattic/ */ /** * Include the composer autoloader. */ require_once __DIR__ . '/../../vendor/autoload.php';
tools/cli/skeletons/plugins/src/example.php
<?php /** * Put your classes in this `src` folder! * * @package automattic/PACKAGE-NAME */ // Start your code here!
tools/cli/skeletons/packages/tests/php/bootstrap.php
<?php /** * Bootstrap. * * @package automattic/ */ /** * Include the composer autoloader. */ require_once __DIR__ . '/../../vendor/autoload.php';
tools/cli/skeletons/packages/src/class-example.php
<?php /** * Package description here * * @package automattic/package-name */ namespace Automattic\Jetpack; /** * Class description. */ class Package_Name { const PACKAGE_VERSION = '1.0.0-alpha'; }
tools/cli/helpers/doc-parser/runner.php
<?php /** * A runner file that is used by Jetpack CLI to start the parsing process. * * @package automattic/jetpack-doc-parser */ use Michelf\Markdown; /** * Loading the autoloader and starting the process. */ require __DIR__ . '/vendor/autoload.php'; $args = array_slice( $argv, 1 ); $parser = new \Automatti...
tools/cli/helpers/doc-parser/src/class-doc-parser.php
<?php /** * Package description here * * @package automattic/jetpack-doc-parser */ namespace Automattic\Jetpack; /** * Converts PHPDoc markup into a template ready for import to a WordPress blog. */ class Doc_Parser { const PACKAGE_VERSION = '0.1.0-alpha'; /** * Generate a JSON file containing the PHPDoc ...
projects/plugins/beta/jetpack-beta.php
<?php /** * Plugin Name: Jetpack Beta Tester * Plugin URI: https://jetpack.com/beta/ * Description: Use the Beta plugin to get a sneak peek at new features and test them on your site. * Version: 4.0.1-alpha * Author: Automattic * Author URI: https://jetpack.com/ * Update URI: https://jetpack.com/download-jetpack...
projects/plugins/beta/src/class-clicommand.php
<?php /** * Jetpack Beta Tester CLI controls * * @package automattic/jetpack-beta */ namespace Automattic\JetpackBeta; use WP_CLI; use WP_CLI_Command; if ( ! class_exists( 'WP_CLI_Command' ) ) { return; } /** * Control your local Jetpack Beta Tester plugin. */ class CliCommand extends WP_CLI_Command { /** ...
projects/plugins/beta/src/class-utils.php
<?php /** * Utilities class file for the Jetpack Beta plugin. * * @package automattic/jetpack-beta */ namespace Automattic\JetpackBeta; /** * Utilities class file for the Jetpack Beta plugin. */ class Utils { /** * Normalize a branch name. * * @param string $branch Branch name. * @return string Normal...
projects/plugins/beta/src/class-admin.php
<?php /** * Handles the Jetpack Admin functions. * * @package automattic/jetpack-beta */ namespace Automattic\JetpackBeta; use Automattic\Jetpack\Admin_UI\Admin_Menu; /** * Handles the Jetpack Beta plugin Admin functions. */ class Admin { /** * Admin page hook name. * * @var string|false */ private ...
projects/plugins/beta/src/class-autoupdateself.php
<?php /** * Allow the Jetpack Beta plugin to autoupdate itself. * * @package automattic/jetpack-beta */ namespace Automattic\JetpackBeta; use Composer\Semver\Comparator as Semver; use WP_Error; /** * Allow the Jetpack Beta plugin to autoupdate itself. * * This registers some hooks in its constructor to point ...
projects/plugins/beta/src/class-plugindataexception.php
<?php /** * Exception thrown when plugin data cannot be loaded. * * @package automattic/jetpack-beta */ namespace Automattic\JetpackBeta; use RuntimeException; /** * Exception thrown when plugin data cannot be loaded. */ class PluginDataException extends RuntimeException { }
projects/plugins/beta/src/class-plugin.php
<?php /** * The Plugin class handles all the stuff that varies between different plugins. * * @package automattic/jetpack-beta */ namespace Automattic\JetpackBeta; use Composer\Semver\Comparator as Semver; use InvalidArgumentException; use Plugin_Upgrader; use WP_Ajax_Upgrader_Skin; use WP_Error; /** * The Plug...
projects/plugins/beta/src/class-parsedownext.php
<?php /** * Extension for Parsedown. * * @package automattic/jetpack-beta */ // phpcs:disable WordPress.NamingConventions.ValidVariableName namespace Automattic\JetpackBeta; use Parsedown; /** * Extension for Parsedown. * * Adds linking of GitHub PRs. */ class ParsedownExt extends Parsedown { /** * Form...
projects/plugins/beta/src/class-hooks.php
<?php /** * Hooks class class file for the Jetpack Beta plugin. * * @package automattic/jetpack-beta */ namespace Automattic\JetpackBeta; use Jetpack; use Language_Pack_Upgrader; use Plugin_Upgrader; use WP_Ajax_Upgrader_Skin; use WP_Error; /** * Hooks class class file for the Jetpack Beta plugin. */ class Hoo...
projects/plugins/beta/src/admin/show-needed-updates.template.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * Jetpack Beta wp-admin template to show needed updates. * * @package automattic/jetpack-beta */ use Automattic\JetpackBeta\Plugin; use Automattic\JetpackBeta\Utils; // Check that the file is not accessed directly. if ( ! defined( 'ABSPATH'...
projects/plugins/beta/src/admin/exception.template.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * Template to display an exception. * * @package automattic/jetpack-beta */ // Check that the file is not accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } // @global Exception $exception Exception to display. if ( ! isset( $excep...
projects/plugins/beta/src/admin/plugin-select.template.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * Jetpack Beta wp-admin page to select a plugin to manage. * * @package automattic/jetpack-beta */ use Automattic\JetpackBeta\Plugin; use Automattic\JetpackBeta\Utils; // Check that the file is not accessed directly. if ( ! defined( 'ABSPAT...
projects/plugins/beta/src/admin/toggles.template.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * Jetpack Beta wp-admin page toggles template. * * @package automattic/jetpack-beta */ use Automattic\JetpackBeta\Admin; // Check that the file is not accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } ?> <span class="dops-foldab...
projects/plugins/beta/src/admin/plugin-manage.template.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * Jetpack Beta wp-admin manage page contents. * * @package automattic/jetpack-beta */ use Automattic\JetpackBeta\Admin; use Automattic\JetpackBeta\Utils; use Composer\Semver\Semver; // Check that the file is not accessed directly. if ( ! de...
projects/plugins/beta/src/admin/header.template.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * Jetpack Beta wp-admin page header. * * @package automattic/jetpack-beta */ use Automattic\JetpackBeta\Utils; // Check that the file is not accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } ?> <div class="jetpack-beta__bleeding-...
projects/plugins/beta/src/admin/notice.template.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * Jetpack Beta wp-admin page notice. * * @package automattic/jetpack-beta */ use Automattic\JetpackBeta\Utils; // Check that the file is not accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } global $current_screen; // ----------...
projects/plugins/beta/src/admin/branch-card.template.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * Template to display a branch card. * * @package automattic/jetpack-beta */ use Automattic\JetpackBeta\Utils; // Check that the file is not accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } // @global \Automattic\JetpackBeta\Plu...
projects/plugins/videopress/jetpack-videopress.php
<?php /** * * Plugin Name: Jetpack VideoPress * Plugin URI: https://wordpress.org/plugins/jetpack-videopress * Description: High quality, ad-free video. * Version: 1.8-alpha * Author: Automattic - Jetpack Video team * Author URI: https://jetpack.com/videopress/ * License: GPLv2 or later * Text Domain: jetpack-...
projects/plugins/videopress/tests/php/bootstrap.php
<?php /** * Bootstrap. * * @package automattic/ */ /** * Include the composer autoloader. */ require_once __DIR__ . '/../../vendor/autoload.php';
projects/plugins/videopress/src/class-jetpack-videopress-plugin.php
<?php /** * Primary class file for the Jetpack VideoPress plugin. * * @package automattic/jetpack-videopress-plugin-plugin */ if ( ! defined( 'ABSPATH' ) ) { exit; } use Automattic\Jetpack\Connection\Manager as Connection_Manager; use Automattic\Jetpack\Connection\Rest_Authentication as Connection_Rest_Authentic...
projects/plugins/inspect/functions.php
<?php use Automattic\Jetpack\Connection\Client; function jetpack_inspect_default_args( $args = array() ) { $defaults = array( 'method' => 'GET', 'body' => null, 'headers' => array(), ); return wp_parse_args( $args, $defaults ); } function jetpack_inspect_connection_request( $url, $args = array() ) { ...
projects/plugins/inspect/options.php
<?php use Automattic\Jetpack\Packages\Async_Option\Async_Option; use Automattic\Jetpack\Packages\Async_Option\Async_Options; use Automattic\Jetpack\Packages\Async_Option\Registry; use Automattic\Jetpack_Inspect\Options\Monitor_Status; use Automattic\Jetpack_Inspect\Options\Observer_Settings; /** * Functions to make ...
projects/plugins/inspect/jetpack-inspect.php
<?php /** * Jetpack Inspect plugin * * @link https://automattic.com * @since 0.1.0 * * @wordpress-plugin * Plugin Name: Jetpack Inspect * Version: 0.1.0-alpha * Plugin URI: https://automattic.com * Description: Inspect HTTP incoming and outgoing requests and responses. * Author: pyro...
projects/plugins/inspect/app/Monitors.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName namespace Automattic\Jetpack_Inspect; use Automattic\Jetpack_Inspect\Monitor\Incoming_REST_API; use Automattic\Jetpack_Inspect\Monitor\Outgoing; /** * The Monitors class. */ class Monitors { const AVAILABLE_OBSERVERS = array( 'outgoing' => Outg...
projects/plugins/inspect/app/Monitor.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName namespace Automattic\Jetpack_Inspect; use Automattic\Jetpack\Packages\Async_Option\Async_Option; use Automattic\Jetpack_Inspect\Monitor\Observable; /** * The Monitor class. */ class Monitor { /** * The observable object. * * @var Observabl...
projects/plugins/inspect/app/Admin_Page.php
<?php namespace Automattic\Jetpack_Inspect; class Admin_Page { public function enqueue() { wp_enqueue_script( 'jetpack-inspect-main', plugins_url( '../app-ui/build/jetpack-inspect.js', __FILE__ ), array(), '1.0.0', true ); wp_enqueue_style( 'jetpack-inspect-css', plugins_url( '../app-ui/build/jetpack-inspect.css...
projects/plugins/inspect/app/Log.php
<?php namespace Automattic\Jetpack_Inspect; class Log { const POST_TYPE_NAME = 'jetpack_inspect_log'; /** * Static initialization. */ public static function register_post_type() { // Check if post type already registered. if ( post_type_exists( static::POST_TYPE_NAME ) ) { return; } register_pos...
projects/plugins/inspect/app/Options/Monitor_Status.php
<?php namespace Automattic\Jetpack_Inspect\Options; use Automattic\Jetpack\Packages\Async_Option\Async_Option_Template; class Monitor_Status extends Async_Option_Template { /** * @param $value * * @return bool */ public function sanitize( $value ) { return (bool) $value; } public function validate( $...
projects/plugins/inspect/app/Options/Observer_Settings.php
<?php namespace Automattic\Jetpack_Inspect\Options; use Automattic\Jetpack\Packages\Async_Option\Async_Option_Template; class Observer_Settings extends Async_Option_Template { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase public static $DEFAULT_VALUE = array( 'enabled' => tr...
projects/plugins/inspect/app/Monitor/Outgoing.php
<?php namespace Automattic\Jetpack_Inspect\Monitor; class Outgoing implements Observable { private $start_time = array(); private $logs = array(); public function attach_hooks() { add_filter( 'http_request_args', array( $this, 'start_timer' ), 10, 2 ); add_action( 'http_api_debug', array( $this, 'log' )...
projects/plugins/inspect/app/Monitor/Observable.php
<?php namespace Automattic\Jetpack_Inspect\Monitor; interface Observable { public function attach_hooks(); public function detach_hooks(); public function get(); }
projects/plugins/inspect/app/Monitor/Incoming_REST_API.php
<?php namespace Automattic\Jetpack_Inspect\Monitor; class Incoming_REST_API implements Observable { private $logs = array(); public function attach_hooks() { add_action( 'rest_request_after_callbacks', array( $this, 'log' ), 10, 3 ); } public function detach_hooks() { remove_action( 'rest_request_after_call...
projects/plugins/inspect/app/REST_API/REST_API.php
<?php namespace Automattic\Jetpack_Inspect\REST_API; use Automattic\Jetpack_Inspect\REST_API\Contracts\Endpoint; class REST_API { /** * @var Route[] */ protected $routes = array(); /** * @param Endpoint[] $routes */ public function __construct( $routes ) { foreach ( $routes as $route_class ) { $th...
projects/plugins/inspect/app/REST_API/Route.php
<?php namespace Automattic\Jetpack_Inspect\REST_API; class Route { /** * @var \Automattic\Jetpack_Inspect\REST_API\Contracts\Endpoint */ protected $endpoint; protected $permissions; public function __construct( $endpoint ) { $this->endpoint = new $endpoint(); $this->permissions = $this->endpoint->pe...
projects/plugins/inspect/app/REST_API/Endpoints/Clear.php
<?php /** * Create a new request for cloud critical CSS. * * Handler for POST 'cloud-css/request-generate'. */ namespace Automattic\Jetpack_Inspect\REST_API\Endpoints; use Automattic\Jetpack_Inspect\Log; use Automattic\Jetpack_Inspect\REST_API\Contracts\Endpoint; use Automattic\Jetpack_Inspect\REST_API\Permissions...
projects/plugins/inspect/app/REST_API/Endpoints/Send_Request.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName namespace Automattic\Jetpack_Inspect\REST_API\Endpoints; use Automattic\Jetpack_Inspect\Monitors; use Automattic\Jetpack_Inspect\REST_API\Permissions\Current_User_Admin; use WP_REST_Server; /** * Request sender endpoint class. */ class Send_Reques...
projects/plugins/inspect/app/REST_API/Endpoints/Latest.php
<?php /** * Create a new request for cloud critical CSS. * * Handler for POST 'cloud-css/request-generate'. */ namespace Automattic\Jetpack_Inspect\REST_API\Endpoints; use Automattic\Jetpack_Inspect\Log; use Automattic\Jetpack_Inspect\REST_API\Contracts\Endpoint; use Automattic\Jetpack_Inspect\REST_API\Permission...
projects/plugins/inspect/app/REST_API/Endpoints/Test_Request.php
<?php /** * Create a new request for cloud critical CSS. * * Handler for POST 'cloud-css/request-generate'. */ namespace Automattic\Jetpack_Inspect\REST_API\Endpoints; use Automattic\Jetpack_Inspect\REST_API\Contracts\Endpoint; class Test_Request implements Endpoint { public function name() { return 'test-re...
projects/plugins/inspect/app/REST_API/Contracts/Has_Endpoints.php
<?php namespace Automattic\Jetpack_Inspect\REST_API\Contracts; interface Has_Endpoints { /** * @return Endpoint[] */ public function get_endpoints(); }
projects/plugins/inspect/app/REST_API/Contracts/Endpoint.php
<?php namespace Automattic\Jetpack_Inspect\REST_API\Contracts; interface Endpoint { public function name(); public function request_methods(); public function response( $request ); public function permissions(); }
projects/plugins/inspect/app/REST_API/Contracts/Permission.php
<?php namespace Automattic\Jetpack_Inspect\REST_API\Contracts; /** * API Endpoints have permissions that are checked by WordPress on `permission_callback`. * * These permissions repeat themselves, for example: * * current_user_can * * wp_verify_nonce * * And in the case of nonces - they also need to interact...
projects/plugins/inspect/app/REST_API/Permissions/Nonce.php
<?php namespace Automattic\Jetpack_Inspect\REST_API\Permissions; use Automattic\Jetpack_Inspect\REST_API\Contracts\Permission; /** * Nonces are tricky in REST. * * `rest_api_init` action is only tirggered when visiting an URL that looks like a REST Endpoint. * This means that if nonces are generated there, they...
projects/plugins/inspect/app/REST_API/Permissions/Current_User_Admin.php
<?php namespace Automattic\Jetpack_Inspect\REST_API\Permissions; use Automattic\Jetpack_Inspect\REST_API\Contracts\Permission; class Current_User_Admin implements Permission { // $request is required to adhere to the contract. //phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable public f...
projects/plugins/inspect/tests/php/bootstrap.php
<?php /** * Bootstrap. * * @package automattic/ */ /** * Include the composer autoloader. */ require_once __DIR__ . '/../../vendor/autoload.php';
projects/plugins/inspect/packages/Async_Option/Registry.php
<?php namespace Automattic\Jetpack\Packages\Async_Option; class Registry { /** * @var Registry[] */ private static $instance = array(); /** * @var Async_Option[] */ private $options = array(); /** * @var Endpoint[] */ private $endpoints = array(); /** * @var string */ private $namespace; ...
projects/plugins/inspect/packages/Async_Option/Async_Option_Template.php
<?php namespace Automattic\Jetpack\Packages\Async_Option; use Automattic\Jetpack\Packages\Async_Option\Storage\Storage; use Automattic\Jetpack\Packages\Async_Option\Storage\WP_Option; /** * Any registered async option should use this async option template * and extend the methods that are necessary. */ abstract c...
projects/plugins/inspect/packages/Async_Option/Async_Option.php
<?php namespace Automattic\Jetpack\Packages\Async_Option; use Automattic\Jetpack\Packages\Async_Option\Storage\Storage; class Async_Option { /** * @var string */ private $key; /** * @var Storage */ protected $storage; /** * @var Async_Option_Template */ protected $option; /** * @param $names...
projects/plugins/inspect/packages/Async_Option/Endpoint.php
<?php namespace Automattic\Jetpack\Packages\Async_Option; class Endpoint { /** * @var Async_Option $option */ private $option; /** * @var string $rest_namespace */ private $rest_namespace; /** * @var string $route */ private $route; /** * @var Authenticated_Nonce */ private $nonce; /** ...
projects/plugins/inspect/packages/Async_Option/Async_Options.php
<?php namespace Automattic\Jetpack\Packages\Async_Option; class Async_Options { /** * @var Registry */ protected $registry; /** * @var string Script Handle name to pass the variables to. */ protected $script_handle; public function __construct( $script_handle, Registry $registry ) { $this->script_han...
projects/plugins/inspect/packages/Async_Option/Authenticated_Nonce.php
<?php namespace Automattic\Jetpack\Packages\Async_Option; class Authenticated_Nonce { /** * @var string Nonce key */ private $key; public function __construct( $key ) { $this->key = $key; } public function create() { if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! did_action( 'set_current_user' ) ) { ...
projects/plugins/inspect/packages/Async_Option/Storage/WP_Option.php
<?php namespace Automattic\Jetpack\Packages\Async_Option\Storage; class WP_Option implements Storage { public function __construct( $namepsace ) { $this->namespace = $namepsace; } public function get( $key, $default = false ) { return get_option( $this->key( $key ), $default ); } public function set( $key...
projects/plugins/inspect/packages/Async_Option/Storage/Storage.php
<?php namespace Automattic\Jetpack\Packages\Async_Option\Storage; interface Storage { public function get( $key ); public function set( $key, $value ); public function delete( $key ); }
projects/plugins/boost/index.php
<?php //phpcs:ignoreFile /** * Empty file. */ // Silence is golden.
projects/plugins/boost/wp-js-data-sync.php
<?php use Automattic\Jetpack\WP_JS_Data_Sync\Contracts\Data_Sync_Entry; use Automattic\Jetpack\WP_JS_Data_Sync\Data_Sync; use Automattic\Jetpack\WP_JS_Data_Sync\Data_Sync_Readonly; use Automattic\Jetpack\WP_JS_Data_Sync\Schema\Schema; use Automattic\Jetpack_Boost\Data_Sync\Critical_CSS_Meta_Entry; use Automattic\Jetpa...
projects/plugins/boost/serve-minified-content.php
<?php if ( ! defined( 'JETPACK_BOOST_CONCAT_USE_WP' ) ) { define( 'JETPACK_BOOST_CONCAT_USE_WP', false ); // Load CSSmin. require_once __DIR__ . '/vendor/tubalmartin/cssmin/src/Colors.php'; require_once __DIR__ . '/vendor/tubalmartin/cssmin/src/Utils.php'; require_once __DIR__ . '/vendor/tubalmartin/cssmin/src/M...
projects/plugins/boost/jetpack-boost.php
<?php /** * Jetpack Boost Plugin * * @link https://automattic.com * @since 0.1.0 * * @wordpress-plugin * Plugin Name: Jetpack Boost * Plugin URI: https://jetpack.com/boost * Description: Boost your WordPress site's performance, from the creators of Jetpack * Version...
projects/plugins/boost/compatibility/yoast.php
<?php /** * Yoast SEO compatibility for Boost * * @package automattic/jetpack-boost */ namespace Automattic\Jetpack_Boost\Compatibility\Yoast; // Add the Critical CSS generation query arg to Yoast's allowed query args list. // This prevents Yoast from removing the query arg, which breaks Critical CSS generation. ...
projects/plugins/boost/compatibility/web-stories.php
<?php /** * Compatibility for Web Stories * * @package automattic/jetpack-boost */ namespace Automattic\Jetpack_Boost\Compatibility\Web_Stories; /** * Exclude Web Stories pages to be processed by the Render Blocking JS module. * * @param bool $should_defer_js default filter value. */ function web_stories_shou...
projects/plugins/boost/compatibility/page-optimize.php
<?php /** * Compatibility file for Page Optimize. * * This will synchronize the settings from Page Optimize to Jetpack Boost. * It will also disable the Page Optimize functionality. * * @package automattic/jetpack-boost */ if ( function_exists( 'page_optimize_js_default' ) ) { $page_optimize_js_concatenate = (...
projects/plugins/boost/compatibility/woocommerce.php
<?php /** * Compatibility functions for WooCommerce * * @package automattic/jetpack-boost */ namespace Automattic\Jetpack_Boost\Compatibility\Woocommerce; /** * Exclude special Woocommerce pages from standard "single page" Critical CSS. * * @param object $args the query args. */ function exclude_woocommerce_p...
projects/plugins/boost/compatibility/wp-super-cache.php
<?php /** * Super Cache compatibility for Boost * * @package automattic/jetpack-boost */ namespace Automattic\Jetpack_Boost\Compatibility\Super_Cache; use Automattic\Jetpack_Boost\Contracts\Changes_Page_Output; use Automattic\Jetpack_Boost\Modules\Modules_Index; /** * Add WP Super Cache bypass query param to th...
projects/plugins/boost/compatibility/amp.php
<?php /** * Compatibility for AMP. * * @package automattic/jetpack-boost */ namespace Automattic\Jetpack_Boost\Compatibility\Amp; use Automattic\Jetpack_Boost\Modules\Optimizations\Critical_CSS\CriticalCSS; /** * Class AMP. */ class Amp { /** * CriticalCSS module instance. * * @var CriticalCSS */ pri...
projects/plugins/boost/compatibility/boost-1.3.1.php
<?php /** * Seamlessly migrate to the new options format. Even if no admin hooks are fired as the plugin is updated, * the visitor will never notice a difference, because we'll use the old options in the background. */ function jetpack_boost_131_option_fallback( $default, $option ) { $old_config = get_option( 'jetp...
projects/plugins/boost/compatibility/aioseo.php
<?php /** * All in One SEO compatibility for Boost * * @package automattic/jetpack-boost */ namespace Automattic\Jetpack_Boost\Compatibility\AIOSEO; // Add the Critical CSS generation query arg to the list of allowed query args of All in One SEO. // This prevents All in One SEO from removing the query arg, which ...
projects/plugins/boost/compatibility/jetpack.php
<?php /** * Jetpack compatibility for Boost * * @package automattic/jetpack-boost */ namespace Automattic\Jetpack_Boost\Compatibility\Jetpack; require_once __DIR__ . '/lib/class-sync-jetpack-module-status.php'; ( new Sync_Jetpack_Module_Status( 'image_cdn', 'photon' ) )->init(); /** * Exclude Jetpack likes scr...
projects/plugins/boost/compatibility/elementor.php
<?php /** * Compatibility functions for Elementor * * @package automattic/jetpack-boost */ namespace Automattic\Jetpack_Boost\Compatibility\Elementor; use Elementor\TemplateLibrary\Source_Local; /** * Exclude Elementor Library custom post type from the list of post types to get urls from. * * @param array $po...
projects/plugins/boost/compatibility/score-prompt.php
<?php /** * Compatibility file for old way of storing dismissed score prompt. * * @package automattic/jetpack-boost */ // Old value is the previous DS key, fallback to even older non-ds value. $old_value = (array) get_option( 'jetpack_boost_ds_dismissed_score_prompt', get_option( 'jb_show_score_prompt' ) ); if ( fa...
projects/plugins/boost/compatibility/lib/class-sync-jetpack-module-status.php
<?php namespace Automattic\Jetpack_Boost\Compatibility\Jetpack; /** * Class that handles the sync of Jetpack module status to Boost module status. */ class Sync_Jetpack_Module_Status { /** Slug of the Jetpack module */ public $jetpack_module_slug; /** Slug of the Boost module */ public $boost_module_slug; pu...
projects/plugins/boost/app/class-jetpack-boost.php
<?php /** * The file that defines the core plugin class * * A class definition that includes attributes and functions used across both the * public-facing side of the site and the admin area. * * @link https://automattic.com * @since 1.0.0 * @package automattic/jetpack-boost */ namespace Automat...
projects/plugins/boost/app/contracts/Has_Slug.php
<?php namespace Automattic\Jetpack_Boost\Contracts; interface Has_Slug { public static function get_slug(); }
projects/plugins/boost/app/contracts/Has_Activate.php
<?php namespace Automattic\Jetpack_Boost\Contracts; interface Has_Activate { public static function activate(); }
projects/plugins/boost/app/contracts/Changes_Output.php
<?php namespace Automattic\Jetpack_Boost\Contracts; /** * Modules can implement this interface to indicate that they change the HTML output for the site visitor. */ interface Changes_Page_Output {}
projects/plugins/boost/app/contracts/Is_Always_On.php
<?php namespace Automattic\Jetpack_Boost\Contracts; /** * Modules can implement this interface to indicate that they are always on if available. */ interface Is_Always_On {}
projects/plugins/boost/app/contracts/Pluggable.php
<?php namespace Automattic\Jetpack_Boost\Contracts; /** * Every plugin feature that's large enough * to need setup also needs a slug */ interface Pluggable extends Has_Setup, Has_Slug { /** * Whether the feature is available for use. * Use this to check for feature flags, etc. * @return bool */ public st...
projects/plugins/boost/app/contracts/Has_Setup.php
<?php namespace Automattic\Jetpack_Boost\Contracts; /** * A class that has a setup step that's supposed to be executed only once. */ interface Has_Setup { /** * This class has a setup method that should be * run only once per the request lifecycle. * * This is a good place to attach hooks * or perform o...
projects/plugins/boost/app/contracts/Has_Deactivate.php
<?php namespace Automattic\Jetpack_Boost\Contracts; interface Has_Deactivate { public static function deactivate(); }
projects/plugins/boost/app/features/setup-prompt/Setup_Prompt.php
<?php /** * Prompt the user to setup Jetpack Boost. * DEPRECATED in v2.3.1 */ namespace Automattic\Jetpack_Boost\Features\Setup_Prompt; use Automattic\Jetpack_Boost\Contracts\Has_Setup; use Automattic\Jetpack_Boost\Data_Sync\Getting_Started_Entry; class Setup_Prompt implements Has_Setup { const NONCE_ACTION = '...