[wp-hackers] Two new, long-overdue plugins to make your wordpress life a little easier...

Otto otto at ottodestruct.com
Fri Oct 28 18:45:04 UTC 2011


On Fri, Oct 28, 2011 at 1:32 PM, Robert Lusby <nanogwp at gmail.com> wrote:
> While writing this I've just seen "because you might write a book" listed as
> a reason for not changing. Seriously?

Yes, seriously. Not about the book, that's just an example. It's about
your inability to predict the future use to which you will want to put
your content.

WP does some post-processing of content now. It does things like
making quotes into curly quotes, and paragraph formatting, etc. The
data itself though, in the DB, remains unaltered. It's more or less
exactly what you submitted in the first place (ignoring TinyMCE for
the moment).

That's the point. You want that content to remain unaltered and useful
no matter where you put it or how you use it. If you have relative
URLs in that content, then the correctness of the content is now
dependent on the place it is displayed. This is the underlying problem
I have with relative URLs.

> Relative URL's change. Sites change domain. Your entire DB is then out of
> date.

You're correct, however URLs should not change often, and neither
should domains. These are things which, in an ideal scenario, *rarely*
happen. On the other hand, content is often displayed outside the
context of the web site. RSS feeds are the most obvious example.

To optimize your methodology to account for the "almost-never-happens"
case while adding a bunch of new and extra code for the
"happens-a-lot" case seems like a poor way to do things.

Basically, you're saying that because the domain *might* change, you
should be using relative URLs. Then, because relative URLs don't work
everywhere, you should add a bunch of code to detect the cases where
they don't work and post-process the content to convert them to
absolute URLs. But the domain changing is, or should be, infrequent,
and pulling RSS feeds happens a hell of a lot more often. Which is it
better to optimize for?

> Otto - how do you show clients your test site?

Simple: I don't write my code in a way that changing the URL will
break the site. If I need to use "real" content, then I can process it
to change the domain around and thus keep things working with just a
few simple filters and the handy str_replace function.

> Do you want me to go round and change the DNS/Host files for *all* of
> these users in often 4/5 different companies?

No, but that's not the same thing at all. A dev/staging/production
environment is something used by a company to create a continual
development process. It's not the same as a demo or test site that you
would be showing clients. You're mixing ideas here.

-Otto


More information about the wp-hackers mailing list