
Building a better WordPress - gmays
https://medium.com/@chrishutchinson/building-a-better-wordpress-4b2a771b4d0b
======
wadetandy
The biggest problem I see with the proposed solutions at the bottom is that
the author arrives on the two node-based solutions as the preferred path
forward. The reason Wordpress has become so successful over the years is that
even the least expensive hosting provider has mod_php installed and you merely
have to drop your installation files on the server via FTP. This is easy
enough for many less technical people to accomplish. Node, ruby, and the like
typically require more advanced and expensive hosting solutions, in my
experience.

Of course I haven't used any of these cheap hosting solutions or setup a
Wordpress site in a couple years so I might be out of date on the state of
things.

~~~
roel_v
"is that the author arrives on the two node-based solutions as the preferred
path forward."

That's the generous interpretation. A more jaded reader might have started
reading the article thinking 'mention of Angular... 3... 2... 1... ah there it
is! suggesting node... 3... 2... 1... ah there it is! Well at least he managed
to contain himself until the next to last paragraph'.

It's technology-centered myopic navel-gazing. Yeah nobody uses Wordpress
because PHP in templates is not 'clean'... Oh wait, half the world _does_ use
Wordpress because everybody and their dog has a server with PHP and because
it's dead simple to hack up something working by cramming some PHP into a
template you bought for 5$. For 95% of all websites, who cares about
maintenance? Just do a new one in 3 years with whatever is hot then.

This article (and many like it, not singling this one out) reads like people
who call themselves 'real' woodworkers, lamenting that people won't fork over
$2500 for a hand-crafted oak dining table and instead get a $100 Ikea one. The
popularity of 'Ikea hacks' amongst the crowd that tends to author articles
like this is ironic in that sense...

~~~
geon
Have you ever tried to modify a wordpress theme? It's a nightmare. And we are
proffessional developers. Imagine the pain this must be for mere webdsigners.

Fixing the mess that is wordpress is a very nobel goal.

~~~
pmlnr
Write your own and keep it simple. It's not that hard.

The ones you can buy however are a nightmare for sure, so are most of the
copy-pasted-glued-together ones.

~~~
geon
Admittedly, it was a few years since I looked at the inside of wp, but it was
horrible, with php api calls inside the template code, bad/missing/misleading
documentation and non-existing database structure.

------
mbesto
> _Yet again, the RESTful API comes to our rescue. Thanks to its simple JSON
> output, we’re able to use JavaScript to its full potential, using ReactJS or
> AngularJS to craft beautiful and fast front end experiences, taking
> advantage of many of the new HTML5 browser APIs that have become available
> over the past few years, including localStorage and more recently, service
> workers. Even better, we don’t have to use jQuery._

Can someone explain to me why using a front-end javascript framework for
entirely static content would be a sound idea?

~~~
detaro
Because that's what the cool kids use. /s

I think a good API would be great to have for a CMS (and one could or maybe
even should run the normal frontend of it), but not for this reason.

EDIT: And if you build non-standard-CMS apps on top of or using data from the
CMS, then you could use React or whatever and the API.

------
Implicated
> the dependency on PHP can turn many developers away from using it

That's interesting, as most people claim PHP and the army of developers that
come with it, is a major factor in WP's domination of the CMS market. If WP
had initially been developed in Python, perl or anything not named PHP would
it be the dominating force it is today? (Honest question, I don't presume to
have the answer)

I'm a PHP developer, I hate working with WP but this whole article had me
scratching my head asking "what? why?".

This isn't 'fixing' wordpress, the author is essentially building a spec for a
new/different CMS that isn't dependant on WP. There's lots of those not named
Wordpress.

~~~
redwall_hp
>If WP had initially been developed in Python, perl or anything not named PHP
would it be the dominating force it is today?

Most of the solutions around at the time were perl, including Movable Type,
which was the WordPress of the time. The _only reason_ anyone went with
WordPress was because the MT developers jacked the price up, and WordPress was
free at the right place/time.

~~~
pp19dd
MT was fairly clumsy in some ways by comparison to WP, though my use of the
word is very questionable. Updating templates was always a pain because we'd
want to update a sidebar widget, and it would take hours to have that change
reflected (regenerate all pages statically) because we had a legion of
prolific writers and they churned out tons of content throughout the years. By
comparison, WP was dynamic - change instantly reflected.

