Skip to content

Commit

Permalink
Merge pull request #58 from newfold-labs/release/4.1.0
Browse files Browse the repository at this point in the history
Release 4.1.0
  • Loading branch information
circlecube authored Feb 26, 2025
2 parents 248a97c + 8c1e9b8 commit 66d910d
Show file tree
Hide file tree
Showing 67 changed files with 22,544 additions and 540 deletions.
2 changes: 0 additions & 2 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ node_modules
/.*
cypress.config.js
postcss.config.js
set-latest-wp-version.js
set-version-bump.js
tailwind.config.js
webpack.config.js

Expand Down
71 changes: 71 additions & 0 deletions .github/scripts/set-latest-wp-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* This sets the latest wp-version in the wp-env.json file.
* It runs every `npm i` so we don't have to manuallly update to latest versions.
*/
const fs = require( 'fs' );
const path = require( 'path' );
const wpEnvFile = path.resolve( __dirname, '../../.wp-env.json' );
const pluginFile = path.resolve(
__dirname,
'../../bluehost-wordpress-plugin.php'
);
const wpEnv = require( '../../.wp-env.json' );
async function fetchData( url ) {
try {
const fetch = ( ...args ) =>
import( 'node-fetch' ).then( ( { default: fetch } ) =>
fetch( ...args )
);
const response = await fetch( url );
if ( ! response.ok ) {
throw new Error( `HTTP error! status: ${ response.status }` );
}
const data = await response.json();
return data;
} catch ( error ) {
console.error( 'Fetching error:', error );
throw error;
}
}

fetchData( 'https://api.wordpress.org/core/stable-check/1.0/' ).then(
( json ) => {
const wpEnvData = require( wpEnvFile );
const wpCurrent = wpEnvData.core.split( '#tags/' )[ 1 ];
const wpVersion = Object.keys( json )[ Object.keys( json ).length - 1 ];
if ( wpCurrent === wpVersion ) {
console.log( 'No WordPress updates found.' );
return;
}
// update data
wpEnvData.core = `WordPress/WordPress#tags/${ wpVersion }`;
// write update to wp-env file
try {
fs.writeFileSync( wpEnvFile, JSON.stringify( wpEnvData, null, 2 ) );
console.log(
`The .wp-env.json file was updated with the latest WordPress version (${ wpVersion }).`
);
} catch ( err ) {
console.log(
'An error occurred while writing latest WordPress version to .wp-env.json file.',
err
);
}

// write to plugin file
fs.readFile( pluginFile, 'utf8', function ( err, data ) {
if ( err ) {
return console.log( err );
}
const result = data.replaceAll( wpCurrent, wpVersion );
fs.writeFile( pluginFile, result, 'utf8', function ( err ) {
if ( err ) {
return console.log( err );
}
} );
console.log(
`The plugin "Tested up to:" value has been updated to ${ wpVersion }.`
);
} );
}
);
19 changes: 17 additions & 2 deletions set-version-bump.js → .github/scripts/set-version-bump.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/**
* For patch releases, use `npm run set-version-bump` script.
* For minor or major releases, use `node run ./.github/scripts/set-version-bump.js minor`.
* - Then run the remaining steps from the npm script:
* - `npm i && rm -rf ./build && npm run build && composer run i18n`
*/

const fs = require( 'fs' );
const path = require( 'path' );
const semver = require( 'semver' );
const packagefile = './package.json';
const pluginfile = './bluehost-wordpress-plugin.php';
const packagefile = path.resolve( __dirname, '../../package.json' );
const pluginfile = path.resolve(
__dirname,
'../../bluehost-wordpress-plugin.php'
);

if ( fs.existsSync( packagefile ) && fs.existsSync( pluginfile ) ) {
const packageData = require( packagefile );
Expand Down Expand Up @@ -29,4 +40,8 @@ if ( fs.existsSync( packagefile ) && fs.existsSync( pluginfile ) ) {
} );

console.log( 'Version updated', currentVersion, '=>', newVersion );
} else {
console.log(
'Version update error: package.json or bluehost-wordpress-plugin.php not found.'
);
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/cypress-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
test:
name: Run Cypress Test Matrix
runs-on: ubuntu-latest
timeout-minutes: 40
timeout-minutes: 60

strategy:
fail-fast: false
Expand Down
4 changes: 2 additions & 2 deletions bluehost-wordpress-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Plugin URI: https://bluehost.com
* Update URI: https://github.com/bluehost/bluehost-wordpress-plugin
* Description: WordPress plugin that integrates a WordPress site with the Bluehost control panel, including performance, security, and update features.
* Version: 4.0.7
* Version: 4.1.0
* Requires at least: 6.5
* Requires PHP: 7.3
* Tested up to: 6.7.2
Expand All @@ -32,7 +32,7 @@
}

