Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

reversed order for changelog

  • Loading branch information...
commit 04853ad6322211c7caebe484e90663a625a0c093 1 parent 75ff4d2
Kaiser franz-josef-kaiser authored

Showing 2 changed files with 43 additions and 32 deletions. Show diff stats Hide diff stats

  1. +28 26 changelog.html
  2. +15 6 plugin-dirs.php
54 changelog.html
... ... @@ -1,30 +1,32 @@
1   -<h4>0.1</h4>
2   -Initial version.
3   -<h4>0.2</h4>
4   -Clean Up & code styling alignment.
5   -<h4>0.3</h4>
6   -Minor styling fixes.
7   -<h4>0.4</h4>
8   -Moved to OOP concept.
9   -<h4>0.5</h4>
10   -Improved API: now supports different plugin locations aside from the <code>WP_CONTENT_DIR</code>.
11   -<h4>0.5.1</h4>
12   -Minor fix for left over debug code.
13   -<h4>0.5.2</h4>
14   -JS styling for readability.
15   -<h4>0.6</h4>
  1 +<h4>1.1</h4>
  2 +Now updates from GitHub.
  3 +<h4>1.0</h4>
  4 +Now updates from GitHub.
  5 +<h4>0.9</h4>
  6 +Added better update message (as seen here).
  7 +<h4>0.8</h4>
16 8 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>.
17   -<h4>0.7</h4>
18   -Added the <code>adp_root_{$root}</code> filter to allow completely custom locations. Moved changelog to separate file.
19   -<h4>0.7.1</h4>
20   -Fix script path for remote locations.
21   -<h4>0.7.2</h4>
22   -Renamed main plugin file to index.php to avoid accidental directory listing.
23 9 <h4>0.7.3</h4>
24 10 Reverted 0.7.2 to avoid plugin deactivation. Added <code>index.html</code> file instead.
25   -<h4>0.8</h4>
  11 +<h4>0.7.2</h4>
  12 +Renamed main plugin file to index.php to avoid accidental directory listing.
  13 +<h4>0.7.1</h4>
  14 +Fix script path for remote locations.
  15 +<h4>0.7</h4>
  16 +Added the <code>adp_root_{$root}</code> filter to allow completely custom locations. Moved changelog to separate file.
  17 +<h4>0.6</h4>
26 18 Moved Bootstrap to OOP construct. Regular child plugins are now allowed to use the default priority.
27   -<h4>0.9</h4>
28   -Added better update message (as seen here).
29   -<h4>1.0</h4>
30   -Now updates from GitHub.
  19 +<h4>0.5.2</h4>
  20 +JS styling for readability.
  21 +<h4>0.5.1</h4>
  22 +Minor fix for left over debug code.
  23 +<h4>0.5</h4>
  24 +Improved API: now supports different plugin locations aside from the <code>WP_CONTENT_DIR</code>.
  25 +<h4>0.4</h4>
  26 +Moved to OOP concept.
  27 +<h4>0.3</h4>
  28 +Minor styling fixes.
  29 +<h4>0.2</h4>
  30 +Clean Up & code styling alignment.
  31 +<h4>0.1</h4>
  32 +Initial version.
21 plugin-dirs.php
@@ -4,7 +4,7 @@
4 4 Plugin Name: Additional Plugin Directories
5 5 Plugin URI: http://github.com/chrisguitarguy
6 6 Description: A framework to allow adding additional plugin directories to WordPress
7   -Version: 1.0
  7 +Version: 1.1
8 8 Author: Christopher Davis
9 9 Contributors: Franz Josef Kaiser, Julien Chaumond
10 10 Author URI: http://christopherdavis.me
@@ -61,7 +61,7 @@ class CD_APD_Bootstrap
61 61 *
62 62 * @var (string)
63 63 */
64   - public $remote_changelog = 'https://raw.github.com/chrisguitarguy/WP-Plugin-Directories/master/changelog.txt';
  64 + public $remote_changelog = 'https://raw.github.com/chrisguitarguy/WP-Plugin-Directories/master/changelog.html';
65 65
66 66
67 67 /**
@@ -138,7 +138,7 @@ public function update_from_github()
138 138 $repo = 'WP-Plugin-Directories';
139 139 new wp_github_updater( array(
140 140 'slug' => plugin_basename( __FILE__ )
141   - ,'proper_folder_name' => dirname( plugin_basename(__FILE__) ) #plugin_basename( __FILE__ )
  141 + ,'proper_folder_name' => dirname( plugin_basename(__FILE__) )
142 142 ,'api_url' => "{$http}api.{$host}/repos/{$name}/{$repo}"
143 143 ,'raw_url' => "{$http}raw.{$host}/{$name}/{$repo}/master"
144 144 ,'github_url' => "{$http}{$host}/{$name}/{$repo}"
@@ -186,14 +186,23 @@ public function update_request_args( $args, $url )
186 186 public function update_message()
187 187 {
188 188 // Get `changelog.txt` from GitHub via WP HTTP API
189   - $changelog = wp_remote_get( $this->remote_changelog );
  189 + $remote_data = wp_remote_get(
  190 + $this->remote_changelog
  191 + ,false
  192 + );
  193 +
190 194 // Die silently
191   - if ( is_wp_error( $changelog ) )
  195 + $response = wp_remote_retrieve_response_code( $remote_data );
  196 +
  197 + if ( is_wp_error( $remote_data ) )
192 198 return _e( 'No changelog could get fetched.', 'cd_apd_textdomain' );
193 199
  200 + if ( 404 === $response )
  201 + return $remote_data['response']['message'];
  202 +
194 203 return sprintf(
195 204 "<p style='font-weight:normal;'>%s</p>"
196   - ,wp_remote_retrieve_body( $changelog )
  205 + ,wp_remote_retrieve_body( $remote_data )
197 206 );
198 207 }
199 208 } // END Class CD_APD_Bootstrap

0 comments on commit 04853ad

Please sign in to comment.
Something went wrong with that request. Please try again.