This may sound simple, but it's not :)
What I want, and most likely many theme developers do (themes that use javascript / jquery), is to warn the theme user that his site has javascript errors.
In my themes at least, in about 95% of these error situations, the problem comes from outdated / badly-written installed plugins. The other 5% comes from conflicts between up-to-date plugins and the theme. So my message would suggest the user to check his plugins one by one and fix the issues.
I found a solution for this, but only for the dashboard (in my theme settings). Essentially what I'm doing is loading the home page inside an iframe and wait 5 seconds for a function inside the iframe's document.ready()
to send me the "OK" message. If it doesn't come, I display the error (I'm using postMessage to communicate with the iframe document).
Anyway, my question is how can I do this from the front page too? Without using pm, because it's too heavy (in the theme settings it's ok, because it's used for live design tweaks too)
Other unreliable solutions:
- add the message just after
<body>
, and hide it with javascript (with js after the message); the problem is that errors might come up after the check - add the message anywhere in the HTML, and remove it with jQuery on document.ready; unacceptable because the user sees the message for 2-3 seconds, during which the site is loaded...
current_user_can( 'manage_options' )
?developer
which gets the admin caps plus a special one to display dev stuff?