WordPress.org

Ready to get started?Download WordPress

Forums

Genericon'd
[resolved] Debugger notice (22 posts)

  1. violacase
    Member
    Posted 4 months ago #

    Theme TwentyFourteen with active DEBUG says:
    Notice: Undefined variable: genericon_rotate in /path/to/genericons.php on line 116

    TIP: It's a silly little bug. Better test your plugins fully with debugger before publishing.

  2. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    Irony? I'm on the plugin review team and I did! Just pushed the wrong file. I'll fix this today *sigh*

    See? Nobody's perfect!

  3. violacase
    Member
    Posted 4 months ago #

    ;-)

  4. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    Huh... That's so weird that I DON'T see that error with Debug on.

    But still, I see where that would be caused. There's no fall back for it.

    Version 3.0.3.3 coming in a moment.

  5. violacase
    Member
    Posted 4 months ago #

    Sure you don't run any cache services? Otherwise you really have to rethink your WordPress setup.

  6. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    On MAMP? Naaah. I always dev on localhost with no caching, then I go to a live site and test uploading. THEN it goes into real sites.

    (I also don't run caching on my live sites like most people mean - no WP Super Cache or W3 Total Cache. Memcached, PHP ZendOptimizerPlus, and Varnish for the most part.)

  7. violacase
    Member
    Posted 4 months ago #

    Well, I've noticed you defined the var genericon_rotate in the last update.

    Still it's odd you couldn't see the debugger notice.
    I also do my tests without any cacheing on the server side. For WordPress I've installed the famous Debug Bar plugin and Kint Debug.

    For Chrome I use the very handy Clear Cache add on.

  8. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    Yeah, not having a default was certainly not correct (now it's 'normal').

    I have that add-on as well. I even went and spun up a VVV install (just figured that out today) and couldn't catch it. What version of PHP are you using? I tested on 5.4 and 5.3.

  9. violacase
    Member
    Posted 4 months ago #

    Hi Mika,

    The site that showed the bug runs on PHP 5.3.3 Apache mode.
    Last idea: did you actually test some code with any undefined var(s)?
    A good debug setup MUST inform you. What's the use of debugging otherwise?

  10. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    Nup, had a totally naked site, never installed the plugin, fresh DB. That's why I love Vagrant. Well I'll keep banging on that. What page did you get the notice on? On display? On every page?

  11. violacase
    Member
    Posted 4 months ago #

    Mika,

    First things first:
    1. Deactivate your plugin.
    2. Deliberately put some errors in your plugin code.
    3. Activate your plugin and see what happens. Check debug console.
    4. Call your code on any page/post/function and see what happens. Check debug console.

    If debugger catches all errors problem is solved.

    If not, notice me. My debugging practice is simple but works. I can explain my debug setup in more detail but please first try yourself.

    NOTA: Are you sure you have Debug Bar plugin running? Standard WP_DEBUG doesn't show Warnings and Notices.

  12. esmi
    Forum Moderator
    Posted 4 months ago #

    I've just installed & activated the plugin on one of my local server sites (PHP 5.3.3 Apache) - the one that's set up to log every warning and error to hell & back for theme reviews. I couldn't see any error messages - not in the front end or the back end. Nada. Zilch.

    HTH

  13. violacase
    Member
    Posted 4 months ago #

    @esmi:

    The plugin has been updated and works fine now. This topic already was marked as 'resolved'. @mika and I are just exchanging some afterthoughts now. Perhaps not the best place. Sorry...

  14. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    Nah, it's fine :)

    violacase - "Check debug console."

    WHICH console? This may be the actual answer to everything. The browser's console or WPs (which you can only get if you have a debug bar type plugin)

  15. violacase
    Member
    Posted 4 months ago #

    Well, you can choose whatever setup you'd like. There are Chrome add-ons for PHP, independent system watchers, etc.

    Whatever you set up: there's always SOME kind of console to watch the debugging info. I'll give you my setup:

    On the server side:
    In wp-config.php: define('WP_DEBUG', true);
    Installed WordPress plugins: Debug Bar and Kint Debugger.
    On the client side (Win8) Chrome with its great Inspector. Here I can closely watch and trace HTML, CSS and Javascript on the fly. Above this 8 extensions that do their own great work. Google on DevTools...

    That's all. Works fine for me. I think this should be enough info.
    Happy coding!

  16. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    Right. I get you think you're being helpful, but if you don't tell me what one you happened to be looking at when you saw that specific error, it's really not useful.

    I know how to test, and use a debugger, and using the debug bar and define, I still don't get THAT specific error. So for you to really be helpful you could explain something like "When I have chrome inspector open and visit a post where I'm using a genericon, I see this error..."

    Instead, you've been maddeningly vague. Again, I know you have good intentions, but it's really not the sort of information I need to understand how to reproduce your error. A good bug report has specific directions to reproduce, maybe a screenshot if you're not sure how to describe it :) this just happened to be one I could see as non optimal code, so you were lucky.

  17. violacase
    Member
    Posted 4 months ago #

    Gee...
    I'll reproduce the bug:

    In your plugin comment line 112 $genericon_rotate = 'genericon-rotate-normal';

    Now you have an undefined var.

    Create a post with this single line in the content area:
    [genericon icon=flag]

    View the post. Voilá.

    I end this conversation: have better things to do.

  18. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    Where does the error display?

    I did that and did not get an error in the WP debug bar, debug output, or debulg log. Hence my confusion. That's why I keep asking where :)

  19. violacase
    Member
    Posted 4 months ago #

    OK.
    With júst WP_DEBUG true:

    Look at this page on a test site

  20. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    Thank you. I still can't reproduce that, but I'm gonna keep trying since it implies an outlier issue with code in general I need to be aware of.

  21. violacase
    Member
    Posted 4 months ago #

    My last words Mika.

    It's very simple to reproduce, but please follow the steps I describe.

    Step 1. Read this.
    Step 2. Be sure that in the file wp-config.php (in the root of your site) this line exists:
    define('WP_DEBUG', true);
    Step 3. Follow the steps I mentioned earlier. E.g.:

    In your plugin comment or DELETE line 112 $genericon_rotate = 'genericon-rotate-normal';

    (Now you have an undefined var)

    Create a post with this single line in the content area:
    [genericon icon=flag]

    Save and view the post. You'll see WordPress echoes the bug notice.

    It that doesn't give you the solution I'm helpless and you have to seek for others who would like to help you.

  22. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 4 months ago #

    Yeah, I did all that. That's why I'm confiused too! :D

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.