Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit 48bce94

Browse files
committed
πŸ› Correct script injection + build via composer
1 parent bea29d8 commit 48bce94

6 files changed

Lines changed: 135 additions & 263 deletions

File tree

β€Žadmin/class-frak-admin.phpβ€Ž

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,48 @@ private function save_settings() {
198198
update_option('frak_modal_language', $modal_language);
199199
update_option('frak_modal_i18n', json_encode($modal_i18n));
200200

201-
// Update config last modified timestamp for cache busting
202-
if (class_exists('Frak_Config_Endpoint')) {
203-
Frak_Config_Endpoint::update_last_modified();
204-
}
201+
// Clear any caches to ensure the new configuration is loaded
202+
$this->clear_caches();
203+
204+
}
205205

206+
/**
207+
* Clear caches from popular caching plugins
208+
*/
209+
private function clear_caches() {
210+
// WP Rocket
211+
if (function_exists('rocket_clean_domain')) {
212+
rocket_clean_domain();
213+
}
214+
215+
// W3 Total Cache
216+
if (function_exists('w3tc_flush_all')) {
217+
w3tc_flush_all();
218+
}
219+
220+
// WP Super Cache
221+
if (function_exists('wp_cache_clear_cache')) {
222+
wp_cache_clear_cache();
223+
}
224+
225+
// WP Fastest Cache
226+
if (class_exists('WpFastestCache') && method_exists('WpFastestCache', 'deleteCache')) {
227+
$wpfc = new WpFastestCache();
228+
$wpfc->deleteCache(true);
229+
}
230+
231+
// LiteSpeed Cache
232+
if (class_exists('LiteSpeed\Purge')) {
233+
LiteSpeed\Purge::purge_all();
234+
}
235+
236+
// Autoptimize
237+
if (class_exists('autoptimizeCache') && method_exists('autoptimizeCache', 'clearall')) {
238+
autoptimizeCache::clearall();
239+
}
240+
241+
// Clear WordPress object cache
242+
wp_cache_flush();
206243
}
207244

208245
private function render_settings_page() {

β€Žbuild.shβ€Ž

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ rm -rf ${BUILD_DIR} ${DIST_DIR}
1414
mkdir -p ${BUILD_DIR}/${PLUGIN_NAME} ${DIST_DIR}
1515

1616
# Install composer dependencies
17-
if [ -f "composer.json" ]; then
18-
echo "Installing composer dependencies..."
19-
composer install --no-dev --optimize-autoloader
20-
fi
17+
echo "Installing composer dependencies..."
18+
composer install --no-dev --optimize-autoloader
2119

2220
# Copy all files to build directory
2321
rsync -av --exclude-from='.distignore' \

β€Žcomposer.jsonβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"simplito/elliptic-php": "^1.0"
99
},
1010
"autoload": {
11-
"psr-4": {
12-
"Frak\\WordPress\\": "includes/"
13-
}
11+
"classmap": [
12+
"includes/"
13+
]
1414
}
1515
}

β€Žincludes/class-frak-config-endpoint.phpβ€Ž

Lines changed: 0 additions & 243 deletions
This file was deleted.

0 commit comments

Comments
Β (0)