diff --git a/bluehost-wordpress-plugin.php b/bluehost-wordpress-plugin.php index 5a1fa9c01..8ebfc24ee 100644 --- a/bluehost-wordpress-plugin.php +++ b/bluehost-wordpress-plugin.php @@ -4,7 +4,7 @@ * * @package WPPluginBluehost * @author Newfold Digital - * @copyright Copyright 2023 by Newfold Digital - All rights reserved. + * @copyright Copyright 2024 by Newfold Digital - All rights reserved. * @license GPL-2.0-or-later * * @wordpress-plugin @@ -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.9.3 + * Version: 3.9.4 * Requires at least: 6.0 * Requires PHP: 7.1 * Tested up to: 6.5.2 @@ -32,7 +32,7 @@ } // Define constants -define( 'BLUEHOST_PLUGIN_VERSION', '3.9.3' ); +define( 'BLUEHOST_PLUGIN_VERSION', '3.9.4' ); define( 'BLUEHOST_PLUGIN_FILE', __FILE__ ); define( 'BLUEHOST_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'BLUEHOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); diff --git a/composer.json b/composer.json index 0109621e6..36b3f6be8 100644 --- a/composer.json +++ b/composer.json @@ -61,15 +61,15 @@ }, "require-dev": { "roave/security-advisories": "dev-latest", - "newfold-labs/wp-php-standards": "^1.2", - "wp-cli/i18n-command": "^2.5.0", - "wp-phpunit/wp-phpunit": "^6.4.2" + "newfold-labs/wp-php-standards": "^1.2.2", + "wp-cli/i18n-command": "^2.6.1", + "wp-phpunit/wp-phpunit": "^6.5.2" }, "require": { "newfold-labs/wp-module-activation": "^1.0.1", "newfold-labs/wp-module-coming-soon": "^1.2.3", "newfold-labs/wp-module-context": "^1.0.0", - "newfold-labs/wp-module-data": "^2.4.20", + "newfold-labs/wp-module-data": "^2.4.24", "newfold-labs/wp-module-deactivation": "^1.1.1", "newfold-labs/wp-module-ecommerce": "^1.3.28", "newfold-labs/wp-module-global-ctb": "^1.0.11", @@ -78,12 +78,12 @@ "newfold-labs/wp-module-marketplace": "^2.2.4", "newfold-labs/wp-module-notifications": "^1.2.5", "newfold-labs/wp-module-onboarding": "^2.1.9", - "newfold-labs/wp-module-patterns": "^0.1.15", + "newfold-labs/wp-module-patterns": "^0.1.18", "newfold-labs/wp-module-performance": "^1.4.0", "newfold-labs/wp-module-runtime": "^1.0.10", "newfold-labs/wp-module-secure-passwords": "^1.1.1", - "newfold-labs/wp-module-sso": "^1.0.4", - "newfold-labs/wp-module-staging": "^1.3.0", + "newfold-labs/wp-module-sso": "^1.0.5", + "newfold-labs/wp-module-staging": "^1.3.3", "wp-forge/wp-update-handler": "^1.0.2", "wp-forge/wp-upgrade-handler": "^1.0" } diff --git a/composer.lock b/composer.lock index b3ed20bd8..bf27523e3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c64335a505426775cf9666ac37868d5f", + "content-hash": "3b6feba64a1a3a41aca68f84d00bab32", "packages": [ { "name": "doctrine/inflector", diff --git a/inc/Admin.php b/inc/Admin.php index 264e80231..0b9e50ce2 100644 --- a/inc/Admin.php +++ b/inc/Admin.php @@ -66,6 +66,9 @@ public static function subpages() { $home = array( 'bluehost#/home' => __( 'Home', 'wp-plugin-bluehost' ), ); + $pagesAndPosts = array( + 'bluehost#/pages-and-posts' => __( 'Pages & Posts', 'wp-plugin-bluehost' ), + ); $store = array( 'bluehost#/store' => __( 'Store', 'wp-plugin-bluehost' ), ); @@ -89,6 +92,7 @@ public static function subpages() { if ( 'atomic' === getContext( 'platform' ) ) { return array_merge( $home, + $pagesAndPosts, $store, $marketplace, $settings, @@ -98,6 +102,7 @@ public static function subpages() { return array_merge( $home, + $pagesAndPosts, $store, $marketplace, $performance, diff --git a/package-lock.json b/package-lock.json index 46687951e..26456e4a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7128,13 +7128,13 @@ "dev": true }, "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", "dev": true, "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -7142,7 +7142,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.1", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -10926,17 +10926,17 @@ "dev": true }, "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -10968,9 +10968,9 @@ } }, "node_modules/express/node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "dev": true, "engines": { "node": ">= 0.6" @@ -18365,9 +18365,9 @@ } }, "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dev": true, "dependencies": { "bytes": "3.1.2", @@ -22156,9 +22156,9 @@ } }, "node_modules/webpack-dev-middleware": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz", - "integrity": "sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA==", + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz", + "integrity": "sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q==", "dev": true, "dependencies": { "colorette": "^2.0.10", diff --git a/package.json b/package.json index f6d4877c3..b05060cef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bluehost-wordpress-plugin", - "version": "3.9.3", + "version": "3.9.4", "description": "WordPress plugin that integrates your WordPress site with the Bluehost control panel, including performance, security, and update features.", "author": { "name": "Bluehost", diff --git a/src/app/data/routes.js b/src/app/data/routes.js index 7e413ed46..6826209fa 100644 --- a/src/app/data/routes.js +++ b/src/app/data/routes.js @@ -5,6 +5,7 @@ import { BoltIcon, AdjustmentsHorizontalIcon, BuildingStorefrontIcon, + DocumentDuplicateIcon, } from '@heroicons/react/24/outline'; import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; import { Route, Routes } from 'react-router-dom'; @@ -18,6 +19,7 @@ import Staging from '../pages/staging'; import Help from '../pages/help'; import { getMarketplaceSubnavRoutes } from '@modules/wp-module-marketplace/components/marketplaceSubnav'; import { ReactComponent as HelpIcon } from '../components/icons/HelpIcon.svg'; +import PagesAndPosts from '../pages/pages-and-posts'; const addPartialMatch = ( prefix, path ) => prefix === path ? `${ prefix }/*` : path; @@ -64,6 +66,7 @@ export const AppRoutes = () => { const topRoutePaths = [ '/home', + '/pages-and-posts', '/store', '/marketplace', '/performance', @@ -80,6 +83,13 @@ export const routes = [ Icon: HomeIcon, condition: true, }, + { + name: '/pages-and-posts', + title: __( 'Pages & Posts', 'wp-plugin-bluehost' ), + Component: PagesAndPosts, + Icon: DocumentDuplicateIcon, + condition: true, + }, { name: '/store', title: __( 'Store', 'wp-plugin-bluehost' ), diff --git a/src/app/pages/pages-and-posts/ProductsPages.js b/src/app/pages/pages-and-posts/ProductsPages.js new file mode 100644 index 000000000..fd3dc49dd --- /dev/null +++ b/src/app/pages/pages-and-posts/ProductsPages.js @@ -0,0 +1,49 @@ +import { Button, Card, Title } from '@newfold/ui-component-library'; + +const ProductsPages = () => { + return ( + + + + + + + + { __( 'Products', 'wp-plugin-bluehost' ) } + +