// Define constants
define( 'BLUEHOST_PLUGIN_VERSION', '4.0.7' );
define( 'BLUEHOST_PLUGIN_VERSION', '4.1.0' );
define( 'BLUEHOST_PLUGIN_FILE', __FILE__ );
define( 'BLUEHOST_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'BLUEHOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
Expand Down
1 change: 1 addition & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ function () {
require BLUEHOST_PLUGIN_DIR . '/inc/settings.php';
require BLUEHOST_PLUGIN_DIR . '/inc/updates.php';
require BLUEHOST_PLUGIN_DIR . '/inc/YoastAI.php';
require BLUEHOST_PLUGIN_DIR . '/inc/widgets/bootstrap.php';

/* WordPress Admin Page & Features */
if ( is_admin() ) {
Expand Down
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@
"i18n-pot": "vendor/bin/wp i18n make-pot . ./languages/wp-plugin-bluehost.pot --headers='{\"Report-Msgid-Bugs-To\":\"https://github.com/newfold-labs/wp-plugin-bluehost/issues\",\"POT-Creation-Date\":\"2023-03-08T20:13:41+00:00\"}' --exclude=assets,tests,src",
"i18n-po": "vendor/bin/wp i18n update-po ./languages/wp-plugin-bluehost.pot ./languages",
"i18n-mo": "vendor/bin/wp i18n make-mo ./languages",
"i18n-php": "vendor/bin/wp i18n make-php ./languages",
"i18n-json": "rm -f languages/*.json && vendor/bin/wp i18n make-json ./languages --no-purge --pretty-print",
"i18n": [
"@i18n-pot",
"@i18n-po",
"@i18n-mo",
"@i18n-php",
"@i18n-json"
]
},
Expand All @@ -72,7 +73,7 @@
"newfold-labs/wp-php-standards": "^1.2.4",
"roave/security-advisories": "dev-latest",
"wp-cli/i18n-command": "^2.6.3",
"wp-phpunit/wp-phpunit": "^6.7.1"
"wp-phpunit/wp-phpunit": "^6.7.2"
},
"require": {
"newfold-labs/wp-module-activation": "^1.0.6",
Expand All @@ -82,23 +83,23 @@
"newfold-labs/wp-module-context": "^1.0.1",
"newfold-labs/wp-module-data": "^2.6.10",
"newfold-labs/wp-module-deactivation": "^1.3.0",
"newfold-labs/wp-module-ecommerce": "^1.5.2",
"newfold-labs/wp-module-ecommerce": "^1.5.3",
"newfold-labs/wp-module-facebook": "^1.1.2",
"newfold-labs/wp-module-features": "^1.4.2",
"newfold-labs/wp-module-global-ctb": "^1.0.14",
"newfold-labs/wp-module-help-center": "^2.2.5",
"newfold-labs/wp-module-help-center": "^2.2.7",
"newfold-labs/wp-module-installer": "^1.3.0",
"newfold-labs/wp-module-loader": "^1.0.12",
"newfold-labs/wp-module-marketplace": "^2.5.0",
"newfold-labs/wp-module-marketplace": "^2.5.1",
"newfold-labs/wp-module-migration": "^1.1.0",
"newfold-labs/wp-module-notifications": "^1.6.6",
"newfold-labs/wp-module-notifications": "^1.6.7",
"newfold-labs/wp-module-onboarding": "^2.5.8",
"newfold-labs/wp-module-onboarding-data": "^1.2.4",
"newfold-labs/wp-module-patterns": "^2.8.1",
"newfold-labs/wp-module-performance": "^2.6.0",
"newfold-labs/wp-module-pls": "^1.0.1",
"newfold-labs/wp-module-runtime": "^1.1.3",
"newfold-labs/wp-module-secure-passwords": "^1.1.1",
"newfold-labs/wp-module-secure-passwords": "^1.1.2",
"newfold-labs/wp-module-solutions": "^1.0.9",
"newfold-labs/wp-module-sso": "^1.0.8",
"newfold-labs/wp-module-staging": "^2.1.3",
Expand Down
Loading

0 comments on commit 66d910d

Please sign in to comment.