프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$checkPeriod | Plugin slug. | ||
$debugMode | Where to store the update info. | ||
$metadataUrl | |||
$optionName | How often to check for updates (in hours). | ||
$pluginFile | The URL of the plugin's metadata file. | ||
$slug | Plugin filename relative to the plugins directory. |
메소드 | 설명 | |
---|---|---|
__construct ( string $metadataUrl, string $pluginFile, string $slug = '', integer $checkPeriod = 12, string $optionName = '' ) | Class constructor. | |
_addCustomSchedule ( array $schedules ) : array | Add our custom schedule to the array of Cron schedules used by WP. | |
_removeUpdaterCron ( ) : void | Remove the scheduled cron event that the library uses to check for updates. | |
addCheckForUpdatesLink ( array $pluginMeta, string $pluginFile, array | null $pluginData = null, string | null $status = null ) : array | Add a "Check for updates" link to the plugin row in the "Plugins" page. By default, the new link will appear after the "Visit plugin site" link. | |
addFilter ( string $tag, callable $callback, integer $priority = 10, integer $acceptedArgs = 1 ) | Register a callback for one of the update checker filters. | |
addHttpRequestArgFilter ( callable $callback ) : void | Register a callback for filtering arguments passed to wp_remote_get(). | |
addQueryArgFilter ( callable $callback ) : void | Register a callback for filtering query arguments. | |
addResultFilter ( callable $callback ) : void | Register a callback for filtering the plugin info retrieved from the external API. | |
checkForUpdates ( ) : PluginUpdate | null | Check for plugin updates. | |
displayManualCheckResult ( ) | Display the results of a manual update check. | |
getCronHookName ( ) : string | Get the name of the update checker's WP-cron hook. Mostly useful for debugging. | |
getInstalledVersion ( ) : string | Get the currently installed version of the plugin. | |
getUpdate ( ) : PluginUpdate | null | Get the details of the currently available update, if any. | |
getUpdateState ( ) : StdClass | null | Load the update checker state from the DB. | |
handleManualCheck ( ) : void | Check for updates when the user clicks the "Check for updates" link. | |
initDebugBarPanel ( ) | Initialize the update checker Debug Bar plugin/add-on thingy. | |
injectInfo ( mixed $result, string $action = null, array | object $args = null ) : mixed | Intercept plugins_api() calls that request information about our plugin and use the configured API endpoint to satisfy them. | |
injectUpdate ( StdClass $updates ) : StdClass | Insert the latest update (if any) into the update list maintained by WP. | |
maybeCheckForUpdates ( ) : void | Check for updates only if the configured check interval has already elapsed. | |
renameGithubDirectory ( string $source, string $remote_source ) : string | Github .zip packages appends the branch name to the plugin's folder name. | |
requestInfo ( array $queryArgs = [] ) : PluginInfo | Retrieve plugin info from the configured API endpoint. | |
requestUpdate ( ) : PluginUpdate | Retrieve the latest update (if any) from the configured API endpoint. | |
resetUpdateState ( ) | Reset update checker state - i.e. last check time, cached update data and so on. | |
sslVerify ( mixed $args, string $url ) : mixed | Callback function for the 'http_request_args' filter. |
메소드 | 설명 | |
---|---|---|
installHooks ( ) : void | Install the hooks required to run periodic update checks and inject update info into WP data structures. |
메소드 | 설명 | |
---|---|---|
setUpdateState ( StdClass $state ) : void | Persist the update checker state to the DB. |
public __construct ( string $metadataUrl, string $pluginFile, string $slug = '', integer $checkPeriod = 12, string $optionName = '' ) | ||
$metadataUrl | string | The URL of the plugin's metadata file. |
$pluginFile | string | Fully qualified path to the main plugin file. |
$slug | string | The plugin's 'slug'. If not specified, the filename part of $pluginFile sans '.php' will be used as the slug. |
$checkPeriod | integer | How often to check for updates (in hours). Defaults to checking every 12 hours. Set to 0 to disable automatic update checks. |
$optionName | string | Where to store book-keeping info about update checks. Defaults to 'external_updates-$slug'. |
public _addCustomSchedule ( array $schedules ) : array | ||
$schedules | array | |
리턴 | array |
public _removeUpdaterCron ( ) : void | ||
리턴 | void |
public addHttpRequestArgFilter ( callable $callback ) : void | ||
$callback | callable | |
리턴 | void |
public addQueryArgFilter ( callable $callback ) : void | ||
$callback | callable | |
리턴 | void |
public addResultFilter ( callable $callback ) : void | ||
$callback | callable | |
리턴 | void |
public checkForUpdates ( ) : PluginUpdate | null | ||
리턴 | PluginUpdate | null |
public displayManualCheckResult ( ) |
public getCronHookName ( ) : string | ||
리턴 | string |
public getInstalledVersion ( ) : string | ||
리턴 | string | Version number. |
public getUpdateState ( ) : StdClass | null | ||
리턴 | StdClass | null |
public handleManualCheck ( ) : void | ||
리턴 | void |
public initDebugBarPanel ( ) |
public injectUpdate ( StdClass $updates ) : StdClass | ||
$updates | StdClass | Update list. |
리턴 | StdClass | Modified update list. |
protected installHooks ( ) : void | ||
리턴 | void |
public maybeCheckForUpdates ( ) : void | ||
리턴 | void |
public renameGithubDirectory ( string $source, string $remote_source ) : string | ||
$source | string | Temporary location of the extracted folder. Contains the plugin folder name with the Github branch appended. |
$remote_source | string | Temporary parent location. One level up from the extracted folder. |
리턴 | string | Location of the extracted folder |
public requestInfo ( array $queryArgs = [] ) : PluginInfo | ||
$queryArgs | array | Additional query arguments to append to the request. Optional. |
리턴 | PluginInfo |
public requestUpdate ( ) : PluginUpdate | ||
리턴 | PluginUpdate | An instance of PluginUpdate, or NULL when no updates are available. |
public resetUpdateState ( ) |