Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixed changelog location #9

Merged
merged 1 commit into from

1 participant

@franz-josef-kaiser
Collaborator

No description provided.

@franz-josef-kaiser franz-josef-kaiser merged commit 8a2b1f8 into chrisguitarguy:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 3, 2012
  1. reversed order for changelog

    franz-josef-kaiser authored
This page is out of date. Refresh to see the latest.
Showing with 43 additions and 32 deletions.
  1. +28 −26 changelog.html
  2. +15 −6 plugin-dirs.php
View
54 changelog.html
@@ -1,30 +1,32 @@
-<h4>0.1</h4>
-Initial version.
-<h4>0.2</h4>
-Clean Up & code styling alignment.
-<h4>0.3</h4>
-Minor styling fixes.
-<h4>0.4</h4>
-Moved to OOP concept.
-<h4>0.5</h4>
-Improved API: now supports different plugin locations aside from the <code>WP_CONTENT_DIR</code>.
-<h4>0.5.1</h4>
-Minor fix for left over debug code.
-<h4>0.5.2</h4>
-JS styling for readability.
-<h4>0.6</h4>
+<h4>1.1</h4>
+Now updates from GitHub.
+<h4>1.0</h4>
+Now updates from GitHub.
+<h4>0.9</h4>
+Added better update message (as seen here).
+<h4>0.8</h4>
Removed <code>activate</code> link when plugin is already active, as suggested by <a href="https://github.com/chrisguitarguy/WP-Plugin-Directories/pull/3">Julien Chaumond in Issue #3</a>.
-<h4>0.7</h4>
-Added the <code>adp_root_{$root}</code> filter to allow completely custom locations. Moved changelog to separate file.
-<h4>0.7.1</h4>
-Fix script path for remote locations.
-<h4>0.7.2</h4>
-Renamed main plugin file to index.php to avoid accidental directory listing.
<h4>0.7.3</h4>
Reverted 0.7.2 to avoid plugin deactivation. Added <code>index.html</code> file instead.
-<h4>0.8</h4>
+<h4>0.7.2</h4>
+Renamed main plugin file to index.php to avoid accidental directory listing.
+<h4>0.7.1</h4>
+Fix script path for remote locations.
+<h4>0.7</h4>
+Added the <code>adp_root_{$root}</code> filter to allow completely custom locations. Moved changelog to separate file.
+<h4>0.6</h4>
Moved Bootstrap to OOP construct. Regular child plugins are now allowed to use the default priority.
-<h4>0.9</h4>
-Added better update message (as seen here).
-<h4>1.0</h4>
-Now updates from GitHub.
+<h4>0.5.2</h4>
+JS styling for readability.
+<h4>0.5.1</h4>
+Minor fix for left over debug code.
+<h4>0.5</h4>
+Improved API: now supports different plugin locations aside from the <code>WP_CONTENT_DIR</code>.
+<h4>0.4</h4>
+Moved to OOP concept.
+<h4>0.3</h4>
+Minor styling fixes.
+<h4>0.2</h4>
+Clean Up & code styling alignment.
+<h4>0.1</h4>
+Initial version.
View
21 plugin-dirs.php
@@ -4,7 +4,7 @@
Plugin Name: Additional Plugin Directories
Plugin URI: http://github.com/chrisguitarguy
Description: A framework to allow adding additional plugin directories to WordPress
-Version: 1.0
+Version: 1.1
Author: Christopher Davis
Contributors: Franz Josef Kaiser, Julien Chaumond
Author URI: http://christopherdavis.me
@@ -61,7 +61,7 @@ class CD_APD_Bootstrap
*
* @var (string)
*/
- public $remote_changelog = 'https://raw.github.com/chrisguitarguy/WP-Plugin-Directories/master/changelog.txt';
+ public $remote_changelog = 'https://raw.github.com/chrisguitarguy/WP-Plugin-Directories/master/changelog.html';
/**
@@ -138,7 +138,7 @@ public function update_from_github()
$repo = 'WP-Plugin-Directories';
new wp_github_updater( array(
'slug' => plugin_basename( __FILE__ )
- ,'proper_folder_name' => dirname( plugin_basename(__FILE__) ) #plugin_basename( __FILE__ )
+ ,'proper_folder_name' => dirname( plugin_basename(__FILE__) )
,'api_url' => "{$http}api.{$host}/repos/{$name}/{$repo}"
,'raw_url' => "{$http}raw.{$host}/{$name}/{$repo}/master"
,'github_url' => "{$http}{$host}/{$name}/{$repo}"
@@ -186,14 +186,23 @@ public function update_request_args( $args, $url )
public function update_message()
{
// Get `changelog.txt` from GitHub via WP HTTP API
- $changelog = wp_remote_get( $this->remote_changelog );
+ $remote_data = wp_remote_get(
+ $this->remote_changelog
+ ,false
+ );
+
// Die silently
- if ( is_wp_error( $changelog ) )
+ $response = wp_remote_retrieve_response_code( $remote_data );
+
+ if ( is_wp_error( $remote_data ) )
return _e( 'No changelog could get fetched.', 'cd_apd_textdomain' );
+ if ( 404 === $response )
+ return $remote_data['response']['message'];
+
return sprintf(
"<p style='font-weight:normal;'>%s</p>"
- ,wp_remote_retrieve_body( $changelog )
+ ,wp_remote_retrieve_body( $remote_data )
);
}
} // END Class CD_APD_Bootstrap
Something went wrong with that request. Please try again.