Visual Editor missing after 3.9 (30 posts)

  1. Like some others, I have had the visual editor disappear from some sites after updating to 3.9. I've been asked to make a separate post. Here's what I have done & found:

    I did have this problem on a few single-install (regular WP) sites, but discovered that when I deactivated all plugins, then re-activated them, the visual editor reappeared and stayed. I could not identify the plugin which caused the issue, but those sites resolved.

    I'm still having this issue of no visual editor on several sites in a multisite install. There are 55+ sites in the install, but only 10 are affected. Those 10 don't seem to have any common themes or plugins that aren't also on unaffected sites.

    Changing the theme to TwentyThirteen does not make a difference.

    I have tried deactivating both all the site-activated and network activated plugins (thinking my single-site solution would work), but it didn't.

    Adding define('SCRIPT_DEBUG', true);, to wp-config.php did not fix this issue.

    Using this post, http://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors, I am finding this error: TypeError: r is undefined tinymce.min.js:8

    Ideas for what else to try?

  2. I've checked error logs: nothing to report there (except that NextGEN Smooth Gallery has been having a MySQL syntax error for more than a week that I didn't know about--that plugin is deactivated & did not affect the visual editor issue).

    While I did deactivate all the network activated plugins and the plugins for my affected site at the same time, there would have still been other site-activated plugins active. It would be a HUGE task on 55+ sites to document which sites have which plugins site-activated, deactivate them all (although this could be done via FTP, I guess), then reactivate & restore settings. I'm hoping to avoid that.

  3. I also looked at this with Chrome, and got this slightly different error message for the same file:

    "Uncaught TypeError: Cannot read property 'documentBaseURL' of undefined tinymce.min.js?ver=4021-20140412:8"

    It looks like there was a similar issue in the development of 3.9 (https://core.trac.wordpress.org/ticket/26750). Any clue what I could try to get my visual editors back?

    Ipstenu replied here (http://wordpress.org/support/topic/39-visual-editor?replies=19) that my fix on the single-install sites sounded like the sites needed to have jquery forcibly reloaded. How would I do that on a multisite with 55+ sites?

  4. Also, since "define('SCRIPT_DEBUG', true);" didn't solve my issue, should I now take it out of wp-config.php?

  5. Maybe this image of the full error message will help:

  6. finaldesign
    Posted 1 year ago #

    Hi Bet!
    I had just resolved the same problem with visual editor on one of my sites. I have managed to replicate it in my local XAMPP installation as on live linux production server.
    The problem was with the plugin "navis media credit", used in LargoProject theme. If you try to disable that plugin it will stay activated anyway and your visual editor wont work. If you switch to another theme visual editor is still not working. Only when you mannualy delete plugin via FTP from server it get's deactivated, and visual editor then works fine.

    I hope that helps,

  7. Hi finaldesign! Thanks for replying.

    I am not using that particular plugin.

    I have 10 sites in my multisite install that are affected, and I've been through the lists of plugins that each are using, and there is no plugin that is common only to these affected sites. They are using some of the same plugins, but those plugins are also being used on non-affected sites.

  8. Leaving the script debug won't hurt anything.

    ps_editor.js is actually the one that jumped out at me, because it's NOT a part of core! Can you search the files in your site for that one?

  9. Hi Mika! Thanks for replying!

    That plugin is PS Disable Auto Formatting, which was network activated. I deactivated it, but that didn't make the visual editor appear, nor did deleting the plugin (even after deleting the browser cache-- not using caching plugins). I'm also still getting the js error message-- the same one in the image-- still including ps_editor.js!

    Below is the content of the file that is referenced (ps_editor.js), the lines the error references are 7 & 39. Maybe that will help?

    var switchEditors = {
    	switchto: function(el) {
    		var aid = el.id, l = aid.length, id = aid.substr(0, l - 5), mode = aid.substr(l - 4);
    		this.go(id, mode);
    	go: function(id, mode) { // mode can be 'html', 'tmce', or 'toggle'
    		id = id || 'content';
    		mode = mode || 'toggle';
    		var t = this, ed = tinyMCE.get(id), wrap_id, txtarea_el, dom = tinymce.DOM;
    		wrap_id = 'wp-'+id+'-wrap';
    		txtarea_el = dom.get(id);
    		if ( 'toggle' == mode ) {
    			if ( ed && !ed.isHidden() )
    				mode = 'html';
    				mode = 'tmce';
    		if ( 'tmce' == mode || 'tinymce' == mode ) {
    			if ( ed && ! ed.isHidden() )
    				return false;
    			if ( typeof(QTags) != 'undefined' )
    			if ( tinyMCEPreInit.mceInit[id] && tinyMCEPreInit.mceInit[id].wpautop )
    				txtarea_el.value = t.wpautop( txtarea_el.value );
    			if ( ed ) {
    			} else {
    				ed = new tinymce.Editor(id, tinyMCEPreInit.mceInit[id]);
    			dom.removeClass(wrap_id, 'html-active');
    			dom.addClass(wrap_id, 'tmce-active');
    			setUserSetting('editor', 'tinymce');
    		} else if ( 'html' == mode ) {
    			if ( ed && ed.isHidden() )
    				return false;
    			if ( ed ) {
    				txtarea_el.style.height = ed.getContentAreaContainer().offsetHeight + 20 + 'px';
    			dom.removeClass(wrap_id, 'tmce-active');
    			dom.addClass(wrap_id, 'html-active');
    			setUserSetting('editor', 'html');
    		return false;
    	_wp_Nop : function(content) {
    		var blocklist1, blocklist2;
    		// Protect pre|script tags
    		if ( content.indexOf('<pre') != -1 || content.indexOf('<script') != -1 ) {
    			content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
    				a = a.replace(/<br ?\/?>(\r\n|\n)?/g, '<wp_temp>');
    				return a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp_temp>');
    		// Pretty it up for the source editor
    		var blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p';
    		content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'mg'), '</$1>\n');
    		content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'mg'), '\n<$1>');
    		content = content.replace(new RegExp('<p( [^>]*)?>[\\s\\n]*<(/?script[^>]*)>', 'mg'), '\n<$2>');
    		content = content.replace(new RegExp('<(/?script[^>]*)>[\\s\\n]*</p>', 'mg'), '\n<$1>');
    		// Fix some block element newline issues
    		content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
    		content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
    		content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
    		content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
    		var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
    		content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
    		content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'mg'), '</$1>\n');
    		content = content.replace(new RegExp('<li([^>]*)>', 'g'), '\t<li$1>');
    		if ( content.indexOf('<object') != -1 ) {
    			content = content.replace(new RegExp('\\s*<param([^>]*)>\\s*', 'mg'), "<param$1>");
    			content = content.replace(new RegExp('\\s*</embed>\\s*', 'mg'), '</embed>');
    		// Unmark special paragraph closing tags
    		content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
    		content = content.replace(new RegExp('\\s*(<p [^>]+>.*</p>)', 'mg'), '\n$1');
    		content = content.replace(new RegExp('<p>\\s*</p>', 'mg'), "<p>&nbsp;</p>\n");
    		// put back the line breaks in pre|script
    		content = content.replace(/<wp_temp>/g, '\n');
    		return content;
    	_wp_Autop : function(pee) {
    		// filtered when switching html to visual
    		var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|script';
    		var blocklist2 = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|h[1-6]|script';
    		pee = pee + "\n\n";
    		pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
    		pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
    		pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
    		pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
    		pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "<p>$1</p>\n");
    		pee = pee.replace(new RegExp('<p( [^>]*)?>[\\s\\n]*</p>', 'mg'), "<p$1>&nbsp;</p>\n");
    		pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
    		pee = pee.replace(new RegExp("<p>(<li.+?)</p>", 'gi'), "$1");
    		pee = pee.replace(new RegExp("<p ?[^>]*>(<!--(.*)?-->)", 'gi'), "$1");
    		pee = pee.replace(new RegExp("(<!--(.*)?-->)</p>", 'gi'), "$1");
    		pee = pee.replace(new RegExp('<p>\\s*<blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
    		pee = pee.replace(new RegExp('</blockquote>\\s*</p>', 'gi'), '</p></blockquote>');
    		pee = pee.replace(new RegExp('<p>[\\s\\n]*(<(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
    		pee = pee.replace(new RegExp('<p>[\\s\\n]*(</(?:'+blocklist2+')[^>]*>)', 'gi'), "$1");
    		pee = pee.replace(new RegExp('(<(?:'+blocklist2+')[^>]*>)[\\s\\n]*</p>', 'gi'), "$1");
    		pee = pee.replace(new RegExp('(</(?:'+blocklist+')[^>]*>)[\\s\\n]*</p>', 'gi'), "$1");
    		pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
    		pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
    		pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
    		// Fix the pre|script tags
    		pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
    			a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
    			return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
    		return pee;
    	pre_wpautop : function(content) {
    		var t = this, o = { o: t, data: content, unfiltered: content },
    			q = typeof(jQuery) != 'undefined';
    		if ( q )
    			jQuery('body').trigger('beforePreWpautop', [o]);
    		o.data = t._wp_Nop(o.data);
    		if ( q )
    			jQuery('body').trigger('afterPreWpautop', [o]);
    		return o.data;
    	wpautop : function(pee) {
    		var t = this, o = { o: t, data: pee, unfiltered: pee },
    			q = typeof(jQuery) != 'undefined';
    		if ( q )
    			jQuery('body').trigger('beforeWpautop', [o]);
    		o.data = t._wp_Autop(o.data);
    		if ( q )
    			jQuery('body').trigger('afterWpautop', [o]);
    		return o.data;
  10. I'm also still getting the js error message-- the same one in the image-- still including ps_editor.js!

    Hmmm. Do you have any server side caching going on, like memcached?

  11. Not that I know of. I'm on Mediatemple's gs server. Should I be able to tell if they have some server caching going on?

  12. Maybe... Can you restart apache on that server? Ask MT to do it, I think it's overkill but it should force clear the cache.

  13. MediaTemple says they run Varnish on their GRID server. They tell me because it is a shared server, they can't reset Varnish, or restart Apache.

    Other ideas?

  14. finaldesign
    Posted 1 year ago #

    Im sure its a plugin issue or maybe template functions file is customized?

  15. smrtcookie83
    Posted 1 year ago #

    I'm not sure if I'm posting this in the right place, but I updated to 3.9 yesterday and I can't even write a post, let alone add media anymore. I use the Genesis framework and a theme I purchased called "Foodie". I tried deactivating my plugins and that didn't work. Any ideas?

  16. bemdesign
    Posted 1 year ago #

    @smrtcookie83 - Per the forum guidelines (you did read them right? :-) ), please post your issue as a new post in the support forums.

  17. @smrtcookie83, start by trying this: http://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors, (although the instructions here are for older versions of these browsers, and you may need to google more updated instructions, like I did).

  18. The mystery deepens:

    My quick look through the multisite shows that only 10 of 555+ sites are affected. Last night, I got an email from a client on one of the UNaffected sites, telling me he can't switch into Visual editor. He describes the problem I am having exactly.

    So I thought initially maybe caching had led me to believe that there were unaffected sites at all-- since really, doesn't it make more sense for multisite subsites to ALL be affected by a TinyMCE issue?

    But I can't replicate the issue on the client's site. It remains unaffected for me. The client is a pretty tech savvy guy, so I'll ask him to look for js errors.

  19. My visual editors are back up! Yaay!

    Maybe there was some caching that wasn't emptying before – no clue.

    Based on the fact that the plug-in was working on a majority of my other sites, I reinstalled and activated PS Disable Auto Formatting, and the visual editors stayed working.

    On another post, when I commented that disabling all plug-ins and re-enabling them made the issue go away, Ipstenu commented that perhaps the JavaScript needed to be forced into refreshing. Whatever did it, I'm just happy to have everything back! :-)

    Thanks to all the great support forum folks were patiently answering all of our questions when these updates turn our sites upside down!

  20. Just a followup, in case it can be helpful for someone else:

    I discovered that the plugin PS Disable Auto Formatting, while it had been network activated, must have at some point, been single site activated on a handful of sites before the network activation. These sites were curiously not among the affected sites, but somehow that seemed to be the source of my js errors.

    I used Network Plugin Auditor to be able to see that some sites had the plugin still activated (even after changing the directory name via ftp--so maybe that's a multisite peculiarity?). Then, I used Multisite Plugin Manager to mass deactivate the plugin on those sites.

    That cleared up my problem, and I was then able to network reactivate the plugin with no more issues.

  21. ronzastovnik
    Posted 1 year ago #

    Hi Bet,
    Yep, PS Disable Auto Formatting was it. I had the same problem and disabled the plugin then re-activated it. My Visual Editor tab is working now, so far. Hope it doesn't happen again. Maybe they'll release an update. Thanks for the posts.

  22. Unfortunately, I have a multisite subsite client still reporting not being able to access the visual editor, so it looks like just deactivating & reactivating didn't completely do it. :-(

    I'm trying out this plugin with a similar function (which happily seems like it is being more actively supported): Disable Automatic P Tags.

  23. ronzastovnik
    Posted 1 year ago #

    It acts like the Text tab "sticks". I was editing fine until I went to the Text mode, did some editing there and updated my page. Then I couldn't go back to the Visual mode. Had to deactivate the PS Disable plug-in, then go to the editor, click the Visual tab, then go back and activate PS Disable.

    Just de-activating and re-activating the PS Disable didn't do it. Had to open the editor and click the Visual tab in between.

    Looks to me like PS Disable plug-in needs an update, but I see that plug-in hasn't been updated in 2 years. Looks like time for a replacement.

  24. Just a followup fyi: the plugin author released an update today to make it compatible with 3.9!

  25. Michael
    Posted 1 year ago #

    Yep, that was it. My site was showing the same problem, Bet, and the update to the new PS Disable Auto Formatting solved my problem.

    Thanks for posting on this and the level of detail you provided, it helped me solve the problem quickly (and saved me from digging deep into the plugin code).


  26. rayds
    Posted 1 year ago #

    After the trial & error of deactivating than reactivating each plugin, Visual Editor returned after deactivating Free Stock Photos Foter by Innovaweb Sp. z o.o. plugin.

  27. Aunty Ann
    Posted 1 year ago #

    Thank you so much for that advice rayds. I was going crazy trying to find the missing visual editor.
    I had purchased a Free Stock Photos plugin called Image Pressr and, as I had paid for it I obviously wanted to use it!
    But once I had deactivated it - having stored the image I want in the media library - the visual editor came back!
    Thanks so much. You have saved me hours of frustration! It is now gone midnight so I can finally go to bed and stop worrying about it!

  28. ishulman
    Posted 1 year ago #

    I had been having the same problem with the missing visual editor for about 2 weeks. Switching and resetting my browsers didn't work at all. I could only see the HTML and had no option to toggle between visual and HTML tabs.

    Thankfully, Apple was able to help me resolve the problem and I wanted to share the solution because it was actually very easy and the problem was quite maddening.

    They had me:
    a) Open a new finder window and select the Macintosh HD option
    b) Select the Library option
    c) Go to the LaunchAgents folder and trash the contents (save them in a folder on your desktop if you want to reinstall them one by one later)
    d) Go to the LaunchDaemons folder and trash the contents (save them in a folder on your desktop if you want to reinstall them one by one later)
    e) Go to the Internet Plug-Ins folder and remove those you don't need
    f) Hold down the OPTION key and select the Library option from the GO menu at the top of your screen
    g) Go to your user-specific Internet Plug-Ins folder and remove those you don't need (again, save them in a folder on your desktop if you want to reinstall them one by one later)
    h) Do the same with the contents of your user-specific LaunchAgents folder
    i) Reset your browser
    j) Restart your computer.

    That resolved my problem with a missing visual editor.
    The morals of this story: Don't give up and Always buy AppleCare. ;)

  29. Processtwo
    Posted 6 months ago #

    Hello everyone!

    My issue with the missing Visual Editor is that it's visible from other computers and my phone but not my laptop. I have tried every "fix" I have come across with no resolution. Even now, I have downloaded Firefox to test it along with Chrome and IE. I've called GoDaddy...no help there.

    This is my third week troubleshooting and it's annoying because I cannot read HTML code. At all.

    Can anyone assist? It would be greatly appreciated.

    Thank you!

  30. WPyogi
    Forum Moderator
    Posted 6 months ago #

    @Processtwo - no one can assist in this thread - it's almost a year outdated and I HOPE you are not using WP 3.9 which is the topic of this thread. Please start your own thread here:


Topic Closed

This topic has been closed to new replies.

About this Topic