From b800c8975f18c242030b16b0902bbb6689c6ab0e Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 22 Nov 2023 13:11:12 -0500 Subject: [PATCH 1/2] use constant text for page title --- components/staging/index.js | 2 +- includes/StagingApi.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/staging/index.js b/components/staging/index.js index ba4474d..17483b5 100644 --- a/components/staging/index.js +++ b/components/staging/index.js @@ -364,7 +364,7 @@ const Staging = ({methods, constants, Components, ...props}) => { }; return ( - +
Date: Wed, 22 Nov 2023 17:33:50 -0500 Subject: [PATCH 2/2] use plugin id from container rather than hardcoded branded urls --- includes/Staging.php | 1 + lib/.staging | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/Staging.php b/includes/Staging.php index 69eced8..7f325c9 100644 --- a/includes/Staging.php +++ b/includes/Staging.php @@ -390,6 +390,7 @@ protected function runCommand( $command, $args = null ) { $config['production_url'], $config['staging_url'], get_current_user_id(), + container()->plugin()->id, ); if ( $args && is_array( $args ) ) { diff --git a/lib/.staging b/lib/.staging index fb1a63b..7965ab1 100644 --- a/lib/.staging +++ b/lib/.staging @@ -164,7 +164,7 @@ function sso_staging { fi wp eval 'file_exists( WPMU_PLUGIN_DIR . "/sso.php" ) ? unlink( WPMU_PLUGIN_DIR . "/sso.php" ) : null;' --path=$STAGING_DIR --skip-themes --skip-plugins --quiet LINK=$(wp newfold sso --url-only --id=$1 --path=$STAGING_DIR) - echo \{\"status\":\"success\",\"load_page\":\"$LINK\&redirect=admin.php\?page=bluehost#\/staging\"\} + echo \{\"status\":\"success\",\"load_page\":\"$LINK\&redirect=admin.php\?page=$PLUGIN_ID#\/staging\"\} } function sso_production { @@ -174,7 +174,7 @@ function sso_production { fi wp eval 'file_exists( WPMU_PLUGIN_DIR . "/sso.php" ) ? unlink( WPMU_PLUGIN_DIR . "/sso.php" ) : null;' --path=$PRODUCTION_DIR --skip-themes --skip-plugins --quiet LINK=$(wp newfold sso --url-only --id=$1 --path=$PRODUCTION_DIR) - echo \{\"status\":\"success\",\"load_page\":\"$LINK\&redirect=admin.php\?page=bluehost#\/staging\"\} + echo \{\"status\":\"success\",\"load_page\":\"$LINK\&redirect=admin.php\?page=$PLUGIN_ID#\/staging\"\} } function error { @@ -208,6 +208,7 @@ STAGING_DIR=$4 PRODUCTION_URL=$5 STAGING_URL=$6 USER_ID=$7 +PLUGIN_ID=$8 DB_HOST=$(wp eval 'echo DB_HOST;' --path=$PRODUCTION_DIR --skip-themes --skip-plugins --quiet) DB_NAME=$(wp eval 'echo DB_NAME;' --path=$PRODUCTION_DIR --skip-themes --skip-plugins --quiet) DB_USER=$(wp eval 'echo DB_USER;' --path=$PRODUCTION_DIR --skip-themes --skip-plugins --quiet) @@ -231,7 +232,7 @@ CONFIG=$(wp option get staging_config --format=json --path=$PRODUCTION_DIR --ski wp transient set nfd_staging_lock "true" 120 --path=$PRODUCTION_DIR --skip-themes --skip-plugins --quiet -$1 "$8" +$1 "$9" wp transient delete nfd_staging_lock --path=$PRODUCTION_DIR --skip-themes --skip-plugins --quiet @@ -242,4 +243,5 @@ wp transient delete nfd_staging_lock --path=$PRODUCTION_DIR --skip-themes --skip # $5 is production url # $6 is staging url # $7 is current user id -# $8 is function param 1 +# $8 is plugin id/brand +# $9 is function param 1