+ { __( + 'Showcase physical and digital goods, product variations, and custom configurations.', + 'wp-plugin-bluehost' + ) } +

+
+
+ + { __( 'View all', 'wp-plugin-bluehost' ) } + + + + +
+
+ ); +}; + +export default ProductsPages; diff --git a/src/app/pages/pages-and-posts/blogPosts.js b/src/app/pages/pages-and-posts/blogPosts.js new file mode 100644 index 000000000..fe0920101 --- /dev/null +++ b/src/app/pages/pages-and-posts/blogPosts.js @@ -0,0 +1,49 @@ +import { Button, Card, Title } from '@newfold/ui-component-library'; + +const BlogPosts = () => { + return ( + + + + + + + + { __( 'Blog Posts', 'wp-plugin-bluehost' ) } + +

+ { __( + 'Add a new blog post or edit your existing posts.', + 'wp-plugin-bluehost' + ) } +

+
+
+ + { __( 'View all', 'wp-plugin-bluehost' ) } + + + + +
+
+ ); +}; + +export default BlogPosts; diff --git a/src/app/pages/pages-and-posts/bookingAndAppointments.js b/src/app/pages/pages-and-posts/bookingAndAppointments.js new file mode 100644 index 000000000..fcf6484e1 --- /dev/null +++ b/src/app/pages/pages-and-posts/bookingAndAppointments.js @@ -0,0 +1,49 @@ +import { Button, Card, Title } from '@newfold/ui-component-library'; + +const BookingAndAppointments = () => { + return ( + + + + + + + + { __( 'Bookings & Appointments', 'wp-plugin-bluehost' ) } + +

+ { __( + 'Add your list of services, setup a booking calendar, and edit your bookings form.', + 'wp-plugin-bluehost' + ) } +

+
+
+ + { __( 'View all', 'wp-plugin-bluehost' ) } + + + + +
+
+ ); +}; + +export default BookingAndAppointments; diff --git a/src/app/pages/pages-and-posts/index.js b/src/app/pages/pages-and-posts/index.js new file mode 100644 index 000000000..ea359e715 --- /dev/null +++ b/src/app/pages/pages-and-posts/index.js @@ -0,0 +1,90 @@ +import { Alert, Container, Page } from '@newfold/ui-component-library'; +import { useContext } from '@wordpress/element'; + +import SitePages from './sitePages'; +import BlogPosts from './blogPosts'; +import BookingAndAppointments from './bookingAndAppointments'; +import ProductsPages from './ProductsPages'; +import AppStore from '../../data/store'; + +const PagesAndPosts = () => { + const { store } = useContext( AppStore ); + + return ( + + + + + { __( + 'Your site is not live.', + 'wp-plugin-bluehost' + ) } + + + ) : ( + + + { __( + 'Your site is live.', + 'wp-plugin-bluehost' + ) } + + + ) + } + className={ 'wppbh-app-settings-header' } + > + { store?.comingSoon ? ( +

+ { __( + 'Visitors to your site will see your "Coming Soon" page and not your actual site. Visit', + 'wp-plugin-bluehost' + ) }{ ' ' } + + { __( '"Settings"', 'wp-plugin-bluehost' ) } + { ' ' } + { __( + 'to set your site live.', + 'wp-plugin-bluehost' + ) } +

+ ) : ( +

+ { __( + 'Visitors to your site will see all your publicly published pages.', + 'wp-plugin-bluehost' + ) } +

+ ) } +
+ +
+ + + { window.NewfoldRuntime.isWoocommerceActive && ( + + ) } + { window.NewfoldRuntime.isYithBookingActive && + window.NewfoldRuntime.isWoocommerceActive && ( + + ) } +
+
+
+ ); +}; + +export default PagesAndPosts; diff --git a/src/app/pages/pages-and-posts/sitePages.js b/src/app/pages/pages-and-posts/sitePages.js new file mode 100644 index 000000000..b2cbe38e1 --- /dev/null +++ b/src/app/pages/pages-and-posts/sitePages.js @@ -0,0 +1,51 @@ +import { Button, Card, Title } from '@newfold/ui-component-library'; + +const SitePages = () => { + return ( + + + + + + + + { __( 'Site Pages', 'wp-plugin-bluehost' ) } + +

+ { __( + 'Edit your homepage and other existing pages or add new pages to your site.', + 'wp-plugin-bluehost' + ) } +

+
+
+ + { __( 'View all', 'wp-plugin-bluehost' ) } + + + + +
+
+ ); +}; + +export default SitePages; diff --git a/tests/cypress/integration/pages-and-posts.cy.js b/tests/cypress/integration/pages-and-posts.cy.js new file mode 100644 index 000000000..fe5dd6e05 --- /dev/null +++ b/tests/cypress/integration/pages-and-posts.cy.js @@ -0,0 +1,113 @@ +describe( 'Pages & Posts', function () { + let NewfoldRuntime; + + before( () => { + cy.visit( + '/wp-admin/admin.php?page=' + + Cypress.env( 'pluginId' ) + + '#/pages-and-posts' + ); + cy.window() + .its( 'NewfoldRuntime' ) + .then( ( data ) => { + NewfoldRuntime = data; + } ); + cy.injectAxe(); + } ); + + it( 'Pages & Posts Exists', () => { + cy.get( '.wppbh-app-pagesAndPosts-page' ) + .contains( 'Pages & Posts' ) + .scrollIntoView() + .should( 'be.visible' ); + } ); + + it( 'site pages Exists', () => { + cy.get( '.wppbh-app-site-page' ) + .findByText( 'Site Pages' ) + .should( 'exist' ); + cy.get( '.wppbh-app-site-page' ) + .find( 'a[href="edit.php?post_type=page"]' ) + .click(); + cy.url().should( 'include', 'edit.php?post_type=page' ); + cy.go( 'back' ); + + cy.get( '.wppbh-app-site-page' ) + .find( 'a[href="post-new.php?post_type=page"] Button' ) + .click(); + cy.url().should( 'include', 'post-new.php?post_type=page' ); + cy.go( 'back' ); + } ); + + it( 'Blog posts Exists', () => { + cy.get( '.wppbh-app-blog-posts' ) + .findByText( 'Blog Posts' ) + .should( 'exist' ); + cy.get( '.wppbh-app-blog-posts' ).find( 'a[href="edit.php"]' ).click(); + cy.url().should( 'include', 'edit.php' ); + cy.go( 'back' ); + + cy.get( '.wppbh-app-blog-posts' ) + .get( 'a[href="post-new.php"] Button' ) + .click(); + cy.url().should( 'include', 'post-new.php' ); + cy.go( 'back' ); + } ); + + it( 'Bookings & Appointments Exists', () => { + if ( + NewfoldRuntime.isYithBookingActive && + NewfoldRuntime.isWoocommerceActive + ) { + cy.get( '.wppbh-app-bookings' ) + .findByText( 'Bookings & Appointments' ) + .should( 'exist' ); + cy.get( '.wppbh-app-bookings' ) + .find( + 'a[href="edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1"]' + ) + .first() + .click(); + cy.url().should( + 'include', + 'edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1' + ); + cy.go( 'back' ); + + cy.get( '.wppbh-app-bookings' ) + .find( + 'a[href="edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1"] Button' + ) + .last() + .click(); + cy.url().should( + 'include', + 'edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1' + ); + cy.go( 'back' ); + } else { + cy.findByText( 'Bookings & Appointments' ).should( 'not.exist' ); + } + } ); + + it( 'Products Exists', () => { + if ( NewfoldRuntime.isWoocommerceActive ) { + cy.get( '.wppbh-app-products' ) + .findByText( 'Products' ) + .should( 'exist' ); + cy.get( '.wppbh-app-products' ) + .find( 'a[href="edit.php?post_type=product"]' ) + .click(); + cy.url().should( 'include', 'edit.php?post_type=product' ); + cy.go( 'back' ); + + cy.get( '.wppbh-app-products' ) + .find( 'a[href="post-new.php?post_type=product"] Button' ) + .click(); + cy.url().should( 'include', 'post-new.php?post_type=product' ); + cy.go( 'back' ); + } else { + cy.findByText( 'Products' ).should( 'not.exist' ); + } + } ); +} );