Skip to content

Commit 03be663

Browse files
committed
Merge branch 'develop'
2 parents 75d5974 + 5bf7e6e commit 03be663

38 files changed

+656
-421
lines changed

.github/workflows/generate-pot-pr.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
branches:
77
- main
88
- master
9+
- develop
910

1011
jobs:
1112
generate-pot:
@@ -52,7 +53,7 @@ jobs:
5253
wp i18n make-pot . "./languages/${{ github.event.repository.name }}.pot" --headers='{"Report-Msgid-Bugs-To":"https://github.com/${{ github.event.repository.full_name }}/issues"}'
5354
5455
- name: Check if there are changes
55-
run: echo "CHANGES_DETECTED=$([[ -z $(git status --porcelain) ]] && echo "0" || echo "1")" >> $GITHUB_ENV
56+
run: echo "CHANGES_DETECTED=$([[ -z $(git diff --ignore-matching-lines='^"POT-Creation-Date|^"Project-Id-Version') ]] && echo "0" || echo "1")" >> $GITHUB_ENV
5657

5758
- name: Commit changes
5859
if: env.CHANGES_DETECTED == 1

CHANGES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#### [unreleased]
22

3+
#### 12.19.0 / 2025-09-29
4+
* setup for Gitea release assets
5+
* use `mcaskill/composer-exclude-files` to exclude autoload of `freemius/wordpress-sdk/start.php`
6+
* harden `parse_meta_response()`
7+
* modify dot org check for package added to mirror like AspireCloud
8+
* don't overwrite `requires` and `requires_php` data from readme.txt if already exists
9+
* correctly parse for multiple release assets per release
10+
* update POT GitHub Action
11+
* refactor `add_accept_header()`
12+
* set `release_assets` and `release_asset_download` for latest release asset
13+
14+
315
#### 12.18.1 / 2025-08-06
416
* data check on release assets
517

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@
3636
"freemius/wordpress-sdk": "^2.12"
3737
},
3838
"require-dev": {
39-
"wp-coding-standards/wpcs": "^3.0.0"
39+
"wp-coding-standards/wpcs": "^3.0.0",
40+
"mcaskill/composer-exclude-files": "^4.0"
41+
},
42+
"extra": {
43+
"exclude-from-files": [
44+
"freemius/wordpress-sdk/start.php"
45+
]
4046
},
4147
"config": {
4248
"allow-plugins": {

composer.lock

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

git-updater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Plugin ID: did:plc:afjf7gsjzsqmgc7dlhb553mv
1414
* Plugin URI: https://git-updater.com
1515
* Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.
16-
* Version: 12.18.1
16+
* Version: 12.19.0
1717
* Author: Andy Fragen
1818
* Author URI: https://thefragens.com
1919
* Security: [email protected]

languages/git-updater.pot

Lines changed: 2 additions & 2 deletions
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.18.1\n"
5+
"Project-Id-Version: Git Updater 12.19.0\n"
66
"Report-Msgid-Bugs-To: https://github.com/afragen/git-updater/issues\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: 2025-08-06T23:27:31+00:00\n"
12+
"POT-Creation-Date: 2025-09-27T18:48:33+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.12.0\n"
1515
"X-Domain: git-updater\n"

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Donate link: https://thefragens.com/git-updater-donate
55
Tags: plugin, theme, language pack, updater
66
Requires at least: 5.9
77
Requires PHP: 8.0
8-
Tested up to: 6.8
8+
Tested up to: 6.9
99
Stable tag: master
1010
License: MIT
1111

src/Git_Updater/API/API.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,10 @@ protected function get_dot_org_data() {
384384
return false;
385385
}
386386

387-
$body = json_decode( wp_remote_retrieve_body( $response ) );
388-
$response = ! $body || ! property_exists( $body, 'name' ) || property_exists( $body, 'error' ) ? 'not in dot org' : 'in dot org';
387+
$body = json_decode( wp_remote_retrieve_body( $response ) );
388+
$invalid_response = ! $body || ! property_exists( $body, 'name' ) || property_exists( $body, 'error' );
389+
$added_to_mirror = isset( $body->ac_origin ) && 'wp_org' === $body->ac_origin;
390+
$response = $invalid_response || ! $added_to_mirror ? 'not in dot org' : 'in dot org';
389391

390392
$this->set_repo_cache( 'dot_org', $response );
391393
}
@@ -571,9 +573,9 @@ public function set_readme_info( $readme ) {
571573
$readme['tested'] = implode( '.', $tested_arr );
572574
}
573575

576+
$this->type->requires = empty( $this->type->requires ) ? $readme['requires'] : $this->type->requires;
577+
$this->type->requires_php = empty( $this->type->requires_php ) ? $readme['requires_php'] : $this->type->requires_php;
574578
$this->type->tested = $readme['tested'] ?? '';
575-
$this->type->requires = $readme['requires'] ?? '';
576-
$this->type->requires_php = $readme['requires_php'] ?? '';
577579
$this->type->donate_link = $readme['donate_link'] ?? '';
578580
$this->type->contributors = $readme['contributors'] ?? [];
579581
if ( empty( $readme['upgrade_notice'] ) ) {
@@ -639,7 +641,10 @@ public function get_release_asset_redirect( $asset, $aws = false ) {
639641

640642
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
641643
if ( ! $response || isset( $_REQUEST['override'] ) ) {
642-
$args = $this->add_auth_header( [], $asset );
644+
$args = $this->add_auth_header( [], $asset );
645+
if ( empty( $args ) ) {
646+
return false;
647+
}
643648
$octet_stream = [ 'accept' => 'application/octet-stream' ];
644649
add_action( 'requests-requests.before_redirect', [ $this, 'set_redirect' ], 10, 1 );
645650
$args['headers'] = array_merge( $args['headers'], $octet_stream );

src/Git_Updater/API/GitHub_API.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,12 @@ public function parse_meta_response( $response ) {
295295
array_filter(
296296
$response,
297297
function ( $e ) use ( &$arr ) {
298-
$arr['private'] = $e->private;
299-
$arr['last_updated'] = $e->pushed_at;
300-
$arr['added'] = $e->created_at;
301-
$arr['watchers'] = $e->watchers;
302-
$arr['forks'] = $e->forks;
303-
$arr['open_issues'] = $e->open_issues;
298+
$arr['private'] = $e->private ?? false;
299+
$arr['last_updated'] = $e->pushed_at ?? '';
300+
$arr['added'] = $e->created_at ?? '';
301+
$arr['watchers'] = $e->watchers ?? 0;
302+
$arr['forks'] = $e->forks ?? 0;
303+
$arr['open_issues'] = $e->open_issues ?? 0;
304304
}
305305
);
306306

src/Git_Updater/REST/REST_API.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ public function get_api_data( WP_REST_Request $request ) {
491491
'homepage' => $repo_data->homepage,
492492
'external' => 'xxx',
493493
];
494-
uksort( $repo_api_data['versions'], 'version_compare' );
494+
if ( ! is_wp_error( $repo_api_data['versions'] ) ) {
495+
uksort( $repo_api_data['versions'], fn ( $a, $b ) => version_compare( $b, $a ) );
496+
}
495497

496498
$repo_cache = $this->get_repo_cache( $slug );
497499
Singleton::get_instance( 'Fragen\Git_Updater\API\API', $this )->response = $repo_cache;

0 commit comments

Comments
 (0)