Nginx Helper - Version 1.3.5

Version Description

  • Improved Readme.
  • Improved cache verification comments.
Download this release

Release Info

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

Code changes from version 1.3.4 to 1.3.5

Files changed (2) hide show
  1. nginx-helper.php +6 -13
  2. readme.txt +34 -16
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.3.4
7
  Author: rtCamp
8
  Author URI: http://rtcamp.com
9
  Requires at least: 3.0
@@ -38,7 +38,7 @@ namespace rtCamp\WP\Nginx {
38
  function start_helper() {
39
 
40
  global $rt_wp_nginx_purger;
41
- add_action('wp_footer',array(&$this, 'add_timestamps'),999);
42
 
43
  add_action( 'publish_post', array(&$rt_wp_nginx_purger, 'purgePost'), 200, 1);
44
  add_action( 'publish_page', array(&$rt_wp_nginx_purger, 'purgePost'), 200, 1);
@@ -246,18 +246,11 @@ namespace rtCamp\WP\Nginx {
246
  }
247
  function add_timestamps(){
248
  if($this->options['enable_purge']!=1) return;
249
- $timestamps = "<!--".
250
- "::Nginx-Helper::".
 
251
  "-->\n".
252
- "<!--".
253
- "::".get_num_queries()." queries executed::Dynamic page generated by Wordpress in ". timer_stop()." seconds::".
254
- "-->\n".
255
- "<!--".
256
- "::Page Cached on '".current_time('mysql')."'::".
257
- "-->\n".
258
- "<!--".
259
- "::Nginx-Helper::".
260
- "-->\n";
261
  echo $timestamps;
262
  }
263
 
3
  Plugin Name: Nginx Helper
4
  Plugin URI: http://rtcamp.com/
5
  Description: An nginx helper that serves various functions.
6
+ Version: 1.3.5
7
  Author: rtCamp
8
  Author URI: http://rtcamp.com
9
  Requires at least: 3.0
38
  function start_helper() {
39
 
40
  global $rt_wp_nginx_purger;
41
+ add_action( 'shutdown', array(&$this, 'add_timestamps'), 999);
42
 
43
  add_action( 'publish_post', array(&$rt_wp_nginx_purger, 'purgePost'), 200, 1);
44
  add_action( 'publish_page', array(&$rt_wp_nginx_purger, 'purgePost'), 200, 1);
246
  }
247
  function add_timestamps(){
248
  if($this->options['enable_purge']!=1) return;
249
+ $timestamps = "\n<!--".
250
+ "Cached using Nginx-Helper on ".current_time('mysql').". ".
251
+ "It took ".get_num_queries()." queries executed in ".timer_stop()." seconds.".
252
  "-->\n".
253
+ "<!--Visit http://wordpress.org/extend/plugins/nginx-helper/faq/ for more details-->\n";
 
 
 
 
 
 
 
 
254
  echo $timestamps;
255
  }
256
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: rtcamp, rahul286, saurabhshukla
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.4.2
6
- Stable tag: 1.3.4
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/
@@ -13,12 +13,12 @@ Helps WordPress-Nginx work together nicely using fastcgi/proxy cache purging, ng
13
  == Description ==
14
 
15
  1. Removes `index.php` from permalinks when using WordPress with nginx.
16
- 1. Add support for nginx fastcgi_cache_purge & proxy_cache_purge directive from [module](https://github.com/FRiCKLE/ngx_cache_purge "ngx_cache_purge module"). Provides settings so you can customize purging rules.
17
  1. Adds support for nginx `map{..}` on a WordPress-multisite network installation. Using it Nginx can serve PHP file uploads even if PHP/MySQL crashes. Please check tutorials list below for related Nginx config.
18
 
19
  = Tutorials =
20
 
21
- You will need to follow one ore more tutorials below to get desired fundtionality:
22
 
23
  * [Nginx Map + WordPress-Multisite + Static Files Handling](http://rtcamp.com/tutorials/nginx-maps-wordpress-multisite-static-files-handling/)
24
  * [Nginx + WordPress + fastcgi_purge_cache](http://rtcamp.com/tutorials/wordpress-nginx-fastcgi-cache-purge-conditional/)
@@ -28,7 +28,11 @@ You will need to follow one ore more tutorials below to get desired fundtionalit
28
 
29
 
30
  == Installation ==
 
 
 
31
 
 
32
  1. Extract the zip file.
33
  1. Upload them to `/wp-content/plugins/` directory on your WordPress installation.
34
  1. Then activate the Plugin from Plugins page.
@@ -41,34 +45,43 @@ For proper configuration, check **tutorial list** of [Description tab](http://wo
41
 
42
  **Q. Will this work out of the box?**
43
 
44
- No. You need to make some changes at Nginx end. Please check **tutorial list** of [Description tab](http://wordpress.org/extend/plugins/nginx-helper/)
45
 
46
  = FAQ - Nginx Map =
47
 
48
- **Q. On my Multisite, I am alredy using `WPMU_ACCEL_REDIRECT`. Do I still need Nginx Map?**
49
 
50
- Definietly yes. `WPMU_ACCEL_REDIRECT` reduceds load on PHP, but it still ask WordPress i.e. PHP/MySQL to do some work for static files e.g. images in your post. Nginx map handles files by itself which gives you much better performance without using a CDN.
51
 
52
  = FAQ - Nginx Fastcgi Cache Purge =
53
 
54
  **Q. Does it work for custom posts and taxonomies?**
55
  Yes. It handles all post-types same way.
56
 
57
- For any page on your site, try purging cache manullay for it, by following instructions mentioned in next answer.
58
 
 
59
 
60
- **Q. How do I know my Nginx config is correct for fastcgi purging?**
 
 
61
 
62
- For any page on your site, try purging cache manullay for it, by following instructions mentioned in next answer.
 
63
 
64
- **Q. I need to flush a cached page immediately! How do I do that?**
65
 
66
- Nginx helper plugin try to handle all common cases when you need to purge a cached copy of page. e.g. a post is edited, a comment is approved on a post, etc.
67
 
68
- If you come across any URL like `http://example.com/hello-world/' you can simply 'purge' before path-part of URL.
69
- It will become like `http://example.com/purge/hello-world/'
70
- Just open in browser and cache for `/hello-world/` will be flushed immeditaley!
71
 
 
 
 
 
 
 
72
 
73
  = FAQ - Nginx Map =
74
 
@@ -88,6 +101,11 @@ Its just that we are hyperactive on our own forum!
88
  2. Remaining settings
89
 
90
  == Changelog ==
 
 
 
 
 
91
  = 1.3.4 =
92
 
93
  * Fixed duplicate entries generated for maps (Harmless, but doesn't look good!)
@@ -128,5 +146,5 @@ Its just that we are hyperactive on our own forum!
128
 
129
  == Upgrade Notice ==
130
 
131
- = 1.3.4 =
132
- Duplicate entries in map cleaned up. Cache info added as html comments for cache verification.
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.4.2
6
+ Stable tag: 1.3.5
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/
13
  == Description ==
14
 
15
  1. Removes `index.php` from permalinks when using WordPress with nginx.
16
+ 1. Adds support for nginx fastcgi_cache_purge & proxy_cache_purge directive from [module](https://github.com/FRiCKLE/ngx_cache_purge "ngx_cache_purge module"). Provides settings so you can customize purging rules.
17
  1. Adds support for nginx `map{..}` on a WordPress-multisite network installation. Using it Nginx can serve PHP file uploads even if PHP/MySQL crashes. Please check tutorials list below for related Nginx config.
18
 
19
  = Tutorials =
20
 
21
+ You will need to follow one ore more tutorials below to get desired functionality:
22
 
23
  * [Nginx Map + WordPress-Multisite + Static Files Handling](http://rtcamp.com/tutorials/nginx-maps-wordpress-multisite-static-files-handling/)
24
  * [Nginx + WordPress + fastcgi_purge_cache](http://rtcamp.com/tutorials/wordpress-nginx-fastcgi-cache-purge-conditional/)
28
 
29
 
30
  == Installation ==
31
+ Automatic Installation
32
+ 1.Log in to your WordPress admin panel, navigate to the Plugins menu and click Add New.
33
+ 1.In the search field type “Nginx Helper” and click Search Plugins. From the search results, pick Nginx Helper and click Install Now. Wordpress will ask you to confirm to complete the installation.
34
 
35
+ Manual Installation
36
  1. Extract the zip file.
37
  1. Upload them to `/wp-content/plugins/` directory on your WordPress installation.
38
  1. Then activate the Plugin from Plugins page.
45
 
46
  **Q. Will this work out of the box?**
47
 
48
+ No. You need to make some changes at the Nginx end. Please check **tutorial list** of [Description tab](http://wordpress.org/extend/plugins/nginx-helper/)
49
 
50
  = FAQ - Nginx Map =
51
 
52
+ **Q. My multisite already uses `WPMU_ACCEL_REDIRECT`. Do I still need Nginx Map?**
53
 
54
+ Definitely. `WPMU_ACCEL_REDIRECT` reduces the load on PHP, but it still ask WordPress i.e. PHP/MySQL to do some work for static files e.g. images in your post. Nginx map lets nginx handle files on its own bypassing wordpress which gives you much better performance without using a CDN.
55
 
56
  = FAQ - Nginx Fastcgi Cache Purge =
57
 
58
  **Q. Does it work for custom posts and taxonomies?**
59
  Yes. It handles all post-types same way.
60
 
61
+ **Q. How do I know my Nginx config is correct for fastcgi purging?**
62
 
63
+ Manually purging any page from the cache, by following instructions in the previous answer.
64
 
65
+ Version 1.3.4 onwards, Nginx Helper adds a comment at the end of the html source ('view source' in your favourite browser):
66
+ &lt;!--Cached using Nginx-Helper on 2012-10-08 07:01:45. It took 42 queries executed in 0.280 seconds.--&gt;
67
+ This shows the time when the page was last cached. This date/time will be reset whenever this page is purged and refreshed in the cache.
68
 
69
+ Just check this comment before and after a manual purge.
70
+ As long as you don't purge the page (or make changes that purge it from the cache), the timestamp will remain as it is, even if you keep refreshing the page. This means the page was served from the cache and it's working!
71
 
72
+ The rest shows you the database queries and time saved on loading this page. (This would have been the additional resource load, if you weren't using fast-cgi-cache.)
73
 
 
74
 
75
+ **Q. I need to flush a cached page immediately! How do I do that?**
76
+
77
+ Nginx helper plugin handles usual scenarios, when a page in the cache will need purging. For example, when a post is edited or a comment is approved on a post.
78
 
79
+ To purge a page immediately, follow these instructions:
80
+ (eg. http://yoursite.com/about/)
81
+ Between the domain name and the rest of the url, insert '/purge/'.
82
+ So, in the above eg, the purge url will be http://yoursite.com/purge/about/
83
+ Just open this in a browser and the page will be purged instantly.
84
+ Needless to say, this won't work, if you have a page or taxonomy called 'purge'.
85
 
86
  = FAQ - Nginx Map =
87
 
101
  2. Remaining settings
102
 
103
  == Changelog ==
104
+ = 1.3.5 =
105
+
106
+ * Improved Readme.
107
+ * Improved cache verification comments.
108
+
109
  = 1.3.4 =
110
 
111
  * Fixed duplicate entries generated for maps (Harmless, but doesn't look good!)
146
 
147
  == Upgrade Notice ==
148
 
149
+ = 1.3.5 =
150
+ Inproved readme and purge/cache verification comments.