site_upgrade plugin modifications???

So I was checking out this option and it's great! BUT, I was thinking there needs to be a little more to it...

If the site is "closed" - there is no way for the person to ever get back to the site once it "re-opens". Since closed.html is a static page - refreshing does nothing and there are no other links on it. So unless the user backs out of the url to index they will never know when the site is back up...unless they close their browser and come back to the site later.

SO, what I did was to add a meta refresh tag to the head:
<meta http-equiv="refresh" content="2;url=/index.php">

This way the page tries to load index.php every 2 seconds so if someone happens to be on closed.html when the site "re-opens" they will automatically be re-directed. I also added some text to let them know what was happening:

"Our site is being upgraded - please be patient - you will be re-directed shortly once the upgrade is complete. You can also CLICK to refresh."

(and the word click is a link to index). This way they are more likely to stay and click rather than just closing the browser)

Nothing major but I think a nice upgrade to an already neat plugin. Anyone can easily modify closed.html themselves but maybe someone that's more of a beginner might not be able to.

The other thing I was thinking about was is there a way for the site to be accessible for testing to someone who is logged in? (while remaining closed to everyone else) Right now, there is no way to test the site w/o "re-opening" it...

Lastly, why does mod_rewrite have to be enabled for this plugin to work? If I manually un-comment the appropriate lines in .htaccess the plugin works just fine w/o mod re-write enabled...I am using this plugin now by manually changing .htaccess but it would a lot easier if I could just do it through the backend...mod_rewrite is NOT enabled on my sites...

Thanks for the consideration,
Mike

Comments

  • acrylian Administrator, Developer
    1. The refresh is then possibly trying to load a file that is not existing while you are upgrading.
    The close page is meant to be customized by every one with appropiate links messages, log (as we do for our site). I think we really cannot always think of what a beginner can do or not. Sounds a bit hard but installing, running and updating a server based tool is probably not really something for a beginner at all.

    2. The main reason the site is "closed" is if you upload a new version. At least for me deleting and uploading zp-core takes 30min+ on every host I tried. So there is no site to access at all! Once you uploaded you can very well access the backend while the site is closed. But probably an idea to think of. Bascially two kinds of closed then.

    Actually the htaccess file does redirect all request to the root index.php of Zenphoto to the closed page. Since no one will "wait" on that page for the site to open the site will be working normally when it is opened again via the normal url.

    3. mod_rewrite: Any proper webhost nowadays should have modrewrite and therefore "cleaner" urls. The reason it uses htaccess (htacceses != modrewrite - the latter is one function of htaccess!) is that the plugin actually could - given the server allows it - modify the htaccess file from the backend button so you don't need to manually change it.
  • Yes I agree uploading takes some time...that's why I like this new feature and as I notice 1.4.3.2 is out I will be using it to upgrade 3 of my sites! lol BUT, I still think some sort of automatic redirect would be helpful as a feature...Also, I DO think people will wait or at least be more inclined to leave the window open will doing something else or even click refresh themselves in hopes of the site being re-opened. And once it is re-opened it would load for them. I know I would be if I encountered that.

    Also, FYI - even when index.php and zp-core are missing my setup still works perfectly. The closed.html page just continues to display until the site is re-opened.

    Also, I'm aware the backend is available when the "site is closed" but I was hoping to be able to test the frontend while it was still closed to everyone else. Sometimes there are a few bugs or quirks after an upgrade in a rush to get everything finished. So yes 2 kinds of closed...or better yet closed for different users...admins can still view the site as normal (but maybe with a small "site is closed" message somewhere) and to all other visitors the standard closed.html page.

    Thanks again,
    Mike
  • acrylian Administrator, Developer
    Ok, maybe I am just thinking of me as I surely would not leave the window open but revisit probably some time later. But each his own...;)

    Ok, sure since it redirects by htaccess, of course.

    I do understand your thought about testing the frontend. Best you open a ticket on this (incl. the refreshing) so we can consider this for 1.4.4 and don't forget it.
  • Ok great thanks!
  • Some comments:

    While it might be nice to allow visits to the site during the upgrade that is not possible via rewrite rules. Remember that these are independent of PHP so have no working knowledge of the state of the installation.

    If the rewrite rule is active you will be redirected to the site closed page no matter who you are.

    Refreshing the page is ok, if that is what you want to do. One of the reasons why the actual page is left mofifiable by the site owner. With the 1.4.4 release this page will change to be a PHP script so that you can do other processing. But remember there is probably no reliable way of knowing if Zenphoto content is available.

    You could create a plugin that redirects to the site closed page for non-admin users. That could be activated and then you could "open" the site for your testing.
  • @n20capri:
    One suggestion: if you plan to put your gallery offline to work, say, for 2 hours, why don't you write on the "website closed" page that the gallery will reopen by this time.

    Besides, the redirect is not a permanent one, so people who go to yoursiteDotCom/zenphoto/whatever will be back on the regular gallery pages when your site goes online.

    Besides, I see a few problems with the Refresh you were suggesting above:
    – It's somewhat of a drain on local resources and bandwidth you pay for. Requesting the same thing over and over when it doesn't change is not the best way to use one's local resources.
    – It's also draining (a bit) on your webhost. I know that someone calling over and over for a static page won't drain too many resources on the host, but when you update a system, the last thing you want is interference.
Sign In or Register to comment.