Skip to content

Commit 86c9d65

Browse files
committed
Merge branch 'develop'
2 parents c0d2b07 + 43b9178 commit 86c9d65

25 files changed

+802
-498
lines changed

CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#### [unreleased]
22

3+
#### 12.6.0 / 2024-10-13
4+
* check existence of `FS__RESOLVE_CLONE_AS` before setting
5+
* add filter hook `gu_api_domain` to set domain for default API updating
6+
* add filter hook `gu_ignore_dot_org` to completely ignore updates from dot org. Works as if every plugin/theme is in the `gu_override_dot_org` hook
7+
38
#### 12.5.0 / 2024-08-16
49
* update `class-parser.php`
510
* update `Requires PHP` to 7.4 for `class-parser.php`

composer.lock

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

git-updater.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Plugin Name: Git Updater
1313
* Plugin URI: https://git-updater.com
1414
* Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.
15-
* Version: 12.5.0
15+
* Version: 12.6.0
1616
* Author: Andy Fragen
1717
* License: MIT
1818
* Domain Path: /languages

languages/git-updater.pot

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# This file is distributed under the MIT.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Git Updater 12.5.0\n"
5+
"Project-Id-Version: Git Updater 12.6.0\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/git-updater\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <[email protected]>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2024-08-16T17:01:51+00:00\n"
12+
"POT-Creation-Date: 2024-10-13T16:08:06+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.11.0\n"
1515
"X-Domain: git-updater\n"
@@ -468,6 +468,6 @@ msgstr ""
468468
msgid "%1$sAutomatic update is unavailable for this theme.%2$s"
469469
msgstr ""
470470

471-
#: src/Git_Updater/Traits/GU_Trait.php:671
471+
#: src/Git_Updater/Traits/GU_Trait.php:677
472472
msgid "There may be a problem with WP-Cron. A Git Updater WP-Cron event is overdue."
473473
msgstr ""

readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ License: MIT
1111

1212
## Description
1313

14-
This plugin was originally designed to simply update any GitHub hosted WordPress plugin or theme. Currently, plugins or themes hosted on Bitbucket, GitLab, Gitea, or Gist are also supported via additional API plugins. Additionally, self-hosted git servers are supported.
14+
This plugin was originally designed to simply update any GitHub hosted WordPress plugin or theme. Currently, plugins or themes hosted on Bitbucket, GitLab, Gitea, or Gist are also supported via additional API plugins. Additionally, self-hosted git servers are supported.
1515

1616
Your plugin or theme **must** contain a header in the style.css header or in the plugin's header denoting the location on GitHub. The format is as follows.
1717

