subscribe-to-comments domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home1/davoscri/public_html/wp-includes/functions.php on line 6170I have a WordPress Multisite instance which uses WordPress MU Domain Mapping plugin to map domains like domain1.com with the subdomains in my WordPress network like: domain1.mynetwork.com.
Yasterday I started using Frontend Editor plugin in my network as a “must use” plugin (inside mu-plugins folder), but noticed it didn’t work in mapped domains but it did with no problem in no mapped websites (subdomain.mynetwork.com). A little bit of research showed me that the problem as that some of the Javascript files used by FEE (Frontend Editor) were not being included with the propper URL in the src attribute, like this:
OK (no mapped domains):
<script src="http://subdomain.mynetwork.com/wp-content/mu-plugins/front-end-editor/lib/aloha-editor/lib/aloha.js" ...
WRONG (mapped domains):
<script src="http://mapped-domain.coms" ...
So, it looked like there was a problem when generating the javascript files URL, time to read the plugin code! This is a step by step description of what I did:
'src' => plugins_url( 'lib/aloha-editor/lib/aloha.js', FEE_MAIN_FILE ),So, to recap, I’ll show you which pieces of code I replaced. Italic is the original code, Bold is the one I replaced it with:
Line #61 /wp-content/mu-plugins/front-end-editor/php/core.php
if ( in_array( 'rich', $wrapped ) ) {
//wp_register_style( 'aloha-editor', plugins_url( 'lib/aloha-editor/css/aloha.css', FEE_MAIN_FILE ), array(), ALOHA_VERSION );
wp_register_style( 'aloha-editor', WPMU_PLUGIN_URL.'/front-end-editor/lib/aloha-editor/css/aloha.css', array(), ALOHA_VERSION );
$css_dependencies[] = 'aloha-editor';
}
Line #92 /wp-content/mu-plugins/front-end-editor/php/core.php
} else {
$min = defined('SCRIPT_DEBUG') ? '' : '.min';
//self::register_script( 'fee-editor', "build/editor$min.js" );
wp_enqueue_script( 'fee-editor', WPMU_PLUGIN_URL."/front-end-editor/build/editor$min.js" );
$css_path = ‘build/editor.css’;
}
Line #99 /wp-content/mu-plugins/front-end-editor/php/core.php
// Core style
//wp_register_style( 'fee-editor', plugins_url( $css_path, FEE_MAIN_FILE ), $css_dependencies, FEE_VERSION );
wp_register_style( 'fee-editor', WPMU_PLUGIN_URL.'/front-end-editor/'.$css_path, $css_dependencies, FEE_VERSION );
scbUtil::do_styles( 'fee-editor' );
Line #144 /wp-content/mu-plugins/front-end-editor/php/core.php
echo html( 'script', array(
//'src' => plugins_url( 'lib/aloha-editor/lib/aloha.js', FEE_MAIN_FILE ),
'src' => WPMU_PLUGIN_URL.'/front-end-editor/lib/aloha-editor/lib/aloha.js',
'data-aloha-plugins' => implode( ',', $plugins )
) ) . "\n";
People, I hope this help others but also I hope Scribu get to see this and comment something, as long as I have tried this, it works, but maybe he has something to say about my “fix” because remember this is not an official fix.
** Note for Scribu: I get this warning in Chrome: “event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future”. Maybe it can be fixed by using a more general attribute of the event?
Thanks a lot and best regards to all of you.
Davo.
As you can see in the comments of this post, I shared some thoughts with Scribu, Front-end Editor plugin’s author and after some research on the issue I found what I think is a bug (?) in the WordPress MU Domain Mapping plugin, so if you are having the same problem described in this post I’d say forget about hacking Front-end Editor plugin and try this new small fix in Domain Mapping plugin instead.
thoughts
]]>