From 10da5a3fc719b7db10b4a629166b653da9b8aad8 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Tue, 9 Jul 2024 11:44:37 -0400 Subject: [PATCH 1/4] plugins: allow staging to set all filter options --- plugins/jquery-filters.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/plugins/jquery-filters.php b/plugins/jquery-filters.php index 5e7238fe..4c0ea153 100644 --- a/plugins/jquery-filters.php +++ b/plugins/jquery-filters.php @@ -14,16 +14,20 @@ $sites = jquery_sites(); $options = array_merge( $options, $sites[ JQUERY_LIVE_SITE ]['options'] ); foreach ( $options as $option => $value ) { - if ( $option === 'stylesheet' || $option === 'template' ) { - // Don't mess with themes for now. - continue; - } - if ( $option === 'active_plugins' ) { - // Deprecated - // In production, Puppet manages activation of per-site plugins. - // Locally, global plugins are enabled via mu-plugins/_loader.php, - // and per-site plugins are activated by the imported database. - continue; + // Skip these in production, where they are managed by puppet. + // Staging should be allowed to set them for testing. + if ( !JQUERY_STAGING ) { + if ( $option === 'stylesheet' || $option === 'template' ) { + // Don't mess with themes for now. + continue; + } + if ( $option === 'active_plugins' ) { + // Deprecated + // In production, Puppet manages activation of per-site plugins. + // Locally, global plugins are enabled via mu-plugins/_loader.php, + // and per-site plugins are activated by the imported database. + continue; + } } add_filter( 'pre_option_' . $option, function () use ( $value ) { return $value; From 6488a7895fe9f1b5a3dc3f5de13fa1ee233e6659 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Tue, 9 Jul 2024 12:04:02 -0400 Subject: [PATCH 2/4] fixup! remove 'Deprecated' --- plugins/jquery-filters.php | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/jquery-filters.php b/plugins/jquery-filters.php index 4c0ea153..fa1fee70 100644 --- a/plugins/jquery-filters.php +++ b/plugins/jquery-filters.php @@ -22,7 +22,6 @@ continue; } if ( $option === 'active_plugins' ) { - // Deprecated // In production, Puppet manages activation of per-site plugins. // Locally, global plugins are enabled via mu-plugins/_loader.php, // and per-site plugins are activated by the imported database. From 85597d26ae8081884bc29a5a5db19d35b841e297 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Tue, 9 Jul 2024 12:48:51 -0400 Subject: [PATCH 3/4] fixup! note that local testing with a fresh database does not work without --- plugins/jquery-filters.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/jquery-filters.php b/plugins/jquery-filters.php index fa1fee70..7f7e357f 100644 --- a/plugins/jquery-filters.php +++ b/plugins/jquery-filters.php @@ -16,6 +16,8 @@ foreach ( $options as $option => $value ) { // Skip these in production, where they are managed by puppet. // Staging should be allowed to set them for testing. + // Local testing with a fresh database does not + // currently work if these are skipped. if ( !JQUERY_STAGING ) { if ( $option === 'stylesheet' || $option === 'template' ) { // Don't mess with themes for now. From fd484d69b97bf9399742913bd67f75f239bf4477 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Tue, 9 Jul 2024 13:32:11 -0400 Subject: [PATCH 4/4] fixup! remove locally note --- plugins/jquery-filters.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/jquery-filters.php b/plugins/jquery-filters.php index 7f7e357f..19c06afd 100644 --- a/plugins/jquery-filters.php +++ b/plugins/jquery-filters.php @@ -25,8 +25,6 @@ } if ( $option === 'active_plugins' ) { // In production, Puppet manages activation of per-site plugins. - // Locally, global plugins are enabled via mu-plugins/_loader.php, - // and per-site plugins are activated by the imported database. continue; } }