missing tab in settings
-
So, almost a year and this problem is still unresolved: Admin tab in settings is missing. Has anyone else solved it?
-
That problem is almost always caused by JavaScript-related bugs in other plugins or themes, so it’s impossible to permanently resolve it in Admin Menu Editor. Instead, the solution is to figure out which plugin is causing the conflict and to either deactivate it or fix the bug.
In this case, it looks like one of the JS files that’s part of AME is either missing or can’t be loaded. Have you recently installed any new plugins or added any code to
functions.php? Things that change how scripts are loaded – such as caching tools, URL/domain mapping, performance optimization plugins – are the most likely culprits. Try temporarily deactivating those plugins/removing the code.I understand it’s a conflict but it came after AME update 10 months ago, when I had installed less plugins than now (no caching tools or scripts though). I do have added some codes to functions.php since, but they are basic Worpdress stuff using core functions. My site is now too complex to go delete codes here and there… I was hoping that the latest AME had overcome this, just as it came out of the blue.
Are any of those
functions.phpsnippets related to adding the “defer” attribute toscripttags, by any chance? I’ve received a few similar problem reports in the past month or two where it turned out the same piece of code was to blame. However, if the problem appeared 10 months ago, it could be something different.If you like, I could take a look at your site and see if I can find what’s causing the conflict. This would require admin access. It’s not safe to post login details in a public forum, so please can contact me via email:
whiteshadow@w-shadow.comOf course, if you’re not comfortable with giving other people admin access, that’s perfectly understandable. In that case, I’d recommend selectively commenting out the code snippets – see if it fixes the problem, and if it doesn’t then you can just uncomment them. The same goes for plugins: deactivate one of them for a minute, check if AME starts working, then reactivate the plugin.
At my first hacking attempt I found there was only one “defer” snippet in functions.php, I commented it and the menu is now visible.
The code is for improvind speed:/* Remove query strings from static resources. This ensures that they are cached like other elements.*/ function ewp_remove_script_version( $src ) { return remove_query_arg( 'ver', $src ); } add_filter( 'script_loader_src', 'ewp_remove_script_version', 15, 1 ); add_filter( 'style_loader_src', 'ewp_remove_script_version', 15, 1 ); * /* Defer parsing of Javascripts using the HTML5 defer property */ function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) return $url; if ( strpos( $url, 'jquery.js' ) ) return $url; return "$url' defer "; } add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );What do you suggest then?
The
defer_parsing_of_jsfunction is buggy. It will produce HTML like this:<script type="text/javascript" src="http://example.com/script.js" defer ">Notice the quote character
"just before the closing angle bracket. That’s invalid HTML. It will make the browser miss the end of the tag, which will prevent some scripts from being loaded. This mostly affects plugins that use a lot of JavaScript, like Admin Menu Editor. Plugins that don’t rely on JS might still work fine.I’d recommend completely removing that code. It’s broken and it has the potential to conflict with other plugins, not just AME.
/* Defer parsing of Javascripts using the HTML5 defer property */ function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) return $url; if ( strpos( $url, 'jquery.js' ) ) return $url; return "$url' defer "; } add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );If you really need to defer JS, please look for a different solution.
uops… thank you for the safety warning! I found that snippet online and I just copied it (I’m no PHP expert) thinking it would help my slow site. I don’t even know if deferring JS would actually speed things up.
But many tutorial about deferring JS are pointing to the same code above. One particular has got a little modification, i.e.
// return “$url’ defer “;
return “$url’ defer onload='”;
so he basically commented the bad line and added a new one.
I have tested and AME is working with also this defer code active! 🙂Well, you have been of great help, let’s mark this topic “resolved”.
The topic ‘missing tab in settings’ is closed to new replies.