From 9ff4c0b0f3971e9947ffcdef645910b0fa5e9492 Mon Sep 17 00:00:00 2001 From: Dave Ryan Date: Sat, 21 Sep 2024 12:07:14 -0700 Subject: [PATCH 1/6] Temporarily remove revision settings UI and filter --- bluehost-wordpress-plugin.php | 4 ++-- inc/settings.php | 2 +- package.json | 2 +- src/app/pages/settings/contentSettings.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bluehost-wordpress-plugin.php b/bluehost-wordpress-plugin.php index 0c0bceb62..8a2e0a2a3 100644 --- a/bluehost-wordpress-plugin.php +++ b/bluehost-wordpress-plugin.php @@ -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.14.10 + * Version: 3.14.11 * Requires at least: 6.4 * Requires PHP: 7.3 * Tested up to: 6.6.2 @@ -32,7 +32,7 @@ } // Define constants -define( 'BLUEHOST_PLUGIN_VERSION', '3.14.10' ); +define( 'BLUEHOST_PLUGIN_VERSION', '3.14.11' ); define( 'BLUEHOST_PLUGIN_FILE', __FILE__ ); define( 'BLUEHOST_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'BLUEHOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); diff --git a/inc/settings.php b/inc/settings.php index 1018bdfb1..1a1234c36 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -18,7 +18,7 @@ function nfd_settings_revisions( $num, $post ) { return get_option( 'nfd_wp_post_revisions', 5 ); } -add_filter( 'wp_revisions_to_keep', __NAMESPACE__ . '\\nfd_settings_revisions', 10, 2 ); +// add_filter( 'wp_revisions_to_keep', __NAMESPACE__ . '\\nfd_settings_revisions', 10, 2 ); if ( ! defined( 'EMPTY_TRASH_DAYS' ) ) { $nfd_empty_trash_days = get_option( 'nfd_empty_trash_days', 30 ); diff --git a/package.json b/package.json index 69f6343ee..9e39a3e6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bluehost-wordpress-plugin", - "version": "3.14.10", + "version": "3.14.11", "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/pages/settings/contentSettings.js b/src/app/pages/settings/contentSettings.js index 5121e30a3..5767805a7 100644 --- a/src/app/pages/settings/contentSettings.js +++ b/src/app/pages/settings/contentSettings.js @@ -200,7 +200,7 @@ const ContentSettings = () => { ) } >
- + {/* */} { isError && ( From 40851262bd52b9b8b8377dadce157b369dc78f84 Mon Sep 17 00:00:00 2001 From: Dave Ryan Date: Sat, 21 Sep 2024 12:08:52 -0700 Subject: [PATCH 2/6] change lock file too --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index f8f9486d2..3b1e26fb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bluehost-wordpress-plugin", - "version": "3.14.10", + "version": "3.14.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "bluehost-wordpress-plugin", - "version": "3.14.10", + "version": "3.14.11", "license": "GPL-2.0-or-later", "dependencies": { "@heroicons/react": "^2.1.5", From fea0193f3fdbf4e4a086ca0b8a041752c1a2482d Mon Sep 17 00:00:00 2001 From: Dave Ryan Date: Sat, 21 Sep 2024 12:12:31 -0700 Subject: [PATCH 3/6] Nix tests --- tests/cypress/integration/settings.cy.js | 34 ------------------------ 1 file changed, 34 deletions(-) diff --git a/tests/cypress/integration/settings.cy.js b/tests/cypress/integration/settings.cy.js index 83174fdfb..bd42cef27 100644 --- a/tests/cypress/integration/settings.cy.js +++ b/tests/cypress/integration/settings.cy.js @@ -200,40 +200,6 @@ describe( 'Settings Page', function () { } ); it( 'Content Settings Work', () => { - cy.get( '[data-id="content-revisions-select"]' ).click(); - cy.wait( 100 ); - cy.get( '[data-id="content-revisions-select"]' ) - .parent() - .next( 'ul.nfd-select__options' ) - .find( 'li:first' ) - .click(); // 1 - cy.wait( 100 ); - cy.get( '#content-revisions-select__description' ) - .contains( 'you can take 1 step back.' ) - .should( 'be.visible' ); - - cy.get( '[data-id="content-revisions-select"]' ).click(); - cy.wait( 1000 ); - cy.get( '[data-id="content-revisions-select"]' ) - .parent() - .next( 'ul.nfd-select__options' ) - .find( 'li:last' ) - .click(); // 40 - cy.wait( 100 ); - cy.get( '#content-revisions-select__description' ) - .contains( 'you can take 40 steps back.' ) - .should( 'be.visible' ); - - cy.get( '[data-id="content-revisions-select"]' ).click(); - cy.wait( 500 ); - cy.get( '[data-id="content-revisions-select"]' ) - .parent() - .next( 'ul.nfd-select__options' ) - .find( 'li:nth-child(2)' ) - .click(); // 5 - cy.get( '#content-revisions-select__description' ) - .contains( 'you can take 5 steps back.' ) - .should( 'be.visible' ); // Empty Trash Setting cy.get( '[data-id="empty-trash-select"]' ).click(); From 16f0caeaec4df4583b0a0e969c4e79e19ba946ad Mon Sep 17 00:00:00 2001 From: Dave Ryan Date: Sat, 21 Sep 2024 12:12:50 -0700 Subject: [PATCH 4/6] Fully remove wp_revisions_to_keep method --- inc/settings.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/inc/settings.php b/inc/settings.php index 1a1234c36..078372950 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -8,18 +8,6 @@ namespace Bluehost; -/** - * Filter wp revisions according to plugin setting - * - * @param int $num Number of posts to retain (unused). - * @param WP_Post|object $post Post object (unused). - * @return int - */ -function nfd_settings_revisions( $num, $post ) { - return get_option( 'nfd_wp_post_revisions', 5 ); -} -// add_filter( 'wp_revisions_to_keep', __NAMESPACE__ . '\\nfd_settings_revisions', 10, 2 ); - if ( ! defined( 'EMPTY_TRASH_DAYS' ) ) { $nfd_empty_trash_days = get_option( 'nfd_empty_trash_days', 30 ); define( 'EMPTY_TRASH_DAYS', $nfd_empty_trash_days ); From 7bea44fa5813d6d6d146b12f48e5312e1a638b2a Mon Sep 17 00:00:00 2001 From: Dave Ryan Date: Sat, 21 Sep 2024 12:13:01 -0700 Subject: [PATCH 5/6] Remove render of ContentRevisions --- src/app/pages/settings/contentSettings.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/pages/settings/contentSettings.js b/src/app/pages/settings/contentSettings.js index 5767805a7..5afd8ba82 100644 --- a/src/app/pages/settings/contentSettings.js +++ b/src/app/pages/settings/contentSettings.js @@ -200,7 +200,6 @@ const ContentSettings = () => { ) } >
- {/* */} { isError && ( From 49f25d4e98200bf09adc19ff82a50c459b9b73fa Mon Sep 17 00:00:00 2001 From: Dave Ryan Date: Sat, 21 Sep 2024 12:26:17 -0700 Subject: [PATCH 6/6] tests remove unused component --- src/app/pages/settings/contentSettings.js | 91 ----------------------- 1 file changed, 91 deletions(-) diff --git a/src/app/pages/settings/contentSettings.js b/src/app/pages/settings/contentSettings.js index 5afd8ba82..570824c1b 100644 --- a/src/app/pages/settings/contentSettings.js +++ b/src/app/pages/settings/contentSettings.js @@ -5,97 +5,6 @@ import AppStore from 'App/data/store'; import { bluehostSettingsApiFetch } from 'App/util/helpers'; import { useNotification } from 'App/components/notifications'; -const ContentRevisions = ( { setError, notify } ) => { - const { store, setStore } = useContext( AppStore ); - const [ contentRevisions, setNumContentRevisions ] = useState( - store.contentRevisions - ); - - const contentRevisionsNoticeTitle = () => { - return __( 'Post revision setting saved ', 'wp-plugin-bluehost' ); - }; - - const contentRevisionsNoticeText = () => { - return ( - __( 'Posts will save ', 'wp-plugin-bluehost' ) + - contentRevisions + - _n( - ' revision.', - ' revisions.', - parseInt( contentRevisions ), - 'wp-plugin-bluehost' - ) - ); - }; - - const contentRevisionsDescriptionText = () => { - return ( - __( - 'Saving drafts and updating published content creates revisions. Make changes with confidence, knowing you can take ', - 'wp-plugin-bluehost' - ) + - contentRevisions + - _n( - ' step back.', - ' steps back.', - parseInt( contentRevisions ), - 'wp-plugin-bluehost' - ) - ); - }; - - const handleContentRevisionsChange = ( value ) => { - bluehostSettingsApiFetch( - { contentRevisions: value }, - setError, - // eslint-disable-next-line no-unused-vars - ( response ) => { - setNumContentRevisions( value ); - } - ); - }; - - const notifySuccess = () => { - notify.push( 'content-revision-notice', { - title: contentRevisionsNoticeTitle(), - description: { contentRevisionsNoticeText() }, - variant: 'success', - autoDismiss: 5000, - } ); - }; - - useUpdateEffect( () => { - setStore( { - ...store, - contentRevisions, - } ); - - notifySuccess(); - }, [ contentRevisions ] ); - - return ( - - ); -}; - const EmptyTrash = ( { setError, notify } ) => { const { store, setStore } = useContext( AppStore ); const [ emptyTrashDays, setNumEmptyTrashDays ] = useState(