Skip to content

Add deactivation modal #822

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

Merged
merged 9 commits into from
Jul 2, 2025
Merged

Conversation

timotei-litespeed
Copy link
Contributor

@timotei-litespeed timotei-litespeed commented Apr 2, 2025

Add survey modal on plugin deactivation.
In multisite will show the modal just in main site.

Add survey modal on plugin deactivation.
Add questions about why deactivating and possibility to clear settings(Multisite supported)
@timotei-litespeed timotei-litespeed changed the base branch from dev to v7.2 April 18, 2025 06:04
@timotei-litespeed timotei-litespeed changed the base branch from v7.2 to dev May 9, 2025 18:34
Comment on lines 18 to 23
<div class="litespeed litespeed-modal<?php
if(isset($_progress) && $_progress ) {
echo ' litespeed-progress';
}
?>"<?php if($_id ) { echo ' id="' . $_id . '"';
} ?>>
Copy link
Contributor

@szepeviktor szepeviktor Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WordPress core lacks a template engine.
I would introduce a very tiny engine to build HTML.
e.g. https://github.com/szepeviktor/SentencePress/tree/master/src/Html
( ?>"<? looks like ASCII art)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Can consider a generic tpl engine like smart template if needed. Can just keep as is for current templates as long as we resolved the syntax format checker reports.

Copy link
Contributor

@szepeviktor szepeviktor Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$modal = new SzepeViktor\SentencePress\Html\Element(
    'div',
    [],
    'The Content'
);

$modal_classes = [
    'litespeed',
    'litespeed-modal',
];
if (isset($_progress) && $_progress) {
    $modal_classes[] = 'litespeed-progress';
}
$modal->setAttribute('class', implode(' ', $modal_classes));

if ($_id) {
    $modal->setAttribute('id', $_id);
}

print $modal->render();

self::delete_site_tables();

// Cloud uninstall
Cloud::version_check('uninstall');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timotei-litespeed Uninstall shouldn't be called in deactivation.

$wpdb->query($wpdb->prepare("DELETE FROM `$wpdb->options` WHERE option_name LIKE '%s'", array('litespeed.%')));
}

private static function delete_site_tables()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timotei-litespeed What is this func for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hi-hai The function is used to delete all settings that are related to LSCWP.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see nowhere it is used.

@timotei-litespeed timotei-litespeed marked this pull request as draft June 26, 2025 13:28
@Tymotey Tymotey force-pushed the Deactivate-modal branch 5 times, most recently from 4bcb6f3 to b9d4e98 Compare June 26, 2025 21:19
@Tymotey Tymotey force-pushed the Deactivate-modal branch from b9d4e98 to 2c7fed8 Compare June 27, 2025 08:45
@timotei-litespeed timotei-litespeed marked this pull request as ready for review June 27, 2025 11:35
@timotei-litespeed timotei-litespeed marked this pull request as draft June 27, 2025 14:44
@Tymotey Tymotey force-pushed the Deactivate-modal branch from bade44a to 41f6955 Compare June 27, 2025 15:10
@Tymotey Tymotey force-pushed the Deactivate-modal branch from 41f6955 to 485c762 Compare June 27, 2025 15:21
@timotei-litespeed timotei-litespeed marked this pull request as ready for review June 27, 2025 17:27
@hi-hai hi-hai merged commit 84d46f6 into litespeedtech:dev Jul 2, 2025
1 check passed
@timotei-litespeed timotei-litespeed deleted the Deactivate-modal branch July 2, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants