Skip to content

Commit

Permalink
disable jquery auto updater
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmondok committed Apr 15, 2020
1 parent df77c50 commit f981178
Show file tree
Hide file tree
Showing 96 changed files with 70 additions and 10,796 deletions.
2 changes: 2 additions & 0 deletions .idea/.gitignore

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

10 changes: 10 additions & 0 deletions .idea/composerJson.xml

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

6 changes: 6 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

9 changes: 9 additions & 0 deletions .idea/php.xml

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

13 changes: 13 additions & 0 deletions .idea/scripts-styles-loader.iml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"source": "https://github.com/wwwoda/woda-scripts-styles-loader"
},
"require": {
"ext-json": "*",
"yahnis-elsts/plugin-update-checker": "^4.9"
"ext-json": "*"
},
"autoload": {
"psr-4": {
Expand Down
51 changes: 2 additions & 49 deletions composer.lock

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

10 changes: 7 additions & 3 deletions includes/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static function register(?array $settings = []): void
self::$vendorScriptsUrl = $settings['vendorScriptsUrl'] ?? $defaults['vendorScriptsUrl'];
add_action('admin_head', [self::class, 'enqueueBackendScripts']);
add_action('wp_enqueue_scripts', [self::class, 'enqueueFrontendScripts']);
add_action('wp_enqueue_scripts', [self::class, 'updateJQueryVersion']);
add_action('wp_enqueue_scripts', [self::class, 'maybeUpdateJQueryVersion']);
add_action('wp_enqueue_scripts', [self::class, 'enqueueFrontendStyles']);
}

Expand All @@ -93,7 +93,7 @@ public static function register(?array $settings = []): void
public static function enqueueBackendScripts(): void
{
self::registerStyles(self::$backendStyles);
self::updateJQueryVersion();
self::maybeUpdateJQueryVersion();
}

/**
Expand All @@ -115,11 +115,15 @@ public static function enqueueFrontendStyles(): void
/**
* Replace version 1 of jQuery registered by default by WordPress with the latest version
*/
public static function updateJQueryVersion(): void
public static function maybeUpdateJQueryVersion(): void
{
if (is_admin()) {
return;
}
$isUpdateNeeded = apply_filters('woda-update-jquery', false);
if ($isUpdateNeeded !== true) {
return;
}
if (empty(self::$vendorScriptsUrl) || empty(self::$vendorScriptsDir)) {
self::triggerError('$vendorScriptsUrl and/or $vendorScriptsDir settings missing');
return;
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: @davidmondok
Tags: fonts, performance
Requires at least: 4.5
Tested up to: 5.3
Stable tag: 0.3.1
Stable tag: 0.4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -34,4 +34,7 @@ License URI: https://www.gnu.org/licenses/gpl-2.0.html
= 0.3.0 =
* Remove internal GitHub Updater logic

= 0.4.0 =
* jQuery is not updated by default any more. Enable via `add_filter( 'woda-update-jquery', '__return_true' ); `

`<?php code(); // goes in backticks ?>`
10 changes: 0 additions & 10 deletions vendor/composer/autoload_files.php

This file was deleted.

18 changes: 0 additions & 18 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,6 @@ public static function getLoader()

$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitdf3f8fe0eeed85367e28e07d385d66fd::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiredf3f8fe0eeed85367e28e07d385d66fd($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequiredf3f8fe0eeed85367e28e07d385d66fd($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}
4 changes: 0 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

class ComposerStaticInitdf3f8fe0eeed85367e28e07d385d66fd
{
public static $files = array (
'241d2b5b9c1e680c0770b006b0271156' => __DIR__ . '/..' . '/yahnis-elsts/plugin-update-checker/load-v4p9.php',
);

public static $prefixLengthsPsr4 = array (
'W' =>
array (
Expand Down
51 changes: 1 addition & 50 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
@@ -1,50 +1 @@
[
{
"name": "yahnis-elsts/plugin-update-checker",
"version": "v4.9",
"version_normalized": "4.9.0.0",
"source": {
"type": "git",
"url": "https://github.com/YahnisElsts/plugin-update-checker.git",
"reference": "28f29c940cc22754aff85a99645e3c0a51c097e8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/YahnisElsts/plugin-update-checker/zipball/28f29c940cc22754aff85a99645e3c0a51c097e8",
"reference": "28f29c940cc22754aff85a99645e3c0a51c097e8",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=5.2.0"
},
"time": "2020-02-07T11:07:19+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"files": [
"load-v4p9.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Yahnis Elsts",
"email": "whiteshadow@w-shadow.com",
"homepage": "http://w-shadow.com/",
"role": "Developer"
}
],
"description": "A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.",
"homepage": "https://github.com/YahnisElsts/plugin-update-checker/",
"keywords": [
"automatic updates",
"plugin updates",
"theme updates",
"wordpress"
]
}
]
[]
15 changes: 0 additions & 15 deletions vendor/yahnis-elsts/plugin-update-checker/.editorconfig

This file was deleted.

6 changes: 0 additions & 6 deletions vendor/yahnis-elsts/plugin-update-checker/Puc/v4/Factory.php

This file was deleted.

47 changes: 0 additions & 47 deletions vendor/yahnis-elsts/plugin-update-checker/Puc/v4p9/Autoloader.php

This file was deleted.

0 comments on commit f981178

Please sign in to comment.