Skip to content

Commit f981178

Browse files
committed
disable jquery auto updater
1 parent df77c50 commit f981178

File tree

96 files changed

+70
-10796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+70
-10796
lines changed

.idea/.gitignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/composerJson.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/scripts-styles-loader.iml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
"source": "https://github.com/wwwoda/woda-scripts-styles-loader"
3030
},
3131
"require": {
32-
"ext-json": "*",
33-
"yahnis-elsts/plugin-update-checker": "^4.9"
32+
"ext-json": "*"
3433
},
3534
"autoload": {
3635
"psr-4": {

composer.lock

Lines changed: 2 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/Loader.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static function register(?array $settings = []): void
8383
self::$vendorScriptsUrl = $settings['vendorScriptsUrl'] ?? $defaults['vendorScriptsUrl'];
8484
add_action('admin_head', [self::class, 'enqueueBackendScripts']);
8585
add_action('wp_enqueue_scripts', [self::class, 'enqueueFrontendScripts']);
86-
add_action('wp_enqueue_scripts', [self::class, 'updateJQueryVersion']);
86+
add_action('wp_enqueue_scripts', [self::class, 'maybeUpdateJQueryVersion']);
8787
add_action('wp_enqueue_scripts', [self::class, 'enqueueFrontendStyles']);
8888
}
8989

@@ -93,7 +93,7 @@ public static function register(?array $settings = []): void
9393
public static function enqueueBackendScripts(): void
9494
{
9595
self::registerStyles(self::$backendStyles);
96-
self::updateJQueryVersion();
96+
self::maybeUpdateJQueryVersion();
9797
}
9898

9999
/**
@@ -115,11 +115,15 @@ public static function enqueueFrontendStyles(): void
115115
/**
116116
* Replace version 1 of jQuery registered by default by WordPress with the latest version
117117
*/
118-
public static function updateJQueryVersion(): void
118+
public static function maybeUpdateJQueryVersion(): void
119119
{
120120
if (is_admin()) {
121121
return;
122122
}
123+
$isUpdateNeeded = apply_filters('woda-update-jquery', false);
124+
if ($isUpdateNeeded !== true) {
125+
return;
126+
}
123127
if (empty(self::$vendorScriptsUrl) || empty(self::$vendorScriptsDir)) {
124128
self::triggerError('$vendorScriptsUrl and/or $vendorScriptsDir settings missing');
125129
return;

0 commit comments

Comments
 (0)