GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Private Member Functions | Private Attributes
EDD_SL_Plugin_Updater Class Reference

Allows plugins to use their own update API. More...

Public Member Functions

 __construct ($_api_url, $_plugin_file, $_api_data=null)
 Class constructor. More...
 
 check_update ($_transient_data)
 Check for Updates at the defined API endpoint and modify the update array. More...
 
 get_cached_version_info ($cache_key= '')
 
 http_request_args ($args, $url)
 Disable SSL verification in order to prevent download update failures. More...
 
 init ()
 Set up WordPress filters to hook into WP's update process. More...
 
 plugins_api_filter ($_data, $_action= '', $_args=null)
 Updates information on the "View version x.x details" page with custom data. More...
 
 set_version_info_cache ($value= '', $cache_key= '')
 
 show_changelog ()
 
 show_update_notification ($file, $plugin)
 show update nofication row – needed for multisite subsites, because WP won't tell you otherwise! More...
 

Private Member Functions

 api_request ($_action, $_data)
 Calls the API and, if successfull, returns the object delivered by the API. More...
 

Private Attributes

 $api_data = array()
 
 $api_url = ''
 
 $cache_key = ''
 
 $name = ''
 
 $slug = ''
 
 $version = ''
 
 $wp_override = false
 

Detailed Description

Allows plugins to use their own update API.

Author
Easy Digital Downloads
Version
1.6.8

Definition at line 12 of file EDD_SL_Plugin_Updater.php.

Constructor & Destructor Documentation

__construct (   $_api_url,
  $_plugin_file,
  $_api_data = null 
)

Class constructor.

plugin_basename() hook()

Parameters
string$_api_urlThe URL pointing to the custom API endpoint.
string$_plugin_filePath to the plugin file.
array$_api_dataOptional data to send with API calls.

Definition at line 32 of file EDD_SL_Plugin_Updater.php.

References $api_data, $slug, and init().

Member Function Documentation

api_request (   $_action,
  $_data 
)
private

Calls the API and, if successfull, returns the object delivered by the API.

get_bloginfo() wp_remote_post() is_wp_error()

Parameters
string$_actionThe requested action.
array$_dataParameters for the API action.
Returns
false|object

Definition at line 308 of file EDD_SL_Plugin_Updater.php.

Referenced by check_update(), plugins_api_filter(), and show_update_notification().

check_update (   $_transient_data)

Check for Updates at the defined API endpoint and modify the update array.

This function dives into the update API just when WordPress creates its update array, then adds a custom API call and injects the custom plugin data retrieved from the API. It is reassembled from parts of the native WordPress plugin update code. See wp-includes/update.php line 121 for the original wp_update_plugins() function.

api_request()

Parameters
array$_transient_dataUpdate array build by WordPress.
Returns
array Modified update array with custom plugin data.

Definition at line 82 of file EDD_SL_Plugin_Updater.php.

References $name, $version, api_request(), get_cached_version_info(), and set_version_info_cache().

get_cached_version_info (   $cache_key = '')
http_request_args (   $args,
  $url 
)

Disable SSL verification in order to prevent download update failures.

Parameters
array$args
string$url
Returns
object $array

Definition at line 289 of file EDD_SL_Plugin_Updater.php.

References $url.

init ( )

Set up WordPress filters to hook into WP's update process.

add_filter()

Returns
void

Definition at line 59 of file EDD_SL_Plugin_Updater.php.

Referenced by __construct().

plugins_api_filter (   $_data,
  $_action = '',
  $_args = null 
)

Updates information on the "View version x.x details" page with custom data.

api_request()

Parameters
mixed$_data
string$_action
object$_args
Returns
object $_data

Definition at line 235 of file EDD_SL_Plugin_Updater.php.

References $cache_key, api_request(), get_cached_version_info(), and set_version_info_cache().

set_version_info_cache (   $value = '',
  $cache_key = '' 
)
show_changelog ( )
show_update_notification (   $file,
  $plugin 
)

show update nofication row – needed for multisite subsites, because WP won't tell you otherwise!

Parameters
string$file
array$plugin

Definition at line 129 of file EDD_SL_Plugin_Updater.php.

References $name, $version, api_request(), get_cached_version_info(), and set_version_info_cache().

Field Documentation

$api_data = array()
private

Definition at line 15 of file EDD_SL_Plugin_Updater.php.

Referenced by __construct().

$api_url = ''
private

Definition at line 14 of file EDD_SL_Plugin_Updater.php.

$cache_key = ''
private
$name = ''
private

Definition at line 16 of file EDD_SL_Plugin_Updater.php.

Referenced by check_update(), and show_update_notification().

$slug = ''
private

Definition at line 17 of file EDD_SL_Plugin_Updater.php.

Referenced by __construct().

$version = ''
private

Definition at line 18 of file EDD_SL_Plugin_Updater.php.

Referenced by check_update(), and show_update_notification().

$wp_override = false
private

Definition at line 19 of file EDD_SL_Plugin_Updater.php.


The documentation for this class was generated from the following file: