1291 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 more
Smartik says

How can I debug a Wordpress theme? I’m trying to debug/check for deprecated(forbiden) functions etc. I have installed Theme Check Plugin but looks like itself is broken and does not work.

ThemeCheck plugin return me 1xxxxx lines of notices(errors) and a fatal error to the end(Fatal error: Maximum execution time of 30 seconds exceeded in D:\xampp\htdocs\wordpress342\wp-content\plugins\theme-check\checks\i18n.php on line 28). Anyway this is not the problem.

Which plugins do you use to check your themes for errors? Please advice. :)

451 posts Math is easy; design is hard
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Won a Most Wanted contest
  • Sells items exclusively on Envato Market
+7 more
metrothemes says
Enable WP_DEBUG and fix all the notices and warnings
- Install http://wordpress.org/extend/plugins/developer as “Theme for a self-hosted WordPress installation”, and let it install the following debug tools:
  • Debug Bar
  • Debug Bar Cron
  • Log Deprecated Notices
  • Monster Widget
    • Theme Check
373 posts WordPress Guy
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Located in Australia
+4 more
Japh says

If Theme Check itself isn’t working, trying disabling all plugins and using the default theme, and then gradually re-enable things to see which is breaking the site.

280 posts
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
PrimaThemes says

ThemeCheck plugin return me 1xxxxx lines of notices(errors) and a fatal error to the end(Fatal error: Maximum execution time of 30 seconds exceeded in D:\xampp\htdocs\wordpress342\wp-content\plugins\theme-check\checks\i18n.php on line 28). Anyway this is not the problem.

I’ve experienced this strange one before. After countless hours investigation, I found the issue came from bad written code in one line!!! I need to move the files on my theme and then include it one by one to find the culprit. Sorry, I couldn’t share the example, I forgot to save it… :(

Right now, every time I make small changes to my code, I always test it using Theme Check, to make sure it doesn’t happen to me again in the future…

1291 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 more
Smartik says

Thanks for replies. I appreciate that.

I forgot to say that my theme works perfectly, I always have WP_DEBUG enabled and I have 0 warnings/notices even on a clean instalation. Looks like I did a mistake somewhere, that’s why ThemeCheck plugin does not work.( http://wordpress.org/support/topic/plugin-theme-check-notice-uninitialized-string-offset-7952-in-i18nphp-on-line-27 ).

35 posts
  • Has been part of the Envato Community for over 4 years
Delpierooo says

Hi,

I have the same issue.

PrimaThemes can you tell us which line of code it was? It might be the same issue for me. What would be the best way to investigate which theme code could be causing this?

Thanks in advance!

1291 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 more
Smartik says

I think is a good idea to answer my own question with a solution since I found it.

The problem was that I had html tags inside of translation functions. Example:
_e('<strong>Here is my text to translate.</strong>','text_domain')
changed to this:
echo '<strong>'. _e('Here is my text to translate.','text_domain') .'</strong>';

:whistle:

373 posts WordPress Guy
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Located in Australia
+4 more
Japh says

Excellent work finding that! Thanks for posting the solution too :)

11 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
rffa says

Post a bit old but I think it’s important to say. I’m developing my first premium theme and I had the same issue. The problem was related to translation functions too. In this case, an open parenthesis.

_e('Sorry =(  I dont have any posts with: ', 'text_domain')

That face =( was creating the problem. So I got rid of it. Now it’s just:

_e('Sorry , I dont have any posts with: ', 'text_domain')
1 post
  • Has been part of the Envato Community for over 2 years
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
toleanu says

I think is a good idea to answer my own question with a solution since I found it. The problem was that I had html tags inside of translation functions. Example:
_e('<strong>Here is my text to translate.</strong>','text_domain')
changed to this:
echo '<strong>'. _e('Here is my text to translate.','text_domain') .'</strong>';
:whistle:
You should not use e under echo (use _()):
echo '<strong>'. __('Here is my text to translate.','text_domain') .'</strong>';

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by