Skip to content

Add Clear VPI #827

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

Draft
wants to merge 2 commits into
base: v7.2
Choose a base branch
from

Conversation

timotei-litespeed
Copy link
Contributor

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

Add Purge VPI data
Move VPI meta fields names to constants in VPI class

VPI class add constants
@Tymotey Tymotey force-pushed the Purge-Add_VPI_clenaup branch from 90ab288 to 29af4c7 Compare April 7, 2025 20:21
@timotei-litespeed timotei-litespeed changed the base branch from dev to v7.2 April 18, 2025 06:06
@hi-hai
Copy link
Collaborator

hi-hai commented Apr 19, 2025

@timotei-litespeed Is there any request for this feature?

@@ -646,7 +646,7 @@ private function _parse_img_for_preload()
{
// Load VPI setting
$is_mobile = $this->_separate_mobile();
$vpi_files = $this->cls('Metabox')->setting($is_mobile ? 'litespeed_vpi_list_mobile' : 'litespeed_vpi_list');
$vpi_files = $this->cls('Metabox')->setting($is_mobile ? $this->cls('Vpi')::POST_META_MOBILE : $this->cls('Vpi')::POST_META);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a weird const usage approach. Please don't use this way anymore

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Another way: constant($className . '::' . $constantName)

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 I think is better

@@ -93,6 +93,15 @@
);
}

if ($this->has_cache_folder('vpi')) {
$_panels[] = array(
'title' => __('Purge All', 'litespeed-cache') . ' - ' . __('VPI', 'litespeed-cache'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

VPI shouldn't be translated @timotei-litespeed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed translation

src/gui.cls.php Outdated
$wp_admin_bar->add_menu(array(
'parent' => 'litespeed-menu',
'id' => 'litespeed-purge-placeholder',
'title' => __('Purge All', 'litespeed-cache') . ' - ' . __('VPI data', 'litespeed-cache'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this menu different than the FE one?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@timotei-litespeed timotei-litespeed Apr 21, 2025

Choose a reason for hiding this comment

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

By mistake, fixed

@timotei-litespeed
Copy link
Contributor Author

@timotei-litespeed Is there any request for this feature?

We had a few request past few months

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.

3 participants