• Stars
    star
    229
  • Rank 174,666 (Top 4 %)
  • Language
    PHP
  • Created about 12 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Nginx Helper for WordPress caching, permalinks & efficient file handling in multisite

Nginx Helper

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

Contributors: rtcamp, rahul286, saurabhshukla, manishsongirkar36, faishal, desaiuditd, darren-slatten, jk3us, daankortenbach, telofy, pjv, llonchj, jinnko, weskoop, bcole808, gungeekatx, rohanveer, chandrapatel, gagan0123, ravanh, michaelbeil, samedwards, niwreg, entr, nuvoPoint, iam404, rittesh.patel, vishalkakadiya, BhargavBhandari90, vincent-lu, murrayjbrown, bryant1410, 1gor, matt-h, pySilver, johan-chassaing, dotsam, sanketio, petenelson, nathanielks, rigagoogoo, dslatten, jinschoi, kelin1003, vaishuagola27, rahulsprajapati, Joel-James, utkarshpatel, gsayed786, shashwatmittal, sudhiryadav, thrijith, stayallive, jaredwsmith, abhijitrakas, umeshnevase, sid177, souptik, arafatkn, subscriptiongroup

Tags: nginx, cache, purge, nginx map, nginx cache, maps, fastcgi, proxy, redis, redis-cache, rewrite, permalinks

Requires at least: 3.0

Tested up to: 6.1

Stable tag: 2.2.3

License: GPLv2 or later (of-course)

License URI: http://www.gnu.org/licenses/gpl-2.0.html

Donate Link: http://rt.cx/eedonate

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also does a few more things.

Description

  1. Removes index.php from permalinks when using WordPress with nginx.
  2. Adds support for purging redis-cache when used as full-page cache created using nginx-srcache-module
  3. Adds support for nginx fastcgi_cache_purge & proxy_cache_purge directive from module. Provides settings so you can customize purging rules.
  4. 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 the tutorial list below for related Nginx configurations.

Tutorials

You will need to follow one or more tutorials below to get desired functionality:

Installation

Automatic Installation

  1. Log in to your WordPress admin panel, navigate to the Plugins menu and click Add New.
  2. 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.

Manual Installation

  1. Extract the zip file.
  2. Upload them to /wp-content/plugins/ directory on your WordPress installation.
  3. Then activate the Plugin from Plugins page.

For proper configuration, check out our tutorial list in the Description tab.

Frequently Asked Questions

Important - Please refer to https://github.com/rtcamp/nginx-helper#frequently-asked-questions for up-to-date FAQs.

FAQ - Installation/Comptability

Q. Will this work out of the box?

No. You need to make some changes at the Nginx end. Please check our tutorial list.

FAQ - Nginx Fastcgi Cache Purge

Q. There's a 'purge all' button? Does it purge the whole site?

Yes, it does. It physically empties the cache directory. It is set by default to /var/run/nginx-cache/.

If your cache directory is different, you can override this in your wp-config.php by adding define('RT_WP_NGINX_HELPER_CACHE_PATH','/var/run/nginx-cache/');

Replace the path with your own.

Q. Does it work for custom posts and taxonomies?

Yes. It handles all post-types the same way.

Q. How do I know my Nginx config is correct for fastcgi purging?

Manually purging any page from the cache, by following instructions in the previous answer.

Version 1.3.4 onwards, Nginx Helper adds a comment at the end of the HTML source ('view source' in your favourite browser): <!--Cached using Nginx-Helper on 2012-10-08 07:01:45. It took 42 queries executed in 0.280 seconds.-->. 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. Just check this comment before and after a manual purge.

As long as you don't purge the page (or make changes that purge it from the cache), the timestamp will remain as is, even if you keep refreshing the page. This means the page was served from the cache and it's working!

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.)

Q. I need to flush a cached page immediately! How do I do that?

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.

To purge a page immediately, follow these instructions:

  • Let's say we have a page at the following domain: http://yoursite.com/about.
  • Between the domain name and the rest of the URL, insert '/purge/'.
  • So, in the above example, the purge URL will be http://yoursite.com/purge/about.
  • Just open this in a browser and the page will be purged instantly.
  • Needless to say, this won't work, if you have a page or taxonomy called 'purge'.

FAQ - Nginx Redis Cache

Q. Can I override the redis hostname, port and prefix?

Yes, you can force override the redis hostname, port or prefix by defining constant in wp-config.php. For example:

define( 'RT_WP_NGINX_HELPER_REDIS_HOSTNAME', '10.0.0.1' );

define( 'RT_WP_NGINX_HELPER_REDIS_PORT', '6000' );

