Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.3
About It:
Get it:
Rate it:
  • Helpful?
  • 3 Yes
  • 5 No
Flag it:
Contact Reason [ ? ]

cbs_maintenance_mode

Description

This plugin is a modified version of rvm_maintenance by Ruud van Melick. It allows you to take the entire public website offline for maintenance in a few clicks. Anyone attempting to access the public part of the website (including logged users) will then see in the default Textpattern error template for an HTTP 503 error instead (error_503 if available, otherwise error_default), including a custom message of your choice which will be displayed by the <txp: error_message /> tag in the template. A “503 – unavailable” HTTP header will be sent along the error template in order to notify bots that they must come back later.

The admin interface will always remain online. A small warning message will be shown at the top of the admin pages as long as the website is in maintenance mode.

Remark

Simply activating the plugin will not take your website offline until the cbs_maintenance_mode_enabled setting is set to true (see below).

Settings

The plugin settings are located in the “Publish” section of the main settings panel.

  • cbs_maintenance_mode_enabled: Boolean, when set to true maintenance mode will be enabled and the public website will be taken offline, displaying the default error template for an HTTP 503 error. The admin interface will also display a warning message at the top of every page. Set to false to take the website back online when maintenance is complete. Default is false.
  • cbs_maintenance_mode_message: The message that will be shown by the <txp: error_message /> tag in the error template when the public website is offline. Default is “The website is currently under maintenance. Please come back later.”.

Changes history

v0.3 (2008-12-05)

  • Added a warning message at the top of the admin pages while the website is in maintenance mode.
  • Improved documentation.

v0.2 (2008-12-02)

  • Delayed the plugin loading to prevent errors from occuring when conditional comments are present in the default error form.

v0.1 (2008-11-16)

  • Initial release.
Article Request Count:
Initially released:
2008-11-16
Posted here:
15 Nov 2008
Article modified:
20 Apr 2015

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (13)

What is the difference between this plugin and rvm_maintenance and ort_maintenance_mode?

Good question!

Compared to rvm_maintenance:

1) It allows you to set a custom message, in rvm_maintenance it’s hard-coded.
2) It stops execution earlier, even before the other plugins are loaded, this means less CPU usage when your site is offline.
3) It blocks access to everybody on the public site, while rvm_maintenance still allows access to the users that are currently logged into the system.
4) It adds a “switch” in the settings panel to take the site online/offline. rvm_maintenance has no switch and takes the site offline as soon as the plugin itself is enabled, and takes it back online when the plugin is disabled.

Compared to ort_maintenancemode:

1) It is much smaller and simpler and does not use external files.
2) It sends back a HTTP 503 header, ort_maintenancemode does not which is not a good thing.
3) It stops execution earlier, even before the other plugins are loaded, this means less CPU usage when your site is offline.
4) It only allows you to set a custom text message and uses the default textpattern error form (that you can customize of course). ort_maintenancemode allows you to set the full HTML page that will be shown when the site is offline and saves it in an external text file.

Lee:

Thanks, a very useful plugin. I never had much luck with the other 2.

I’ve just installed 4.07 and using this plugin gives me errors; when I switch the site into maintenance mode, I get the following:

Tag error: <txp:if_section name=’<txp:section />’> -> Warning: extract() [function.extract]: First argument should be an array on line 3021

Tag error: <txp:if_section name=’<txp:section />’> -> Warning: extract() [function.extract]: First argument should be an array on line 3021

Tag error: <txp:article_custom section=’<txp:section />’ wraptag=“ul” break=“li”> -> Warning: extract() [function.extract]: First argument should be an array on line 557

Tag error: <txp:if_section name=’<txp:section />’> -> Warning: extract() [function.extract]: First argument should be an array on line 3021

Tag error: <txp:if_section name=’<txp:section />’> -> Warning: extract() [function.extract]: First argument should be an array on line 3021

Tag error: <txp:if_section name=’<txp:section />’> -> Warning: extract() [function.extract]: First argument should be an array on line 3021

Tag error: <txp:if_section name=’<txp:section />’> -> Warning: extract() [function.extract]: First argument should be an array on line 3021

Hi Peter,

I’ve just upgraded to 4.0.7 too, using a dozen of other plugins and it works perfectly, no errors.

These warning messages that you are seeing on your website are not caused by my plugin, but rather by a form error or by another plugin.

Check your forms and look for the tags mentioned in the warning messages. If you see nothing wrong there, try to disable your other plugins one by one to see which one is causing errors (but I would rather vote for a form error).

textscratch:

> It allows you to set a custom message, in rvm_maintenance it’s hard-coded

rvm_maintenance allows you to set the maintenance message to a desired template. We use it successfully with a custom template including graphics.

@ Christophe: This is using the default theme on a fresh install, with no other plugins activated!

Okay, I see what’s the problem. Because the plugin loads very early, all things are not fully initialized and the default error form is not able to show conditional “txp:” tags. My error form did not contain any of these tags, that’s why I did not see any problem on my website. So, I’ve updated the plugin so that it activates a bit later, after things are properly initialized. Thanks for the feedback.

@textscratch:

Nope, rvm_maintenance uses the default error template of textpattern (the same one which is used for 404 errors and others) like this plugin but, unlike it, this plugin allows you to set the error message that will appear in the template at the location of the <txp:error_message /> tag.

I have another issue with this plugin, but rather than filling the comments, I have started a forum thread.

rvm_maintenance allows you to create and use the ‘error_503’ template/page, although by default it uses the ‘error_default’ template. So while it works out of the box, you can customize it as much as you want.

rvm_maintenance does have a switch: enabling/disabling the plugin. Just as easy as a preference and less CPU consuming if you’re not in maintenance mode (because the plugin code isn’t loaded), which is what matters for most websites ;)

Ruud,

I agree, it’s better without the additional switch. I added a switch to my plugin because I wanted the user to be able to set the custom message through the options before taking the website offline, because this option only shows up after enabling the plugin the first time. Anyway, the user can still leave to switch enabled afterwards and just enable or disable the plugin.

Basically my plugin is your plugin with only small changes. I first saw your plugin and I liked it but I wanted to use my default error template and change the custom message, and I also wanted the logged users to see the offline page too. So I created this one.

I didn’t know it was possible to create a custom error template for a specific http status code like 503, so I thank you for the tip. However I still find it useful to be able to customize the value of the <txp:error_message /> tag.

I decided to use rvm_maintenance, because that way I can still access the site frontend while the site is offline, but even after removing cbs_maintenance mode, the settings in Admin > Preferences prevail.

How do I go about removing the plugin completely?

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment or visit the forum discussion?

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern