From 4b0fb8a40f517ece654ca2371539836a3dbf8526 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Mon, 28 Jun 2021 15:11:09 -0500 Subject: [PATCH] Add option for bleeding edge JP Beta. Fixes #236 --- docs/specialops.md | 5 +++-- features/jetpack-beta.php | 11 ++++++++--- lib/stuff.php | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/specialops.md b/docs/specialops.md index f943aaf..56fb1cd 100644 --- a/docs/specialops.md +++ b/docs/specialops.md @@ -30,7 +30,6 @@ Recommended `/specialops` page content:

  •  Include Jetpack Beta
    +
    +
    +


  • diff --git a/features/jetpack-beta.php b/features/jetpack-beta.php index daca7d3..d86d158 100644 --- a/features/jetpack-beta.php +++ b/features/jetpack-beta.php @@ -36,7 +36,10 @@ function ( &$app = null, $features, $domain ) use ( $defaults ) { $features = array_merge( $defaults, $features ); if ( $features['jetpack-beta'] ) { debug( '%s: Adding Jetpack Beta Tester Plugin', $domain ); - add_jetpack_beta_plugin(); + add_jetpack_beta_plugin( false ); + } else if ( $features['jetpack-beta-dev'] ) { + debug( '%s: Adding Jetpack Beta Tester Plugin (Bleeding Edge)', $domain ); + add_jetpack_beta_plugin( true ); } if ( $features['branch'] ) { @@ -114,9 +117,11 @@ function ( $fields ) { /** * Installs and activates Jetpack Beta Tester plugin on the site. + * + * @param bool $dev Install bleeding edge version of the Jetpack Beta plugin. */ -function add_jetpack_beta_plugin() { - $jetpack_beta_plugin_url = JETPACK_BETA_PLUGIN_URL; +function add_jetpack_beta_plugin( $dev = false ) { + $jetpack_beta_plugin_url = ( $dev ) ? JETPACK_BETA_PLUGIN_DEV_URL : JETPACK_BETA_PLUGIN_URL; $cmd = "wp plugin install $jetpack_beta_plugin_url --activate"; add_filter( 'jurassic_ninja_feature_command', diff --git a/lib/stuff.php b/lib/stuff.php index 49dfc14..b0a6c3d 100644 --- a/lib/stuff.php +++ b/lib/stuff.php @@ -46,6 +46,7 @@ function ( $item ) { define( 'REST_API_NAMESPACE', 'jurassic.ninja' ); define( 'COMPANION_PLUGIN_URL', 'https://github.com/Automattic/companion/archive/master.zip' ); define( 'JETPACK_BETA_PLUGIN_URL', 'https://github.com/Automattic/jetpack-beta/releases/latest/download/jetpack-beta.zip' ); +define( 'JETPACK_BETA_PLUGIN_DEV_URL', 'https://github.com/Automattic/jetpack-beta/archive/master.zip' ); define( 'SUBDOMAIN_MULTISITE_HTACCESS_TEMPLATE_URL', 'https://gist.githubusercontent.com/oskosk/8cac852c793df5e4946463e2e55dfdd6/raw/a60ce4122a69c1dd36c623c9b999c36c9c8d3db8/gistfile1.txt' ); define( 'SUBDIR_MULTISITE_HTACCESS_TEMPLATE_URL', 'https://gist.githubusercontent.com/oskosk/f5febd1bb65a2ace3d35feac949b47fd/raw/6ea8ffa013056f6793d3e8775329ec74d3304835/gistfile1.txt' ); define( 'REGULAR_SITE_HTACCESS_TEMPLATE_URL', 'https://gist.githubusercontent.com/oskosk/0dab794274742af9caddefbc73f0ad80/raw/504f60da86969a9d55487f0c4821d06928a97218/.htaccess' );