Digging into the plugin code I see:
add_action( 'wp_head', 'remote_login_js_loader' );
No clue what it does and why its needed. Its adding 400-600ms to load time of my nicely cached websites!!
Please help!
I actually dove in and edited the remote_login_js_loader function in mu-plugins/domain_mapping.php
I commented out the line that chachra pasted, around line 586.
My wordpress network still works like a charm, only without the longer loadtimes.
Thank You!!! For post.
I am very lucky that I stubled on to this posting, because I was unsure what exactly to search for terms. I was searching for “wordpress domain mapping javascript error all sites” and eventually found the solution you posted.
I did the same thing. I commented out the line of code in my domain_mapping.php file and no more JavaScript errors on all my sites.
Thanks again!
-=JFK=-
Mm, works for me too. But this solution doesn’t explain why the DM is doing this javascript stuff to begin with. What is it for, what does it do, and how do you control it in the prefs? There is nothing about this in the documentation.
What gives?
Adding remove_action( 'wp_head', 'remote_login_js_loader' );
…to your functions.php
also works.
Still not sure how takuya tracked it to the domain-mapping plugin (or how the rest of you isolated the offending function) but I am jazzed on open source today!
Maybe we could ask donncha or wpmuguru (the plugin authors).
I could ask wpmuguru to take a look at this thread. he’s in the room with me.. π
The script is for cross domain login support.
Ahhh. How/Does “cross domain login” actually work?
It would be handy (but seems like a possible security risk, no?)
Oh, I should also mention that if the script alone is supposed to enable the cross domain login to work, it doesn’t seem to.
I am glad troycawley asked the question, because it was begging to be brought up.
Can anyone lend information on this? I agree, it seems like a very helpful feature. I work on one system where we have over 20 sites using the WordPress 3.0 (multi domain) and it is a pain-in-the-butt to re-login every time I want to update another site.
I will 2nd the fact that the “cross domain login” feature didn’t work for me as well. Thus, I was getting JavaScript errors on my sites resulting in me disabling it.
-=JFK=-
If someone could point out exactly what those errors are, it would really help the devs narrow down where to look first. π
Andrea_r
Here is the JavaScript error that is being thrown on all my multi sites with the WordPress 3.0.2 setup:
Error: syntax error
Source File: http://domain.com/?dm=73f2cb985eb8bc020d004f1cee832624&action=load&blogid=3&siteid=1&t=1133799345&back=http%3A%2F%2Fdemo.domain.com%2F
Line: 1
Source Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Here is the line of code that causes the error:
<script src='http://domain.com/?dm=73f2cb985eb8bc020d004f1cee832624&action=load&blogid=3&siteid=1&t=1133799345&back=http%3A%2F%2Fdemo.domain.com%2F' type='text/javascript'></script>
When I comment out <strong>remove_action( 'wp_head', 'remote_login_js_loader' );</strong>
from <strong>functions.php</strong>
I do not get JavaScript errors anymore.
Is there anymore information I can provide?
-=JFK=-
A similar issue is driving my site into a perpetual redirect loop. Whenever I’m logged into another window, the published view site will continually reload without ever fully loading the page.
When I check in Firebug, I see a javascript script reference to the root domain of my WPMU install which is a “window.location” script is the last thing in the <head>
<script src=’http://slowprint.org/?dm=fef677426a881d04389ff5e8106c1e8c&action=load&blogid=13&siteid=1&t=438793505&back=http%3A%2F%2Fwww.spiritsex.org%2F’ type=’text/javascript’></script>
loads this:
window.location = ‘http://www.spiritsex.org/?action=login&dm=fef677426a881d04389ff5e8106c1e8c&k=ca46a5df46a4fd3caaadbb24e7b91458&t=736476260’
Which reloads the page again…
I have had to manually remove cookies to regain access to the published site (in the open browser – anon users can see it no problem AFAICT). I can log in to the backend, as that’s using the original domain (not the mapped domain).
It’s very annoying and potentially damaging for client relationships.
Has anybody a definitive answer from Donncha?
Or should I file a bug report?
Or is there something I’m doing wrong here??
Thanks
Peter
Try the fix I posted above.
But, unless spiritsex.org
is another domain within your multisite installation, I think that something else is at fault here (i.e. you’ve been hacked somehow).
@troy
Yes, spiritsex.org is one of mine.
It’s not porn, BTW π
I’ve now determined that the temporary fix is to delete the root WPMU site authorization cookie from the browser.
Once that’s gone the site loads fine.
But requires relogin of course to get back to the admin.
thanks!
peter