Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Merge pull request #739 from bluehost/release/3.4.1
Browse files Browse the repository at this point in the history
Release/3.4.1
  • Loading branch information
wpscholar authored Oct 16, 2023
2 parents bb99e14 + e7379ad commit 6c97d29
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": "WordPress/WordPress#tags/6.3.1",
"core": "WordPress/WordPress#tags/6.3.2",
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
Expand Down
6 changes: 3 additions & 3 deletions bluehost-wordpress-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
* Plugin Name: The Bluehost Plugin
* Plugin URI: https://bluehost.com
* Description: WordPress plugin that integrates a WordPress site with the Bluehost control panel, including performance, security, and update features.
* Version: 3.4.0
* Version: 3.4.1
* Requires at least: 6.0
* Requires PHP: 7.1
* Tested up to: 6.3
* Tested up to: 6.3.2
* Author: Bluehost
* Author URI: https://bluehost.com
* Text Domain: wp-plugin-bluehost
Expand All @@ -31,7 +31,7 @@
}

// Define constants
define( 'BLUEHOST_PLUGIN_VERSION', '3.4.0' );
define( 'BLUEHOST_PLUGIN_VERSION', '3.4.1' );
define( 'BLUEHOST_PLUGIN_FILE', __FILE__ );
define( 'BLUEHOST_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'BLUEHOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"newfold-labs/wp-module-data": "^2.4.8",
"newfold-labs/wp-module-deactivation": "^1.0",
"newfold-labs/wp-module-ecommerce": "^1.3.0",
"newfold-labs/wp-module-global-ctb": "^1.0.4",
"newfold-labs/wp-module-global-ctb": "^1.0.5",
"newfold-labs/wp-module-help-center": "1.0.17",
"newfold-labs/wp-module-loader": "^1.0.10",
"newfold-labs/wp-module-marketplace": "^2.0.2",
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

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

21 changes: 12 additions & 9 deletions inc/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,18 @@ public static function page() {
0
);

foreach ( self::subpages() as $route => $title ) {
\add_submenu_page(
'bluehost',
$title,
$title,
'manage_options',
$route,
array( __CLASS__, 'render' )
);
// If we're outside of Bluehost, add subpages to Bluehost menu
if ( false === ( isset( $_GET['page'] ) && strpos( filter_input( INPUT_GET, 'page', FILTER_UNSAFE_RAW ), 'bluehost' ) >= 0 ) ) { // phpcs:ignore
foreach ( self::subpages() as $route => $title ) {
\add_submenu_page(
'bluehost',
$title,
$title,
'manage_options',
$route,
array( __CLASS__, 'render' )
);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "WordPress plugin that integrates your WordPress site with the Bluehost control panel, including performance, security, and update features.",
"license": "GPL-2.0-or-later",
"version": "3.4.0",
"version": "3.4.1",
"private": true,
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/app-nav/logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Mark = () => {
};
return (
<Button
icon={ <Brand className="wppbh-logo" /> }
icon={ <Brand className="wppbh-logo nfd-w-full nfd-h-auto" /> }
style={ { width: '160px', height: 'auto' } }
onMouseUp={ defocus }
className="logo-mark nfd-p-0"
Expand Down
30 changes: 20 additions & 10 deletions src/app/pages/home/accountCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "@heroicons/react/24/outline";
import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime";
import { Card, Title } from "@newfold/ui-component-library";
import { addUtmParams, getPlatformBaseUrl, getPlatformPathUrl } from "../../util/helpers";
import { addUtmParams, getPlatformPathUrl, getPlatformBaseUrl } from "../../util/helpers";
import classNames from "classnames";

const isJarvis = NewfoldRuntime.sdk.isJarvis;
Expand All @@ -17,35 +17,43 @@ const base = [
{
icon: CpuChipIcon,
id: "account_link",
href: addUtmParams( getPlatformPathUrl("home", "app") ),
label: __("Control Panel", "bluehost-wordpress-plugin"),
href: addUtmParams( getPlatformPathUrl("hosting/list", "app") ),
label: isJarvis
? __("Hosting", "bluehost-wordpress-plugin")
: __("Control Panel", "bluehost-wordpress-plugin"),
color: "nfd-fill-gray",
},
{
icon: GiftIcon,
id: "products_link",
href: addUtmParams( getPlatformPathUrl("market-place", "account_center#products") ),
label: __("Products", "bluehost-wordpress-plugin"),
href: addUtmParams( getPlatformPathUrl("renewal-center", "account_center#products") ),
label: isJarvis
? __("Renewal Center", "bluehost-wordpress-plugin")
: __("Products", "bluehost-wordpress-plugin"),
color: "nfd-fill-primary-dark",
},
{
icon: CreditCardIcon,
id: "billing_link",
href: addUtmParams( getPlatformPathUrl("renewal-center", "account_center#billing") ),
label: __("Billing", "bluehost-wordpress-plugin"),
href: addUtmParams( getPlatformPathUrl("billing-center", "account_center#billing") ),
label: isJarvis
? __("Payment Methods", "bluehost-wordpress-plugin")
: __("Billing", "bluehost-wordpress-plugin"),
color: "nfd-fill-primary",
},
{
icon: EnvelopeIcon,
id: "mail_link",
href: addUtmParams( getPlatformPathUrl("home", "app#/email-office") ),
label: __("Mail & Office", "bluehost-wordpress-plugin"),
label: isJarvis
? __("Mail", "bluehost-wordpress-plugin")
: __("Mail & Office", "bluehost-wordpress-plugin"),
color: "nfd-fill-[#5b5b5b]",
},
{
icon: ShieldCheckIcon,
id: "security_link",
href: addUtmParams( getPlatformPathUrl("security", "account_center#security") ),
href: addUtmParams( getPlatformPathUrl("account-center", "account_center#security") ),
label: __("Security", "bluehost-wordpress-plugin"),
color: "nfd-fill-[#17b212]",
},
Expand All @@ -55,7 +63,9 @@ const base = [
href: isJarvis
? addUtmParams( getPlatformPathUrl("account-center") )
: addUtmParams( getPlatformBaseUrl("/cgi/token") ),
label: __("Validation Token", "bluehost-wordpress-plugin"),
label: isJarvis
? __("Profile", "bluehost-wordpress-plugin")
: __("Validation Token", "bluehost-wordpress-plugin"),
color: "nfd-fill-[#f89c24]",
},
];
Expand Down
58 changes: 23 additions & 35 deletions tests/cypress/integration/navigation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ describe('Navigation', function () {

});

it('Admin submenu shouldn\'t exist inside app', () => {
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu')
.should('not.exist');
});

it('Logo Links to home', () => {
cy.get('.wppbh-logo-wrap').click();
cy.wait(500);
cy.hash().should('eq', '#/home');
});

it('Admin Subnav properly highlights', () => {
cy
.get('#adminmenu #toplevel_page_bluehost')
.should('have.class', 'wp-has-current-submenu');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /home/);
});

// test main nav
it('Main nav links properly navigates', () => {
Expand All @@ -35,10 +31,6 @@ describe('Navigation', function () {
cy
.get('.wppbh-app-navitem-Marketplace')
.should('have.class', 'active');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /marketplace/);

cy.get('.wppbh-app-navitem-Performance').click();
cy.wait(500);
Expand All @@ -49,18 +41,10 @@ describe('Navigation', function () {
cy
.get('.wppbh-app-navitem-Marketplace')
.should('not.have.class', 'active');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /performance/);

cy.get('.wppbh-app-navitem-Settings').click();
cy.wait(500);
cy.hash().should('eq', '#/settings');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /settings/);
});

it('Subnav links properly navigates', () => {
Expand All @@ -76,21 +60,13 @@ describe('Navigation', function () {
cy
.get('.wppbh-app-navitem-Marketplace')
.should('have.class', 'active');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /marketplace/);

cy.get('.wppbh-app-subnavitem-Services').click();
cy.wait(500);
cy.hash().should('eq', '#/marketplace/services');
cy
.get('.wppbh-app-subnavitem-Services')
.should('have.class', 'active');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /marketplace/);
cy
.get('.wppbh-app-navitem-Marketplace')
.should('have.class', 'active');
Expand All @@ -105,14 +81,10 @@ describe('Navigation', function () {
cy
.get('.wppbh-app-subnavitem-Services')
.should('not.have.class', 'active');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /marketplace/);
cy
.get('.wppbh-app-navitem-Marketplace')
.should('have.class', 'active');

cy.get('.wppbh-app-navitem-Performance').click();
cy.wait(500);
cy
Expand All @@ -126,6 +98,22 @@ describe('Navigation', function () {
.should('not.have.class', 'active');
});

it('Admin submenu exist outside the app', () => {
cy.visit('/wp-admin/index.php');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu')
.should('exist');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/home"]')
.should('exist');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/marketplace"]')
.should('exist');
cy
.get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/settings"]')
.should('exist');
});

// utility nav is no more, leaving this in place un case we bring it back anytime soon.
it.skip('Utility nav links properly navigates', () => {
cy
Expand Down

0 comments on commit 6c97d29

Please sign in to comment.