filename stringlengths 11 137 | content stringlengths 6 292k |
|---|---|
projects/plugins/migration/tests/php/bootstrap.php | <?php
/**
* Bootstrap.
*
* @package automattic/
*/
/**
* Include the composer autoloader.
*/
require_once __DIR__ . '/../../vendor/autoload.php';
|
projects/plugins/migration/src/class-wpcom-migration.php | <?php
/**
* Primary class file for the Move to WordPress.com plugin.
*
* @package automattic/wpcom-migration-plugin
*/
namespace Automattic\Jetpack\Migration;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
use Automattic\Jetpack\Assets;
use Automattic\Jetpack\Backup\V0003\Jetpack_Backup;
use Automattic\Jetpack\Connect... |
projects/plugins/migration/src/class-rest-controller.php | <?php
/**
* REST API Endpoints
*
* @package automattic/wpcom-migration-plugin
*/
namespace Automattic\Jetpack\Migration;
use Automattic\Jetpack\Connection\Client;
/**
* Makes REST API Endpoints for Migration
*
* @package Automattic\Jetpack\Migration
*/
class REST_Controller {
/**
* Constructor.
*/
pub... |
projects/packages/blocks/tests/php/test-blocks.php | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
* Test methods from Automattic\Jetpack\Blocks
*
* @since 9.0.0
*
* @package automattic/jetpack-blocks
*/
namespace Automattic\Jetpack;
use Automattic\Jetpack\Constants as Jetpack_Constants;
use Brain\Monkey;
use PHPUnit\Framework\TestCase;
... |
projects/packages/blocks/tests/php/bootstrap.php | <?php
/**
* PHPUnit bootstrap file.
*
* @package automattic/jetpack-blocks
*/
/**
* Load the composer autoloader.
*/
require_once __DIR__ . '/../../vendor/autoload.php';
/**
* Load WorDBless
*/
\WorDBless\Load::load();
|
projects/packages/blocks/src/class-blocks.php | <?php
/** Blocks package.
*
* @since 1.1.0
*
* This package lifts elements from Jetpack's Jetpack_Gutenberg class.
* It is now an standalone package reusable outside Jetpack.
*
* @package automattic/jetpack-blocks
*/
namespace Automattic\Jetpack;
use Automattic\Jetpack\Constants as Jetpack_Constants;
use Jetp... |
projects/packages/plugin-deactivation/tests/php/bootstrap.php | <?php
/**
* Bootstrap.
*
* @package automattic/
*/
/**
* Include the composer autoloader.
*/
require_once __DIR__ . '/../../vendor/autoload.php';
|
projects/packages/plugin-deactivation/src/dialog-template.php | <?php
/**
* Reference template file for deactivation handler dialog.
*
* This file is not used directly. Copy this file to your plugin and modify it to suit your needs.
*
* @package automattic/jetpack-plugin-deactivation
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<main class="jp-... |
projects/packages/plugin-deactivation/src/class-deactivation-handler.php | <?php
/**
* Intercept deactivation of plugins.
*
* @package automattic/jetpack-plugin-deactivation
*/
namespace Automattic\Jetpack\Plugin_Deactivation;
use Automattic\Jetpack\Assets;
/**
* Handles plugin deactivation.
*
* Instantiates the deactivation handler to intercept the deactivation of plugins.
*/
clas... |
projects/packages/options/legacy/class-jetpack-options.php | <?php // phpcs:ignore
/**
* Legacy Jetpack_Options class.
*
* @package automattic/jetpack-options
* @deprecated 1.15.3
* @see automattic/jetpack-connection
*/
require_once __DIR__ . '/../../jetpack-connection/legacy/class-jetpack-options.php';
|
projects/packages/jetpack-mu-wpcom/tests/php/bootstrap.php | <?php
/**
* Bootstrap.
*
* @package automattic/
*/
/**
* Include the composer autoloader.
*/
require_once __DIR__ . '/../../vendor/autoload.php';
\WorDBless\Load::load();
require_once __DIR__ . '/../lib/functions-wordpress.php';
require_once __DIR__ . '/../../src/class-jetpack-mu-wpcom.php';
Automattic\Jetpack... |
projects/packages/jetpack-mu-wpcom/tests/php/features/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-launchpad-test.php | <?php
/**
* Test class for WPCOM_REST_API_V2_Endpoint_Launchpad.
*
* @package automattic/jetpack-mu-wpcom
*/
//phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.NotAbsolutePath
require_once \Automattic\Jetpack\Jetpack_Mu_Wpcom::PKG_DIR . 'src/features/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-launchpad.p... |
projects/packages/jetpack-mu-wpcom/tests/php/features/block-patterns/class-wpcom-block-patterns-utils-test.php | <?php
/**
* Test class for Wpcom_Block_Patterns_Utils.
*
* @package automattic/jetpack-mu-wpcom
*/
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
use PHPUnit\Framework\TestCase;
require_once Jetpack_Mu_Wpcom::PKG_DIR . 'src/features/block-patterns/class-wpcom-block-patterns-utils.php';
/**
* Class Wpcom_Block_Pattern... |
projects/packages/jetpack-mu-wpcom/tests/php/features/block-patterns/class-wpcom-block-patterns-from-api-test.php | <?php
/**
* Test class for Wpcom_Block_Patterns_From_Api.
*
* @package automattic/jetpack-mu-wpcom
*/
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
use PHPUnit\Framework\TestCase;
require_once Jetpack_Mu_Wpcom::PKG_DIR . 'src/features/block-patterns/block-patterns.php';
require_once Jetpack_Mu_Wpcom::PKG_DIR . 'src/fe... |
projects/packages/jetpack-mu-wpcom/tests/php/features/launchpad/class-launchpad-task-list-validation-test.php | <?php
/**
* Test class for Launchpad_Task_Lists.
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Test class for Launchpad_Task_Lists.
*
* @coversDefaultClass Launchpad_Task_Lists
*/
class Launchpad_Task_List_Validation_Test extends \WorDBless\BaseTestCase {
/**
* Data provider for test_validate_task_list.... |
projects/packages/jetpack-mu-wpcom/tests/php/features/launchpad/class-launchpad-task-lists-test.php | <?php
/**
* Test class for Launchpad_Task_Lists.
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Test class for Launchpad_Task_Lists.
*
* @coversDefaultClass Launchpad_Task_Lists
*/
class Launchpad_Task_Lists_Test extends \WorDBless\BaseTestCase {
/**
* Set up.
*/
public function set_up() {
parent::s... |
projects/packages/jetpack-mu-wpcom/tests/php/features/launchpad/class-launchpad-wpcom-requests-test.php | <?php
/**
* Test class for requests to the WPCOM api.
*
* @package automattic/jetpack-mu-wpcom
*/
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
require_once Jetpack_Mu_Wpcom::PKG_DIR . '../status/src/class-visitor.php';
require_once __DIR__ . '/class-launchpad-jetpack-connection-client-mock.php';
/**
* Test class for... |
projects/packages/jetpack-mu-wpcom/tests/php/features/launchpad/class-launchpad-jetpack-connection-client-mock.php | <?php
/**
* Mocking Automattic\Jetpack\Connection\Client::wpcom_json_api_request_as_user
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Status and information regarding the site visitor.
*
* @package automattic/jetpack-status
*/
class Launchpad_Jetpack_Connection_Client_Mock {
/**
* Mocking Automattic\Je... |
projects/packages/jetpack-mu-wpcom/tests/php/features/launchpad/class-launchpad-task-definitions-test.php | <?php
/**
* Test class for Launchpad_Task_Lists.
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Test class for Launchpad_Task_Lists.
*
* @coversDefaultClass Launchpad_Task_Lists
*/
class Launchpad_Task_Definitions_Test extends \WorDBless\BaseTestCase {
/**
* Set up.
*/
public function set_up() {
par... |
projects/packages/jetpack-mu-wpcom/tests/php/features/verbum-comments/class-verbum-block-utils-test.php | <?php
/**
* Test class for Verbum_Block_Utils.
*
* @package automattic/jetpack-mu-wpcom
*/
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
require_once Jetpack_Mu_Wpcom::PKG_DIR . 'src/features/verbum-comments/assets/class-verbum-block-utils.php';
/**
* Test class for Verbum_Block_Utils.
*
* @coversDefaultClass Verbu... |
projects/packages/jetpack-mu-wpcom/tests/php/features/blog-privacy/class-blog-privacy-test.php | <?php
/**
* Blog Privacy Tests
*
* @package automattic/jetpack-mu-wpcom
*/
declare( strict_types = 1 );
namespace Automattic\Jetpack\Jetpack_Mu_Wpcom\Blog_Privacy;
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
require_once Jetpack_Mu_Wpcom::PKG_DIR . 'src/features/blog-privacy/blog-privacy.php';
/**
* Tests for th... |
projects/packages/jetpack-mu-wpcom/tests/php/features/coming-soon/class-coming-soon-test.php | <?php
/**
* Coming Soon Tests File
*
* @package full-site-editing-plugin
*/
namespace A8C\FSE\Coming_soon;
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
require_once Jetpack_Mu_Wpcom::PKG_DIR . 'src/features/coming-soon/coming-soon.php';
/**
* Class Coming_Soon_Test
*/
class Coming_Soon_Test extends \WorDBless\Bas... |
projects/packages/jetpack-mu-wpcom/tests/php/common/index-test.php | <?php
/**
* Common Test File
*
* @package automattic/jetpack-mu-wpcom
*/
use Automattic\Jetpack\Jetpack_Mu_Wpcom\Common;
use PHPUnit\Framework\TestCase;
/**
* Test Common class
*/
class CommonTest extends TestCase {
/**
* Test get_iso_639_locale()
*
* @param string $language Language to test.
* @param... |
projects/packages/jetpack-mu-wpcom/tests/lib/functions-wordpress.php | <?php
/**
* Functions that mock WordPress core functionality for testing purposes.
*
* @package automattic/jetpack-mu-wpcom
*/
if ( ! function_exists( 'add_blog_option' ) ) {
/**
* A drop-in for a WordPress core function.
*
* @param int $id A blog ID. Can be null to refer to the current blog.
* @pa... |
projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php | <?php
/**
* Enhances your site with features powered by WordPress.com
* This package is intended for internal use on WordPress.com sites only (simple and Atomic).
* Internal PT Reference: p9dueE-6jY-p2
*
* @package automattic/jetpack-mu-wpcom
*/
namespace Automattic\Jetpack;
/**
* Jetpack_Mu_Wpcom main class.
... |
projects/packages/jetpack-mu-wpcom/src/utils.php | <?php
/**
* Utility functions for jetpack-mu-wpcom.
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Helper function to return the site slug for Calypso URLs.
* The fallback logic here is derived from the following code:
*
* @see https://github.com/Automattic/wc-calypso-bridge/blob/85664e2c7836b2ddc29e99871ec... |
projects/packages/jetpack-mu-wpcom/src/features/block-theme-previews/block-theme-previews.php | <?php
/**
* Gutenberg's Block Theme Previews feature
*
* @package automattic/jetpack-mu-wpcom
*/
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
/**
* Always show the correct homepage when previewing a theme in the Site Editor
*
* @see https://github.com/Automattic/wp-calypso/issues/79221
* @since 12.4
*/
if ( ! f... |
projects/packages/jetpack-mu-wpcom/src/features/first-posts-stream/first-posts-stream-helpers.php | <?php
/**
* First posts stream helpers
*
* @package automattic/jetpack-mu-wpcom
* @since 4.11.0
*/
/**
* Adds the required options to the sync list for the First Posts Stream feature.
*
* @param array $allowed_options The allowed options.
*/
function register_first_posts_stream_options_sync( $allowed_options ... |
projects/packages/jetpack-mu-wpcom/src/features/error-reporting/error-reporting.php | <?php
/**
* Error reporting from wp-admin / Gutenberg context for Simple Sites and WoA.
*
* @package automattic/jetpack-mu-wpcom
*/
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
/**
* Whether the site is eligible for Error Reporting, which is a feature that's specific to WPCOM.
*
* By default, sites should not be e... |
projects/packages/jetpack-mu-wpcom/src/features/wpcom-site-menu/wpcom-site-menu.php | <?php
/**
* WordPress.com Site Menu
*
* Add's a WordPress.com menu item to the admin menu linking back to the sites WordPress.com home page.
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Add a WordPress.com menu item to the wp-admin sidebar menu.
*
* Of note, we need the $parent_slug so that we can link t... |
projects/packages/jetpack-mu-wpcom/src/features/100-year-plan/locked-mode.php | <?php
/**
* Locked Mode.
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Adds the action to limit capabilities for locked mode sites when the Locked Mode feature is available
* and the option enabled.
*/
function wpcom_lm_maybe_add_map_meta_cap_filter() {
// On REST API requests, wait until we switch to the ... |
projects/packages/jetpack-mu-wpcom/src/features/100-year-plan/enhanced-ownership.php | <?php
/**
* Enhanced Ownership
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Registers Enhanced Ownership settings.
*/
function wpcom_eo_register_settings() {
if ( ! wpcom_site_has_feature( WPCOM_Features::LEGACY_CONTACT ) ) {
return;
}
register_setting(
'general',
'wpcom_legacy_contact',
array(
... |
projects/packages/jetpack-mu-wpcom/src/features/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-launchpad-navigator.php | <?php
/**
* Launchpad API endpoint
*
* @package automattic/jetpack-mu-wpcom
* @since 4.9.0
*/
/**
* Fetches Launchpad Navigator-related data for the site.
*
* @since 4.9.0
*/
class WPCOM_REST_API_V2_Endpoint_Launchpad_Navigator extends WP_REST_Controller {
/**
* Class constructor
*/
public function __c... |
projects/packages/jetpack-mu-wpcom/src/features/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-launchpad.php | <?php
/**
* Launchpad API endpoint
*
* @package automattic/jetpack-mu-wpcom
* @since 1.1.0
*/
/**
* Fetches Launchpad-related data for the site.
*
* @since 1.1.0
*/
class WPCOM_REST_API_V2_Endpoint_Launchpad extends WP_REST_Controller {
/**
* Class constructor
*/
public function __construct() {
$this... |
projects/packages/jetpack-mu-wpcom/src/features/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-site-migration-migrate-guru-key.php | <?php
/**
* Allow us to access the Migrate Guru site migration key via API.
*
* @package automattic/jetpack
*/
/**
* WARNING: This file is distributed verbatim in Jetpack.
* There should be nothing WordPress.com specific in this file.
*
* @hide-in-jetpack
*/
class WPCOM_REST_API_V2_Endpoint_Site_Migration_Mig... |
projects/packages/jetpack-mu-wpcom/src/features/block-patterns/class-wpcom-block-patterns-from-api.php | <?php
/**
* Class Wpcom Block Patterns From Api
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Require the utils class.
*/
require_once __DIR__ . '/class-wpcom-block-patterns-utils.php';
/**
* Class Wpcom_Block_Patterns_From_Api
*/
class Wpcom_Block_Patterns_From_Api {
const PATTERN_NAMESPACE = 'a8c/';
... |
projects/packages/jetpack-mu-wpcom/src/features/block-patterns/class-wpcom-block-patterns-utils.php | <?php
/**
* Block Patterns Utils.
*
* @package automattic/jetpack-mu-wpcom
*/
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
use Automattic\Jetpack\Jetpack_Mu_Wpcom\Common;
/**
* Class Wpcom_Block_Patterns_Utils
*/
class Wpcom_Block_Patterns_Utils {
/**
* Make remote get requests.
*
* @param string $request_ur... |
projects/packages/jetpack-mu-wpcom/src/features/block-patterns/block-patterns.php | <?php
/**
* Load block patterns from the API.
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Re-register some core patterns to push them down in the inserter list.
* The reason is that Dotcom curate the pattern list based on their look.
*/
function wpcom_reorder_curated_core_patterns() {
$pattern_names = ar... |
projects/packages/jetpack-mu-wpcom/src/features/marketplace-products-updater/class-marketplace-products-updater.php | <?php
/**
* Marketplace Product Updates Provider
*
* @package automattic/jetpack-mu-wpcom
*/
use Automattic\Jetpack\Connection\Client;
/**
* Marketplace Product Updates
*
* This file hooks into the WordPress core's update API to provides new versions updates
* related to the WPCOM Marketplace products.
*
* ... |
projects/packages/jetpack-mu-wpcom/src/features/site-editor-dashboard-link/site-editor-dashboard-link.php | <?php
/**
* Change the Site Editor's dashboard link.
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* This file provide a feature to override the Site Editor's dashboard link.
*
* @package automattic/jetpack-mu-wpcom
*/
require_once __DIR__ . '/../../utils.php';
add_filter(
'block_editor_settings_all',
fu... |
projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad.php | <?php
/**
* Launchpad Helpers
*
* @package automattic/jetpack-mu-wpcom
* @since 1.4.0
*/
/**
* This file provides helpers that return the appropriate Launchpad
* checklist and tasks for a given checklist id.
*
* @package automattic/jetpack-mu-wpcom
* @since 1.4.0
*/
require_once __DIR__ . '/../../utils.php... |
projects/packages/jetpack-mu-wpcom/src/features/launchpad/class-launchpad-task-lists.php | <?php
/**
* Launchpad Task Lists Registry
*
* @package automattic/jetpack-mu-wpcom
* @since 1.5.0
*/
/**
* Launchpad Task List
*
* This file provides a Launchpad Task List class that manages the current list
* of Launchpad checklists that are available to be used.
*
* @package automattic/jetpack-mu-wpcom
*... |
projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php | <?php
/**
* Launchpad: Task definitions and helpers
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Returns whether the task link should point to wp-admin page
* instead of Calypso page.
*
* @return bool
*/
function wpcom_launchpad_should_use_wp_admin_link() {
return get_option( 'wpcom_admin_interface' ) =... |
projects/packages/jetpack-mu-wpcom/src/features/wpcom-command-palette/wpcom-command-palette.php | <?php
/**
* WPCom Command Palette support for WordPress.com sites.
*
* @package automattic/jetpack-mu-plugins
*/
/**
* Check if the WPCom Command Palette should be loaded.
*
* @return bool
*/
function should_load_wpcom_command_palette() {
// Only load on the WPcom platform.
if ( ! class_exists( 'Automattic\J... |
projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/class-verbum-comments.php | <?php
/**
* Plugin Name: Verbum Comments Experience
* Description: Preact app for commenting on WordPress.com sites
* Author: Vertex
* Text Domain: jetpack-mu-wpcom
*
* @package automattic/jetpack-mu-wpcom
*/
namespace Automattic\Jetpack;
require_once __DIR__ . '/assets/class-wpcom-rest-api-v2-verbum-auth.php'... |
projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/assets/class-wpcom-rest-api-v2-verbum-auth.php | <?php
/**
* Plugin Name: Verbum Comments Experience Auth.
* Description: This returns the user info based on their cookies/headers.
* Author: Vertex
* Text Domain: jetpack-mu-wpcom
*
* @package automattic/jetpack-mu-plugins
*/
declare( strict_types = 1 );
/**
* Verbum Comments Experience Auth endpoint.
*/
cl... |
projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/assets/class-wpcom-rest-api-v2-verbum-oembed.php | <?php
/**
* Plugin Name: Verbum Comments Experience Embeds.
* Description: This is used to get the embed data for the embed block. The core API requires authentication, so we need to create our own endpoint.
* Author: Vertex
* Text Domain: jetpack-mu-wpcom
*
* @package automattic/jetpack-mu-plugins
*/
declare( ... |
projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/assets/class-verbum-block-utils.php | <?php
/**
* Verbum Block Utils
*
* @package automattic/jetpack-mu-plugins
*/
/**
* Verbum_Block_Utils offer utility functions for sanitizing and parsing blocks.
*/
class Verbum_Block_Utils {
/**
* Remove blocks that aren't allowed
*
* @param string $content - Text of the comment.
* @return string
*/
... |
projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/assets/class-verbum-gutenberg-editor.php | <?php
/**
* Verbum Gutenberg Editor
*
* @package automattic/jetpack-mu-plugins
*/
declare( strict_types = 1 );
require_once __DIR__ . '/class-verbum-block-utils.php';
/**
* Verbum_Gutenberg_Editor is responsible for loading the Gutenberg editor for comments.
*
* This loads the isolated editor, and sets up the... |
projects/packages/jetpack-mu-wpcom/src/features/blog-privacy/blog-privacy.php | <?php
/**
* Blog Privacy Settings
*
* Controls for Blog Privacy are spread out over several different places.
* * WordPress Core (all sites: `blog_privacy_selector`, `blog_public`)
* * wpcomsh (WoA: Private Site feature)
* * WP.com (simple: `blog_public`)
* * This jetpack-mu-wpcom feature (WoA, simple: `wpcom_da... |
projects/packages/jetpack-mu-wpcom/src/features/import-customizations/import-customizations.php | <?php // phpcs:ignore Squiz.Commenting.FileComment.Missing
/**
* Customizations to the wp-admin/import.php page.
*
* @package automattic/jetpack-mu-wpcom
*/
/**
* Only add_action if the current screen is the wp-admin/import.php page.
*/
function import_page_customizations_init() {
$screen = get_current_screen()... |
projects/packages/jetpack-mu-wpcom/src/features/coming-soon/fallback-coming-soon-page.php | <?php
/**
* Coming Soon fallback page.
*
* This page is used when the site is set to Coming Soon mode, but no
* Coming Soon page id has been set.
*
* @package A8C\FSE\Coming_soon
*/
namespace A8C\FSE\Coming_soon;
use Automattic\Jetpack\Jetpack_Mu_Wpcom\Common;
/**
* Returns the current locale
*
* @return s... |
projects/packages/jetpack-mu-wpcom/src/features/coming-soon/coming-soon.php | <?php
/**
* Coming Soon
*
* @package A8C\FSE\Coming_soon
*/
namespace A8C\FSE\Coming_soon;
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
/**
* Determines whether the coming soon page should be shown.
*
* @return boolean
*/
function should_show_coming_soon_page() {
if ( ! is_singular() && ! is_archive() && ! is_s... |
projects/packages/jetpack-mu-wpcom/src/features/media/heif-support.php | <?php
/**
* HEIF/HEIF support for WordPress.com sites.
*
* @package automattic/jetpack-mu-plugins
*/
/**
* Convert HEIF/HEIC uploads to JPEG.
*
* @param string $filename Path to the file.
* @return bool True if the file was converted, false otherwise.
*/
function jetpack_wpcom_maybe_convert_heif_to_jpg( $file... |
projects/packages/jetpack-mu-wpcom/src/common/index.php | <?php
/**
* File for various functionality which needs to be added to Simple and Atomic
* sites.
*
* @package automattic/jetpack-mu-wpcom
*/
namespace Automattic\Jetpack\Jetpack_Mu_Wpcom\Common;
/**
* Returns ISO 639 conforming locale string.
*
* @param string $language a language tag to be converted e.g. "en... |
projects/packages/videopress/tests/php/test-uploader.php | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
* Tests the Legacy Jetpack_XMLRPC_Server class.
*
* @package jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Connection\Tokens;
use Automattic\Jetpack\Constants;
use WorDBless\BaseTestCase;
use WorDBless\... |
projects/packages/videopress/tests/php/test-class-initializer.php | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
* Tests for Automattic\Jetpack\VideoPress\Initializer methods
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack;
use Automattic\Jetpack\VideoPress\Initializer as VideoPress_Initializer;
use WorDBless\BaseTestCase;
/*... |
projects/packages/videopress/tests/php/bootstrap.php | <?php
/**
* Bootstrap.
*
* @package automattic/
*/
/**
* Include the composer autoloader.
*/
require_once __DIR__ . '/../../vendor/autoload.php';
define( 'WP_DEBUG', true );
\WorDBless\Load::load();
|
projects/packages/videopress/tests/php/test-class-utils.php | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
* Tests for Automattic\Jetpack\VideoPress\Initializer methods
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack;
use Automattic\Jetpack\VideoPress\Utils;
use WorDBless\BaseTestCase;
/**
* Class UtilsTest
*/
class U... |
projects/packages/videopress/src/class-jwt-token-bridge.php | <?php
/**
* VideoPress Jwt_Token_Bridge
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* VideoPress Jwt_Token_Bridge class.
*/
class Jwt_Token_Bridge {
/**
* The handle used to enqueue the script
*
* @var string
*/
const SCRIPT_HANDLE = 'media-video-jwt-bri... |
projects/packages/videopress/src/class-videopresstoken.php | <?php
/**
* VideoPress Token
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
use Jetpack_Options;
/**
* VideoPress token utility class
*/
class VideoPressToken {
/**... |
projects/packages/videopress/src/class-videopress-rest-api-v1-settings.php | <?php
/**
* VideoPress Settings Endpoint
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use WP_Error;
use WP_REST_Response;
use WP_REST_Server;
/**
* Rest API class for fetching and setting site settings related to VideoPress.
*/
class VideoPress_Rest_Api_V1_Settings {
... |
projects/packages/videopress/src/class-utils.php | <?php
/**
* The Utils class.
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* The Utils class.
*/
class Utils {
/**
* Build a VideoPress video URL based on the guid and block attributes.
*
* @param {string} $guid - Video GUID.
* @param {array} $attribu... |
projects/packages/videopress/src/class-ajax.php | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Connection\Client;
/**
* VideoPress AJAX action handlers and utilities.
*
* Note: this is also being used on WordPress.com.
* Use IS_WPCOM checks for functionality that is specific ... |
projects/packages/videopress/src/class-package-version.php | <?php
/**
* The Package_Version class.
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* The Package_Version class.
*/
class Package_Version {
const PACKAGE_VERSION = '0.23.8';
const PACKAGE_SLUG = 'videopress';
/**
* Adds the package slug and version to the pac... |
projects/packages/videopress/src/class-admin-ui.php | <?php
/**
* The initializer class for Admin UI elements
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Admin_UI\Admin_Menu;
use Automattic\Jetpack\Assets;
use Automattic\Jetpack\Connection\Initial_State as Connection_Initial_State;
use Automattic\Jetp... |
projects/packages/videopress/src/class-block-editor-content.php | <?php
/**
* VideoPress Block Editor Content
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* VideoPress block editor class for content generation
*/
class Block_Editor_Content {
/**
* Initializer
*
* This method should be called only once by the Initializer cla... |
projects/packages/videopress/src/class-status.php | <?php
/**
* The class that provides information about VideoPress Status
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Jetpack;
/**
* The class that provides information about VideoPress Status
*/
class Status {
/**
* Returns whether VideoPress is active
* eith... |
projects/packages/videopress/src/class-module-control.php | <?php
/**
* Jetpack VideoPress: Module_Control class
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* To handle VideoPress module statuses
*/
class Module_Control {
/**
* Initializer
*
* This method should onlybe called once by the Initializer class. Do not ca... |
projects/packages/videopress/src/class-stats.php | <?php
/**
* Provides data stats about videos inside VideoPress
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Connection\Client;
use WP_Error;
/**
* Provides data stats about videos inside VideoPress
*/
class Stats {
/**
* Hit WPCOM video-plays ... |
projects/packages/videopress/src/class-wpcom-rest-api-v2-attachment-videopress-data.php | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
* Extend the REST API functionality for VideoPress users.
*
* @package automattic/jetpack-videopress
* @since-jetpack 7.1.0
* @since 0.3.1
*/
namespace Automattic\Jetpack\VideoPress;
/**
* Add per-attachment VideoPress data.
*
* { # Atta... |
projects/packages/videopress/src/class-block-editor-extensions.php | <?php
/**
* VideoPress Extensions
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Connection\Initial_State as Connection_Initial_State;
use Automattic\Jetpack\Constants;
use Automattic\Jetpack\Status\Host;
/**
* VideoPress Extensions class.
*/
class... |
projects/packages/videopress/src/class-divi.php | <?php
/**
* Divi integration for Videopress.
*
* @package automattic/jetpack-videopress
**/
namespace Automattic\Jetpack\VideoPress;
/**
* Class Divi
**/
class Divi {
/**
* The instance.
*
* @var Divi
**/
private static $instance = null;
/**
* Running or not.
*
* @var bool
**/
private $runn... |
projects/packages/videopress/src/class-attachment-handler.php | <?php
/**
* VideoPress Attachment_Handler
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Current_Plan;
/**
* VideoPress Attachment_Handler class.
*/
class Attachment_Handler {
/**
* Initializer
*
* ... |
projects/packages/videopress/src/class-wpcom-rest-api-v2-endpoint-videopress.php | <?php
/**
* REST API endpoint for managing VideoPress metadata.
*
* @package automattic/jetpack
* @since-jetpack 9.3.0
* @since 0.1.3
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Constants;
use WP_Error;
use WP_REST_Controller;
use WP_REST_Response... |
projects/packages/videopress/src/class-options.php | <?php
/**
* VideoPress Options
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Current_Plan;
use Jetpack_Options;
/**
* VideoPress Options class.
*/
class Options {
/**
* Option name.
*
* @var string $option_name The 'videopress' option name... |
projects/packages/videopress/src/class-xmlrpc.php | <?php
/**
* The VIdeoPress XMLRPC class
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* VideoPress playback module markup generator.
*
* @since 0.1.1
*/
class XMLRPC {
/**
* Singleton XMLRPC instance.
*
* @var XMLRPC
**/
private static $instance = null;
... |
projects/packages/videopress/src/class-wpcom-rest-api-v2-attachment-field-videopress.php | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
* Extend the REST API functionality for VideoPress users.
*
* @package automattic/jetpack-videopress
* @since-jetpack 7.1.0
* @since 0.3.0
*/
namespace Automattic\Jetpack\VideoPress;
/**
* Add per-attachment VideoPress data.
*
* { # Atta... |
projects/packages/videopress/src/class-uploader.php | <?php
/**
* VideoPress Uploader
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Jetpack_Options;
use VideoPressUploader\File_Exception;
use VideoPressUploader\Tus_Client;
/**
* VideoPress Uploader class
*
* Handles the upload from the Media Library to VideoPress serv... |
projects/packages/videopress/src/class-videopress-rest-api-v1-site.php | <?php
/**
* VideoPress Site Info Endpoint
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* VideoPress rest api class for fetching site information
*/
class VideoPress_Rest_Api_V1_Site {
/**
* Initializes the endpoints
*
* @return void
*/
public static functi... |
projects/packages/videopress/src/utility-functions.php | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
use Automattic\Jetpack\Connection\Client;
defined( 'VIDEOPRESS_MIN_WIDTH' ) || define( 'VIDEOPRESS_MIN_WIDTH', 60 );
defined( 'VIDEOPRESS_DEFAULT_WIDTH' ) || define( 'VIDEOPRESS_DEFAULT_WIDTH', 640 );
// phpcs:disable Universal.Files.SeparateFunctio... |
projects/packages/videopress/src/class-initializer.php | <?php
/**
* The initializer class for the videopress package
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* Initialized the VideoPress package
*/
class Initializer {
const JETPACK_VIDEOPRESS_IFRAME_API_HANDLER = 'jetpack-videopress-iframe-api';
/**
* Initializ... |
projects/packages/videopress/src/class-data.php | <?php
/**
* The Data class.
* This class provides methods for data VideoPress access and manipulation.
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
use Automattic\Jetpack\Status\Host;
use WP_REST_Request;
/... |
projects/packages/videopress/src/class-uploader-rest-endpoints.php | <?php
/**
* VideoPress Uploader
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use WP_Error;
/**
* VideoPress Uploader class
*
* Handles the upload from the Media Library to VideoPress servers
*/
class Uploader_Rest_Endpoints {
/**
* Initializes the endpoints
*
... |
projects/packages/videopress/src/class-upload-exception.php | <?php
/**
* VideoPress Uploader Exception
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* VideoPress Uploader Exception class
*/
class Upload_Exception extends \Exception {
const ERROR_INVALID_ATTACHMENT_ID = 0;
const ERROR_FILE_NOT_FOUND = 1;
const ERR... |
projects/packages/videopress/src/class-plan.php | <?php
/**
* The Plan class.
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* The Plan class.
*/
class Plan {
/**
* The meta name used to store the cache date
*
* @var string
*/
const CACHE_DATE_META_NAME = 'videopress-cache-date';
/**
* Valid pediord for... |
projects/packages/videopress/src/class-videopress-rest-api-v1-stats.php | <?php
/**
* VideoPress Stats Endpoints
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use WP_REST_Response;
/**
* VideoPress stats rest api class
*/
class VideoPress_Rest_Api_V1_Stats {
/**
* Initializes the endpoints
*
* @return void
*/
public static function ... |
projects/packages/videopress/src/class-site.php | <?php
/**
* Provides site data sourced from WPCOM
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Connection\Client;
use WP_Error;
/**
* Provides site data sourced from WPCOM
*/
class Site {
/**
* Returns all the data provided by WPCOM for the s... |
projects/packages/videopress/src/class-access-control.php | <?php
/**
* VideoPress Access Control.
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
use Automattic\Jetpack\Extensions\Premium_Content\Subscription_Service\Abstract_Token_Subscription_Service;
use Automattic\Jetpack\Modules;
use VIDEOPRESS_PRIVACY;
/**
* VideoPress video... |
projects/packages/videopress/src/tus/class-tus-client.php | <?php
/**
* Tus_Client
*
* @package VideoPressUploader
**/
// phpcs:disable Generic.Commenting.DocComment.MissingShort
// phpcs:disable Squiz.Commenting.VariableComment.Missing
// phpcs:disable Squiz.Commenting.FunctionComment.EmptyThrows
// phpcs:disable Generic.Commenting.DocComment.MissingShort
// phpcs:disable... |
projects/packages/videopress/src/tus/class-tus-exception.php | <?php
/**
* Tus Exception
*
* @package jetpack-videopress
*/
namespace VideoPressUploader;
/**
* Tus Exception
*/
class Tus_Exception extends \Exception {
}
|
projects/packages/videopress/src/tus/class-tus-date-utils.php | <?php
/**
* Tus_Date Utils.
*
* @package VideoPressUploader
**/
namespace VideoPressUploader;
// Avoid direct calls to this file.
if ( ! defined( 'ABSPATH' ) ) {
die();
}
/**
* Class Tus_Date_Utils
*/
class Tus_Date_Utils {
/**
* Returns a UTC date.
*
* @param null|int|string $s Thing to turn to date u... |
projects/packages/videopress/src/tus/class-file-exception.php | <?php
/**
* Cap checker.
*
* @package VideoPressUploader
**/
namespace VideoPressUploader;
// Avoid direct calls to this file.
if ( ! defined( 'ABSPATH' ) ) {
die();
}
/**
* Unauthorized_Exception class.
*
* @package VideoPressUploader
**/
class File_Exception extends \Exception {
}
|
projects/packages/videopress/src/tus/class-tus-file.php | <?php
/**
* Main
*
* @package VideoPressUploader
**/
namespace VideoPressUploader;
use InvalidArgumentException;
// Avoid direct calls to this file.
if ( ! defined( 'ABSPATH' ) ) {
die();
}
/**
* Class Tus_File.
*
* @package VideoPressUploader
*/
class Tus_File {
const CHUNK_SIZE = 8192; // 8 kilobytes... |
projects/packages/videopress/src/tus/class-transient-store.php | <?php
/**
* Transient Store.
*
* @package VideoPressUploader
**/
namespace VideoPressUploader;
// Avoid direct calls to this file.
if ( ! defined( 'ABSPATH' ) ) {
die();
}
/**
* Transient - based store.
*/
class Transient_Store extends Tus_Abstract_Cache {
/**
* Get key.
*
* @param string $key The blo... |
projects/packages/videopress/src/tus/class-tus-abstract-cache.php | <?php
/**
* Main
*
* @package VideoPressUploader
**/
namespace VideoPressUploader;
// Avoid direct calls to this file.
if ( ! defined( 'ABSPATH' ) ) {
die();
}
/**
* Abstract cache class.
**/
abstract class Tus_Abstract_Cache {
/**
* Date format standard.
*
* @see https://tools.ietf.org/html/rfc7231#s... |
projects/packages/videopress/src/videopress-divi/class-videopress-divi-extension.php | <?php
/**
* Divi integration for Videopress.
*
* @package automattic/jetpack-videopress
**/
use Automattic\Jetpack\Assets;
/**
* Divi extension.
**/
class VideoPress_Divi_Extension extends DiviExtension {
/**
* The extension's js file namespace.
*
* @var string
*/
const JETPACK_VIDEOPRESS_DIVI_PKG_NA... |
projects/packages/videopress/src/videopress-divi/class-videopress-divi-module.php | <?php
/**
* VideoPress Divi Editor module.
*
* @package VideoPress
*/
use Automattic\Jetpack\VideoPress\Jwt_Token_Bridge;
/**
* VideoPress Divi module
**/
class VideoPress_Divi_Module extends ET_Builder_Module {
/**
* Module slug
*
* @var string
*/
public $slug = 'divi_videopress';
/**
* For matc... |
projects/packages/scheduled-updates/tests/php/class-scheduled-updates-test.php | <?php
/**
* Test class for Scheduled_Updates.
*
* @package automattic/scheduled-updates
*/
namespace Automattic\Jetpack;
/**
* Test class for Scheduled_Updates.
*
* @coversDefaultClass Scheduled_Updates
*/
class Scheduled_Updates_Test extends \WorDBless\BaseTestCase {
/**
* Used to mock global functions i... |
projects/packages/scheduled-updates/tests/php/bootstrap.php | <?php
/**
* Bootstrap.
*
* @package automattic/scheduled-updates
*/
/**
* Include the composer autoloader and dependencies.
*/
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../lib/functions-wordpress.php';
/**
* Load WorDBless.
*/
\WorDBless\Load::load();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.