define( 'RT_WP_NGINX_HELPER_REDIS_PREFIX', 'page-cache:' );

FAQ - Nginx Map

Q. My multisite already uses WPMU_ACCEL_REDIRECT. Do I still need Nginx Map?

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.

Q. I am using X plugin. Will it work on Nginx?

Most likely yes. A wordpress plugin, if not using explicitly any Apache-only mod, should work on Nginx. Some plugin may need some extra work.

Still need help!

Please post your problem in our free support forum.

Screenshots

1. Nginx plugin settings

Nginx plugin settings

2. Remaining settings

Remaining settings

Changelog

2.2.3

2.2.2

  • Add action rt_nginx_helper_after_purge_all to fire after the entire cache has been purged whatever caching type is used. #232 - by Julien-prrs
  • Fix issue where settings not saved because the button's value localized (for any language). #236 - by umeshnevase
  • Fix issue where "Custom Purge URL" option displays previous value. #240, #241 - by KirillGritcenko
  • Tested with WordPress 5.4

2.2.1

2.2.0

2.1.0

  • Add wildcard cache key deletion for device type cache purge. #203 - by pradeep910
  • Add filter rt_nginx_helper_purge_url to filter the URL to be purged. #182 - by todeveni
  • Add filter rt_nginx_helper_purge_cached_file to filter the cached file name. #182 - by todeveni
  • Add filter rt_nginx_helper_remote_purge_url to filter remote URL to be purged. #182 - by todeveni
  • Add action rt_nginx_helper_after_fastcgi_purge_all to fire after the FastCGI cache has been purged. #182 - by todeveni
  • Add action rt_nginx_helper_after_redis_purge_all to fire after the Redis cache has been purged. #182 - by todeveni
  • Add action rt_nginx_helper_purged_file to fire an action after deleting file from cache. #182 - by todeveni
  • Add action rt_nginx_helper_before_remote_purge_url to fire an action before purging remote URL. #182 - by todeveni
  • Add action rt_nginx_helper_after_remote_purge_url to fire an action after remote purge request. #182 - by todeveni
  • Fix issue with post purge on new comments. #175 - by jinschoi
  • Fix Nginx Timestamp being added to invalid content type. #200 - by thrijith
  • Handle filesize exception while truncating nginx.log file. #206 - by peterjanes

2.0.3

2.0.2

  • Fix undefined error when we install the plugin for the first time and if Redis is not available. #162 - by Joel-James
  • Remove extra spacing for nginx map section. #169 - by ShashwatMittal
  • Purge Cache menu in front-end admibar now purge current page. #173 - by imranhsayed
  • Fix issue where cache is not cleared when page is swiched from publish to draft. #174 - by imranhsayed
  • Fix an issue where custom purge url option does not show newlines when using multiple urls. #184 - by mist-webit

2.0.1

  • Fix settings url for multisite: use network_admin_url to get network correct settings url. #163 - by Joel-James
  • Fix php error with arbitrary statement in empty - Prior to PHP 5.5. #165 - by PatelUtkarsh

2.0.0

1.9.12

  • Allow override Redis host/port/prefix by defining constant in wp-config.php #152 - by vincent-lu

1.9.11

  • Fixed issue where permalinks without trailing slash does not purging #124 - by Patrick
  • Check whether role exist or not before removing capability. #134 - by 1gor

1.9.10

  • Fixed issue where Nginx cache folders deleted on purge. #123 - by johan-chassaing
  • Fixed Redis purge all feature for installation where WordPress lives in a separate folder. #130 - by pySilver

1.9.9

1.9.8

  • Fixed homepage cache cleared when WPML plugin used #116 - by Niwreg
  • Fixed Purge Cache clears the whole Redis cache #113 - by HansVanEijsden
  • One log file for all site in WPMU.
  • Single site Redis cache purge when click on Purge Cache button in WPMU #122 - by Lars StΓΈttrup Nielsen
  • Fixed notices and warnings.

1.9.7

  • Remove timestamp if cron or wp-cli #114 - by samedwards
  • Fixed notices and warnings.

1.9.6

  • Fixed cache purging on post publish.
  • Error fixed when redis server not installed.

1.9.5

Added custom purge URL option.

1.9.4

  • Added redis server connection timeout.
  • Added RedisException handling.

1.9.3

  • Added PhpRedis API support.
  • Added redis-lua script support to purge complete cache very fast.
  • Added composer.json support
  • Fixed cache purging link in admin bar.
  • Updated the initial settings to include the 'purge_method' #99 - by gagan0123

1.9.2

Fix purging for Redis cache and FastCGI cache

1.9.1

