Scriptrunner (Doug Sparling)
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: PHP 5.4 Update Breaks My WebsiteI’ve moved a few sites to PHP 5.4 on BlueHost, and the only issue I ran into was plugins using PHP call-time pass-by-reference, which was deprecated in PHP 5.3 and removed in PHP 5.4.
The easiest way to track this down is testing your site in PHP 5.4 locally or a test machine and setting WP_DEBUG to true. PHP 5.4 will not effect WordPress itself in anyway, but any plugins/themes using call time pass by reference will cause a fatal error.
Forum: Fixing WordPress
In reply to: How to make my feeds update in RSS reders?Have you checked
Settings->Reading?Specifically, the option to show number of posts in your feed:
Syndication feeds show the most recent
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1@adamelmer – this is starting to venture into needing to start a new thread, but I’ll go ahead and give you a couple of suggestions none the less.
It sounds like you have a plugin that’s not compatible with WordPress 3.7.1. So, try:
1) Turn on WP_DEBUG and/or look in your server error logs. Besides the “Cookies are blocked or not supported” that’s displayed on the login page, do you see any errors with debugging turned on? (and most likely, they’ll be “headers already sent”)
2) Rename your plugin folder like you were doing, but add a single plugin back at a time to your new empty plugin folder and go through the logout/login process until you find the plugin that’s causing the issue. Or alternatively, do what you’re doing now, except deactivate all your plugins before logging out.
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1@esmi – you’re welcome!
Also, one more bit of information. If someone says they get the
ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.
message the first time they try to login, and then they can login successfully the second time, that’s a sure sign that a proxy is deleting cookies on
GETrequests. WordPress (wp-login.php) will also run the same code to set the test cookie on aPOSTbut it can’t read the cookie until the next request. (in this case, a second login form post)Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1OK, thanks to @jgjh151 sharing his Varnish config file, I think I’ve got this mystery solved.
So…it is definitely an issue with Varnish configuration, but, something also did change in WordPress 3.7, but it was a bug fix. So due to a bug in
wp-login.phpin pre-WordPress 3.7, an incorrect configuration in Varnish did not cause any issues with WordPress because the bug in WordPress causedwp-login.phpto not actually check the test cookie.Here’s the line in Varnish config that’s causing the issue:
if ( (!(req.url ~ "(wp-(login|admin)|login)")) || (req.request == "GET") ) {It needs to be:
if ( (!(req.url ~ "(wp-(login|admin)|login)")) ) {Now for the quick explanation. In WordPress 3.6.1 (and earlier I assume), the
req.request == "GET"part of Varnish config was preventingwp-login.phpfrom writing the test cookie when the form was loaded (called with aGET), but the code that checked if the test cookie was actually set (whenwp-login.phpcalled via aPOST) never ran if the user’s credentials were good. That is, on the form post, if the user authenticated properly, then the user was redirected to wp-admin without this code being run:if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )In WordPress 3.7, this bug in
wp-login.phpwas fixed, moving the redirect to wp-admin on successful login *after* the cookie check code above. So now the cookie check is actually run. So if Varnish is deleting the test cookie onGETrequest to thewp-login.php, this won’t prevent a login with WordPress 3.6.1 or older, but now that WordPress is actually checking for the test cookie, it will fails the cookie check as it should.So even though something did change in WordPress, it’s due to misconfiguration of Varnish. (and any other proxy/caching server I imagine)
To use Varnish with WordPress, at least Varnish 3, it’s best to follow the sample template here:
Varnish 3.0 templates – WordPress, Drupal, Joomla and Fork CMS VCL templates
And specifically for WordPress:
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1@jgjh151 – would you mind either posting your Varnish config file(s) or sending them to me (dougsparling at gmail dot com). I’m still baffled how Varnish would cause 3.7.1 to fail, yet pre-3.7.1 would work.
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1Default Varnish config is OK. (everything is basically commented out) I am going to experiment by uncommenting more of what’s in the default config file.
I added the WordPress specific config from these templates to my Varnish config, and everything worked ok:
If I change
if (!(req.url ~ "wp-(login|admin)")) { unset beresp.http.set-cookie; }to
if (!(req.url ~ "wp-admin")) { unset beresp.http.set-cookie; }Then I get the cookies not supported error message on WordPress 3.7.1 because now Varnish is unsetting the test cookie from wp-login.php. But…by doing this I can’t login to WordPress 3.6.1 either, I just don’t get the message, (in both cases the testcookie is not set) though I stay on wp-login.php, just no error message.
I’m not seeing an obvious way to configure Varnish in a way that it would break WordPress 3.7.1 but not effect previous versions of WordPress.
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1I doubt it’s PHP. (and I’ve tested on PHP 5.2.x, 5.3.x, 5.4.x, and 5.5.x – all good) Since JavaScript runs client side, no surprise that cookies can be set that way. It all points to server configuration/environment, with proxy server definitely a possibility.
In all the testing I’ve done, the only way I’ve gotten the cookie to not set properly is by modifying my Varnish config.
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1Here’s what I get as far as varnish goes (on the response):
X-Varnish: 827414583 827414582 Age: 83 Via: 1.1 varnishForum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1I’m still able to login by after removing:
<input type="hidden" name="testcookie" value="1" />but then again, I’m not having any trouble with it either. I would be very curious what’s in the server error log if you can get access to it or the engineer can get you a copy.
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1@willem.deboer – When I get a chance, I’ll double check that testcookie hidden variable. I saw a post on BuddyPress where that was removed so it would work with WordPress. As far as I can tell, all it does is remove the check if test cookie exists, and things should work as normal. Does WP_DEBUG show anything? Otherwise, it would be nice to know what’s showing up in the server error log.
As far as the headers, “Via” is used in both http request and response headers to show which proxy servers request/response went through. Whether it’s Varnish, I don’t know. I could see what I get back on my local test install, but it’ll have to be a bit later today.
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1I downloaded fresh archive versions of 3.5, 3.6, 3.6.1, 3.7, and 3.7.1. What I did notice is that wp-login.php did not change between 3.7 and 3.7.1. 3.5-3.6.1, wp-login.php sets the test cookies in the same way as it does in 3.7+, but the code dealing with logic for a missing test cookie is somewhat different between pre-3.7 and 3.7+.
I’ve been guessing too much, but it seems that nothing in 3.7/3.7.1 has changed in regard to setting of the test cookie when first hitting wp-login.php. You might try removing:
<input type="hidden" name="testcookie" value="1" />as that should disable the test cookie check on form submission.
As I said, for now I’m going to bow out of any more troubleshooting suggestions, at least until I discover something substantial. It seems to be an environment issue of some sort. I run a dozen or so sites using three different hosting companies and have yet to have any problem, which is the opposite of your situation.
I’m back in work mode, so I’ll have lest time to devote this issue. If I discovering something tangible, I’ll let you know.
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1It would be this:
sub vcl_fetch { # Drop any cookies WordPress (except for wp-login/wp-admin) tries to send back to the client. if (!(req.url ~ "wp-(login|admin)")) { unset beresp.http.set-cookie; } }But that configuration works, and deleting out the if will make it fail for all recent versions of WordPress, not just 3.7.1.
Forum: Fixing WordPress
In reply to: "Cookies are blocked or not supported" since update to 3.7.1OK, curiosity got the best of me and I installed Varnish.
Actually, it’s conf.d/fetch/wordpress.vcl
By doing this:
#if (!(req.url ~ "wp-(login|admin)")) { unset beresp.http.set-cookie; #}I can stop the testcookie from being set and I get the “Cookies are blocked or not supported” error. However, that gives me the error on WordPress, at least back to 3.6.1, and if I uncomment the if statement, it works on 3.7.1. So yes, Varnish can cause the issue, but it doesn’t seem to be 3.7.1 specific. (but once again, it could depends
on configuration)So I’m bowing out this thread…I can duplicate it, but I’m not sure my results mean much.