diff --git a/composer.json b/composer.json index 909773f84..314b331fd 100644 --- a/composer.json +++ b/composer.json @@ -67,7 +67,7 @@ }, "require": { "newfold-labs/wp-module-business-reviews": "^1.1.1", - "newfold-labs/wp-module-coming-soon": "^1.1.15", + "newfold-labs/wp-module-coming-soon": "^1.1.16", "newfold-labs/wp-module-ctb": "^1.1.2", "newfold-labs/wp-module-customer-bluehost": "^1.6.0", "newfold-labs/wp-module-data": "^2.4.16", diff --git a/composer.lock b/composer.lock index 22975f9c9..5870c4828 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": "24a154b682117a3cc2d38e7ad973c5db", + "content-hash": "3471384cccebdf9525cbc051a97ddaf3", "packages": [ { "name": "doctrine/inflector", @@ -272,16 +272,16 @@ }, { "name": "newfold-labs/wp-module-coming-soon", - "version": "1.1.15", + "version": "1.1.16", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-coming-soon.git", - "reference": "09e5a9bac43102bb0ebc2547b0952a85b17c6138" + "reference": "224a336252579ed32da06b0f1a5c0d347e281db5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-coming-soon/zipball/09e5a9bac43102bb0ebc2547b0952a85b17c6138", - "reference": "09e5a9bac43102bb0ebc2547b0952a85b17c6138", + "url": "https://api.github.com/repos/newfold-labs/wp-module-coming-soon/zipball/224a336252579ed32da06b0f1a5c0d347e281db5", + "reference": "224a336252579ed32da06b0f1a5c0d347e281db5", "shasum": "" }, "require": { @@ -318,10 +318,10 @@ ], "description": "Coming Soon module for WordPress sites.", "support": { - "source": "https://github.com/newfold-labs/wp-module-coming-soon/tree/1.1.15", + "source": "https://github.com/newfold-labs/wp-module-coming-soon/tree/1.1.16", "issues": "https://github.com/newfold-labs/wp-module-coming-soon/issues" }, - "time": "2024-01-16T16:23:29+00:00" + "time": "2024-01-17T23:06:56+00:00" }, { "name": "newfold-labs/wp-module-ctb", diff --git a/inc/RestApi/SettingsController.php b/inc/RestApi/SettingsController.php index bfaa1731f..3df1074a9 100644 --- a/inc/RestApi/SettingsController.php +++ b/inc/RestApi/SettingsController.php @@ -2,6 +2,8 @@ namespace Bluehost\RestApi; +use function NewfoldLabs\WP\ModuleLoader\container; + /** * Class SettingsController */ @@ -67,8 +69,11 @@ public function update_item( $request ) { $new_value = $params[ $setting ]; switch ( $setting ) { case 'comingSoon': - $new_value = ( $new_value ) ? 'true' : 'false'; - update_option( 'nfd_coming_soon', $new_value ); + if ( $new_value ) { + container()->get( 'comingSoon' )->enable(); + } else { + container()->get( 'comingSoon' )->disable(); + } break; case 'autoUpdatesMajorCore': $new_value = ( $new_value ) ? 'true' : 'false'; @@ -170,7 +175,7 @@ public function get_current_settings() { } $settings = array( - 'comingSoon' => ( 'true' === get_option( 'nfd_coming_soon', 'false' ) ), + 'comingSoon' => container()->get( 'comingSoon' )->is_enabled(), 'autoUpdatesAll' => $major && $plugins && $themes, 'autoUpdatesMajorCore' => $major, 'autoUpdatesMinorCore' => $minor, diff --git a/inc/base.php b/inc/base.php index 45efb184c..8fde9ab5f 100644 --- a/inc/base.php +++ b/inc/base.php @@ -87,19 +87,3 @@ function bluehost_install_date_filter( $install_date ) { return bluehost_get_plugin_install_date(); } add_filter( 'nfd_install_date_filter', __NAMESPACE__ . '\\bluehost_install_date_filter' ); - - -/** - * Update mm value when updating nfd one - * - * @param mixed $new_option New option value. - * @param mixed $old_option Previous option value. - * - * @return mixed - */ -function site_launched( $new_option, $old_option ) { - update_option( 'mm_coming_soon', $new_option ); - return $new_option; -} - -add_filter( 'pre_update_option_nfd_coming_soon', __NAMESPACE__ . '\\site_launched', 10, 2 ); diff --git a/inc/jetpack.php b/inc/jetpack.php index 6c076047a..59296b3e1 100644 --- a/inc/jetpack.php +++ b/inc/jetpack.php @@ -44,15 +44,4 @@ function jetpack_unregister_blocks( $blocks ) { return $blocks; } -add_filter( 'jetpack_set_available_blocks', __NAMESPACE__ . '\\jetpack_unregister_blocks' ); - -/** - * Tell jetpack that the site is in construction mode. - * See https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php#L1122-L1143 - */ -function jetpack_construction() { - if ( 'true' === get_option( 'nfd_coming_soon', 'false' ) ) { - return true; - } -} -add_filter( 'jetpack_is_under_construction_plugin', __NAMESPACE__ . '\\jetpack_construction' ); \ No newline at end of file +add_filter( 'jetpack_set_available_blocks', __NAMESPACE__ . '\\jetpack_unregister_blocks' ); \ No newline at end of file diff --git a/inc/upgrades/2.12.11.php b/inc/upgrades/2.12.11.php deleted file mode 100644 index 43185de25..000000000 --- a/inc/upgrades/2.12.11.php +++ /dev/null @@ -1,13 +0,0 @@ -