Fix purging for custom post types

1.9

Added Redis cache purge support.

1.8.13

Fixed PHP notice for an undefined index when "Enable Logging" is not set.

1.8.12

Updated readme and changelog

1.8.11

Fix url escaping #82 - by javisperez

1.8.10

  • Security bug fix

1.8.9

  • Default setting fix and wp-cli example correction - by bcole808

1.8.8

  • Added option to purge cache without nginx purge module - by bcole808

1.8.7

  • Added action rt_nginx_helper_purge_all to purge cache from other plugins - by gungeekatx

1.8.6

  • Removed wercker.yml from plugin zip/svn.
  • Updated readme

1.8.5

1.8.4

  • Fix undefined index issue and correct "purge_archive_on_del" key

1.8.3

  • Tested with WordPress 4.0
  • Fix issue #69

1.8.1

  • Tested with wordpress 3.9.1
  • Fix confilct with Mailchimp's Social plugin

1.8

  • New admin UI
  • Fix missing wp_sanitize_redirect function call

1.7.6

  • Update Backend UI
  • Added Language Support

1.7.5

  • Fixed option name mismatch issue to purge homepage on delete.

1.7.4

  • Disable purge and stamp by default.

1.7.3

  • Suppressed unlink related error-messages which can be safely ignored.
  • Fixed a bug in purge-all option.

1.7.2

  • pjv fixed bug in logging file.

1.7.1

  • Fixes bug in true purge and admin screen.

1.7

1.6.13

  • pjv changed the way home URL is accessed. Instead of site option, the plugin now uses home_URL() function.

1.6.12

  • telofy added purging of atom and RDF feeds.

1.6.11

  • Removed comments from Admin screens since, it was interfering with media uploads in 3.5 up.

1.6.10

  • Cleaned up code.
  • Added credits for code.
  • Improved attachment purging.

1.6.9

  • Added Faux to Purge all buttons, to avoid misleading users.

1.6.8

1.6.7

  • jk3us added better content-type detection for cache verification comments

1.6.6

1.6.5

  • Fixed typo that interfered with archive purge settings. Thanks to Daan Kortenbach for pointing this out.

1.6.4

  • Improved code for map generation to better conventions since the nesting confused some servers.
  • Added map update process to admin_init for frequent refreshes.

1.6.3

  • Fixed duplicate entries.

1.6.2

  • Another bug fix in the revised code for improved multisite and multidomain mapping.

1.6.1

  • Fixed bug in the revised code for improved multisite and multidomain mapping.

1.6

  • Revised code for improved multisite and multidomain mapping.

1.5

  • Timestamp now only gets added to content-type text/html
  • Added option to toggle timestamp creation

1.4

  • Fixed bug related to nomenclature of comment status that caused purge to fail.

1.3.9

  • Removed extraneous headers.

1.3.8

1.3.7

  • Changed the action hook, back to 'shutdown' from 'wp_footer' to add verification comments.
  • Added a check to prevent adding comments to ajax requests,

1.3.6

  • Changed the action hook, from 'shutdown' to 'wp_footer' to add verification comments. This was interfering with other plugins.

1.3.5

  • Improved Readme.
  • Improved cache verification comments.

1.3.4

1.3.3

  • Fixed map generation for multi domain installs using domain mapping plugin, where blog ids were not displayed.

1.3.2

  • Fixed map generation for multi domain installs with domain mapping plugin.

1.3.1

  • Minor fixes for directory structure and file names.

1.3

  • Improved Readme.

1.2

  • Fixed map generation error.
  • Fixed purging logic.
  • Fixed UI where purge settings were lost on disabling and re-enabling purge.
  • Minor Ui rearrangement.

1.1

  • Improved readme.txt. Added Screenshots.

1.0

  • First release

Upgrade Notice

2.2.3

Nginx Helper 2.2.3, Fix performance issue when saving nav menus, purging date archives for CPTs, purge page and post URLs when the post is trashed and passes the URL being purged in "rt_nginx_helper_purge_cached_file" hook as parameter.

Does this interest you?

Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions

More Repositories

1

action-slack-notify

GitHub Action for sending a notification to a Slack channel
Go
1,071
star
2

wp-decoupled

Next.js app with WPGraphQL and WordPress at the backend.
JavaScript
267
star
3

VueTheme

WordPress theme using Rest API and Vue.js
CSS
220
star
4

gutenberg-fields-middleware

Register fields for Gutenberg blocks with less repetitive code
JavaScript
167
star
5

rtMedia

rtMedia (formerly Buddypress Media) adds advanced multimedia functionality to WordPress, BuddyPress and bbPress
PHP
121
star
6

