Skip to content

Commit

Permalink
Merge e6a5370 into 2d6179d
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube authored Dec 4, 2024
2 parents 2d6179d + e6a5370 commit c667bbd
Show file tree
Hide file tree
Showing 10 changed files with 261 additions and 209 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/cypress-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ jobs:
echo '{"wpVersion": "${{ matrix.wpVersion }}","phpVersion": "${{ matrix.phpVersion }}"}' > cypress.env.json
- name: Install WordPress
run: npx wp-env start --debug
uses: nick-fields/retry@v3
with:
timeout_minutes: 4
max_attempts: 3
command: npx wp-env start --debug

- name: Run Cypress Tests
if: ${{ github.repository != 'bluehost/bluehost-wordpress-plugin' || github.actor == 'dependabot[bot]' }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ jobs:
run: echo '{"plugins":["${{ steps.workflow.outputs.DIST }}/${{ steps.workflow.outputs.PACKAGE }}"]}' > .wp-env.override.json

- name: Install WordPress
run: npx wp-env start --debug
uses: nick-fields/retry@v3
with:
timeout_minutes: 4
max_attempts: 3
command: npx wp-env start --debug

- name: Run Cypress Tests
if: ${{ github.repository != 'bluehost/bluehost-wordpress-plugin' || github.actor == 'dependabot[bot]' }}
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: 3.15.5
* Version: 3.15.6
* Requires at least: 6.5
* Requires PHP: 7.3
* Tested up to: 6.7.1
Expand All @@ -32,7 +32,7 @@
}

// Define constants
define( 'BLUEHOST_PLUGIN_VERSION', '3.15.5' );
define( 'BLUEHOST_PLUGIN_VERSION', '3.15.6' );
define( 'BLUEHOST_PLUGIN_FILE', __FILE__ );
define( 'BLUEHOST_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'BLUEHOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
Expand Down
4 changes: 1 addition & 3 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use WP_Forge\UpgradeHandler\UpgradeHandler;
use NewfoldLabs\WP\ModuleLoader\Container;
use NewfoldLabs\WP\ModuleLoader\Plugin;
use NewfoldLabs\WP\Context\Context;
use NewfoldLabs\WP\Module\Features\Features;
use function NewfoldLabs\WP\ModuleLoader\container as setContainer;
use function NewfoldLabs\WP\Context\setContext;
Expand Down Expand Up @@ -80,8 +79,7 @@ function () {
$bluehost_module_container->set( 'cache_types', $cache_types );
$bluehost_module_container->set( 'marketplace_brand', $marketplace_brand );
}
},
11
}
);

// Properly get branding links depending on market
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@
"require": {
"newfold-labs/wp-module-activation": "^1.0.5",
"newfold-labs/wp-module-atomic": "^1.3.0",
"newfold-labs/wp-module-coming-soon": "^1.2.6",
"newfold-labs/wp-module-coming-soon": "^1.3.2",
"newfold-labs/wp-module-context": "^1.0.1",
"newfold-labs/wp-module-data": "^2.6.7",
"newfold-labs/wp-module-deactivation": "^1.2.3",
"newfold-labs/wp-module-ecommerce": "^1.4.3",
"newfold-labs/wp-module-ecommerce": "^1.4.4",
"newfold-labs/wp-module-facebook": "^1.0.9",
"newfold-labs/wp-module-features": "^1.4.2",
"newfold-labs/wp-module-global-ctb": "^1.0.13",
Expand All @@ -95,7 +95,7 @@
"newfold-labs/wp-module-pls": "^1.0.0",
"newfold-labs/wp-module-runtime": "^1.0.12",
"newfold-labs/wp-module-secure-passwords": "^1.1.1",
"newfold-labs/wp-module-solutions": "^1.0.6",
"newfold-labs/wp-module-solutions": "^1.0.7",
"newfold-labs/wp-module-sso": "^1.0.7",
"newfold-labs/wp-module-staging": "^2.1.1",
"wp-forge/wp-update-handler": "^1.0.2",
Expand Down
63 changes: 34 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 52 additions & 6 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ module.exports = defineConfig( {
],
e2e: {
setupNodeEvents( on, config ) {
const semver = require( 'semver' );

// Ensure that the base URL is always properly set.
if ( config.env && config.env.baseUrl ) {
config.baseUrl = config.env.baseUrl;
Expand All @@ -53,13 +51,27 @@ module.exports = defineConfig( {
}
}

// Exclude Onboarding and ecommerce tests for WordPress lower than 6.5 (6.4 or 6.3) or PHP lower than 7.4 (7.1, 7.2 and 7.3)
if ( semver.satisfies( config.env.wpSemverVersion, '<6.5.0' ) || semver.satisfies( config.env.phpSemverVersion, '<7.4.0' )) {
// Tests require Wondor Theme, exclude if not supported due to WP or PHP versions
if ( ! supportsWonderTheme( config.env ) ) {
config.excludeSpecPattern = config.excludeSpecPattern.concat( [
'vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/**', // Onboarding requires Wonder Theme
'vendor/newfold-labs/wp-module-ecommerce/tests/cypress/integration/Home/ecommerce-next-steps.cy.js', // Requires Onboarding
] );
}

// Tests requires Woo, so exclude if not supported due to WP or PHP versions
if ( ! supportsWoo( config.env ) ) {
config.excludeSpecPattern = config.excludeSpecPattern.concat( [
'vendor/newfold-labs/wp-module-ecommerce/tests/cypress/integration/Site-Capabilities/**',
'vendor/newfold-labs/wp-module-ecommerce/tests/cypress/integration/Home/homePageWithWoo.cy.js',
'vendor/newfold-labs/wp-module-ecommerce/tests/cypress/integration/Home/ecommerce-next-steps.cy.js', // Skip this since Onboarding does not support this version
'vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/**' // Onboarding requires WP 6.5 or greater, as it uses the Wonder Theme which has the same requirement
'vendor/newfold-labs/wp-module-coming-soon/tests/cypress/integration/coming-soon-woo.cy.js',
] );
}

// Test requires Jetpack, so exclude if not supported due to WP or PHP versions
if ( ! supportsJetpack( config.env ) ) {
config.excludeSpecPattern = config.excludeSpecPattern.concat( [
'vendor/newfold-labs/wp-module-solutions/tests/cypress/integration/wp-plugins-installation-check.cy.js',
] );
}

Expand All @@ -81,3 +93,37 @@ module.exports = defineConfig( {
retries: 1,
experimentalMemoryManagement: true,
} );

// Check against plugin support at https://wordpress.org/plugins/woocommerce/
const supportsWoo = ( env ) => {
const semver = require( 'semver' );
if (
semver.satisfies( env.wpSemverVersion, '>=6.5.0' ) &&
semver.satisfies( env.phpSemverVersion, '>=7.4.0' )
) {
return true;
}
return false;
};
// Check against plugin support at https://wordpress.org/plugins/jetpack/
const supportsJetpack = ( env ) => {
const semver = require( 'semver' );
if (
semver.satisfies( env.wpSemverVersion, '>=6.6.0' ) &&
semver.satisfies( env.phpSemverVersion, '>=7.2.0' )
) {
return true;
}
return false;
};
// Check against theme support at https://github.com/newfold-labs/yith-wonder/blob/master/style.css
const supportsWonderTheme = ( env ) => {
const semver = require( 'semver' );
if (
semver.satisfies( env.wpSemverVersion, '>=6.5.0' ) &&
semver.satisfies( env.phpSemverVersion, '>=7.0.0' )
) {
return true;
}
return false;
};
Loading

0 comments on commit c667bbd

Please sign in to comment.