0

For some reason it seems that WP3.0 is bugged with everything relate to maintenance-mode.

The 2 maintenance-mode plugins (maintenance-mode & wp-maintenance-mode) cause the following problems:

  1. wp-maintenance-mode doesn't allow u login as an admin. He just blocks you at the wp-login page.
  2. wp-maintenance-mode even doesnt influence a thing.

The same thing happend to me when I tried to write it by myself using this tutorial.

This line worked perfect and showed the built-in maintenance screen, but when I tried to add the condition for is_user_logged_in(), the mode stops working, letting you see the cliend & back end, when u r logged in or logged out.

What can I do? Thanks for all the answerers.

neoswf
  • 4,730
  • 6
  • 39
  • 59
  • Is this a programming issue? If not then it's likely to get closed as "off topic". – ChrisF Jun 24 '10 at 19:17
  • It might be cause it might demand an API usage of WP. And can't I publish question regarding WP here? thanks, Shlomi – neoswf Jun 25 '10 at 00:16

1 Answers1

0

The is_user_logged_in() function the tutorial provides is pretty terrible, and it's why you're getting false positives for being 'logged in'.

Instead, load the pluggable file that contains the default WordPress is_user_logged_in() function;

require_once (ABSPATH . WPINC . '/pluggable.php');
if ( ! stristr($_SERVER['REQUEST_URI'], '/wp-admin') && ! stristr($_SERVER['REQUEST_URI'], '/wp-login.php') && ! is_user_logged_in() )
    $upgrading = time();
else
    $upgrading = 0;
TheDeadMedic
  • 9,948
  • 2
  • 35
  • 50
  • Thank you man for your answer. I've loaded the pluggable file and I got this error- "Fatal error: Call to undefined function is_ssl()". I read and it seems like I have to dig into the php definitions of the server. I'm giving up and will upload everything so fast, that my users won't sense the update :) – neoswf Jun 25 '10 at 16:43
  • Just add this line before the others; `require_once (ABSPATH . WPINC . '/functions.php');`! – TheDeadMedic Jun 25 '10 at 16:55