action-deploy-wordpress

GitHub Action for deploying a WordPress site using using PHP's Deployer.org
Shell
120
star
7

Frappe-Manager

A CLI tool based on Docker Compose to easily manage Frappe based projects.
Python
111
star
8

action-phpcs-code-review

Github Action to perform automated code review on pull requests
Shell
101
star
9

github-actions-library

Collection of Github Actions useful for WordPress Deployments
93
star
10

wp-partytown

Add partytown support to WordPress sites.
JavaScript
75
star
11

login-with-google

Minimal plugin which allows WordPress user to login with google.
PHP
62
star
12

learn

rtCamp assignment and issue tracker
51
star
13

rtpanel

WordPress Theme Framework
PHP
43
star
14

gitbook-plugin-edit-link

GitBook Plugin to add "Edit with Github (or Gitlab)" link on every page
JavaScript
42
star
15

wordpress-skeleton

A base repository structure for rtCamp's WordPress sites, pre-configured to use Github Actions
PHP
41
star
16

gutenberg-supplements

JavaScript
28
star
17

rtsocial

rtSocial is lightest wordpress plugin for facebook & twitter social sharing
PHP
26
star
18

theme-elementary

A starter theme that facilitates a quick headstart for developing new block-based themes along with a bunch of developer-friendly features.
JavaScript
26
star
19

wpveda-book

We now have our own training module which has all the lessons that covers the core topics on WordPress and the various steps involved in WordPress development. Check it out
Shell
25
star
20

blank-theme

Customized Blank theme based on Underscore and Foundation
PHP
25
star
21

gitbook-plugin-collapsible-menu

GitBook Plugin to change sidebar menu's to collapsible menu. For gitbook with many pages, navigating long menus can get irritating.
JavaScript
24
star
22

woocommerce-to-easydigitaldownloads

A script to migrate products, orders, payments and other stuff from WooCommerce to EasyDigitalDownloads
PHP
21
star
23

rt-optimizer

A WordPress plugin that improves Core Web Vitals score by loading scripts via worker thread. Keeps the main thread idle for users to interact with page as quickly as possible.
PHP
19
star
24

rtpanel-child-theme

Example child theme for rtPanel wordpress theme framework
CSS
16
star
25

rtbiz

WordPress 4 Business!
PHP
16
star
26

web-story-creation-tool

Demo https://rtcamp.github.io/web-story-creation-tool
JavaScript
16
star
27

wp-menu-custom-fields

An example of custom fields for menu in WordPress 5.4+
TypeScript
16
star
28

woobench-woocommerce-load-testing

WooCommerce Benchmarking
Python
14
star
29

gitlab-to-github-migration

Migrate GitLab project to GitHub
PHP
12
star
30

rt-lib

rt-lib is (intended to be) collection of reusable PHP classes useful for WordPress plugin/theme projects
PHP
12
star
31

transcoder

This WordPress plugin, useful to transcode audio and video file from any format to mp3 and mp4 respectively. Also it will generate thumbnails of videos.
PHP
10
star
32

action-phpcs-inspection

GitHub Action for PHPCS inspection.
Dockerfile
10
star
33

rt-newrelic-browser

NewRelic Browser Monitoring (Real User Monitoring) WordPress
PHP
10
star
34

wordpress-preview-revisions

WordPress Preview Revisions Plugin help editors to preview the revisions with exact same content that would look like on the frontend.
PHP
9
star
35

wp-plugin-bootstrap

A skeleton wordpress plugin to bootstrap & standardize your development
Shell
9
star
36

rtsyntax

A lightweight syntax highlighter for WordPress
CSS
9
star
37

visual-automation-backstop

Visual automation with Backstop JS
JavaScript
9
star
38

media-node

A node.js wrapper for ffmpeg. Made for https://github.com/rtCamp/buddypress-media but can be used in any project which needs FFMPEG
Shell
9
star
39

docs.rtcamp.com

Documentation for rtCamp projects/products
CSS
8
star
40

gutenberg-plugin-boilerplate

Simple Gutenberg Boilerplate for plugin development
JavaScript
8
star
41

search-with-google

A plugin for replacing WordPress default search with Google Custom Search results.
TypeScript
8
star
42

ninja-to-gravity

PHP
7
star
43

pwa-wordpress-plugin

WordPress Plugin to enable PWA features.
PHP
7
star
44

httperf

httperf clone with fix for FD_SETSIZE (open file limit)
C
7
star
45

amp-admanager

Easy and hassle free Google Admanager amp-ad tags integration for all WordPress sites. (AMP and Non-AMP)
PHP
5
star
46