Of course, that difference had its disadvantages - you had to make sure WP
traffic didn't melt the server(s), optimize for the traffic, then finally give
up on caching strategies after traffic growth overwhelms conditions, and
upgrade to a CDN to basically imitate a static site you were avoiding.

In some ways, we're making a full circle in blogging technology (and web in
general), but here's a major WP disadvantage at this moment in time: it might
take 32MB of ram to generate a 3kB page.

------
kijin
> _the dependency on PHP can turn many developers away from using it_

Well, that's going to be the same no matter which technology you choose. The
dependency on ReactJS is also going to turn many developers away from your
proposed changes.

Why turn away? Here's a possible reason: Instead of generating perfectly valid
and semantic markup that can be understood by all clients from Lynx to Chrome
as well as search engines, you want to turn every blog into a single-page
"webapp" where the markup only contains some empty placeholders and all
content is rendered separately by a hefty JavaScript framework.

No, thank you.

One thing I'm absolutely flabbergasted about is that we as a community have
spent the last 10 years trying to get everyone to serve valid semantic markup,
only to throw it all away. This tastes just as vile as using tables
everywhere.

There's a time and place where JavaScript MVC frameworks make sense. A blog
ain't one of them. Even Medium is barely tolerable nowadays -- I am often
forced to use the Reader View in Firefox to get rid of all the junk that
Medium throws into every blog post.

Please, please keep that junk to yourself. Don't pollute my precious WordPress
with it.

~~~
Hytosys
>One thing I'm absolutely flabbergasted about is that we as a community have
spent the last 10 years trying to get everyone to serve valid semantic markup,
only to throw it all away. This tastes just as vile as using tables
everywhere.

Using a DOM manipulation engine does not disqualify the developer from
producing perfectly semantic markup.

~~~
kijin
Sure, but that beautiful markup only exists inside the Developer Tools of
modern browsers, and only thanks to several megabytes of scripts that waste my
time, data, and battery.

Good luck loading that page with whatever the most popular browser is in 2040,
or on archive.org if the original website has long disappeared.

~~~
Hytosys
You believe that HTML won't be deprecated by 2040, but JS will? You also
believe archive.org won't make an effort to store JS files within that
timeframe?

The reality is that the modern web depends on JS, and the argument of
deprecation won't change that anytime soon. We're moving forward, not
backward.

On a technical note, there is quite some effort in rendering React/Angular
apps on the server in case it's serving an outdated browser.

Edit: just realized that of course storing JS files isn't the solution to
archive.org's challenge, it's storing server responses.

~~~
kijin
JS is a lot more fragile than HTML.

It won't be difficult to extract useful information from a static HTML
document 25 years from now, even if it doesn't render correctly. Actually, we
do that already with static HTML documents written 20-25 years ago. But
there's no guarantee that a script with lots of moving parts written today
will run without errors on a future browser, especially if it stopped being
maintained sometime in the middle.

Why do we need so many moving parts to display a goddamn blog post? It's a
mostly static document, after all. There's no reason it shouldn't be readable
with NoScript on, or even in a terminal-based browser like lynx, with a very
small number of HTTP requests.

The reality is that only some parts of the modern web depends on JS. Hiring
five people to change a lightbulb is not "moving forward", it's just wasteful.

------
voidr
> the dependency on PHP can turn many developers away from using it.

the dependency on <chose your programming language> can turn many developers
away from using it.

> Almost all interactive elements are built using jQuery, which, while a great
> library in many respects, is weak in comparison to many of the emerging
> front end frameworks we have today — ReactJS, AngularJS and others.

Weak? what does that even mean? Also the author is horribly confused because
he compares a library with two frameworks.

Calling jQuery weak in this context is like calling C weak in comparison to
Java, however, I would still prefer to write my operating system in C thank
you very much.

> I’ve already mentioned using localStorage as a mechanism for providing
> caching in front end apps, ensuring content is loaded quickly, avoiding ugly
> loading screens and flashes of blank content, but this only goes so far. As
> ReactJS (and soon AngularJS 2.0) can be run on the server as well as in the
> browser, we can pre-render the initial page load for the user on the server,
> and then hand-off all future content and navigation requests to the browser.

You solve a problem that you introduced in the first place. I'm surprised I
don't see MongoDb mentioned anywhere in this article.

Wordpress is a pretty terrible platform to work on as a developer, however
introducing trendy technologies will not make it any better. Ironically
JavaScript is more similar to PHP than a lot of people care to admit:

* JavaScript, just like PHP was not designed for what people are using it for today

