How does printf( __( ) ); work?

It’s used for translate text. The second argument is a kind of namespace (called domain here) to retrieve the translation (for example from a dedicated file or something else). So Anyword here, should be the guy behind the template, or the company or what ever that can be a domain/namespace. edit: The doc from wordpress … Read more

Best Practice for PHP

That’s question is only relevant, because WordPress use a mix from a coding language and layout language. If you would use a template language, syntax, than is this topic not relevant. But to your question. If you use your example source for a Theme, much more layout language like html, then I prefer the first … Read more

How to check if a plugin (WooCommerce) is active?

Your edit got me to this idea, there indeed is no function called »woocommerce«, there is a class »WooCommerce« though. One thing to be aware of is, that the check has to late enough, so that plug-ins are actually initialized, otherwise – obviously – the class won’t exists and the check returns false. So your … Read more

WordPress and magic quotes

Simply put WP turns indeterminate situation (magic quotes might or might not be enabled in server configuration) into determinate (magic quotes are always present and server configuration does not matter). Rather than messing with this for all WP core it makes much more sense to simply strip slashes in your code on your own variables, … Read more

Why isn’t WordPress part of Framework Interop Group?

Yes, WordPress’s maintains backward compatibility (spaghetti), it would not be feasible to adhere to PSR-0 and rename everything, which is somewhat unfortunate for the long-term, with regards to FIG. That being said it’s possible to adopt it for plugins and themes, there is a trac about it here: https://core.trac.wordpress.org/ticket/21300