Skip to content

Commit

Permalink
Bump version number to 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
YahnisElsts committed Feb 7, 2020
1 parent 3857481 commit 28f29c9
Show file tree
Hide file tree
Showing 38 changed files with 224 additions and 224 deletions.
2 changes: 1 addition & 1 deletion Puc/v4/Factory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
if ( !class_exists('Puc_v4_Factory', false) ):

class Puc_v4_Factory extends Puc_v4p8_Factory { }
class Puc_v4_Factory extends Puc_v4p9_Factory { }

endif;
4 changes: 2 additions & 2 deletions Puc/v4p8/Autoloader.php → Puc/v4p9/Autoloader.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

if ( !class_exists('Puc_v4p8_Autoloader', false) ):
if ( !class_exists('Puc_v4p9_Autoloader', false) ):

class Puc_v4p8_Autoloader {
class Puc_v4p9_Autoloader {
private $prefix = '';
private $rootDir = '';
private $libraryDir = '';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
if ( !class_exists('Puc_v4p8_DebugBar_Extension', false) ):
if ( !class_exists('Puc_v4p9_DebugBar_Extension', false) ):

class Puc_v4p8_DebugBar_Extension {
class Puc_v4p9_DebugBar_Extension {
const RESPONSE_BODY_LENGTH_LIMIT = 4000;

/** @var Puc_v4p8_UpdateChecker */
/** @var Puc_v4p9_UpdateChecker */
protected $updateChecker;
protected $panelClass = 'Puc_v4p8_DebugBar_Panel';
protected $panelClass = 'Puc_v4p9_DebugBar_Panel';

public function __construct($updateChecker, $panelClass = null) {
$this->updateChecker = $updateChecker;
Expand Down Expand Up @@ -150,11 +150,11 @@ private function getLibraryUrl($filePath) {
$absolutePath = realpath(dirname(__FILE__) . '/../../../' . ltrim($filePath, '/'));

//Where is the library located inside the WordPress directory structure?
$absolutePath = Puc_v4p8_Factory::normalizePath($absolutePath);
$absolutePath = Puc_v4p9_Factory::normalizePath($absolutePath);

$pluginDir = Puc_v4p8_Factory::normalizePath(WP_PLUGIN_DIR);
$muPluginDir = Puc_v4p8_Factory::normalizePath(WPMU_PLUGIN_DIR);
$themeDir = Puc_v4p8_Factory::normalizePath(get_theme_root());
$pluginDir = Puc_v4p9_Factory::normalizePath(WP_PLUGIN_DIR);
$muPluginDir = Puc_v4p9_Factory::normalizePath(WPMU_PLUGIN_DIR);
$themeDir = Puc_v4p9_Factory::normalizePath(get_theme_root());

if ( (strpos($absolutePath, $pluginDir) === 0) || (strpos($absolutePath, $muPluginDir) === 0) ) {
//It's part of a plugin.
Expand Down
6 changes: 3 additions & 3 deletions Puc/v4p8/DebugBar/Panel.php → Puc/v4p9/DebugBar/Panel.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

if ( !class_exists('Puc_v4p8_DebugBar_Panel', false) && class_exists('Debug_Bar_Panel', false) ):
if ( !class_exists('Puc_v4p9_DebugBar_Panel', false) && class_exists('Debug_Bar_Panel', false) ):

class Puc_v4p8_DebugBar_Panel extends Debug_Bar_Panel {
/** @var Puc_v4p8_UpdateChecker */
class Puc_v4p9_DebugBar_Panel extends Debug_Bar_Panel {
/** @var Puc_v4p9_UpdateChecker */
protected $updateChecker;

private $responseBox = '<div class="puc-ajax-response" style="display: none;"></div>';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
if ( !class_exists('Puc_v4p8_DebugBar_PluginExtension', false) ):
if ( !class_exists('Puc_v4p9_DebugBar_PluginExtension', false) ):

class Puc_v4p8_DebugBar_PluginExtension extends Puc_v4p8_DebugBar_Extension {
/** @var Puc_v4p8_Plugin_UpdateChecker */
class Puc_v4p9_DebugBar_PluginExtension extends Puc_v4p9_DebugBar_Extension {
/** @var Puc_v4p9_Plugin_UpdateChecker */
protected $updateChecker;

public function __construct($updateChecker) {
parent::__construct($updateChecker, 'Puc_v4p8_DebugBar_PluginPanel');
parent::__construct($updateChecker, 'Puc_v4p9_DebugBar_PluginPanel');

add_action('wp_ajax_puc_v4_debug_request_info', array($this, 'ajaxRequestInfo'));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

if ( !class_exists('Puc_v4p8_DebugBar_PluginPanel', false) ):
if ( !class_exists('Puc_v4p9_DebugBar_PluginPanel', false) ):

class Puc_v4p8_DebugBar_PluginPanel extends Puc_v4p8_DebugBar_Panel {
class Puc_v4p9_DebugBar_PluginPanel extends Puc_v4p9_DebugBar_Panel {
/**
* @var Puc_v4p8_Plugin_UpdateChecker
* @var Puc_v4p9_Plugin_UpdateChecker
*/
protected $updateChecker;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

if ( !class_exists('Puc_v4p8_DebugBar_ThemePanel', false) ):
if ( !class_exists('Puc_v4p9_DebugBar_ThemePanel', false) ):

class Puc_v4p8_DebugBar_ThemePanel extends Puc_v4p8_DebugBar_Panel {
class Puc_v4p9_DebugBar_ThemePanel extends Puc_v4p9_DebugBar_Panel {
/**
* @var Puc_v4p8_Theme_UpdateChecker
* @var Puc_v4p9_Theme_UpdateChecker
*/
protected $updateChecker;

Expand Down
8 changes: 4 additions & 4 deletions Puc/v4p8/Factory.php → Puc/v4p9/Factory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
if ( !class_exists('Puc_v4p8_Factory', false) ):
if ( !class_exists('Puc_v4p9_Factory', false) ):

/**
* A factory that builds update checker instances.
Expand All @@ -11,7 +11,7 @@
* At the moment it can only build instances of the UpdateChecker class. Other classes are
* intended mainly for internal use and refer directly to specific implementations.
*/
class Puc_v4p8_Factory {
class Puc_v4p9_Factory {
protected static $classVersions = array();
protected static $sorted = false;

Expand All @@ -24,15 +24,15 @@ class Puc_v4p8_Factory {
* This method automatically detects if you're using it for a plugin or a theme and chooses
* the appropriate implementation for your update source (JSON file, GitHub, BitBucket, etc).
*
* @see Puc_v4p8_UpdateChecker::__construct
* @see Puc_v4p9_UpdateChecker::__construct
*
* @param string $metadataUrl The URL of the metadata file, a GitHub repository, or another supported update source.
* @param string $fullPath Full path to the main plugin file or to the theme directory.
* @param string $slug Custom slug. Defaults to the name of the main plugin file or the theme directory.
* @param int $checkPeriod How often to check for updates (in hours).
* @param string $optionName Where to store book-keeping info about update checks.
* @param string $muPluginFile The plugin filename relative to the mu-plugins directory.
* @return Puc_v4p8_Plugin_UpdateChecker|Puc_v4p8_Theme_UpdateChecker|Puc_v4p8_Vcs_BaseChecker
* @return Puc_v4p9_Plugin_UpdateChecker|Puc_v4p9_Theme_UpdateChecker|Puc_v4p9_Vcs_BaseChecker
*/
public static function buildUpdateChecker($metadataUrl, $fullPath, $slug = '', $checkPeriod = 12, $optionName = '', $muPluginFile = '') {
$fullPath = self::normalizePath($fullPath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
if ( !class_exists('Puc_v4p8_InstalledPackage', false) ):
if ( !class_exists('Puc_v4p9_InstalledPackage', false) ):

/**
* This class represents a currently installed plugin or theme.
*
* Not to be confused with the "package" field in WP update API responses that contains
* the download URL of a the new version.
*/
abstract class Puc_v4p8_InstalledPackage {
abstract class Puc_v4p9_InstalledPackage {
/**
* @var Puc_v4p8_UpdateChecker
* @var Puc_v4p9_UpdateChecker
*/
protected $updateChecker;

Expand Down
4 changes: 2 additions & 2 deletions Puc/v4p8/Metadata.php → Puc/v4p9/Metadata.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
if ( !class_exists('Puc_v4p8_Metadata', false) ):
if ( !class_exists('Puc_v4p9_Metadata', false) ):

/**
* A base container for holding information about updates and plugin metadata.
Expand All @@ -8,7 +8,7 @@
* @copyright 2016
* @access public
*/
abstract class Puc_v4p8_Metadata {
abstract class Puc_v4p9_Metadata {

/**
* Create an instance of this class from a JSON document.
Expand Down
4 changes: 2 additions & 2 deletions Puc/v4p8/OAuthSignature.php → Puc/v4p9/OAuthSignature.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

if ( !class_exists('Puc_v4p8_OAuthSignature', false) ):
if ( !class_exists('Puc_v4p9_OAuthSignature', false) ):

/**
* A basic signature generator for zero-legged OAuth 1.0.
*/
class Puc_v4p8_OAuthSignature {
class Puc_v4p9_OAuthSignature {
private $consumerKey = '';
private $consumerSecret = '';

Expand Down
4 changes: 2 additions & 2 deletions Puc/v4p8/Plugin/Info.php → Puc/v4p9/Plugin/Info.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
if ( !class_exists('Puc_v4p8_Plugin_Info', false) ):
if ( !class_exists('Puc_v4p9_Plugin_Info', false) ):

/**
* A container class for holding and transforming various plugin metadata.
Expand All @@ -8,7 +8,7 @@
* @copyright 2016
* @access public
*/
class Puc_v4p8_Plugin_Info extends Puc_v4p8_Metadata {
class Puc_v4p9_Plugin_Info extends Puc_v4p9_Metadata {
//Most fields map directly to the contents of the plugin's info.json file.
//See the relevant docs for a description of their meaning.
public $name;
Expand Down
10 changes: 5 additions & 5 deletions Puc/v4p8/Plugin/Package.php → Puc/v4p9/Plugin/Package.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
if ( !class_exists('Puc_v4p8_Plugin_Package', false) ):
if ( !class_exists('Puc_v4p9_Plugin_Package', false) ):

class Puc_v4p8_Plugin_Package extends Puc_v4p8_InstalledPackage {
class Puc_v4p9_Plugin_Package extends Puc_v4p9_InstalledPackage {
/**
* @var Puc_v4p8_Plugin_UpdateChecker
* @var Puc_v4p9_Plugin_UpdateChecker
*/
protected $updateChecker;

Expand Down Expand Up @@ -170,8 +170,8 @@ public function isMuPlugin() {
$pluginPath = realpath($this->pluginAbsolutePath);
//If realpath() fails, just normalize the syntax instead.
if (($muPluginDir === false) || ($pluginPath === false)) {
$muPluginDir = Puc_v4p8_Factory::normalizePath(WPMU_PLUGIN_DIR);
$pluginPath = Puc_v4p8_Factory::normalizePath($this->pluginAbsolutePath);
$muPluginDir = Puc_v4p9_Factory::normalizePath(WPMU_PLUGIN_DIR);
$pluginPath = Puc_v4p9_Factory::normalizePath($this->pluginAbsolutePath);
}

$cachedResult = (strpos($pluginPath, $muPluginDir) === 0);
Expand Down
6 changes: 3 additions & 3 deletions Puc/v4p8/Plugin/Ui.php → Puc/v4p9/Plugin/Ui.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
if ( !class_exists('Puc_v4p8_Plugin_Ui', false) ):
if ( !class_exists('Puc_v4p9_Plugin_Ui', false) ):
/**
* Additional UI elements for plugins.
*/
class Puc_v4p8_Plugin_Ui {
class Puc_v4p9_Plugin_Ui {
private $updateChecker;
private $manualCheckErrorTransient = '';

/**
* @param Puc_v4p8_Plugin_UpdateChecker $updateChecker
* @param Puc_v4p9_Plugin_UpdateChecker $updateChecker
*/
public function __construct($updateChecker) {
$this->updateChecker = $updateChecker;
Expand Down
16 changes: 8 additions & 8 deletions Puc/v4p8/Plugin/Update.php → Puc/v4p9/Plugin/Update.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
if ( !class_exists('Puc_v4p8_Plugin_Update', false) ):
if ( !class_exists('Puc_v4p9_Plugin_Update', false) ):

/**
* A simple container class for holding information about an available update.
Expand All @@ -8,7 +8,7 @@
* @copyright 2016
* @access public
*/
class Puc_v4p8_Plugin_Update extends Puc_v4p8_Update {
class Puc_v4p9_Plugin_Update extends Puc_v4p9_Update {
public $id = 0;
public $homepage;
public $upgrade_notice;
Expand All @@ -24,13 +24,13 @@ class Puc_v4p8_Plugin_Update extends Puc_v4p8_Update {
* Create a new instance of PluginUpdate from its JSON-encoded representation.
*
* @param string $json
* @return Puc_v4p8_Plugin_Update|null
* @return Puc_v4p9_Plugin_Update|null
*/
public static function fromJson($json){
//Since update-related information is simply a subset of the full plugin info,
//we can parse the update JSON as if it was a plugin info string, then copy over
//the parts that we care about.
$pluginInfo = Puc_v4p8_Plugin_Info::fromJson($json);
$pluginInfo = Puc_v4p9_Plugin_Info::fromJson($json);
if ( $pluginInfo !== null ) {
return self::fromPluginInfo($pluginInfo);
} else {
Expand All @@ -42,8 +42,8 @@ public static function fromJson($json){
* Create a new instance of PluginUpdate based on an instance of PluginInfo.
* Basically, this just copies a subset of fields from one object to another.
*
* @param Puc_v4p8_Plugin_Info $info
* @return Puc_v4p8_Plugin_Update
* @param Puc_v4p9_Plugin_Info $info
* @return Puc_v4p9_Plugin_Update
*/
public static function fromPluginInfo($info){
return self::fromObject($info);
Expand All @@ -52,8 +52,8 @@ public static function fromPluginInfo($info){
/**
* Create a new instance by copying the necessary fields from another object.
*
* @param StdClass|Puc_v4p8_Plugin_Info|Puc_v4p8_Plugin_Update $object The source object.
* @return Puc_v4p8_Plugin_Update The new copy.
* @param StdClass|Puc_v4p9_Plugin_Info|Puc_v4p9_Plugin_Update $object The source object.
* @return Puc_v4p9_Plugin_Update The new copy.
*/
public static function fromObject($object) {
$update = new self();
Expand Down
Loading

0 comments on commit 28f29c9

Please sign in to comment.