rtpanel-hooks-editor

rtPanel hooks editor plugin provides user-interface for rtPanel WordPress Theme Framework
PHP
5
star
47

my-comment-manager

Better comment management for wordpress
PHP
5
star
48

action-wordpress-org-plugin-deploy

Shell
4
star
49

web-stories-ad-tool

Ad creation tool for google web stories. https://rtcamp.github.io/web-stories-ad-tool
JavaScript
4
star
50

automate-slack-invite-gravityforms

GravityForms addon to invite a user on Slack automatically
PHP
4
star
51

blogger-to-wordpress

Blogger to WordPress Redirection Plugin
TypeScript
4
star
52

rtmedia-code-snippets

This is custom code library for rtMedia core and premium add-ons
PHP
4
star
53

gitlab-bulk-delete-users

Delete users in bulk from Gitlab setup using rake tasks
Ruby
4
star
54

wporg-api-client

WordPress.org API client built in node.js
JavaScript
3
star
55

dockerfiles

Various Dockerfiles in use by rtCamp.
Dockerfile
3
star
56

amp-onesignal-compat

A WordPress Plugin to add AMP compatibility to OneSignal – Web Push Notifications
PHP
3
star
57

pwa-extension

Enables PWA features such as add to homescreen, offline reading features.
PHP
3
star
58

api_playwright_utils

API Automation Testing with Playwright
JavaScript
3
star
59

frappe-dev-tools

App for frappe devs to go πŸš€
Python
3
star
60

integrate-woocommerce-gitlab

With this code users can connect GitLab to WooCommerce, users will get source code repositories access as a Guest, Reporter, Developer or Master
PHP
3
star
61

wp-cli-report-command

Lists the plugin and theme usage for a multisite
PHP
2
star
62

wercker-step-wordpress-svn

Wercker deploy step for wordpress.org plugin svn repo
Shell
2
star
63

rtbiz-helpdesk

PHP
2
star
64

migrate-wufoo-to-gravity-forms

Import content from wufoo to Gravity Form- Entries, Comments and attachments.
PHP
2
star
65

blocks-bento-variations

PHP
2
star
66

px-wp-insights

AMP Compatibility Database
JavaScript
2
star
67

amp-generic-compat

AMP plugin to provide generic compatibility for Elements with hide and show toggle feature
PHP
2
star
68

rtWidgets

Sidebar Widgets Collection for rtPanel Theme Framework mainly. Might work on other theme as well.
PHP
2
star
69

embed-google-drive

TypeScript
2
star
70

rtmoto

rtMoto Theme
PHP
2
star
71

mention-links

Plugin which brings Github style user @mentions and article #links to the WordPress
TypeScript
2
star
72

stripe-xero-csv

Export Stripe's balance affecting transactions in a CSV file, recognisable by Xero Import CSV Statement feature.
PHP
2
star
73

action-deploy-frappe

Shell
2
star
74

edit-flow-slack-integration

This plugin is to send slack notification when editotial comment added.
PHP
1
star
75

lando-wordpress-skeleton

PHP
1
star
76

action-deploy-on-managed-instance

Shell
1
star
77

amp-infinite-scroll

AMP plugin for infinite scroll
PHP
1
star
78

web-stories-playground

JavaScript
1
star
79

rtAdmin

PHP-CLI nginx vhost creation script. Succeeded by https://github.com/rtCamp/easyengine
PHP
1
star
80

rtAntiSpam

WordPress login/register sidebar widget with recaptcha support
PHP
1
star
81

wp-cls-terminator

Remove CLS from Block Editor Embeds
JavaScript
1
star
82

rt-google-analytics-scroll-tracking

Integrates jquery-scrolldepth with Google Analytics by Yoast
JavaScript
1
star
83

amp-colormag-compat

Adds Compatibility to WordPress ColorMag theme.
PHP
1
star
84

gitolite-setup

Setup scripts for Gitolite v3
Shell
1
star
85

AMP-Extensions-Mini-Plugins

Monorepo contains different AMP extension plugins
PHP
1
star
86

psat-demos

EJS
1
star
87

rtmedia-transcoding-service-old

rtmedia Transcoding Plugin for rtMedia and WordPress Media Library
PHP
1
star
88

rt-react-theme

JavaScript
1
star
89

gravityforms-sfmc-data-extension

Gravity Forms add-on to send entry data to a Salesforce Marketing Cloud Data Extension
PHP
1
star
90

amp-email-subscribers

AMP compatibility for Email Subscribers & Newsletters – Simple and Effective Email Marketing WordPress Plugin by icegram
PHP
1
star