Skip to content

Commit

Permalink
Fixed update function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Neychok committed Jul 5, 2023
1 parent 058c3db commit 3660dbf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions dxsf-proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Plugin Name: DXSF Proxy
* Plugin URI: https://devrix.com
* Description: Stability Framework Proxy Plugin
* Version: 2.3.1
* Version: 2.3.2
* Author: DevriX
* Author URI: https://devrix.com
* License: GPL-2.0+
Expand All @@ -34,7 +34,7 @@
* For the versioning of the plugin is used SemVer - https://semver.org
* Rename this for every new plugin and update it as you release new versions.
*/
define( 'DXSF_PROXY_VERSION', '2.3.1' );
define( 'DXSF_PROXY_VERSION', '2.3.2' );

if ( ! defined( 'DXSF_PROXY_DIR' ) ) {
define( 'DXSF_PROXY_DIR', plugin_dir_path( __FILE__ ) );
Expand Down
23 changes: 13 additions & 10 deletions includes/classes/updater/class-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ class Update {
public $version;
public $cache_key;
public $cache_allowed;
public $package_name;

public function __construct() {

$this->plugin_slug = plugin_basename( DXSF_PROXY_DIR );
$this->version = DXSF_PROXY_VERSION;
$this->cache_key = 'dxsf_proxy_update';
$this->plugin_slug = plugin_basename( DXSF_PROXY_DIR );
$this->package_name = 'dxsf-wordpress-proxy.zip';
$this->version = DXSF_PROXY_VERSION;
$this->cache_key = 'dxsf_proxy_update';
$this->cache_allowed = false;
}

Expand Down Expand Up @@ -104,12 +106,13 @@ public function update( $transient ) {
&& version_compare( $this->version, $remote_version, '<' )
) {
$res = new \stdClass();
$res->slug = $this->plugin_slug;
$res->plugin = plugin_basename( DXSF_PROXY_DIR . '/dxsf-proxy.php' ); // misha-update-plugin/misha-update-plugin.php
$res->new_version = $remote_version;
$res->author = 'DevriX';
$res->download_link = 'https://github.com/DevriX/dxsf-proxy/releases/latest/download/dxsf-wordpress-proxy.zip';
$res->trunk = 'https://github.com/DevriX/dxsf-proxy/releases/latest/download/dxsf-wordpress-proxy.zip';
$res->slug = $this->plugin_slug;
$res->plugin = plugin_basename( DXSF_PROXY_DIR . '/dxsf-proxy.php' ); // misha-update-plugin/misha-update-plugin.php
$res->new_version = $remote_version;
$res->author = 'DevriX';
$res->download_link = 'https://github.com/DevriX/dxsf-proxy/releases/latest/download/' . $this->package_name;
$res->trunk = 'https://github.com/DevriX/dxsf-proxy/releases/latest/download/' . $this->package_name;
$res->package = 'https://github.com/DevriX/dxsf-proxy/releases/latest/download/' . $this->package_name;

$transient->response[ $res->plugin ] = $res;
}
Expand All @@ -128,4 +131,4 @@ public function purge( $upgrader, $options ) {
delete_transient( $this->cache_key );
}
}
}
}

0 comments on commit 3660dbf

Please sign in to comment.