Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #462

Merged
merged 11 commits into from
Dec 4, 2024
17 changes: 0 additions & 17 deletions assets/js/scripts-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,6 @@ jQuery( function( $ ) {
*/
function handlePlugins() {
const optimoleCheckbox = $( '#wizard-optimole-checkbox' );
const hyveCheckbox = $( '#wizard-hyve-checkbox' );

let promiseChain = Promise.resolve();

if ( optimoleCheckbox.length && optimoleCheckbox.is( ':checked' ) ) {
Expand All @@ -596,19 +594,6 @@ jQuery( function( $ ) {
});
}

if ( hyveCheckbox.length && hyveCheckbox.is( ':checked' ) ) {
promiseChain = promiseChain
.then(() => {
if ( ! wpmmVars.isHyveInstalled ) {
return installPlugin( 'hyve-lite' ).then( () => activatePlugin( 'hyve-lite' ) );
}

if ( ! wpmmVars.isHyveActive ) {
return activatePlugin( 'hyve-lite' );
}
});
}

return promiseChain.catch( ( error ) => {
console.error( 'Error in plugin installation or activation:', error );
});
Expand Down Expand Up @@ -676,8 +661,6 @@ jQuery( function( $ ) {
return $.get( wpmmVars.otterActivationLink );
case 'optimole-wp':
return $.get( wpmmVars.optimoleActivationLink );
case 'hyve-lite':
return $.get( wpmmVars.hyveActivationLink );
default:
break;
}
Expand Down
30 changes: 18 additions & 12 deletions composer.lock

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

12 changes: 0 additions & 12 deletions includes/classes/wp-maintenance-mode-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ public function enqueue_admin_scripts() {
'isOtterActive' => is_plugin_active( 'otter-blocks/otter-blocks.php' ),
'isOptimoleInstalled' => file_exists( ABSPATH . 'wp-content/plugins/optimole-wp/optimole-wp.php' ),
'isOptimoleActive' => is_plugin_active( 'optimole-wp/optimole-wp.php' ),
'isHyveInstalled' => file_exists( ABSPATH . 'wp-content/plugins/hyve-lite/hyve-lite.php' ),
'isHyveActive' => is_plugin_active( 'hyve-lite/hyve-lite.php' ),
'errorString' => __( 'Something went wrong, please try again.', 'wp-maintenance-mode' ),
'loadingString' => __( 'Doing some magic...', 'wp-maintenance-mode' ),
'importingText' => __( 'Importing', 'wp-maintenance-mode' ),
Expand Down Expand Up @@ -189,16 +187,6 @@ public function enqueue_admin_scripts() {
),
esc_url( network_admin_url( 'plugins.php' ) )
),
'hyveActivationLink' => add_query_arg(
array(
'action' => 'activate',
'plugin' => rawurlencode( 'hyve-lite/hyve-lite.php' ),
'plugin_status' => 'all',
'paged' => '1',
'_wpnonce' => wp_create_nonce( 'activate-plugin_hyve-lite/hyve-lite.php' ),
),
esc_url( network_admin_url( 'plugins.php' ) )
),
'modalTexts' => array(
'title' => __( 'The template has been imported!', 'wp-maintenance-mode' ),
'description' => __( 'The template has been imported to a new draft page. You can take a look and enable it from plugin settings.', 'wp-maintenance-mode' ),
Expand Down
27 changes: 0 additions & 27 deletions views/wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
),
);

$show_hyve_promo = version_compare( PHP_VERSION, '8.1', '>=' ) && ! is_plugin_active( 'hyve-lite/hyve-lite.php' ) && ! defined( 'HYVE_LITE_VERSION' );

?>
<div id="wpmm-wizard-wrapper">
<div class="slider-wrap">
Expand Down Expand Up @@ -88,31 +86,6 @@
</div>
<?php } ?>

<?php if ( $show_hyve_promo ) { ?>
<div class="optimole-upsell">
<div class="optimole-upsell-container">
<span class="components-checkbox-control__input-container">
<input id="wizard-hyve-checkbox" type="checkbox" class="components-checkbox-control__input" checked>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" role="presentation" class="components-checkbox-control__checked" aria-hidden="true" focusable="false"><path d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"></path></svg>
</span>
<label for="wizard-hyve-checkbox">
<?php esc_html_e( 'Interactive Chatbot', 'wp-maintenance-mode' ); ?>
</label>
</div>
<p class="description">
<?php
printf(
wp_kses(
/* translators: Hyve Lite url */
__( '<a href="%1$s" target="_blank">Hyve%2$s</a> is an AI chatbot plugin for WordPress, ideal for sites in maintenance mode. It enhances user experience by turning your content into interactive conversations, helping visitors access information while your site is under development.', 'wp-maintenance-mode' ),
wpmm_translated_string_allowed_html()
),
esc_url( 'https://wordpress.org/plugins/hyve-lite/' ),
$this->get_external_link_icon()
);
?>
</div>
<?php } ?>
<div id="wizard-buttons" class="import-button">
<input type="button" class="button button-big button-primary disabled button-import" value="<?php esc_html_e( 'Continue', 'wp-maintenance-mode' ); ?>"/>
<input type="button" class="button button-big button-secondary button-skip" value="<?php esc_html_e( 'I don’t want to use a template', 'wp-maintenance-mode' ); ?>"/>
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2698,9 +2698,9 @@ cosmiconfig@^7.0.0:
yaml "^1.10.0"

cross-spawn@^7.0.0, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
version "7.0.6"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==
dependencies:
path-key "^3.1.0"
shebang-command "^2.0.0"
Expand Down
Loading