Skip to content

Commit 3e62c43

Browse files
author
Arkady Yusupov
committed
minor version (auto)updates fix
1 parent 34206f5 commit 3e62c43

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

update.json renamed to .update.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Payneteasy Payment System",
33
"slug": "php-plugin-woocommerce",
44
"author": "<a href='https://payneteasy.com/'>Payneteasy</a>",
5-
"version": "1.2.0",
5+
"version": "1.2.1",
66
"requires": "6.6",
77
"tested": "6.9.1",
88
"requires_php": "7.4",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# php plugin for woocommerce wordpress
22

3-
version 1.2.0.
3+
version 1.2.1.
44
tested on Wordpress 6.6, 6.8.1, 6.8.2, 6.8.3, 6.9.1.
55
with wooCommerce (8.7.0, 9.3.4, 9.5.1).

wc-payneteasy.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Payneteasy payment system
44
* Plugin URI: https://github.com/payneteasy/php-plugin-woocommerce?tab=readme-ov-file#php-plugin-for-woocommerce-wordpress
55
* Description: Allows you to use payment system Payneteasy with the WooCommerce.
6-
* Version: 1.2.0
6+
* Version: 1.2.1
77
* Author: Payneteasy
88
* Author URI: https://payneteasy.com/
99
* Text Domain: wc-payneteasy
@@ -12,7 +12,7 @@
1212
* Requires Plugins: woocommerce/woocommerce
1313
*
1414
* @package Payneteasy
15-
* @version 1.2.0
15+
* @version 1.2.1
1616
*/
1717

1818
if (!defined('ABSPATH')) exit; # Exit if accessed directly
@@ -48,7 +48,7 @@ class WC_Payneteasy extends WC_Payment_Gateway {
4848
function __construct() {
4949
$this->id = 'wc_payneteasy';
5050
$this->icon = apply_filters('woocommerce_payneteasy_icon', plugin_dir_url(__FILE__).'payneteasy.png');
51-
$this->method_title = __('Payment system Payneteasy v1.2.0', 'wc-payneteasy');
51+
$this->method_title = __('Payment system Payneteasy v1.2.1', 'wc-payneteasy');
5252
$this->method_description = __('Plugin "Payneteasy Payment System" for WooCommerce, which allows you to integrate online payments.', 'wc-payneteasy');
5353
$this->has_fields = false;
5454

@@ -78,7 +78,7 @@ public static function hook_plugin_update_info($rv, $action, $args) {
7878

7979
private static function fetch_update_json($failret = null): ?array {
8080
if (!($json_str = get_transient(self::GITHUB_REPO))) {
81-
if (!empty($json_str = wp_remote_retrieve_body( wp_remote_get(sprintf('https://raw.githubusercontent.com/%s/refs/heads/main/update.json', self::GITHUB_REPO)) )))
81+
if (!empty($json_str = wp_remote_retrieve_body( wp_remote_get(sprintf('https://raw.githubusercontent.com/%s/refs/heads/main/.update.json', self::GITHUB_REPO)) )))
8282
set_transient(self::GITHUB_REPO, $json_str, HOUR_IN_SECONDS);
8383
else
8484
return $failret;
@@ -99,17 +99,17 @@ public static function hook_plugin_check_version(stdClass $T): stdClass {
9999
if ($info->version != $T->checked[$entry = plugin_basename(__FILE__)]) {
100100
$is_pkg_avail = wp_remote_head($pkg_url = sprintf('https://github.com/%s/releases/download/v%s/php-plugin-woocommerce.zip', self::GITHUB_REPO, $info->version));
101101

102-
if (is_wp_error($is_pkg_avail) || !in_array(wp_remote_retrieve_response_code($is_pkg_avail), [ 200, 302 ]))
103-
$pkg_url = null; #throw new Payneteasy\lib\ApiException('New release package is not available yet');
104-
105102
$T->response[$entry] = (object)[
106103
'plugin' => $entry,
107-
'package' => $pkg_url,
108104
'slug' => $info->slug,
109105
'new_version' => $info->version,
110106
'requires' => $info->requires,
107+
'requires_php' => $info->requires_php,
108+
'package' => (is_wp_error($is_pkg_avail) || !in_array(wp_remote_retrieve_response_code($is_pkg_avail), [ 200, 302 ])) ? '' : $pkg_url,
111109
'url' => 'https://github.com/payneteasy/php-plugin-woocommerce/blob/main/README.md#php-plugin-for-woocommerce-wordpress' ];
112110
}
111+
else
112+
$T->no_update[$entry] = (object)[ 'slug' => $info->slug, 'plugin' => $entry, 'new_version' => $info->version ];
113113

114114
return $T;
115115
}

0 commit comments

Comments
 (0)