src/Git_Updater/API/API.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,16 @@ public function get_api_url( $endpoint, $download_link = false ) {
343343
protected function get_dot_org_data() {
344344
$response = $this->response['dot_org'] ?? false;
345345

346+
/**
347+
* Filter hook to set an API domain for updating.
348+
*
349+
* @since 12.x.0
350+
* @param string Default is 'api.wordpress.org'.
351+
*/
352+
$api_domain = apply_filters( 'gu_api_domain', 'api.wordpress.org' );
353+
346354
if ( ! $response ) {
347-
$url = "https://api.wordpress.org/{$this->type->type}s/info/1.2/";
355+
$url = "https://{$api_domain}/{$this->type->type}s/info/1.2/";
348356
$url = add_query_arg(
349357
[
350358
'action' => "{$this->type->type}_information",

src/Git_Updater/GU_Freemius.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ function gu_fs() {
102102
$this->remove_fs_plugin_updater_hooks( $gu_fs );
103103

104104
// Hopefully eliminate clone resolution popup as single license for unlimited sites.
105-
define( 'FS__RESOLVE_CLONE_AS', 'long_term_duplicate' );
105+
if ( ! defined( 'FS__RESOLVE_CLONE_AS' ) ) {
106+
define( 'FS__RESOLVE_CLONE_AS', 'long_term_duplicate' );
107+
}
106108
}
107109

108110
/**

src/Git_Updater/Traits/Basic_Auth_Loader.php

+12-3
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,19 @@ final public function add_auth_header( $args, $url ) {
8989
* @return array $credentials
9090
*/
9191
private function get_credentials( $url ) {
92-
$options = get_site_option( 'git_updater' );
93-
$headers = parse_url( $url );
92+
$options = get_site_option( 'git_updater' );
93+
$headers = parse_url( $url );
94+
95+
/**
96+
* Filter hook to set an API domain for updating.
97+
*
98+
* @since 12.x.0
99+
* @param string Default is 'api.wordpress.org'.
100+
*/
101+
$api_domain = apply_filters( 'gu_api_domain', 'api.wordpress.org' );
102+
94103
$credentials = [
95-
'api.wordpress' => 'api.wordpress.org' === isset( $headers['host'] ) ? $headers['host'] : false,
104+
'api.wordpress' => $api_domain === isset( $headers['host'] ) ? $headers['host'] : false,
96105
'isset' => false,
97106
'token' => null,
98107
'type' => null,

src/Git_Updater/Traits/GU_Trait.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,13 @@ final public function override_dot_org( $type, $repo ) {
297297
}
298298
}
299299

300-
return ! $dot_org_master || $override;
300+
/**
301+
* Filter hook to completely ignore any updates from dot org when using Git Updater.
302+
*
303+
* @since 12.x.0
304+
* @param bool Default is false. Do not ignore updates from dot org.
305+
*/
306+
return ! $dot_org_master || $override || apply_filters( 'gu_ignore_dot_org', false );
301307
}
302308

303309
/**

vendor/composer/installed.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -344,17 +344,17 @@
344344
},
345345
{
346346
"name": "freemius/wordpress-sdk",
347-
"version": "2.7.4",
348-
"version_normalized": "2.7.4.0",
347+
"version": "2.8.1",
348+
"version_normalized": "2.8.1.0",
349349
"source": {
350350
"type": "git",
351351
"url": "https://github.com/Freemius/wordpress-sdk.git",
352-
"reference": "2741ba2b4f819b5018f68529036e505ef1e7c349"
352+
"reference": "cc31279d088909135b6b2d8b4f2696312f5731fc"
353353
},
354354
"dist": {
355355
"type": "zip",
356-
"url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/2741ba2b4f819b5018f68529036e505ef1e7c349",
357-
"reference": "2741ba2b4f819b5018f68529036e505ef1e7c349",
356+
"url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/cc31279d088909135b6b2d8b4f2696312f5731fc",
357+
"reference": "cc31279d088909135b6b2d8b4f2696312f5731fc",
358358
"shasum": ""
359359
},
360360
"require": {
@@ -369,7 +369,7 @@
369369
"szepeviktor/phpstan-wordpress": "^1.3",
370370
"wp-coding-standards/wpcs": "^2.3"
371371
},
372-
"time": "2024-08-07T14:07:59+00:00",
372+
"time": "2024-09-19T15:55:19+00:00",
373373
"type": "library",
374374
"installation-source": "dist",
375375
"notification-url": "https://packagist.org/downloads/",
@@ -389,7 +389,7 @@
389389
],
390390
"support": {
391391
"issues": "https://github.com/Freemius/wordpress-sdk/issues",
392-
"source": "https://github.com/Freemius/wordpress-sdk/tree/2.7.4"
392+
"source": "https://github.com/Freemius/wordpress-sdk/tree/2.8.1"
393393
},
394394
"install-path": "../freemius/wordpress-sdk"
395395
},
@@ -567,17 +567,17 @@
567567
},
568568
{
569569
"name": "squizlabs/php_codesniffer",
570-
"version": "3.10.2",
571-
"version_normalized": "3.10.2.0",
570+
"version": "3.10.3",
571+
"version_normalized": "3.10.3.0",
572572
"source": {
573573
"type": "git",
574574
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
575-
"reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017"
575+
"reference": "62d32998e820bddc40f99f8251958aed187a5c9c"
576576
},
577577
"dist": {
578578
"type": "zip",
579-
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017",
580-
"reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017",
579+
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c",
580+
"reference": "62d32998e820bddc40f99f8251958aed187a5c9c",
581581
"shasum": ""
582582
},
583583
"require": {
@@ -589,7 +589,7 @@
589589
"require-dev": {
590590
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
591591
},
592-
"time": "2024-07-21T23:26:44+00:00",
592+
"time": "2024-09-18T10:38:58+00:00",
593593
"bin": [
594594
"bin/phpcbf",
595595
"bin/phpcs"

vendor/composer/installed.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
'dev_requirement' => false,
7979
),
8080
'freemius/wordpress-sdk' => array(
81-
'pretty_version' => '2.7.4',
82-
'version' => '2.7.4.0',
83-
'reference' => '2741ba2b4f819b5018f68529036e505ef1e7c349',
81+
'pretty_version' => '2.8.1',
82+
'version' => '2.8.1.0',
83+
'reference' => 'cc31279d088909135b6b2d8b4f2696312f5731fc',
8484
'type' => 'library',
8585
'install_path' => __DIR__ . '/../freemius/wordpress-sdk',
8686
'aliases' => array(),
@@ -105,9 +105,9 @@
105105
'dev_requirement' => true,
106106
),
107107
'squizlabs/php_codesniffer' => array(
108-
'pretty_version' => '3.10.2',
109-
'version' => '3.10.2.0',
110-
'reference' => '86e5f5dd9a840c46810ebe5ff1885581c42a3017',
108+
'pretty_version' => '3.10.3',
109+
'version' => '3.10.3.0',
110+
'reference' => '62d32998e820bddc40f99f8251958aed187a5c9c',
111111
'type' => 'library',
112112
'install_path' => __DIR__ . '/../squizlabs/php_codesniffer',
113113
'aliases' => array(),

0 commit comments

Comments
 (0)