Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Jan 2, 2023
2 parents 88d1938 + c0f4e22 commit c9f1b69
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 60 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#### [unreleased]

#### 12.0.1 / 2023-01-02
* cleanup parsing of GitHub release assets
* composer update to fix dependency conflict

#### 12.0.0 / 2022-12-12
* ensure `$wp_filesystem` is available
* re-integrate Git Updater PRO
Expand Down
10 changes: 5 additions & 5 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.0.0
* Version: 12.0.1
* Author: Andy Fragen
* License: MIT
* Domain Path: /languages
Expand Down
2 changes: 1 addition & 1 deletion src/Git_Updater/GU_Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class GU_Upgrade {
*
* @var int
*/
private $db_version = '11.1.10.3'; // TODO: change number.
private $db_version = '12.0.0'; // TODO: change number.

/**
* Run update check against db_version.
Expand Down
14 changes: 6 additions & 8 deletions src/Git_Updater/Traits/API_Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,13 @@ private function parse_release_asset( $git, $request, $response ) {
return null;
}
if ( 'github' === $git ) {
do {
$assets = isset( $response->assets ) ? $response->assets : [];
foreach ( $assets as $asset ) {
if ( 1 === count( $assets ) || 0 === strpos( $asset->name, $this->type->slug ) ) {
$response = $asset->url;
break;
}
$assets = isset( $response->assets ) ? $response->assets : [];
foreach ( $assets as $asset ) {
if ( 1 === count( $assets ) || str_starts_with( $asset->name, $this->type->slug ) ) {
$response = $asset->url;
break;
}
} while ( false );
}
$response = is_string( $response ) ? $response : null;
$this->set_repo_cache( 'release_asset_response', $asset );
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/afragen/wp-dismiss-notice/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "afragen/wp-dismiss-notice",
"description": "Library for time dismissible WordPress admin notices.",
"version": "0.2.6",
"version": "0.3.0",
"type": "library",
"license": "MIT",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion vendor/afragen/wp-dismiss-notice/js/dismiss-notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
option_name = attr_value.join('-');

data = {
'action': 'dismiss_admin_notice',
'action': 'wp_dismiss_notice',
'option_name': option_name,
'dismissible_length': dismissible_length,
'nonce': window.wp_dismiss_notice.nonce
Expand Down
2 changes: 1 addition & 1 deletion vendor/afragen/wp-dismiss-notice/wp-dismiss-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class WP_Dismiss_Notice {
*/
public static function init() {
add_action( 'admin_enqueue_scripts', [ __CLASS__, 'load_script' ] );
add_action( 'wp_ajax_dismiss_admin_notice', [ __CLASS__, 'dismiss_admin_notice' ] );
add_action( 'wp_ajax_wp_dismiss_notice', [ __CLASS__, 'dismiss_admin_notice' ] );
}

/**
Expand Down
37 changes: 23 additions & 14 deletions vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;

/** @var ?string */
private $vendorDir;

Expand Down Expand Up @@ -106,6 +109,7 @@ class ClassLoader
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}

/**
Expand Down Expand Up @@ -425,7 +429,7 @@ public function unregister()
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
(self::$includeFile)($file);

return true;
}
Expand Down Expand Up @@ -555,18 +559,23 @@ private function findFileWithExtension($class, $ext)

return false;
}
}

/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
* @private
*/
function includeFile($file)
{
include $file;
private static function initializeIncludeClosure(): void
{
if (self::$includeFile !== null) {
return;
}

/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = static function($file) {
include $file;
};
}
}
27 changes: 10 additions & 17 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,18 @@ public static function getLoader()

$loader->register(true);

$includeFiles = \Composer\Autoload\ComposerStaticInita27e6a3df8c435e2b136f961f0442be2::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirea27e6a3df8c435e2b136f961f0442be2($fileIdentifier, $file);
$filesToLoad = \Composer\Autoload\ComposerStaticInita27e6a3df8c435e2b136f961f0442be2::$files;
$requireFile = static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

require $file;
}
};
foreach ($filesToLoad as $fileIdentifier => $file) {
($requireFile)($fileIdentifier, $file);
}

return $loader;
}
}

/**
* @param string $fileIdentifier
* @param string $file
* @return void
*/
function composerRequirea27e6a3df8c435e2b136f961f0442be2($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

require $file;
}
}
12 changes: 6 additions & 6 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,23 @@
},
{
"name": "afragen/wp-dismiss-notice",
"version": "0.2.6",
"version_normalized": "0.2.6.0",
"version": "0.3.0",
"version_normalized": "0.3.0.0",
"source": {
"type": "git",
"url": "https://github.com/afragen/wp-dismiss-notice.git",
"reference": "d6511c4eea243449dc6d15efcc807aa8ab0d3a91"
"reference": "8b690bc045620811d3c0724c2a2746cf1baab809"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/afragen/wp-dismiss-notice/zipball/d6511c4eea243449dc6d15efcc807aa8ab0d3a91",
"reference": "d6511c4eea243449dc6d15efcc807aa8ab0d3a91",
"url": "https://api.github.com/repos/afragen/wp-dismiss-notice/zipball/8b690bc045620811d3c0724c2a2746cf1baab809",
"reference": "8b690bc045620811d3c0724c2a2746cf1baab809",
"shasum": ""
},
"require": {
"php": ">=5.6"
},
"time": "2022-07-25T15:44:19+00:00",
"time": "2023-01-02T19:27:07+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'afragen/git-updater',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'bf7f2f7ae9c14bc283a21a069f94834521736d73',
'reference' => '88d1938409e3704255440a05149aaf073e2741fe',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'afragen/git-updater' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'bf7f2f7ae9c14bc283a21a069f94834521736d73',
'reference' => '88d1938409e3704255440a05149aaf073e2741fe',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -51,9 +51,9 @@
'dev_requirement' => false,
),
'afragen/wp-dismiss-notice' => array(
'pretty_version' => '0.2.6',
'version' => '0.2.6.0',
'reference' => 'd6511c4eea243449dc6d15efcc807aa8ab0d3a91',
'pretty_version' => '0.3.0',
'version' => '0.3.0.0',
'reference' => '8b690bc045620811d3c0724c2a2746cf1baab809',
'type' => 'library',
'install_path' => __DIR__ . '/../afragen/wp-dismiss-notice',
'aliases' => array(),
Expand Down

0 comments on commit c9f1b69

Please sign in to comment.