1179 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. :)

395 posts
  • Located in Madagascar
  • Has sold $40,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Helped several times protecting Envato Market against copyright violations
+6 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
366 posts WordPress Guy
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+5 more
Japh Envato team 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…

1179 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 ).

34 posts
  • Has been part of the Envato Community for over 3 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!

1179 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:

366 posts WordPress Guy
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+5 more
Japh Envato team 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 1 year
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
  • Located in Europe
+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>';
by
by
by
by
by
by