Skip to content

Commit 6fede9b

Browse files
committed
Merge branch 'develop'
2 parents 2bbab2f + d83cc1e commit 6fede9b

File tree

8 files changed

+67
-22
lines changed

8 files changed

+67
-22
lines changed

CHANGES.md

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

3+
#### 10.2.0 / 2021-06-02
4+
* add filter to pre-process configuration array of repositories
5+
* add filter to modify repos on waiting for background tasks
6+
37
#### 10.1.0 / 2021-05-27
48
* cache GitHub API response failures for rate limit timeout to avoid hammering the API
59
* add constant `GU_MU_LOADER` to aid in mu-plugin loading of Git Updater PRO

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: 10.1.0
15+
* Version: 10.2.0
1616
* Author: Andy Fragen
1717
* License: MIT
1818
* Domain Path: /languages

languages/git-updater.pot

+13-13
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 10.1.0\n"
5+
"Project-Id-Version: Git Updater 10.2.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: 2021-05-27T15:23:28+00:00\n"
12+
"POT-Creation-Date: 2021-06-03T00:30:41+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.5.0\n"
1515
"X-Domain: git-updater\n"
@@ -248,42 +248,42 @@ msgid "Installed Plugins and Themes"
248248
msgstr ""
249249

250250
#. translators: %s: theme name
251-
#: src/Git_Updater/Theme.php:379
252-
#: src/Git_Updater/Theme.php:504
251+
#: src/Git_Updater/Theme.php:387
252+
#: src/Git_Updater/Theme.php:512
253253
msgid "There is a new version of %s available."
254254
msgstr ""
255255

256256
#. translators: %s: theme version
257-
#: src/Git_Updater/Theme.php:391
257+
#: src/Git_Updater/Theme.php:399
258258
msgid "View version %s details."
259259
msgstr ""
260260

261-
#: src/Git_Updater/Theme.php:395
261+
#: src/Git_Updater/Theme.php:403
262262
msgid "Automatic update is unavailable for this theme."
263263
msgstr ""
264264

265265
#. translators: 1: version number, 2: closing anchor tag, 3: update URL
266-
#: src/Git_Updater/Theme.php:400
267-
#: src/Git_Updater/Theme.php:515
266+
#: src/Git_Updater/Theme.php:408
267+
#: src/Git_Updater/Theme.php:523
268268
msgid "View version %1$s details%2$s or %3$supdate now%2$s."
269269
msgstr ""
270270

271271
#. translators: %s: theme name
272-
#: src/Git_Updater/Theme.php:405
273-
#: src/Git_Updater/Theme.php:520
272+
#: src/Git_Updater/Theme.php:413
273+
#: src/Git_Updater/Theme.php:528
274274
msgid "Update %s now"
275275
msgstr ""
276276

277277
#. translators: 1: version number, 2: closing anchor tag, 3: update URL
278-
#: src/Git_Updater/Theme.php:527
278+
#: src/Git_Updater/Theme.php:535
279279
msgid "View version %1$s details%2$s."
280280
msgstr ""
281281

282282
#. translators: %s: opening/closing paragraph and italic tags
283-
#: src/Git_Updater/Theme.php:533
283+
#: src/Git_Updater/Theme.php:541
284284
msgid "%1$sAutomatic update is unavailable for this theme.%2$s"
285285
msgstr ""
286286

287-
#: src/Git_Updater/Traits/GU_Trait.php:657
287+
#: src/Git_Updater/Traits/GU_Trait.php:666
288288
msgid "There may be a problem with WP-Cron. A Git Updater WP-Cron event is overdue."
289289
msgstr ""

src/Git_Updater/Plugin.php

