Do as I say, not as I do!



  • So I'm about to venture into the exciting world of WordPress plugins. Apparently a good list of what-not-to-dos is this article:

    http://planetozh.com/blog/2009/09/top-10-most-common-coding-mistakes-in-wordpress-plugins/ (won't open in a new window cause I'm lazy).

    But while reading this guy's rants about bad code I notice a block, it's the bottom one in the right column:

    Warning: require_once(/home/ozh/lib/simplepie/simplepie.inc) [function.require-once]: failed to open stream: Permission denied in /home/planetozh/planetozh.com/blog/wp-content/themes/planetozh/functions-feed.php on line 56

    Fatal error: require_once() [function.require]: Failed opening required '/home/ozh/lib/simplepie/simplepie.inc' (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear:/home/planetozh/planetozh.com/blog/wp-content/themes/planetozh') in /home/planetozh/planetozh.com/blog/wp-content/themes/planetozh/functions-feed.php on line 56

    From the fact that the messages are the very last bit of HTML code, I rather suspect that it's the bottom block because the rest of the page failed to load. Anyway: permission errors, what a moron and finally, TRWTF is of course setting error_reporting display_errors (ack sorry) to "on", on a production site.



  • The column is labelled "Communism" (!?)

    BTW, here's my number 1 WordPress plug-in tip: remember the site might be hosted on Windows! Or at least document that it isn't compatible with Windows. When I was running WP on Windows, it was amazing how many plug-ins failed because they had undocumented dependencies on Linux-specific stuff.



  • @blakeyrat said:

    The column is labelled "Communism" (!?)

    BTW, here's my number 1 WordPress plug-in tip: remember the site might be hosted on Windows! Or at least document that it isn't compatible with Windows. When I was running WP on Windows, it was amazing how many plug-ins failed because they had undocumented dependencies on Linux-specific stuff.

    That's definitely a good tip, because I'll be developing it at home on my desktop PC, on which I run Linux because I want to hang out with all the cool geeks. In deciding whether or not to distribute it (might look cool on my resumé?) I'll have to keep that in mind.



  • @toon said:

    So I'm about to venture into the exciting world of WordPress plugins. Apparently a good list of what-not-to-dos is this article:

    (won't open in a new window cause I'm lazy).

    But while reading this guy's rants about bad code I notice a block, it's the bottom one in the right column:

    Warning: require_once(/home/ozh/lib/simplepie/simplepie.inc) [function.require-once]: failed to open stream: Permission denied in /home/planetozh/planetozh.com/blog/wp-content/themes/planetozh/functions-feed.php on line 56

    Fatal error: require_once() [function.require]: Failed opening required '/home/ozh/lib/simplepie/simplepie.inc' (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear:/home/planetozh/planetozh.com/blog/wp-content/themes/planetozh') in /home/planetozh/planetozh.com/blog/wp-content/themes/planetozh/functions-feed.php on line 56

    From the fact that the messages are the very last bit of HTML code, I rather suspect that it's the bottom block because the rest of the page failed to load. Anyway: permission errors, what a moron and finally, TRWTF is of course setting error_reporting display_errors (ack sorry) to "on", on a production site.

    A rant about how to handle PHP errors in a blog post about Wordpress plugins... all you needed was a bit of JSON in there and I would have called WTF Bingo.



  • @toon said:

    @blakeyrat said:
    The column is labelled "Communism" (!?)

    BTW, here's my number 1 WordPress plug-in tip: remember the site might be hosted on Windows! Or at least document that it isn't compatible with Windows. When I was running WP on Windows, it was amazing how many plug-ins failed because they had undocumented dependencies on Linux-specific stuff.

    That's definitely a good tip, because I'll be developing it at home on my desktop PC, on which I run Linux because I want to hang out with all the cool geeks. In deciding whether or not to distribute it (might look cool on my resumé?) I'll have to keep that in mind.

    Save yourself the trouble and do it right from the get-go.



  • @Speakerphone Dude said:

    A rant about how to handle PHP errors in a blog post about Wordpress plugins... all you needed was a bit of JSON in there and I would have called WTF Bingo.

    What do you have against JSON?



  • @Speakerphone Dude said:

    A rant about how to handle PHP errors in a blog post about Wordpress plugins... all you needed was a bit of JSON XML in there and I would have called WTF Bingo.

    FTFY



  • @toon said:

    So I'm about to venture into the exciting world of WordPress plugins. Apparently a good list of what-not-to-dos is this article:

    (won't open in a new window cause I'm lazy).

    [...]
    It also has one of my pet peeves as "good advice":
    Use WP_PLUGIN_DIR, WP_PLUGIN_URL, plugin_basename( __FILE__ )
    Great, just encourage people to write plugins that load their assets (scripts, CSS) via HTTP on a page loaded as HTTPS, why don't you? I guess he's never heard of the functions for Determining Plugin and Content Directories, which handle the change in protocol (the constants don't because they're defined upfront, although that might be changing).


  • @rosko said:

    @toon said:

    So I'm about to venture into the exciting world of WordPress plugins. Apparently a good list of what-not-to-dos is this article:

    (won't open in a new window cause I'm lazy).

    [...]
    It also has one of my pet peeves as "good advice":
    Use WP_PLUGIN_DIR, WP_PLUGIN_URL, plugin_basename( __FILE__ )
    Great, just encourage people to write plugins that load their assets (scripts, CSS) via HTTP on a page loaded as HTTPS, why don't you? I guess he's never heard of the functions for Determining Plugin and Content Directories, which handle the change in protocol (the constants don't because they're defined upfront, although that might be changing).

    Why use a function? Just use relative URLs.



  • @morbiuswilters said:

    @rosko said:
    Great, just encourage people to write plugins that load their assets (scripts, CSS) via HTTP on a page loaded as HTTPS, why don't you? I guess he's never heard of the functions for Determining Plugin and Content Directories, which handle the change in protocol (the constants don't because they're defined upfront, although that might be changing).

    Why use a function? Just use relative URLs.

    That's OK for URLs you directly output, but the wp_enqueue* functions don't accept relative URLs (which I guess is another WTF in itself). As it is, parse_url() gets a lot of work in my templates, but using plugin_dir_url() et al in plugins helps ensure that enqueued assets will load with the correct protocol.



  • @toon said:

    [...], on which I run Linux because I want to hang out with all the cool geeks

    Try BSD:

    BSD vs Linux

     



  • @Severity One said:

    @toon said:

    [...], on which I run Linux because I want to hang out with all the cool geeks

    Try BSD:

    BSD vs Linux

     

    Nothing says "The Power To Serve" like short, chubby gals in cheap, unflattering latex.


  • Discourse touched me in a no-no place

    Looks like you (or someone here) hit a raw nerve:

    Ray(United States)
    commented, on 07/May/12 at 11:49 pm # :

    @tdwtf
    update to mistake 11
    finding an error and posting it publicly instead of contacting the author privately...
    doesn't make you look like some really incredible coder.
    it makes you look like a disgruntled hacker who tried to hack his site and failed and now you're mad...
    just sayin... think before you post
    Ray


  • @PJH said:

    Looks like you (or someone here) hit a raw nerve:

    Ray(United States)
    commented, on 07/May/12 at 11:49 pm # :

    @tdwtf
    update to mistake 11
    finding an error and posting it publicly instead of contacting the author privately...
    doesn't make you look like some really incredible coder.
    it makes you look like a disgruntled hacker who tried to hack his site and failed and now you're mad...
    just sayin... think before you post
    Ray

    Hmm. I must admit I didn't think to contact the owner of the blog. I kind of agree that that would have been the nice thing to do. However, I don't see how that error poses a security risk. Assuming, of course that WordPress isn't full of holes (of which I'm quite confident). If it looked serious, I would definitely have tried to contact the blogger.



  • @PJH said:

    Looks like you (or someone here) hit a raw nerve:

    That 'tdwtf' guy on the blog isn't me, for the record.



  • @morbiuswilters said:

    Nothing says "The Power To Serve" like short, chubby gals in cheap, unflattering latex.
     

    You shouldn't be so critical of yourself.



  • @morbiuswilters said:

    @Severity One said:

    @toon said:

    [...], on which I run Linux because I want to hang out with all the cool geeks

    Try BSD:

    BSD vs Linux

     

    Nothing says "The Power To Serve" like short, chubby gals in cheap, unflattering latex.

     

    Chubby? Really? I'd say she looks like a normal sized girl. We'll none of that size-zero crap here thank you.

     


  • Trolleybus Mechanic

    @ASheridan said:

    @morbs said:

    Nothing says "The Power To Serve" like short, chubby gals in cheap, unflattering latex.
     

    Chubby? Really? I'd say she looks like a normal sized girl. We'll none of that size-zero crap here thank you.

     

    It's always a fun and exciting time to witness the exact moment a thread derails into a unwinnable social-driven flamewar.

     



  • @Lorne Kates said:

    Filed under: The BSD vs. Linux post was a ruse-- or a warmup

    the bsd ruse was a.......... distaction


  • ♿ (Parody)

    @Lorne Kates said:

    It's always a fun and exciting time to witness the exact moment a thread derails into a unwinnable social-driven flamewar.

    Look, it's a known fact that anorexia and bulimia kill more people than texting while driving, proving that morbs is a psychopath. QED.



  • @morbiuswilters said:

    Save yourself the trouble and do it right from the get-go.
     

    Most. Valuable. Piece. Of. Advice. Ever.



  • @Lorne Kates said:

    It's always a fun and exciting time to witness the exact moment a thread derails into a unwinnable social-driven flamewar.

    Did you know Skyrim is super-sexist?



  • @blakeyrat said:

    @Lorne Kates said:
    It's always a fun and exciting time to witness the exact moment a thread derails into a unwinnable social-driven flamewar.
    Did you know Skyrim is super-sexist?
    Not to mention that there are no fat people in Skyrim.


  • Trolleybus Mechanic

    @Anketam said:

    @blakeyrat said:
    @Lorne Kates said:
    It's always a fun and exciting time to witness the exact moment a thread derails into a unwinnable social-driven flamewar.
    Did you know Skyrim is super-sexist?
    Not to mention that there are no fat people in Skyrim.
     

    They fed all the fat people to the lesbians so they could outbreed The Gays, and thus steal their inappropriate screen time.



  • @ASheridan said:

    Chubby? Really? I'd say she looks like a normal sized girl. We'll none of that size-zero crap here thank you.

    Hey, it's cool if you're into fat fetishism, nobody's judging..



  • @dhromed said:

    @morbiuswilters said:

    Nothing says "The Power To Serve" like short, chubby gals in cheap, unflattering latex.
     

    You shouldn't be so critical of yourself.

    This latex isn't cheap. Especially not when you have to buy a few dozen cubic yards. And unflattering? It accentuates my bulges, thank you very much.



  • @pkmnfrk said:

    the bsd ruse was a.......... distaction
     

    IT KEEPS HAPENIG



  • @dhromed said:

    @pkmnfrk said:

    the bsd ruse was a.......... distaction
     

    IT KEEPS HAPENIG

    where doing it man

    where MAKING THIS HAPPEN


Log in to reply