Issue on console related to Domain Mapping

There’s an error visible on the console on my site that seems to be related to the Domain Mapping plugin. If you go and inspect the console then you see the domain mapping plugin might be causing an issue or at least seems to be relate.

There seems to be an unterminated string on line 34. Here’s the code:

(function(window) {
window.dm_redirect_to = function(){
if( "" ){
window.location.href = "";
}else{
window.location.reload();
}
};
var document = window.document;
var url = 'https://****.o1.com/dm-sso-endpoint/1517861143/?dm_action=domainmap-check-login-status&domain=www.mastecsmarthome.com';
var iframe = document.createElement('iframe');
(iframe.frameElement || iframe).style.cssText =
"width: 0; height: 0; border: 0";
iframe.src = "javascript:false";
var where = document.getElementsByTagName('script')[0];
where.parentNode.insertBefore(iframe, where);
var doc = iframe.contentWindow.document;
doc.open().write('<body onload="'+
'var js = document.createElement(\'script\');'+
'js.src = \''+ url +'\';'+
'document.body.appendChild(js);">
');
doc.close();

}(parent.window));

And right under the 4 line from the bottom, the line under it is a '); that should be on the same line (when you move it up it gets resolved).

And in that first javascript, if you follow its link, it takes you to this script, that seems to be from Domain Mapping:

// Starting Domain Mapping SSO
(function(window) {
var document = window.top.document;
var url = 'https://www****.me.com/dm-sso-endpoint/1517860559/?dm_action=domainmap-authorize-user-async&auth=roiezra|1517860619|2CpjFDLaUT6glFvin8qy3Mjp7oeIUOgOYM32Q1TD8j4|851c970196b7edb4958c38064db70614d9ae5d60707d354d935dd70348cd39b9&refresh=1';
var iframe = document.createElement('iframe');
(iframe.frameElement || iframe).style.cssText =
"width: 0; height: 0; border: 0";
iframe.src = "javascript:false";
var where = document.getElementsByTagName('script')[0];
where.parentNode.insertBefore(iframe, where);
var doc = iframe.contentWindow.document;
doc.open().write('<body onload="'+
'var js = document.createElement(\'script\');'+
'js.src = \''+ url +'\';'+
'document.body.appendChild(js);">');
doc.close();

}(parent.top.window));

  • Predrag Dubajic

    Hi Roi,

    Hope you're doing well, and thanks for the detailed report.

    I was testing this issue but I'm afraid that I can't replicate it on my installation, and when I check Domain Mapping code in /domain-mapping/classes/Domainmap/Module/Cdsso.php I can see the part you are referring to but the code seems correct and the closing bracket is not in the next row:

    So if I check my test site with mapped domain http://dubica.we.bs/ I don't see any console errors.

    It seem that there's something specific on your installation that's causing this issue for you.
    Can you please perform a conflict test by disabling your other plugins and switching to default WP theme and see if the error is gone after that?

    Best reagards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.