Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-14 18:59:15

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

rvm_maintenance (v0.5)

This plugin, when activated, will show a maintenance page to all visitors who are not logged in on the admin side of Textpattern. Requires Textpattern 4.0.7 or higher.

Download

Features:

  • Very small, due to efficient reuse of TXP internal functions (less than 400 bytes of PHP code)
  • Detailed documentation in the plugin help.
  • Users logged in on the TXP admin side, can still view the website normally. After all, it’s harder to maintain a website if you can’t see what the result is on the front end.
  • Customizable ‘maintenance mode’ template.
  • Sends a “HTTP 503 Service Unavailable” response when in maintenance mode, telling Google spiders to come back later instead of indexing the maintenance page.
  • Minimal interface. Activating and deactivating the plugin is all you have to do to make it work.

Changelog:

  • version 0.1 (2007-11-12)
  • version 0.2 (2007-11-13)
    • use different name for session cookie to avoid name clashes.
    • fix potential, though hard to exploit security vulnerability in cookie hash.
  • version 0.3 (2007-11-13)
    • fix ‘double slash’ bug in cookie path.
  • version 0.4 (2008-03-03)
    • much smaller now (700 -> 250 bytes), but requires TXP 4.0.6 or higher.
    • fixed conflicts with clean url test (diagnostics) and the asy_dashboard plugin
  • version 0.5 (2009-01-05)
    • initialize pretext variables to avoid warnings when parsing error_ template
    • requires TXP 4.0.7 or higher (code size still small: 385 bytes)

Last edited by ruud (2009-01-05 21:15:28)

Offline

#2 2007-11-14 19:44:55

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

Re: rvm_maintenance (v0.5)

Very interesting plugin, and very useful. Tkanks lot :)

Just one question : do you think it would be difficult to add a warning message within the back-end header in the purpose to inform the administrator that the website is in maintenance mode. The goal is to remember administrators that the website is unavailable and don’t forget to switch in active mode.

I’d traying to test you cookie and display this kind of message, but cause live mode is activate when your plugin is disable, the cookie still exist.

Best regards,

Last edited by Pat64 (2007-11-14 19:49:33)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#3 2007-11-14 21:19:19

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_maintenance (v0.5)

It’s not difficult, but my aim is to keep it small and adding such code, which involves adding some javascript at the bottom of each page to rewrite the pagetop, would increase the code size considerably with little extra benefit. Also, adding a warning message somewhere at the top by using such a Javascript solution could easily conflict with another plugin trying to do the same thing. Although I can see why a warning on each admin page is useful, the benefits don’t outweigh the downsides, IMHO.

If you want to test if the plugin is active, just use function_exists('rvm_maintenance') in an if-construct.

Offline

#4 2007-11-15 07:24:26

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

Re: rvm_maintenance (v0.5)

Ruud the Great said :

If you want to test if the plugin is active, just use function_exists(‘rvm_maintenance’) in an if-construct.

Fine. Thanks lot again.

Best regards,


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#5 2007-11-15 07:26:42

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: rvm_maintenance (v0.5)

This was so much needed! Is there a possibility to absorb it in the default install for the next txp release? It could appear in the preferences with an on/off radio button next to it.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2007-11-15 07:33:06

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: rvm_maintenance (v0.5)

colak

I think that would be a good idea. It’s a pretty small plugin and would, IMO, make more sense to have it in the core than as an optional add-on.

ruud

Nice bit of code, thank you! I, for one, am learning from you :)


Steve

Offline

#7 2007-11-20 00:08:58

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: rvm_maintenance (v0.5)

Strange error. I get twice this message:

Warning: unknown_tag: sitename in /web/htdocs/www.site.it/home/textpattern/publish.php on line 973

…in the error page with maintenance advice. Sitename actually isn’t displayed (!). Am I missing something?

Very useful plugin, anyway!

Z-

Offline

#8 2007-11-20 00:35:49

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: rvm_maintenance (v0.5)

Zanza wrote:

Strange error. I get twice this message:

Warning: unknown_tag: sitename in /web/htdocs/www.site.it/home/textpattern/publish.php on line 973

…in the error page with maintenance advice. Sitename actually isn’t displayed (!). Am I missing something?

Very useful plugin, anyway!

Z-

received the same error and decided to play around with what was going on.

for whatever reason, when the plugin is on, it doesn’t seem to recognize <txp:sitename /> but it will recognize <txp:site_name />
(devs: the default error page uses <txp:site_name /> while the regular default page uses <txp:sitename />. that should probably be corrected?)

zanza to answer your question, you can edit your error_default page (or custom page if you made one) and just replace all instances of <txp:sitename /> with <txp:site_name />

Last edited by iblastoff (2007-11-20 00:41:18)

Offline

#9 2007-11-20 11:19:25

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: rvm_maintenance (v0.5)

Iblastoff, you’re totally right. Thank you!

Maybe the default template should actually use site_name, I suppose.

Bye!

Z-

Offline

#10 2007-11-20 12:58:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: rvm_maintenance (v0.5)

ruud

Awesome, dude! Exactly what the doctor ordered.

+1 for this making it to the core if possible.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#11 2007-11-20 13:14:10

Joey
Member
From: Netherlands
Registered: 2005-01-19
Posts: 257

Re: rvm_maintenance (v0.5)

Great, always wanted this kind of plugin. Finally fully online txp editing and testing without making it public. Thanks!


Regards,

Joey

Offline

#12 2007-11-26 22:08:43

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_maintenance (v0.5)

Bloke wrote:

+1 for this making it to the core if possible.

I think what can be done as a plugin with minimal effort and without duplicating a lot of code doesn’t belong in core TXP. In this case I’d say doing it as a plugin is even a bit more efficient because during times when the plugin is not in use (which should be most of the time), the code is not even loaded ;)

Offline

Board footer

Powered by FluxBB