WordPress? php error showing on Oxford Online English Dictionary





  • Seems to be coming from their blog. Which may quite reasonably be running a BLOGGING system.

    Which to be fair, looks even worse. At least the dictionary part is usable.



  • My god, it's everywhere.

    Poor [whoever is in charge].



  • Yup... That's pretty bad, especially since it looks like that formatting.php file is part of core WP.

    [snip]
    // Look for shortcodes and HTML elements.
    
    preg_match_all( '@\[/?([^<>&/\[\]\x00-\x20=]++)@', $text, $matches );
    $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
    $found_shortcodes = ! empty( $tagnames );
    $shortcode_regex = $found_shortcodes ? _get_wptexturize_shortcode_regex( $tagnames ) : '';
    $regex = _get_wptexturize_split_regex( $shortcode_regex );
    [snip]
    

    No idea why $shortcode_tags would be null, or why WP does not check for it instead of shitting itself.



  • Looks like the dog did it.


  • SockDev

    Because it's WordPress, need you ask any further?



  • Ah yes... For a brief happy momen I forgot what a shithole Wordpress is.
    Wordpress is the type of "software" that gives PHP a bad word...


  • SockDev

    Which is impressive because PHP gave itself a terrible reputation before WP was even a thing.



  • Truth... But WP most certainly dows not help getting it better...
    If you have ever tried to develop a plugin for WP you will know what a strinking pile of utter :shit: it is.
    It manages to be even less consistent than PHP, not to mention unstable, undebugable, and with a horrible documentation.

    The only good thing about WP is that it only takes 5 minutes to set up your bug-ridden :shit: and put your first utter unimportant "post" on there.



  • I once tried to work with wordpress. So I picked up a book and started to dig in.

    I won't say it is this or that but
    I did not like what I saw under the hood.
    It made me shudder more than I usually do whenever I see denormalised tables.

    Also, I could not help but wonder about those people who call themselves software engineers or an expert in Wordpress.


  • SockDev

    For those of us who work professionally with PHP - which is a terrible enough thing before you start - it makes the rest of us look bad.

    I call myself a software engineer - it's my job title - but I'd not turn out the stuff in WP. Though I have to admit it does nail a certain amount of usability. It might be a mess under the hood but normal people can use it.



  • I've worked professionally with PHP (thankfully not anymore), and you really can produce quality software using the language. However, the barrier of entry for PHP seems to be waaay to low, resulting in all kinds of :shit: out there.

    Sure, WP is useful, and if you're an end-user you can surely ignore how much of a :shit: it is.
    However, you wouldn't drive a car that turned out to be hastily put together using duct-tape and paper-clips under the hood.



  • @MHolt said:

    The only good thing about WP is that it only takes 5 minutes to set up your bug-ridden :shit: and put your first utter unimportant "post" on there.

    Usability is king. Bow before it.



  • That is why we can't have nice things.



  • The usable things ARE the nice things.


  • SockDev

    Even if it's a complete mess under the hood?



  • @MHolt said:

    instead of shitting itself

    WordPress is not shitting itself. The problem here is the sysadmin that didn't configure the server properly.

    These are Warnings, output to the browser, is this a test server ?

    In php.ini, display_errors should be OFF on a production site.

    Please put the blame where it belongs.



  • @Arantor said:

    Even if it's a complete mess under the hood?

    Impossible to answer. Depends on whether the "complete mess" affects the usability or not. For example, a program that crashes because it's a "complete mess" is not very usable.

    If the code is just "sloppy" in the opinion of those idiot developers who think writing code is poetry or whatever, but the program works, who gives a fuck?

    The code implementing X is just an implementation detail of X for the next layer of abstraction up. If you're working on the next layer of abstraction up, you do not give a fuck as long as it works.


  • SockDev

    We're talking about WordPress. The out of the box version is simple enough for just about anyone to use.

    On the other hand, it's frequently receiving security patches because of shitty coding.

    And that's before we get into the realms of the addons for it, where everything is shoved into the 'post' and 'post meta' tables, where a photo on a photo gallery might be a 'post', where an item in an online store might be a 'post' (as too might the orders)


  • SockDev

    @TimeBandit said:

    In php.ini, display_errors should be OFF on a production site.

    in preoper code there should be no visible difference to the user regardless of what the setting of display_errors is because the code will never generate warnings, and will never fail to catch exceptions.

    but who am i kidding, this is PHP, where even an simple IF statement can, and at some point will, generate a warning



  • @accalia said:

    but who am i kidding, this is PHP, where even an simple IF statement can, and at some point will, generate a warning

    Exactly, that's why you configure your production server to NOT display warnings.


  • SockDev

    @TimeBandit said:

    Exactly, that's why you configure your production server to NOT display warnings.

    no, that's why you configure you server to use a language that is sanely designed to NOT use the output stream to users as a debug log.



  • WordPress is built with PHP. So please explain to me how you're gonna configure your server to use a sanely designed language while running WordPress ??

    And I doubt that you configure your IIS server to print detailed aspx error messages to the browser.


  • SockDev

    @TimeBandit said:

    And I doubt that you configure your IIS server to print detailed aspx error messages to the browser.

    I would, but only for Debug builds. But then again, that's actually ASP.NET config, not IIS config.


  • SockDev

    @TimeBandit said:

    So please explain to me how you're gonna configure your server to use a sanely designed language while running WordPress ??

    i'm not. wordpress is infected with the rot that is PHP.

    @TimeBandit said:

    And I doubt that you configure your IIS server to print detailed aspx error messages to the browser.
    as a matter of fact, i do not. each app catches those errors and displays its own pretty error message and IIS itself catches any that may have gotten through and replaces them with a generic "something went wrong" error while at the same time emailing the system admins about the error so they can figure out who fducked up this time and box their ears.



  • Well you could prefix all your if calls with @ which swallows errors.
    Also, tbf, it wouldn't be the if that threw and error, it would be whatever statement you pass at it. Any language can throw an error at an if statement.

    object v = null;
    if (v.toString().Equals("Hello");
    

    Would also throw an exception in C#.

    As for this specific error, sure as @timebandit pointed out, the server is configured wrong, that being said, this is a CORE WP function, working on a GLOBAL variable that should NEVER be null.
    So either the WP Core team should have checked for null, or the Oxford guys should stop installing weird plugins that destroys shortcodes :wtf:



  • @MHolt said:

    object v = null;
    if (v.toString().Equals("Hello");

    Would also throw an exception in C#.

    Once you get past the two compile time errors yes.

    Or at least I'm assuming an empty body for an if statement is a compile time error (the missing parenthesis definitely is).


  • SockDev

    @powerlord said:

    Or at least I'm assuming an empty body for an if statement is a compile time error

    IIRC, it's just a warning. But then if you're compiling with 'Warnings as errors' (and if not, why not?), it would indeed be an error.


  • Winner of the 2016 Presidential Election

    @powerlord said:

    the missing parenthesis definitely is

    :pendant:



  • Any compile-time errors are left as an exercise to the reader.



  • @blakeyrat said:

    The usable things ARE the nice things.

    Agreed. The people at Wordpress have done a great job in their user interface design, which is why their software has become as popular as it is. The quality of the underlying code doesn't matter at all to, say, Ms Tina L'Hipstèr who wants to blog about fashion. It's just got to work.

    See also: the popularity of the iPhone.



  • While that is true. The quality matters to me, trying to work against it when developing plug-ins for the piece of :shit:

    Also as mentioned gaping security holes.


  • Winner of the 2016 Presidential Election

    @MHolt said:

    Also as mentioned gaping security holes

    But (unfortunately) nobody cares about that either. Which is exactly why security for products like WordPress is so shitty. Because they can get away with it.



  • Yeah, why care about security when it's shiiiiiny... :disco:

    Freaking morons



  • Visual Studio's C++ compiler has a warning for "This function isn't called" when compiled with /Wall, it fires on headers.

    Sometimes compilers have dumb warnings.


  • SockDev

    A warning about unreachable code is dumb?



  • It is when it fires on every single function in the standard library that you aren't calling. And every function in every other library you're using that you're not calling.

    (Also sometimes I like to be able to run in-progress code that has stubbed functions)


  • SockDev

    @jmp said:

    It is when it fires on every single function in the standard library that you aren't calling.

    wait... it warns about the standard library?!

    @jmp said:

    And every function in every other library you're using that you're not calling.

    :wtf:

    if you didn't write the code the compiler shouldn't give you code style warnings. that's what Veracode (or similar Source Code Analysis Tool) is for!


  • Discourse touched me in a no-no place

    @accalia said:

    wait... it warns about the standard library?!

    It's probably reacting to all those function prototypes.



  • Keep in mind that C++'s #include directive is just flat source code inclusion. #include <foo.h> just means "Recursively evaluate directives in foo.h and then put the output here".

    So when you #include <iostream>, you get a bunch of function prototypes dumped into your .cpp for everything in iostream. If you're not using everything in iostream...

    The compiler would have to go well out of its way to not do that. Probably a good heuristic would be marking everything coming out of a #include using <> brackets as don't-warn-on-it, because traditionally those are used for system headers or libraries (there isn't strictly speaking a difference between #include <foo.h> and #include "foo.h").

    But then there's a problem: What about templates? You probably don't want to get warnings from the implementation of std::vector, but you might want the warning if it's to do with the type you're templating on (Maybe you've done something weird with one of its constructors and so you get a warning somewhere in std::vector where it uses it).

    Visual Studio's compiler writers probably just went "Fuck it, too hard, let them eat warning", and so /Wall is unusable for VS when building C++ unless you turn off ~10 warnings.

    (Added complexity: There probably /are/ some warnings you want from system headers, the ones that are just plain "Bang you're dead, but this isn't technically illegal C++ so we won't make it an error". Use of uninitialized variables, for example. If your standard library's implementation of vector trips that warning, you want to know so you can write your own and/or complain to the implementor).


  • Discourse touched me in a no-no place

    @jmp said:

    Visual Studio's compiler writers probably just went "Fuck it, too hard, let them eat warning", and so /Wall is unusable for VS when building C++ unless you turn off ~10 warnings.

    Fortunately you can use pragmas to selectively turn them off for just the includes, though.



  • I do believe #include <foo.h> and #include "foo.h" use different include paths - I believe only the latter also automatically searches in the current directory?

    GCC does have a number of warnings that are disabled by default on 'system' headers, but enabled on other headers. You can indicate an include path as system by using -isystem instead of -I.

    I'm not sure what GCC's heuristic is for warning about unused functions. It definitely only warns on static functions, but I've got a couple of static inline functions in header files it doesn't warn on being unused.



  • @PleegWat said:

    I do believe #include <foo.h> and #include "foo.h" use different include paths - I believe only the latter also automatically searches in the current directory?

    Pedantic and completely useless C standard answer:

    A preprocessing directive of the form
    # include <h-char-sequence> new-line
    searches a sequence of implementation-defined places for a header identified uniquely by
    the specified sequence between the < and > delimiters, and causes the replacement of that
    directive by the entire contents of the header. How the places are specified or the header
    identified is implementation-defined.
    3 A preprocessing directive of the form
    # include "q-char-sequence" new-line
    causes the replacement of that directive by the entire contents of the source file identified
    by the specified sequence between the " delimiters. The named source file is searched
    for in an implementation-defined manner. If this search is not supported, or if the search
    fails, the directive is reprocessed as if it read
    # include <h-char-sequence> new-line

    <header> searches for the header in an implementation-defined manner, and "header" searches for the header in an implementation-defined manner - yay for the C standard!

    But yeah, the usual implementation is for "" to search in the current directory, and then fallback to <> search mode.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.