Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Oct 13, 2024
2 parents c0d2b07 + 43b9178 commit 86c9d65
Show file tree
Hide file tree
Showing 25 changed files with 802 additions and 498 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#### [unreleased]

#### 12.6.0 / 2024-10-13
* check existence of `FS__RESOLVE_CLONE_AS` before setting
* add filter hook `gu_api_domain` to set domain for default API updating
* 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

#### 12.5.0 / 2024-08-16
* update `class-parser.php`
* update `Requires PHP` to 7.4 for `class-parser.php`
Expand Down
28 changes: 14 additions & 14 deletions composer.lock

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

2 changes: 1 addition & 1 deletion git-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Plugin Name: Git Updater
* Plugin URI: https://git-updater.com
* Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.
* Version: 12.5.0
* Version: 12.6.0
* Author: Andy Fragen
* License: MIT
* Domain Path: /languages
Expand Down
6 changes: 3 additions & 3 deletions languages/git-updater.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the MIT.
msgid ""
msgstr ""
"Project-Id-Version: Git Updater 12.5.0\n"
"Project-Id-Version: Git Updater 12.6.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/git-updater\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-08-16T17:01:51+00:00\n"
"POT-Creation-Date: 2024-10-13T16:08:06+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: git-updater\n"
Expand Down Expand Up @@ -468,6 +468,6 @@ msgstr ""
msgid "%1$sAutomatic update is unavailable for this theme.%2$s"
msgstr ""

#: src/Git_Updater/Traits/GU_Trait.php:671
#: src/Git_Updater/Traits/GU_Trait.php:677
msgid "There may be a problem with WP-Cron. A Git Updater WP-Cron event is overdue."
msgstr ""
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ License: MIT

## Description

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.
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.

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.

