Skip to content

Commit

Permalink
Merge pull request #15 from newfold-labs/update/support-more-brands
Browse files Browse the repository at this point in the history
Update/support more brands
  • Loading branch information
circlecube authored Nov 27, 2023
2 parents 5a045d4 + 329a317 commit 442ea23
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/staging/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ const Staging = ({methods, constants, Components, ...props}) => {
};

return (
<Components.Page title={__('Staging', 'wp-plugin-bluehost')} className={methods.classnames('newfold-staging-page', getClasses())}>
<Components.Page title={constants.text.title} className={methods.classnames('newfold-staging-page', getClasses())}>
<Components.SectionContainer className={'wppbh-app-staging-container'}>
<div className={methods.classnames('newfold-staging-wrapper')}>
<Components.SectionHeader
Expand Down
1 change: 1 addition & 0 deletions includes/Staging.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand Down
4 changes: 2 additions & 2 deletions includes/StagingApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class StagingApi extends \WP_REST_Controller {
protected $namespace = 'newfold-staging/v1';

/**
* An instance of the BluehostStaging class.
* An instance of the Staging class.
*
* @var Staging
*/
protected $staging;

/**
* Bluehost_Staging_Controller constructor.
* Staging_Controller constructor.
*
* @param Container $container An instance of the Container class.
*/
Expand Down
10 changes: 6 additions & 4 deletions lib/.staging
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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)
Expand All @@ -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

Expand All @@ -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

0 comments on commit 442ea23

Please sign in to comment.