diff --git a/.github/files/generate-ci-matrix.php b/.github/files/generate-ci-matrix.php
index 08cfa32b3b6bf..a09a019b96bf5 100755
--- a/.github/files/generate-ci-matrix.php
+++ b/.github/files/generate-ci-matrix.php
@@ -89,6 +89,16 @@
'with-woocommerce' => true,
);
+// Add WooCommerce tests.
+$matrix[] = array(
+ 'name' => 'PHP tests: PHP 7.4 WP latest with WPCOMSH',
+ 'script' => 'test-php',
+ 'php' => '8.1',
+ 'wp' => 'latest',
+ 'timeout' => 20,
+ 'with-wpcomsh' => true,
+);
+
// Add JS tests.
$matrix[] = array(
'name' => 'JS tests',
diff --git a/.github/files/setup-wordpress-env.sh b/.github/files/setup-wordpress-env.sh
index 6505d513beeca..0824af412333d 100755
--- a/.github/files/setup-wordpress-env.sh
+++ b/.github/files/setup-wordpress-env.sh
@@ -160,6 +160,16 @@ if [[ "$WITH_WOOCOMMERCE" == true ]]; then
echo "::endgroup::"
fi
+# Install WooCommerce plugin used for some Jetpack integration tests.
+if [[ "$WITH_WPCOMSH" == true ]]; then
+ echo "::group::Installing wpcomsh into WordPress"
+
+ mkdir "/tmp/wordpress-$WP_BRANCH/src/wp-content/mu-plugins"
+ cp -r "/tmp/wordpress-$WP_BRANCH/src/wp-content/plugins/wpcomsh/src" "/tmp/wordpress-$WP_BRANCH/src/wp-content/mu-plugins/wpcomsh"
+
+ echo "::endgroup::"
+fi
+
cd "/tmp/wordpress-$WP_BRANCH"
cp wp-tests-config-sample.php wp-tests-config.php
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 2772beda960c6..f9ce01cea98e5 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -46,6 +46,7 @@ jobs:
NODE_VERSION: ${{ matrix.node }}
MONOREPO_BASE: ${{ github.workspace }}
WITH_WOOCOMMERCE: ${{ matrix.with-woocommerce }}
+ WITH_WPCOMSH: ${{ matrix.with-wpcomsh }}
strategy:
fail-fast: false
matrix:
diff --git a/projects/plugins/jetpack/changelog/try-wpcomsh-skeleton-ci b/projects/plugins/jetpack/changelog/try-wpcomsh-skeleton-ci
new file mode 100644
index 0000000000000..bfa76cda3e850
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/try-wpcomsh-skeleton-ci
@@ -0,0 +1,4 @@
+Significance: minor
+Type: other
+
+Added ability to test Jetpack together with wpcomsh.
diff --git a/projects/plugins/jetpack/tests/action-test-php.sh b/projects/plugins/jetpack/tests/action-test-php.sh
index 1c67dbe5573a7..eb82fd51d98cd 100755
--- a/projects/plugins/jetpack/tests/action-test-php.sh
+++ b/projects/plugins/jetpack/tests/action-test-php.sh
@@ -11,6 +11,10 @@ if [[ "$WITH_WOOCOMMERCE" == true ]]; then
exit 0
fi
+if [[ "$WITH_WPCOMSH" == true ]]; then
+ export JETPACK_TEST_WPCOMSH=1
+fi
+
echo "::group::Jetpack tests"
phpunit
echo "::endgroup::"
diff --git a/projects/plugins/jetpack/tests/php/bootstrap.php b/projects/plugins/jetpack/tests/php/bootstrap.php
index 3188c189025ae..10a013e85e858 100644
--- a/projects/plugins/jetpack/tests/php/bootstrap.php
+++ b/projects/plugins/jetpack/tests/php/bootstrap.php
@@ -95,6 +95,10 @@ function _manually_load_plugin() {
if ( '1' === getenv( 'JETPACK_TEST_WOOCOMMERCE' ) ) {
require JETPACK_WOOCOMMERCE_INSTALL_DIR . '/woocommerce.php';
}
+
+ if ( '1' === getenv( 'JETPACK_TEST_WPCOMSH' ) ) {
+ require __DIR__ . '/../../../../mu-plugins/wpcomsh/wpcomsh.php';
+ }
require __DIR__ . '/../../jetpack.php';
$jetpack = Jetpack::init();
$jetpack->configure();
diff --git a/projects/plugins/wpcomsh/.gitattributes b/projects/plugins/wpcomsh/.gitattributes
new file mode 100644
index 0000000000000..dd08c5ac8f82f
--- /dev/null
+++ b/projects/plugins/wpcomsh/.gitattributes
@@ -0,0 +1,15 @@
+# Files not needed to be distributed in the package.
+.gitattributes export-ignore
+.github/ export-ignore
+package.json export-ignore
+
+# Files to include in the mirror repo, but excluded via gitignore
+# Remember to end all directories with `/**` to properly tag every file.
+# /src/js/example.min.js production-include
+
+# Files to exclude from the mirror repo, but included in the monorepo.
+# Remember to end all directories with `/**` to properly tag every file.
+.gitignore production-exclude
+changelog/** production-exclude
+phpunit.xml.dist production-exclude
+tests/** production-exclude
diff --git a/projects/plugins/wpcomsh/.gitignore b/projects/plugins/wpcomsh/.gitignore
new file mode 100644
index 0000000000000..140fd587d2d52
--- /dev/null
+++ b/projects/plugins/wpcomsh/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+node_modules/
diff --git a/projects/plugins/wpcomsh/CHANGELOG.md b/projects/plugins/wpcomsh/CHANGELOG.md
new file mode 100644
index 0000000000000..721294abd00ad
--- /dev/null
+++ b/projects/plugins/wpcomsh/CHANGELOG.md
@@ -0,0 +1,7 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
diff --git a/projects/plugins/wpcomsh/README.md b/projects/plugins/wpcomsh/README.md
new file mode 100644
index 0000000000000..a0581cbc27e8d
--- /dev/null
+++ b/projects/plugins/wpcomsh/README.md
@@ -0,0 +1,24 @@
+# wpcomsh
+
+A helper for connecting WordPress.com sites to external host infrastructure.
+
+## How to install wpcomsh
+
+### Installation From Git Repo
+
+## Contribute
+
+## Get Help
+
+## Using this package in your WordPress plugin
+
+If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.
+
+## Security
+
+Need to report a security vulnerability? Go to [https://automattic.com/security/](https://automattic.com/security/) or directly to our security bug bounty site [https://hackerone.com/automattic](https://hackerone.com/automattic).
+
+## License
+
+wpcomsh is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)
+
diff --git a/projects/plugins/wpcomsh/changelog/.gitkeep b/projects/plugins/wpcomsh/changelog/.gitkeep
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/projects/plugins/wpcomsh/changelog/initial-version b/projects/plugins/wpcomsh/changelog/initial-version
new file mode 100644
index 0000000000000..fb1837c901e51
--- /dev/null
+++ b/projects/plugins/wpcomsh/changelog/initial-version
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Initial version.
diff --git a/projects/plugins/wpcomsh/composer.json b/projects/plugins/wpcomsh/composer.json
new file mode 100644
index 0000000000000..755bb2799f9db
--- /dev/null
+++ b/projects/plugins/wpcomsh/composer.json
@@ -0,0 +1,51 @@
+{
+ "name": "automattic/jetpack-wpcomsh",
+ "description": "A helper for connecting WordPress.com sites to external host infrastructure.",
+ "type": "wordpress-plugin",
+ "license": "GPL-2.0-or-later",
+ "require": {},
+ "require-dev": {
+ "yoast/phpunit-polyfills": "1.1.0",
+ "automattic/jetpack-changelogger": "@dev",
+ "automattic/wordbless": "dev-master"
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "scripts": {
+ "phpunit": [
+ "./vendor/phpunit/phpunit/phpunit --colors=always"
+ ],
+ "test-php": [
+ "@composer phpunit"
+ ],
+ "build-production": "echo 'Add your build step to composer.json, please!'",
+ "build-development": "echo 'Add your build step to composer.json, please!'",
+ "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy",
+ "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy"
+ },
+ "repositories": [
+ {
+ "type": "path",
+ "url": "../../packages/*",
+ "options": {
+ "monorepo": true
+ }
+ }
+ ],
+ "minimum-stability": "dev",
+ "prefer-stable": true,
+ "config": {
+ "allow-plugins": {
+ "roots/wordpress-core-installer": true
+ }
+ },
+ "extra": {
+ "release-branch-prefix": "wpcomsh",
+ "changelogger": {
+ "versioning": "semver"
+ }
+ }
+}
diff --git a/projects/plugins/wpcomsh/package.json b/projects/plugins/wpcomsh/package.json
new file mode 100644
index 0000000000000..c6ff4b9f3e893
--- /dev/null
+++ b/projects/plugins/wpcomsh/package.json
@@ -0,0 +1,25 @@
+{
+ "private": true,
+ "name": "@automattic/jetpack-wpcomsh",
+ "version": "0.1.0-alpha",
+ "description": "A helper for connecting WordPress.com sites to external host infrastructure.",
+ "homepage": "https://jetpack.com",
+ "bugs": {
+ "url": "https://github.com/Automattic/jetpack/labels/[Plugin] Wpcomsh"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Automattic/jetpack.git",
+ "directory": "projects/plugins/wpcomsh"
+ },
+ "license": "GPL-2.0-or-later",
+ "author": "Automattic",
+ "scripts": {
+ "build": "echo 'Not implemented.'",
+ "build-js": "echo 'Not implemented.'",
+ "build-production": "echo 'Not implemented.'",
+ "build-production-js": "echo 'Not implemented.'",
+ "clean": "true"
+ },
+ "devDependencies": {}
+}
diff --git a/projects/plugins/wpcomsh/phpunit.xml.dist b/projects/plugins/wpcomsh/phpunit.xml.dist
new file mode 100644
index 0000000000000..3223c32458db2
--- /dev/null
+++ b/projects/plugins/wpcomsh/phpunit.xml.dist
@@ -0,0 +1,14 @@
+
' ), + 'end' => '', + ), + array( + 'match' => array( '
' ),
+ 'end' => '
',
+ ),
+ array(
+ 'match' => array( '',
+ ),
+ array(
+ 'match' => array( '',
+ ),
+ array(
+ 'match' => array( '',
+ ),
+ array(
+ 'match' => array( '