+18-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,16 @@ function ( $key ) use ( $plugin ) {
239239
*/
240240
public function get_remote_plugin_meta() {
241241
$plugins = [];
242-
foreach ( (array) $this->config as $plugin ) {
243242

243+
/**
244+
* Filter repositories.
245+
*
246+
* @since 10.2.0
247+
* @param array $this->config Array of repository objects.
248+
*/
249+
$config = apply_filters( 'gu_config_pre_process', $this->config );
250+
251+
foreach ( (array) $config as $plugin ) {
244252
$disable_wp_cron = (bool) apply_filters( 'gu_disable_wpcron', false );
245253
$disable_wp_cron = $disable_wp_cron ?: (bool) apply_filters_deprecated( 'github_updater_disable_wpcron', [ false ], '10.0.0', 'gu_disable_wpcron' );
246254

@@ -350,7 +358,15 @@ public function update_site_transient( $transient ) {
350358
$transient = new \stdClass();
351359
}
352360

353-
foreach ( (array) $this->config as $plugin ) {
361+
/**
362+
* Filter repositories.
363+
*
364+
* @since 10.2.0
365+
* @param array $this->config Array of repository objects.
366+
*/
367+
$config = apply_filters( 'gu_config_pre_process', $this->config );
368+
369+
foreach ( (array) $config as $plugin ) {
354370
if ( ! property_exists( $plugin, 'remote_version' ) ) {
355371
continue;
356372
}

src/Git_Updater/Theme.php

+18-2
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,16 @@ function ( $key ) use ( $theme ) {
225225
*/
226226
public function get_remote_theme_meta() {
227227
$themes = [];
228-
foreach ( (array) $this->config as $theme ) {
229228

229+
/**
230+
* Filter repositories.
231+
*
232+
* @since 10.2.0
233+
* @param array $this->config Array of repository objects.
234+
*/
235+
$config = apply_filters( 'gu_config_pre_process', $this->config );
236+
237+
foreach ( (array) $config as $theme ) {
230238
$disable_wp_cron = (bool) apply_filters( 'gu_disable_wpcron', false );
231239
$disable_wp_cron = $disable_wp_cron ?: (bool) apply_filters_deprecated( 'github_updater_disable_wpcron', [ false ], '10.0.0', 'gu_disable_wpcron' );
232240

@@ -558,7 +566,15 @@ public function update_site_transient( $transient ) {
558566
$transient = new \stdClass();
559567
}
560568

561-
foreach ( (array) $this->config as $theme ) {
569+
/**
570+
* Filter repositories.
571+
*
572+
* @since 10.2.0
573+
* @param array $this->config Array of repository objects.
574+
*/
575+
$config = apply_filters( 'gu_config_pre_process', $this->config );
576+
577+
foreach ( (array) $config as $theme ) {
562578
if ( ! property_exists( $theme, 'remote_version' ) ) {
563579
continue;
564580
}

src/Git_Updater/Traits/GU_Trait.php

+9
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,15 @@ protected function waiting_for_background_update( $repo = null ) {
369369
Singleton::get_instance( 'Fragen\Git_Updater\Plugin', $this )->get_plugin_configs(),
370370
Singleton::get_instance( 'Fragen\Git_Updater\Theme', $this )->get_theme_configs()
371371
);
372+
373+
/**
374+
* Filter to modify array of repos.
375+
*
376+
* @since 10.2.0
377+
* @param array $repos Array of repositories.
378+
*/
379+
$repos = apply_filters( 'gu_github_api_no_wait', $repos );
380+
372381
foreach ( $repos as $git_repo ) {
373382
$caches[ $git_repo->slug ] = $this->get_repo_cache( $git_repo->slug );
374383
}

vendor/composer/InstalledVersions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class InstalledVersions
3232
'aliases' =>
3333
array (
3434
),
35-
'reference' => 'afbe8cedb89b457f12b6cff3cc5ef2b88c34e940',
35+
'reference' => '2bbab2ff97e82bb3afe5af9e803643c8fecc93cb',
3636
'name' => 'afragen/git-updater',
3737
),
3838
'versions' =>
@@ -44,7 +44,7 @@ class InstalledVersions
4444
'aliases' =>
4545
array (
4646
),
47-
'reference' => 'afbe8cedb89b457f12b6cff3cc5ef2b88c34e940',
47+
'reference' => '2bbab2ff97e82bb3afe5af9e803643c8fecc93cb',
4848
),
4949
'afragen/singleton' =>
5050
array (

vendor/composer/installed.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'aliases' =>
77
array (
88
),
9-
'reference' => 'afbe8cedb89b457f12b6cff3cc5ef2b88c34e940',
9+
'reference' => '2bbab2ff97e82bb3afe5af9e803643c8fecc93cb',
1010
'name' => 'afragen/git-updater',
1111
),
1212
'versions' =>
@@ -18,7 +18,7 @@
1818
'aliases' =>
1919
array (
2020
),
21-
'reference' => 'afbe8cedb89b457f12b6cff3cc5ef2b88c34e940',
21+
'reference' => '2bbab2ff97e82bb3afe5af9e803643c8fecc93cb',
2222
),
2323
'afragen/singleton' =>
2424
array (

0 commit comments

Comments
 (0)