Expand Down
10 changes: 9 additions & 1 deletion src/Git_Updater/API/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,16 @@ public function get_api_url( $endpoint, $download_link = false ) {
protected function get_dot_org_data() {
$response = $this->response['dot_org'] ?? false;

/**
* Filter hook to set an API domain for updating.
*
* @since 12.x.0
* @param string Default is 'api.wordpress.org'.
*/
$api_domain = apply_filters( 'gu_api_domain', 'api.wordpress.org' );

if ( ! $response ) {
$url = "https://api.wordpress.org/{$this->type->type}s/info/1.2/";
$url = "https://{$api_domain}/{$this->type->type}s/info/1.2/";
$url = add_query_arg(
[
'action' => "{$this->type->type}_information",
Expand Down
4 changes: 3 additions & 1 deletion src/Git_Updater/GU_Freemius.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ function gu_fs() {
$this->remove_fs_plugin_updater_hooks( $gu_fs );

// Hopefully eliminate clone resolution popup as single license for unlimited sites.
define( 'FS__RESOLVE_CLONE_AS', 'long_term_duplicate' );
if ( ! defined( 'FS__RESOLVE_CLONE_AS' ) ) {
define( 'FS__RESOLVE_CLONE_AS', 'long_term_duplicate' );
}
}

/**
Expand Down
15 changes: 12 additions & 3 deletions src/Git_Updater/Traits/Basic_Auth_Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,19 @@ final public function add_auth_header( $args, $url ) {
* @return array $credentials
*/
private function get_credentials( $url ) {
$options = get_site_option( 'git_updater' );
$headers = parse_url( $url );
$options = get_site_option( 'git_updater' );
$headers = parse_url( $url );

/**
* Filter hook to set an API domain for updating.
*
* @since 12.x.0
* @param string Default is 'api.wordpress.org'.
*/
$api_domain = apply_filters( 'gu_api_domain', 'api.wordpress.org' );

$credentials = [
'api.wordpress' => 'api.wordpress.org' === isset( $headers['host'] ) ? $headers['host'] : false,
'api.wordpress' => $api_domain === isset( $headers['host'] ) ? $headers['host'] : false,
'isset' => false,
'token' => null,
'type' => null,
Expand Down
8 changes: 7 additions & 1 deletion src/Git_Updater/Traits/GU_Trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ final public function override_dot_org( $type, $repo ) {
}
}

return ! $dot_org_master || $override;
/**
* Filter hook to completely ignore any updates from dot org when using Git Updater.
*
* @since 12.x.0
* @param bool Default is false. Do not ignore updates from dot org.
*/
return ! $dot_org_master || $override || apply_filters( 'gu_ignore_dot_org', false );
}

/**
Expand Down
26 changes: 13 additions & 13 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,17 @@
},
{
"name": "freemius/wordpress-sdk",
"version": "2.7.4",
"version_normalized": "2.7.4.0",
"version": "2.8.1",
"version_normalized": "2.8.1.0",
"source": {
"type": "git",
"url": "https://github.com/Freemius/wordpress-sdk.git",
"reference": "2741ba2b4f819b5018f68529036e505ef1e7c349"
"reference": "cc31279d088909135b6b2d8b4f2696312f5731fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/2741ba2b4f819b5018f68529036e505ef1e7c349",
"reference": "2741ba2b4f819b5018f68529036e505ef1e7c349",
"url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/cc31279d088909135b6b2d8b4f2696312f5731fc",
"reference": "cc31279d088909135b6b2d8b4f2696312f5731fc",
"shasum": ""
},
"require": {
Expand All @@ -369,7 +369,7 @@
"szepeviktor/phpstan-wordpress": "^1.3",
"wp-coding-standards/wpcs": "^2.3"
},
"time": "2024-08-07T14:07:59+00:00",
"time": "2024-09-19T15:55:19+00:00",
"type": "library",
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",
Expand All @@ -389,7 +389,7 @@
],
"support": {
"issues": "https://github.com/Freemius/wordpress-sdk/issues",
"source": "https://github.com/Freemius/wordpress-sdk/tree/2.7.4"
"source": "https://github.com/Freemius/wordpress-sdk/tree/2.8.1"
},
"install-path": "../freemius/wordpress-sdk"
},
Expand Down Expand Up @@ -567,17 +567,17 @@
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.10.2",
"version_normalized": "3.10.2.0",
"version": "3.10.3",
"version_normalized": "3.10.3.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
"reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017"
"reference": "62d32998e820bddc40f99f8251958aed187a5c9c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017",
"reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017",
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c",
"reference": "62d32998e820bddc40f99f8251958aed187a5c9c",
"shasum": ""
},
"require": {
Expand All @@ -589,7 +589,7 @@
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
},
"time": "2024-07-21T23:26:44+00:00",
"time": "2024-09-18T10:38:58+00:00",
"bin": [
"bin/phpcbf",
"bin/phpcs"
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
'dev_requirement' => false,
),
'freemius/wordpress-sdk' => array(
'pretty_version' => '2.7.4',
'version' => '2.7.4.0',
'reference' => '2741ba2b4f819b5018f68529036e505ef1e7c349',
'pretty_version' => '2.8.1',
'version' => '2.8.1.0',
'reference' => 'cc31279d088909135b6b2d8b4f2696312f5731fc',
'type' => 'library',
'install_path' => __DIR__ . '/../freemius/wordpress-sdk',
'aliases' => array(),
Expand All @@ -105,9 +105,9 @@
'dev_requirement' => true,
),
'squizlabs/php_codesniffer' => array(
'pretty_version' => '3.10.2',
'version' => '3.10.2.0',
'reference' => '86e5f5dd9a840c46810ebe5ff1885581c42a3017',
'pretty_version' => '3.10.3',
'version' => '3.10.3.0',
'reference' => '62d32998e820bddc40f99f8251958aed187a5c9c',
'type' => 'library',
'install_path' => __DIR__ . '/../squizlabs/php_codesniffer',
'aliases' => array(),
Expand Down
Loading

0 comments on commit 86c9d65

Please sign in to comment.