Skip to content

Commit

Permalink
v2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
xxsimoxx committed Mar 13, 2020
1 parent 31810fb commit 4d79b17
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
26 changes: 17 additions & 9 deletions classes/UpdateClient.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
* -----------------------------------------------------------------------------
*/

/**
*
* Note: this is not the original file.
* It's modified to remove text domain.
*
*/


// EDIT: Make this unique. Example: YourDevName\YourPluginName;
namespace XXSimoXX\Vars\UpdateClient;

Expand Down Expand Up @@ -77,6 +69,14 @@ class UpdateClient {
*/
private $cp_latest_version = '4.9.99';

/**
* Cached component data
*
* As pre_set_site_transient_update_plugins is called twice by ClassicPress,
* saving this value will cut an extra HTTP call to the update server.
*/
private $component_data = '';

/**
* Constructor.
*
Expand Down Expand Up @@ -564,6 +564,11 @@ private function get_plugin_identifier() {
*/
private function get_component_data($action, $component='') {

// If component data exists, no need to requery; return that data.
if (!empty($this->component_data)) {
return $this->component_data;
}

// Localize the platform version.
global $cp_version;

Expand Down Expand Up @@ -660,8 +665,11 @@ private function get_component_data($action, $component='') {
// Get the response body; decode it as an array.
$data = json_decode(trim(wp_remote_retrieve_body($raw_response)), true);

// Set retrieved data to the object for reuse elsewhere.
$this->component_data = is_array($data) ? $data : [];

// Return the reponse body.
return is_array($data) ? $data : [];
return $this->component_data;

}

Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== vars ===
Plugin Name: vars
Description: Vars in shortcodes
Version: 2.0.2
Version: 2.0.3
Text Domain: vars
Domain Path: /languages
Requires PHP: 5.6
Expand All @@ -10,7 +10,7 @@ Tested: 4.9.99
Author: Gieffe edizioni
Author URI: https://www.gieffeedizioni.it
Plugin URI: https://software.gieffeedizioni.it
Download link: https://github.com/xxsimoxx/vars/releases/download/v2.0.2/vars.zip
Download link: https://github.com/xxsimoxx/vars/releases/download/v2.0.3/vars.zip
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -38,6 +38,9 @@ You can choose which users can manage vars.
3. TinyMCE button

== Changelog ==
= 2.0.3 =
* Updated Update Manager client

= 2.0.2 =
* Updated Update Manager client
* PHP code styling
Expand Down
2 changes: 1 addition & 1 deletion vars.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: vars
* Plugin URI: https://software.gieffeedizioni.it
* Description: Vars in shortcodes
* Version: 2.0.2
* Version: 2.0.3
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Author: Gieffe edizioni srl
Expand Down

0 comments on commit 4d79b17

Please sign in to comment.