Nginx Helper - Version 1.6.10

Version Description

  • Cleaned up code.
  • Added credits for code.
  • Improved attachment purging.
Download this release

Release Info

Developer saurabhshukla
Plugin Icon 128x128 Nginx Helper
Version 1.6.10
Comparing to
See all releases

Code changes from version 1.6.9 to 1.6.10

Files changed (4) hide show
  1. admin/install.php +5 -10
  2. nginx-helper.php +1 -24
  3. purger.php +1 -0
  4. readme.txt +6 -1
admin/install.php CHANGED
@@ -1,5 +1,9 @@
1
  <?php
2
-
 
 
 
 
3
  namespace rtCamp\WP\Nginx {
4
  if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER[ 'PHP_SELF' ] ) ) {
5
  die( 'You are not allowed to call this page directly.' );
@@ -51,8 +55,6 @@ namespace rtCamp\WP\Nginx {
51
 
52
  function rt_wp_nginx_helper_uninstall() {
53
 
54
- global $rt_wp_nginx_helper, $rt_wp_nginx_purger;
55
-
56
  wp_clear_scheduled_hook( 'rt_wp_nginx_helper_check_log_file_size_daily' );
57
 
58
  delete_site_option( 'rt_wp_nginx_helper_options' );
@@ -73,19 +75,12 @@ namespace rtCamp\WP\Nginx {
73
 
74
  function rt_wp_nginx_helper_get_options() {
75
 
76
- global $rt_wp_nginx_helper;
77
-
78
  $rt_wp_nginx_helper_get_options = array( );
79
 
80
 
81
  $rt_wp_nginx_helper_get_options[ 'log_level' ] = 'INFO';
82
  $rt_wp_nginx_helper_get_options[ 'log_filesize' ] = 5;
83
 
84
- $rt_wp_nginx_helper_get_options[ 'current_db_version' ] = $rt_wp_nginx_helper->db_version;
85
-
86
- $rt_wp_nginx_helper_get_options[ 'mobile_uncache' ] = 1;
87
- $rt_wp_nginx_helper_get_options[ 'mobile_regexp' ] = '#2.0 MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo Wii|Nitro|Nokia|Opera Mini|Palm|PlayStation Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows CE|WinWAP|YahooSeeker/M1A1-R2D2|NF-Browser|iPhone|iPod|Android|BlackBerry9530|G-TU915 Obigo|LGE VX|webOS|Nokia5800#';
88
-
89
  $rt_wp_nginx_helper_get_options[ 'enable_purge' ] = 1;
90
  $rt_wp_nginx_helper_get_options[ 'enable_map' ] = 0;
91
  $rt_wp_nginx_helper_get_options[ 'enable_log' ] = 0;
1
  <?php
2
+ /**
3
+ * @author: Saurabh Shukla <saurabh.shukla@rtcamp.com>
4
+ *
5
+ * Parts of code based off http://wordpress.org/extend/plugins/nginx-manager/ by http://profiles.wordpress.org/hpatoio/ and http://profiles.wordpress.org/rukbat/
6
+ */
7
  namespace rtCamp\WP\Nginx {
8
  if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER[ 'PHP_SELF' ] ) ) {
9
  die( 'You are not allowed to call this page directly.' );
55
 
56
  function rt_wp_nginx_helper_uninstall() {
57
 
 
 
58
  wp_clear_scheduled_hook( 'rt_wp_nginx_helper_check_log_file_size_daily' );
59
 
60
  delete_site_option( 'rt_wp_nginx_helper_options' );
75
 
76
  function rt_wp_nginx_helper_get_options() {
77
 
 
 
78
  $rt_wp_nginx_helper_get_options = array( );
79
 
80
 
81
  $rt_wp_nginx_helper_get_options[ 'log_level' ] = 'INFO';
82
  $rt_wp_nginx_helper_get_options[ 'log_filesize' ] = 5;
83
 
 
 
 
 
 
84
  $rt_wp_nginx_helper_get_options[ 'enable_purge' ] = 1;
85
  $rt_wp_nginx_helper_get_options[ 'enable_map' ] = 0;
86
  $rt_wp_nginx_helper_get_options[ 'enable_log' ] = 0;
nginx-helper.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Nginx Helper
4
  Plugin URI: http://rtcamp.com/
5
  Description: An nginx helper that serves various functions.
6
- Version: 1.6.9
7
  Author: rtCamp
8
  Author URI: http://rtcamp.com
9
  Requires at least: 3.0
@@ -16,10 +16,7 @@ namespace rtCamp\WP\Nginx {
16
 
17
  class Helper {
18
 
19
- var $version = '1.4'; // Plugin version
20
- var $db_version = '0.1'; // DB version, change it to show the upgrade page
21
  var $minium_WP = '3.0';
22
- var $minimum_PHP = '5.3';
23
  var $options = null;
24
 
25
  function __construct() {
@@ -29,7 +26,6 @@ namespace rtCamp\WP\Nginx {
29
  return;
30
 
31
  $this->load_options();
32
- $this->define_constant();
33
  $this->plugin_name = plugin_basename( __FILE__ );
34
 
35
  register_activation_hook( $this->plugin_name, array( &$this, 'activate' ) );
@@ -87,11 +83,6 @@ namespace rtCamp\WP\Nginx {
87
  rt_wp_nginx_helper_uninstall();
88
  }
89
 
90
- function define_constant() {
91
- define( 'RT_WP_NGINX_HELPER_VERSION', $this->version );
92
- define( 'RT_WP_NGINX_HELPER_DB_VERSION', $this->db_version );
93
- define( 'RT_WP_NGINX_HELPER_FOLDER', plugin_basename( dirname( __FILE__ ) ) );
94
- }
95
 
96
  function required_wp_version() {
97
 
@@ -110,20 +101,6 @@ namespace rtCamp\WP\Nginx {
110
  return true;
111
  }
112
 
113
- function required_php_version() {
114
-
115
- $php_ok = version_compare( PHP_VERSION, '5.3', '>=' );
116
- if ( ($php_ok == FALSE ) ) {
117
- add_action(
118
- 'admin_notices', create_function(
119
- '', 'global $rt_wp_nginx_helper; printf (\'<div id="message" class="error"><p><strong>\' . __(\'Sorry, Nginx Helper requires PHP %s or higher\', "rt_wp_nginx_helper" ) . \'</strong></p></div>\', $rt_wp_nginx_helper->minium_PHP );'
120
- )
121
- );
122
- return false;
123
- }
124
-
125
- return true;
126
- }
127
 
128
  function load_options() {
129
  $this->options = get_site_option( 'rt_wp_nginx_helper_options' );
3
  Plugin Name: Nginx Helper
4
  Plugin URI: http://rtcamp.com/
5
  Description: An nginx helper that serves various functions.
6
+ Version: 1.6.10
7
  Author: rtCamp
8
  Author URI: http://rtcamp.com
9
  Requires at least: 3.0
16
 
17
  class Helper {
18
 
 
 
19
  var $minium_WP = '3.0';
 
20
  var $options = null;
21
 
22
  function __construct() {
26
  return;
27
 
28
  $this->load_options();
 
29
  $this->plugin_name = plugin_basename( __FILE__ );
30
 
31
  register_activation_hook( $this->plugin_name, array( &$this, 'activate' ) );
83
  rt_wp_nginx_helper_uninstall();
84
  }
85
 
 
 
 
 
 
86
 
87
  function required_wp_version() {
88
 
101
  return true;
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  function load_options() {
106
  $this->options = get_site_option( 'rt_wp_nginx_helper_options' );
purger.php CHANGED
@@ -317,6 +317,7 @@ namespace rtCamp\WP\Nginx {
317
  $this->purgeUrl( $resize_image[ 0 ], false );
318
  }
319
  }
 
320
  } else {
321
  $this->log( "Media (id $attachment_id) edited: no image", "WARNING" );
322
  }
317
  $this->purgeUrl( $resize_image[ 0 ], false );
318
  }
319
  }
320
+ $this->purgeURL( get_attachment_link( $attachment_id ) );
321
  } else {
322
  $this->log( "Media (id $attachment_id) edited: no image", "WARNING" );
323
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: rtcamp, rahul286, saurabhshukla, Darren Slatten, jk3us, daankorten
3
  Tags: nginx, cache, purge, nginx map, nginx cache, maps, fastcgi, proxy, rewrite, permalinks
4
  Requires at least: 3.0
5
  Tested up to: 3.5
6
- Stable tag: 1.6.9
7
  License: GPLv2 or later (of-course)
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Donate Link: http://rtcamp.com/donate/
@@ -109,6 +109,11 @@ Its just that we are hyperactive on our own forum!
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
112
  = 1.6.9 =
113
  * Added Faux to Purge all buttons, to avoid misleading users.
114
 
3
  Tags: nginx, cache, purge, nginx map, nginx cache, maps, fastcgi, proxy, rewrite, permalinks
4
  Requires at least: 3.0
5
  Tested up to: 3.5
6
+ Stable tag: 1.6.10
7
  License: GPLv2 or later (of-course)
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Donate Link: http://rtcamp.com/donate/
109
 
110
  == Changelog ==
111
 
112
+ = 1.6.10 =
113
+ * Cleaned up code.
114
+ * Added credits for code.
115
+ * Improved attachment purging.
116
+
117
  = 1.6.9 =
118
  * Added Faux to Purge all buttons, to avoid misleading users.
119