WordPress 3.5 “Elvin” Released
wordpress.org
wordpress.org
http://codex.wordpress.org/Version_3.5
The biggest thing I wish WordPress would add is a better built in system for real templates, using a something along the lines of Twig (http://twig.sensiolabs.org/).
That mixed PHP code and HTML in your standard WordPress template disgusts me every time I see it. I know there are some custom solutions for creating real templates in Twig, but this should be part of the mainstream WordPress branch.
The template pseudo languages enforce a strict separation between model and view, and they typically do so with a much more concise syntax and legible format compared with embedding PHP in HTML, for example.
I used to prefer general languages for templating, but once I learned the pattern of using Twig to the full I found that I could create templates much faster than before, and I could also go back to a template after a couple months of not looking at it and quickly understand what I was looking at.
So much of programming is protecting the programmer from him or herself. By enforcing rules you protect yourself from bad habits. I think a separate template system and keeping the view separate would help keep everyone honest.
Eventually I started to do my modifications as plugins, which is one area where Wordpress really shines. Other systems could definitely take note of the way WP handles plugins.
In contrary, I am in the pursuit for the one universal language to be used everyhere replacing, javascript, html, css, templating language, ruby/python/php, sql..
As an aside, though, part of the reason we have different languages for things like backend code, markup and styling is that they're commonly done by different people with different specialties. A general-purpose language will not offer much benefit to a designer, but it will trip them up more often. Having a language tailored to your specialist is a good thing. The only time you'd really want everything done in one language is when the same coders are doing everything. I admit I'm in that situation very often, but it's more maintainable if you just use CSS or similar so that normal front-end guys can work with it.
The bigger the project is the more you have to favor readability and maintainability first, and using multiple specialized languages to accomplish different specific tasks is an effective way to keep the codebase readable and maintainable.
That leads to all sorts of debugging fun when something weird is happening, and opens up naïve users who assume that a "theme" is somehow safer than a "plugin" (because all themes do is change the look and feel, right?) to security risks from downloaded or hacked-up themes.
Pity it's so widely used, and there's little competition...
http://trends.builtwith.com/cms provides some good trends of the big players, but I wouldn't put too much stock in it.
That said, as a developer who has fallen into the WordPress business out of necessity, there are a lot of great products out there that are built much better than WordPress and I wish one of them were the dominant player. Still, WP manages to get the job done most of the time.
Honest question: Can you name one?
I'm seriously looking for a WordPress alternative, but I haven't found one that is truly BETTER.
Sticking with PHP, both http://modx.com/ and http://www.silverstripe.org/ are fairly popular and well-built. I've also heard good things of http://www.concrete5.org/ , http://www.movabletype.com/ , http://textpattern.com/ , and http://ellislab.com/expressionengine . http://habariproject.org/en/ has also been built specifically to address many of the faults in WordPress and other popular systems.
There's still plenty of warts, of course, but that seems true of just about every widely used piece of software -- bad decisions early on in development become very hard to walk back later when any of millions of sites/themes/plugins/etc. could turn out to be depending on that bad decision being there...
The syntax is very Django/Jinja alike. They took good inspiration.
Meanwhile, why the Wordpress team didn't switch to a template engine and orm after all those years is a true mystery to me.
As long as you use the MVC paradigm or at-least sperate views from business and data store logic it seems like PHP works fine to do the templating its self.
Yes I can see the argument that non coders have to learn PHP, but is PHP really much harder to learn then the template language?
Also templating add's performance overhead.
What you essentially end up with is a "hypertext preprocessor preprocessor"
{get $blogs from "/channels/blogs/entries"}
...
Alpha version was released just yesterday, you can sign up and download it at http://getfwd.com/shameless plug
I doubt Wordpress would be used for anything other than simple blogs if it weren't for querying from templates.
Obviously there is the risk of theme developers loading tons of queries from a template but I think trying to prevent that would be premature optimization. The benefit of greater customizability outweighs the potential performance hit IMO.
# controllers/BlogController.php
class BlogController extends AppController
{
function index ()
{
$this->entries = get("/channels/blogs/entries");
}
}
# templates/blog/index.html
{foreach $entries as $blog}
...
{/foreach}
Or, as in my example, this... # templates/blog.html
{get $entries from "/channels/blogs/entries"}
{foreach $entries as $blog}
...
{/foreach}
I've written substantial apps both ways, and so far I have found that powerful templates are actually easier to write, read, and maintain, perhaps because the entire request flow happens in a single file.It's great to see Wordpress is taking steps in the right direction with every release. Another wishlist feature would be the integration of the Advanced Custom Fields plugin straight into the core which allows you to add custom meta boxes and fields to posts in a tasteful and aesthetically pleasing way. I'm excited about the future of Wordpress, it's my bread and butter and I don't see it being beat any time soon.
Re: custom fields: This makes little to no sense to be in core, because custom fields are just that, "custom". There's no point in giving the end user the ability to make their own meta boxes hooked to custom post meta if there is no plugin or theme actually using that meta data. Creating a meta box is something that the theme/plugin should do, because it's actually going to use the data gained from that meta box.
In other words, the horse goes in front of the cart, not the other way 'round.
This would allow future WordPress developers to namespace their code, and out allow simple closures withint your code.
As of PHP 5.5, there is no support for a straight mySQL connection. There is no real downside in WordPress adopting the PDO standard.
https://wiki.php.net/rfc/mysql_deprecation
As of 5.4, mysql_* were officially discouraged via the docs.
Maybe in > 5.5.* mysql_* functions will be officially removed from core?
(Personally, I want it, but I can see there being friction, given the possibility of breakage.)
There are still many other issues with the code, but having a clearly defined error-handling / -signaling for plugins would be the one single change that would help in many problem areas of wordpress development - making rules and knowledge about successful plugin execution and error handling obligatory for plugin devs could be the one single change that could also help to reduce that annoying flood of unbelievable bad code to be found in WP plugins repo.
That said, I haven't checked out the last 2 versions or so.
So yeah, there is some precedent at popular CMSs using a modern framework on server, client, or both. We'll see when and if WordPress follows the example...
At the moment, we're not considering dropping support for PHP 5.2, so we'll likely take the best ideas and implementation from various frameworks and combine them. I'm fairly committed to reiterating wherever possible that WP isn't a silo and we need to be looking at what other PHP projects are doing. We're getting better at that.
1) not make comments enabled out of box with no anti-spam measures (moderating isn't anti-spam in my opinion: technical solutions should come before man-power)
2) not make me rely on third-party plugins to combat it