Skip to content

Commit adf32b6

Browse files
committed
Merge branch 'develop'
2 parents 564aa0d + 977e5d7 commit adf32b6

File tree

9 files changed

+62
-43
lines changed

9 files changed

+62
-43
lines changed

CHANGES.md

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

3+
#### 8.8.1 / 2019-06-11
4+
* set `homepage` to `PluginURI` or `ThemeURI`, fixes [#791](https://github.com/afragen/github-updater/issues/791)
5+
* fixed Bitbucket release asset updates for proper containing folder structure, thanks @benoitchantre for the bug report
6+
37
#### 8.8.0 / 2019-05-15
48
* switched from `pre_set_site_transient_update_{plugins|themes}` to `site_transient_update_{plugins|themes}`
59
* update `Remote_Management` to work with filter change

composer.lock

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

github-updater.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Plugin Name: GitHub Updater
1313
* Plugin URI: https://github.com/afragen/github-updater
1414
* Description: A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs. It also allows for remote installation of plugins or themes into WordPress.
15-
* Version: 8.8.0
15+
* Version: 8.8.1
1616
* Author: Andy Fragen
1717
* License: GNU General Public License v2
1818
* License URI: http://www.gnu.org/licenses/gpl-2.0.html

languages/github-updater.pot

+21-21
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
# This file is distributed under the same license as the GitHub Updater plugin.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: GitHub Updater 8.7.3\n"
5+
"Project-Id-Version: GitHub Updater 8.8.1\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/github-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: 2019-04-09T04:15:06+00:00\n"
12+
"POT-Creation-Date: 2019-06-12T00:38:56+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14-
"X-Generator: WP-CLI 2.1.0\n"
14+
"X-Generator: WP-CLI 2.2.0\n"
1515
"X-Domain: github-updater\n"
1616

1717
#. Plugin Name of the plugin
@@ -157,65 +157,65 @@ msgstr ""
157157
msgid "Installed Plugins and Themes"
158158
msgstr ""
159159

160-
#: src/GitHub_Updater/Plugin.php:326
160+
#: src/GitHub_Updater/Plugin.php:324
161161
msgid "View details"
162162
msgstr ""
163163

164164
#. translators: %s: theme name
165-
#: src/GitHub_Updater/Theme.php:340
166-
#: src/GitHub_Updater/Theme.php:536
165+
#: src/GitHub_Updater/Theme.php:333
166+
#: src/GitHub_Updater/Theme.php:529
167167
msgid "There is a new version of %s available."
168168
msgstr ""
169169

170170
#. translators: %s: theme version
171-
#: src/GitHub_Updater/Theme.php:352
171+
#: src/GitHub_Updater/Theme.php:345
172172
msgid "View version %s details."
173173
msgstr ""
174174

175-
#: src/GitHub_Updater/Theme.php:356
175+
#: src/GitHub_Updater/Theme.php:349
176176
msgid "Automatic update is unavailable for this theme."
177177
msgstr ""
178178

179179
#. translators: 1: version number, 2: closing anchor tag, 3: update URL
180-
#: src/GitHub_Updater/Theme.php:361
181-
#: src/GitHub_Updater/Theme.php:546
180+
#: src/GitHub_Updater/Theme.php:354
181+
#: src/GitHub_Updater/Theme.php:539
182182
msgid "View version %1$s details%2$s or %3$supdate now%2$s."
183183
msgstr ""
184184

185185
#. translators: %s: theme name
186-
#: src/GitHub_Updater/Theme.php:366
187-
#: src/GitHub_Updater/Theme.php:551
186+
#: src/GitHub_Updater/Theme.php:359
187+
#: src/GitHub_Updater/Theme.php:544
188188
msgid "Update %s now"
189189
msgstr ""
190190

191191
#. translators: 1: branch name, 2: jQuery dropdown, 3: closing tag
192-
#: src/GitHub_Updater/Theme.php:588
193-
#: src/GitHub_Updater/Base.php:912
192+
#: src/GitHub_Updater/Theme.php:581
193+
#: src/GitHub_Updater/Base.php:828
194194
msgid "Current branch is `%1$s`, try %2$sanother version%3$s"
195195
msgstr ""
196196

197-
#: src/GitHub_Updater/Theme.php:596
197+
#: src/GitHub_Updater/Theme.php:589
198198
msgid "Choose a Version"
199199
msgstr ""
200200

201-
#: src/GitHub_Updater/Theme.php:614
202-
#: src/GitHub_Updater/Base.php:947
201+
#: src/GitHub_Updater/Theme.php:607
202+
#: src/GitHub_Updater/Base.php:863
203203
msgid "No previous tags to rollback to."
204204
msgstr ""
205205

206-
#: src/GitHub_Updater/Theme.php:618
206+
#: src/GitHub_Updater/Theme.php:611
207207
msgid "Install"
208208
msgstr ""
209209

210-
#: src/GitHub_Updater/Base.php:447
210+
#: src/GitHub_Updater/Base.php:446
211211
msgid "There may be a problem with WP-Cron. A GitHub Updater WP-Cron event is overdue."
212212
msgstr ""
213213

214-
#: src/GitHub_Updater/Base.php:923
214+
#: src/GitHub_Updater/Base.php:839
215215
msgid "Switch to branch "
216216
msgstr ""
217217

218-
#: src/GitHub_Updater/Base.php:939
218+
#: src/GitHub_Updater/Base.php:855
219219
msgid "Switch to release "
220220
msgstr ""
221221

src/GitHub_Updater/Base.php

+20-10
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public function upgrader_source_selection( $source, $remote_source, $upgrader, $
512512
Singleton::get_instance( 'Branch', $this )->set_branch_on_switch( $slug );
513513

514514
$new_source = $this->fix_misnamed_directory( $new_source, $remote_source, $upgrader_object, $slug );
515-
$new_source = $this->fix_gitlab_release_asset_directory( $new_source, $remote_source, $upgrader_object, $slug );
515+
$new_source = $this->fix_release_asset_directory( $new_source, $remote_source, $upgrader_object, $slug );
516516

517517
$wp_filesystem->move( $source, $new_source );
518518

@@ -557,8 +557,10 @@ private function fix_misnamed_directory( $new_source, $remote_source, $upgrader_
557557
}
558558

559559
/**
560-
* Renaming if using a GitLab Release Asset.
561-
* It has a different download directory structure.
560+
* Fix the directory structure of certain release assests.
561+
*
562+
* GitLab release assets have a different download directory structure.
563+
* Bitbucket release assets need to be copied into a containing directory.
562564
*
563565
* @param string $new_source
564566
* @param string $remote_source
@@ -567,13 +569,21 @@ private function fix_misnamed_directory( $new_source, $remote_source, $upgrader_
567569
*
568570
* @return string $new_source
569571
*/
570-
private function fix_gitlab_release_asset_directory( $new_source, $remote_source, $upgrader_object, $slug ) {
571-
if ( ( isset( $upgrader_object->config[ $slug ]->release_asset ) &&
572-
$upgrader_object->config[ $slug ]->release_asset ) &&
573-
! empty( $upgrader_object->config[ $slug ]->ci_job )
574-
) {
575-
$new_source = trailingslashit( dirname( $remote_source ) ) . $slug;
576-
add_filter( 'upgrader_post_install', [ $this, 'upgrader_post_install' ], 10, 3 );
572+
private function fix_release_asset_directory( $new_source, $remote_source, $upgrader_object, $slug ) {
573+
global $wp_filesystem;
574+
if ( isset( $upgrader_object->config[ $slug ]->release_asset ) &&
575+
$upgrader_object->config[ $slug ]->release_asset ) {
576+
if ( 'gitlab' === $upgrader_object->config[ $slug ]->git ) {
577+
$new_source = trailingslashit( dirname( $remote_source ) ) . $slug;
578+
add_filter( 'upgrader_post_install', [ $this, 'upgrader_post_install' ], 10, 3 );
579+
}
580+
if ( 'bitbucket' === $upgrader_object->config[ $slug ]->git ) {
581+
$temp_source = trailingslashit( dirname( $remote_source ) ) . $slug;
582+
$wp_filesystem->move( $remote_source, $temp_source );
583+
wp_mkdir_p( $new_source );
584+
copy_dir( $temp_source, $new_source );
585+
$wp_filesystem->delete( $temp_source, true );
586+
}
577587
}
578588

579589
return $new_source;

src/GitHub_Updater/Plugin.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ protected function get_plugin_meta() {
129129
$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $git_plugin['file'] );
130130
$git_plugin['author'] = $plugin_data['AuthorName'];
131131
$git_plugin['name'] = $plugin_data['Name'];
132+
$git_plugin['homepage'] = $plugin_data['PluginURI'];
132133
$git_plugin['local_version'] = strtolower( $plugin_data['Version'] );
133134
$git_plugin['sections']['description'] = $plugin_data['Description'];
134135
$git_plugin['languages'] = $header['languages'];
@@ -358,7 +359,7 @@ public function plugins_api( $false, $action, $response ) {
358359
$response->plugin_name = $plugin->name;
359360
$response->name = $plugin->name;
360361
$response->author = $plugin->author;
361-
$response->homepage = $plugin->uri;
362+
$response->homepage = $plugin->homepage;
362363
$response->donate_link = $plugin->donate_link;
363364
$response->version = $plugin->remote_version;
364365
$response->sections = $plugin->sections;

src/GitHub_Updater/Theme.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ protected function get_theme_meta() {
147147
$git_theme['file'] = "{$header['repo']}/style.css";
148148
$git_theme['name'] = $theme->get( 'Name' );
149149
$git_theme['theme_uri'] = $theme->get( 'ThemeURI' );
150+
$git_theme['homepage'] = $theme->get( 'ThemeURI' );
150151
$git_theme['author'] = $theme->get( 'Author' );
151152
$git_theme['local_version'] = strtolower( $theme->get( 'Version' ) );
152153
$git_theme['sections']['description'] = $theme->get( 'Description' );
@@ -263,7 +264,7 @@ public function themes_api( $false, $action, $response ) {
263264

264265
$response->slug = $theme->slug;
265266
$response->name = $theme->name;
266-
$response->homepage = $theme->uri;
267+
$response->homepage = $theme->homepage;
267268
$response->donate_link = $theme->donate_link;
268269
$response->version = $theme->remote_version;
269270
$response->sections = $theme->sections;

vendor/afragen/wordpress-plugin-readme-parser/class-parser.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,10 @@ protected function sanitize_tested_version( $version ) {
613613
// x.y or x.y.z
614614
! preg_match( '!^\d+\.\d(\.\d+)?$!', $version ) ||
615615
// Allow plugins to mark themselves as compatible with Stable+0.1 (trunk/master) but not higher
616-
defined( 'WP_CORE_STABLE_BRANCH' ) && ( (float)$version > (float)WP_CORE_STABLE_BRANCH+0.1 )
616+
(
617+
defined( 'WP_CORE_STABLE_BRANCH' ) &&
618+
version_compare( (float)$version, (float)WP_CORE_STABLE_BRANCH+0.1, '>' )
619+
)
617620
) {
618621
$this->warnings['tested_header_ignored'] = true;
619622
// Ignore the readme value.

vendor/composer/installed.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@
5050
"source": {
5151
"type": "git",
5252
"url": "https://github.com/afragen/wordpress-plugin-readme-parser.git",
53-
"reference": "df96450ef96aafee3db3c86c67cf7f3119519a07"
53+
"reference": "2ae820e44b0d53766557bb3b38f8908539799c83"
5454
},
5555
"dist": {
5656
"type": "zip",
57-
"url": "https://api.github.com/repos/afragen/wordpress-plugin-readme-parser/zipball/df96450ef96aafee3db3c86c67cf7f3119519a07",
58-
"reference": "df96450ef96aafee3db3c86c67cf7f3119519a07",
57+
"url": "https://api.github.com/repos/afragen/wordpress-plugin-readme-parser/zipball/2ae820e44b0d53766557bb3b38f8908539799c83",
58+
"reference": "2ae820e44b0d53766557bb3b38f8908539799c83",
5959
"shasum": ""
6060
},
6161
"require": {
6262
"erusev/parsedown": "^1.7",
6363
"php": ">=5.4"
6464
},
65-
"time": "2019-01-05T16:19:09+00:00",
65+
"time": "2019-04-11T04:09:48+00:00",
6666
"type": "library",
6767
"installation-source": "dist",
6868
"autoload": {

0 commit comments

Comments
 (0)