* JavaScript, just like PHP is riddled with bad legacy

* JavaScript, just like PHP is trying to evolve to escape from that legacy and become more like other languages.

The fact of life right now, is that PHP and MySQL are well understood
technologies, countless web applications in production are using them, the
same cannot be said for NodeJS and this has real world consequences, because
running a NodeJS app on your laptop is totally different from running it in
production.

On a standard Ubuntu machine, having a production viable PHP installation is 1
apt-get install away and I get: web server set up, error handling, logging and
a standard way to customise the system wide configuration. With NodeJS, I have
to worry about restarting it if it fails, logging the error, handling them,
configuring the web server etc.

I find that people who criticize PHP, have no clue on what makes it so
popular.

------
bad_user
Bemoaning WordPress for being built in PHP, then proposing something built on
top of Node.js and Angular. Now I've heard it all.

------
rmccue
Side note: we started the process of getting the REST API merged today:
[https://make.wordpress.org/core/2015/09/21/wp-rest-api-
merge...](https://make.wordpress.org/core/2015/09/21/wp-rest-api-merge-
proposal/)

(Feel free to ask questions if you've got any :) )

~~~
pbowyer
Congratulations, that's great news! What is the documentation status, as
[http://v2.wp-api.org/](http://v2.wp-api.org/) has a lot of gaps?

~~~
rmccue
We're working on it; meetings just started two weeks ago on our new
documentation efforts: [https://make.wordpress.org/core/2015/09/07/wp-rest-
api-v2-do...](https://make.wordpress.org/core/2015/09/07/wp-rest-api-v2-docs/)

We've been short on time in the past, which is why our docs aren't up to
scratch. Fingers crossed we'll get that sorted very soon!

------
et1337
I've been building and iterating little toy CMSes for years, each one a little
better.

Current version pros:

\- SQLite makes deployment and backups a breeze. I can also copy the SQLite
file to create two versions of the site: "draft" and "live". Hitting "publish"
syncs them.

\- From the developer's perspective, it's just a regular Python app, except
you can insert user-editable elements into any template.

\- From the user's perspective, you can edit stuff right in the page.

Works fairly well. Two big hurdles remain:

\- I rely on medium-editor[1] for in-page WYSIWYG editing. It's the best open
source solution I've seen, but it's still horrible. Generates crap HTML[2].

\- For major layout changes, the developer has to create a new template with
placeholders for content creators to fill in. Ideally, developers would create
building blocks that creators could then drag and drop in to place.

[1] [https://github.com/yabwe/medium-editor](https://github.com/yabwe/medium-
editor)

[2]
[https://twitter.com/etodd_/status/644898235836989440](https://twitter.com/etodd_/status/644898235836989440)

~~~
evunveot
Have you tried the "inline" option in TinyMCE 4? Basically you just give each
editable element on the page its own, independently configured TinyMCE
instance.

TinyMCE's markup output is probably as good as it gets.

[http://www.tinymce.com/tryit/inline.php](http://www.tinymce.com/tryit/inline.php)

~~~
bhhaskin
I haven't seem this before.... might have to give this a try.

------
cjbarber
Ironic that this is posted on Medium.com.

I expected an humorous article about Medium being the better WordPress. I
think Medium might just be the better WordPress (for _most_ , not _all_ ).

~~~
rokhayakebe
Medium is a a blogging platform. Wordpress is a CMS. Medium is not a better
WP, it is a better group blogging product, one of the many ways you can use
WP.

~~~
juhq
Wordpress started out as a blogging platform. Who knows what Medium will be in
ten years.

------
EGreg
Let's face it. Wordpress works because of the themes. Hire a quasi developer
to set it up for you with plugins, and they will find a nice theme to install.
And the result - the end client WHO PAYS will get a visually nice site!
Especially responsive themes.

Take note, folks... theming and designers are crucial to your platform if you
plan it to be used by a significant number of websites.

~~~
aendrew
Couldn't agree more. Somebody above mentioned Drupal, which is also a widely-
used PHP-based CMS, but (IMO) far superior to WP (Comparing the two
communities is night and day — when I published my first Drupal module, I got
hours of community support and released something that was high quality and
reviewed by a member of the security team. With my first WP plugin, the most
code review I got was somebody who ran it through a linter). Alas, theming
Drupal is awful (especially if you're a designer who's invested in learning WP
theming); my personal opinion about why it's never gotten anywhere near WP's
market share is largely (largely!) due to the lack of themes.

------
pmlnr
Sure, dude, let's make a theme which is unusable with JS off. Also known as:
instead of plain HTML let's complicate things as much as we can.

------
wizzzzzy
I find one of the quickest and easiest ways to greatly improve working with
WordPress (in my opinion) is to just install the timber plugin. This allows
you to write template files in twig and does a good job of cleaning up the
mess of HTML weaved into 'the loop'.

------
tilt
While I'd LOVE WordPress to be run on Node, don't forget FB runs on PHP, and
they're investing in React.

[https://github.com/reactjs/react-php-v8js](https://github.com/reactjs/react-
php-v8js)

~~~
giaour
That project literally requires that you have PHP manage a separate javascript
runtime just to compile your templates. No thanks.

------
wodenokoto
I have never build a Wordpress theme using jquery. What is he on about?

~~~
coldtea
First, you might very well be an outlier. In which case, what you did or did
not doesn't matter at all with regards to WP. FWIW, tons of WP plugins and
themes (professional and popular free ones) use jQuery.

Second, WP used jQuery itself in the management interface, which is actually
what he was on about.

------
mschuster91
What the author wants can be done way more efficiently with Drupal and its
AJAX, not to mention that Drupal's data and template management is far better
than Wordpress'.

Downside with Drupal is that it ships with a stone-age version of jQuery,
which sucks if you want to use any modern jQ plugin. Also, Drupal mixes config
and data in the database, making proper separation of live/stage/dev a PITA.

------
reustle
Sure, this looks like a cool project, but good luck getting a bunch of non
tech people to install node on some server. PHP is just too dead easy. What
might be a good first step is to create a plugin for wordpress which creates
these same rest endpoints and then replacing the frontend entirely (has been
done before). Then, allow the backend to be swapped out with wordpress, this,
ghost, whatever.

------
mizzao
Instead of making the whole REST API, perhaps we could consider using
something like Meteor (or at least offer ways to skip the API altogether in
favor of some other mechanism.)

~~~
xj9
Couldn't you build something like that on top of the REST API?

~~~
mizzao
You should check out how Meteor
([https://www.meteor.com/](https://www.meteor.com/)) works. It makes REST
pretty much unnecessary.

~~~
detaro
But then you don't have a nice REST API to integrate with different things
anymore (authoring tools. exporting tools. frontends for devices that don't
like meteor. ...)

IMHO tying itself to a single front-end technology would be the totally wrong
thing to do.

~~~
jorjordandan
Meteor is not tied to any single front end technology, nor is it a front end
technology. It has an optional templating system, but lots of people are using
react now instead. I love meteor, but using meteor with wordpress sounds like
a nightmare. I think it was probably suggested more as an alternative.

~~~
detaro
Ok, then I got that wrong. Meteor apps always seemed incredibly coupled and
integrated to me, so I assumed it was one "package".

------
PythonicAlpha
I thought, WP was successful, because it was easy to deploy and easy to use
... and not because all the newest cool things where included ...

------
wangii
Seems nobody cares about this question: what's the target market?

------
matthewrhoden1
When I started to play around with Node and learning about NoSQL, this was the
first thing I thought of. I knew this was going to happen.

------
jordanlev
> The WordPress admin interface is it one its best features, and provides a
> clean and elegant way of viewing and managing data

lol

~~~
d2xdy2
While not saying I whole heartedly agree with that statement, the admin panel
is a major selling point.

~~~
pbowyer
And yet I've never had a client say they like it, or find it easy to use.
Neither did they find Drupal any better, but they have found other options
easier to use.

~~~
josefresco
I have over 50 clients (small business owners) who run WordPress. Many came to
us complaining about their old CMS, sometimes even WordPress.

After building their site for ongoing management ...correctly, and tutoring
them many were/are thrilled with WP and the content editing process.

The key is implementation and tutoring. Asking a client to manage raw markup,
or handing the keys over with no tutoring are recipes for dissatisfaction.

~~~
aklemm
Would you reach out to me (contact info in profile) if you'd be willing to
talk about WP management on those 50 clients? I'm working on a hosting
solution focused on the problems agencies may have managing updates and
cleaning up broken or hacked client installs.

~~~
josefresco
Hey there, didn't see this until ... now - don't see any contact details in
your profile.

~~~
aklemm
No worries. If you see this, you should now be able to find my email in my
profile. Would love to chat.

