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 24, 2022
2 parents 2afecc8 + 4cf240b commit d72c975
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 31 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#### [unreleased]

#### 11.1.7 / 2022-10-24
* load `wp-admin/includes/file.php` for when move_dir() in core, avoid redeclaration error
* allow updating of Git Remote Updater
* now using `str_contains`

#### 11.1.6 / 2022-10-05
* update Appsero SDK options

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ We now have a [Slack team for Git Updater](https://git-updater.slack.com). Pleas
## Translations

If you are a polyglot I would greatly appreciate translation contributions to [GlotPress for Git Updater](https://translate.git-updater.com).

## Analytics

Use of this plugin implies consent for obtaining [analytics data](https://appsero.com/features/analytics/) regarding its usage. This data is obtained via the Appsero SDK. If you wish to opt out of this data collection simply deactivate and remove the plugin. Your data will be automatically purged.
8 changes: 4 additions & 4 deletions composer.lock

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

4 changes: 3 additions & 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: 11.1.6
* Version: 11.1.7
* Author: Andy Fragen
* License: MIT
* Domain Path: /languages
Expand All @@ -38,6 +38,8 @@

// Load the Composer autoloader.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
// Avoids a redeclaration error for move_dir() from Shim.php.
require_once ABSPATH . 'wp-admin/includes/file.php';
require __DIR__ . '/vendor/autoload.php';
}

Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ We now have a [Slack team for Git Updater](https://git-updater.slack.com). Pleas
#### Translations

If you are a polyglot I would greatly appreciate translation contributions to [GlotPress for Git Updater](https://translate.git-updater.com).

## Analytics

Use of this plugin implies consent for obtaining [analytics data](https://appsero.com/features/analytics/) regarding its usage. This data is obtained via the Appsero SDK. If you wish to opt out of this data collection simply deactivate and remove the plugin. Your data will be automatically purged.
2 changes: 1 addition & 1 deletion src/Git_Updater/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ public function row_meta_icons( $links, $file ) {
* @return string
*/
public function get_git_icon( $file, $add_padding ) {
$type = false !== strpos( current_filter(), 'plugin' ) ? 'plugin' : 'theme';
$type = str_contains( current_filter(), 'plugin' ) ? 'plugin' : 'theme';
$type_cap = ucfirst( $type );
$filepath = 'plugin' === $type ? WP_PLUGIN_DIR . "/$file" : get_theme_root() . "/$file/style.css";

Expand Down
2 changes: 1 addition & 1 deletion src/Git_Updater/GU_Appsero.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function appsero_init_tracker_git_updater() {
// Activate insights.
$client->insights()
->hide_notice()
->add_plugin_data()
->init();
$client->insights()->optin();
// $client->insights()->add_plugin_data();

$gu_license = $client->license();

Expand Down
1 change: 0 additions & 1 deletion src/Git_Updater/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public function run() {
$this->load_hooks();

new Ignore( 'git-updater-pro', 'git-updater-pro/git-updater-pro.php' );
new Ignore( 'git-remote-updater', 'git-remote-updater/git-remote-updater.php' );
}

if ( static::is_wp_cli() ) {
Expand Down
2 changes: 1 addition & 1 deletion src/Git_Updater/Readme_Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function faq_as_h4( $data ) {
* @return array $data
*/
public function readme_section_as_h4( $section, $data ) {
if ( empty( $data['sections'][ $section ] ) || false !== strpos( $data['sections'][ $section ], '<h4>' ) ) {
if ( empty( $data['sections'][ $section ] ) || str_contains( $data['sections'][ $section ], '<h4>' ) ) {
return $data;
}
$pattern = '~<p>=(.*)=</p>~';
Expand Down
4 changes: 2 additions & 2 deletions src/Git_Updater/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ function ( $e ) use ( &$gu_unset_keys, $gu_tokens, &$reset_keys ) {
$key = array_search( $e, $gu_unset_keys, true );
$repo = str_replace( 'current_branch_', '', $key );
if ( array_key_exists( $key, $gu_unset_keys )
&& false !== strpos( $key, 'current_branch' )
&& str_contains( $key, 'current_branch' )
) {
unset( $gu_unset_keys[ $key ] );
}
Expand Down Expand Up @@ -899,7 +899,7 @@ function ( $e ) {
$dismiss = '&nbsp;<span title="' . $dismiss_title . '" class="dashicons dashicons-dismiss"></span></span>';
printf( '<h2>' . esc_html__( 'Installed Plugins and Themes', 'git-updater' ) . '</h2>' );
foreach ( $display_data as $data ) {
$dashicon = false !== strpos( $data['type'], 'theme' )
$dashicon = str_contains( $data['type'], 'theme' )
? '<span class="dashicons dashicons-admin-appearance"></span>&nbsp;&nbsp;'
: '<span class="dashicons dashicons-admin-plugins"></span>&nbsp;&nbsp;';
$is_private = $data['private'] ? $lock : null;
Expand Down
8 changes: 4 additions & 4 deletions src/Git_Updater/Traits/Basic_Auth_Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private function get_slug_for_credentials( $headers, $repos, $url, $options ) {
// Some installers, like TGMPA, pass an array.
$slug = is_array( $slug ) ? array_pop( $slug ) : $slug;

$slug = false !== strpos( $slug, '/' ) ? dirname( $slug ) : $slug;
$slug = str_contains( $slug, '/' ) ? dirname( $slug ) : $slug;

// Set for bulk upgrade.
if ( ! $slug ) {
Expand All @@ -181,7 +181,7 @@ private function get_slug_for_credentials( $headers, $repos, $url, $options ) {
$slug = array_filter(
$bulk_update,
function ( $e ) use ( $url ) {
return false !== strpos( $url, $e );
return str_contains( $url, $e );
}
);
$slug = array_pop( $slug );
Expand Down Expand Up @@ -232,7 +232,7 @@ private function get_type_for_credentials( $slug, $repos, $url ) {
// Set for Remote Install.
// phpcs:disable WordPress.Security.NonceVerification.Missing
$type = isset( $_POST['git_updater_api'], $_POST['git_updater_repo'] )
&& false !== strpos( $url, basename( sanitize_text_field( wp_unslash( $_POST['git_updater_repo'] ) ) ) )
&& str_contains( $url, basename( sanitize_text_field( wp_unslash( $_POST['git_updater_repo'] ) ) ) )
? sanitize_text_field( wp_unslash( $_POST['git_updater_api'] ) )
: $type;
// phpcs:enable
Expand All @@ -256,7 +256,7 @@ public function unset_release_asset_auth( $args, $url ) {
$releases = false;
$release_asset_parts = [ 's3.amazonaws.com', 'releases/download', 'github-releases', 'release-asset' ];
foreach ( $release_asset_parts as $part ) {
if ( false !== strpos( $url, $part ) ) {
if ( str_contains( $url, $part ) ) {
$releases = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
exit;
}

$options = [ 'github_updater', 'github_updater_api_key', 'github_updater_remote_management', 'git_updater', 'git_updater_api_key' ];
$options = [ 'github_updater', 'github_updater_api_key', 'github_updater_remote_management', 'git_updater', 'git_updater_api_key', 'git_updater_additions' ];
foreach ( $options as $option ) {
delete_option( $option );
delete_site_option( $option );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ public function __construct( $string ) {
&& false === strpos( $string, "\n" )
&& file_exists( $string )
)
|| preg_match( '!^https?://!i', $string )
|| preg_match( '!^data:text/plain!i', $string) )
|| preg_match( '!^https?://!i', $string )
|| preg_match( '!^data:text/plain!i', $string) )
{
$this->parse_readme( $string );
} elseif ( $string ) {
Expand Down Expand Up @@ -578,6 +578,9 @@ protected function sanitize_text( $text ) {
*/
protected function sanitize_contributors( $users ) {
foreach ( $users as $i => $name ) {
// Trim any leading `@` off the name, in the event that someone uses `@joe-bloggs`.
$name = ltrim( $name, '@' );

// Contributors should be listed by their WordPress.org Login name (Example: 'Joe Bloggs')
$user = get_user_by( 'login', $name );

Expand Down
17 changes: 15 additions & 2 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@
// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
exit(1);
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}

require_once __DIR__ . '/composer/autoload_real.php';
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@
"source": {
"type": "git",
"url": "https://github.com/afragen/wordpress-plugin-readme-parser.git",
"reference": "a3b3a1313a8ca870f9d1ebd97148f63045a8adf9"
"reference": "77fa0ee009bcfce63da1a51aa091dac20e242c98"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/afragen/wordpress-plugin-readme-parser/zipball/a3b3a1313a8ca870f9d1ebd97148f63045a8adf9",
"reference": "a3b3a1313a8ca870f9d1ebd97148f63045a8adf9",
"url": "https://api.github.com/repos/afragen/wordpress-plugin-readme-parser/zipball/77fa0ee009bcfce63da1a51aa091dac20e242c98",
"reference": "77fa0ee009bcfce63da1a51aa091dac20e242c98",
"shasum": ""
},
"require": {
"erusev/parsedown": "^1.7",
"php": ">=5.4"
},
"time": "2022-06-10T20:13:50+00:00",
"time": "2022-10-14T02:55:01+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php return array(
'root' => array(
'name' => 'afragen/git-updater',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '08b10a1c5f91e410b0339e2ff6f15f472e79fc38',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'df1372aa3eb97e55f35b947ff6bef9348b068c2c',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => false,
),
'versions' => array(
'afragen/git-updater' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '08b10a1c5f91e410b0339e2ff6f15f472e79fc38',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'df1372aa3eb97e55f35b947ff6bef9348b068c2c',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -33,7 +33,7 @@
'afragen/wordpress-plugin-readme-parser' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'a3b3a1313a8ca870f9d1ebd97148f63045a8adf9',
'reference' => '77fa0ee009bcfce63da1a51aa091dac20e242c98',
'type' => 'library',
'install_path' => __DIR__ . '/../afragen/wordpress-plugin-readme-parser',
'aliases' => array(
Expand Down

0 comments on commit d72c975

Please sign in to comment.