also i see it as big disadvantage of wordpress that it can't be easily accessed by ip and http and https urls at the same time without changing configuration (without the plugin). this plugin is a must-have.
It's undesirable to have any site accessible directly via IP, but if it was, what you said would not be true.
There are also millions of WordPress websites handling both http and https traffic from the same installation, so there is strong evidence that the rest of what you said is not true.
to reduce server load? its very expensive when all stuff has to be computed always.
It is a
horrendous idea to cache most HTTPS pages in full. https connections imply that secure data is being transferred or that personal data is being transferred, imagine logging in over https and seeing MY private messages instead of your own, does that sound logical?
What you actually want is object caching, and other forms of fragment caching. Full page caching should not be applied to https connections.
To add to this, full page caching over https is more difficult, for example, Varnish does not distinguish between http and https, and requires a 3rd box sitting in front acting as a proxy to forward http connections to the varnish cache and https to the original box or load balancers.
So no, for security, data protection, and practical reasons, caching full HTTPS pages is a bad idea. Cache objects and data at the PHP level instead. It's on the same level of insecurity as sharing a database, once someone breaks in they have access to
everything, imagine if you visited an admin dashboard page shortly after the site administrator had been there and saw the full admin interface with all the stats and data?
This, and the whole URL in the database thing...
1. There are constants you can put in the wp-config.php file that set the base URL and install URL manually
2. It's not always possibly to figure out where the installation is located URL-wise depending on where execution started on the server. For historical reasons not everything is routed through index.php, although most things are, and new stuff is.
3. There is no performance cost here, because the site URL is pulled in from the options table, and is marked as auto-loaded. This means WordPress pulls it in amongst other options on every page load. There are optimisations such as the wp-config.php change, and database caching that improve this, but any half decent MySQL installation will have cached that query, as will any decent object cache.
4. Not every WordPress installation has a single URL. Would you seriously expect an installation such as wordpress.com with millions of sites on a single installation to use str_replace?
5. I would argue a single query to the database ( which as I said is not what happens, the data is pulled in along with the rest of the auto-loaded options ), would be faster on a well set up system, than continuous string replacement searches, which would be a sloppy method of doing things
6. Links between pages and posts already sidestep this issue entirely and work fine moving from one site to another, as they have the necessary meta data if added correctly to account for this, as well as slug changes etc
7. A lot of plugins add direct references to URLs, these are poorly built plugins that generally aren't popular, that should have used Post IDs instead.
To the idea that you should be able to use the same database for test and production, I say that is also an idea with impracticalities. You should be able to throw away your test environment and replace it on a whim.
That something as simple as a search replace of serialised data is such an issue indicates:
1. A lack of a build process
2. Poorly built code
3. Poor content and data exports
it is! exactly because of that. you can't use the same stuff on test and dev site which means you will apply untested changes which leads to unexpected results as well.
This is a self defeating point, because the moment you change the URL the site is installed at you've changed the environment, regardless of the need for any database change.
which leads to unexpected results as well.
This in particular suggests the tests pass because you're applying a particular set of data, not because what has been built is flexible and robust enough to fail gracefully and handle unexpected data ( data which may be entered into the live site at a future data )
this is a BIG limitation in wordpress.
No, as I mentioned, this is actually an advantage, and it's pretty much a requirement in any situation with a single installation serving multiple domains, especially in situations where new domains can be added from the front end.
------------
Migrations in WordPress are something that happen on a regular basis with a large amount of tooling and methods to doing it. As somebody who has moved hundreds of sites, everything from a simple export and import, setting up virtual machines, deploying websites, or consolidating as many as 50 out of date installations into a single updated Multi-site installation via bash scripting, the URL search replace is not the most difficult part.
Keeping in mind WordPress is not a brand new project, perhaps you would have seen fit to do some research?
https://core.trac.wordpress.org/ticket/17048
Regarding relative URLs Andrew Nacin, core developer who lead several releases:
Root-relative URLs aren't really proper. /path/ might not be WordPress, it might be outside of the install. So really it's not much different than an absolute URL.
Any relative URLs also make it significantly more difficult to perform transformations when the install is moved. The find-replace is going to be necessary in most situations, and having an absolute URL is ironically more portable for those reasons.
As you said, absolute URLs are needed in numerous other places. Needing to add these in conditionally will add to processing, as well as introduce potential bugs (and incompatibilities with plugins).
Unfortunately, the opinion of those threads are skewed in the direction you mention due to most of them not really understanding the problem or the design decision (nor are most of them active core contributors or core developers). I've tried to cover a bit of the design decision on wp-hackers before, and I've been able to locate this reply of mine (the first part, in particular):
http://lists.automattic.com/pipermail/w ... 36195.html
Simply using relative URLs is not appropriate. Especially when the user can use wp-config.php settings to move around the locations of uploads, plugins, themes, admin panel, etc, sometimes to completely new domains entirely.
Also keep in mind WordPress is not the only major CMS to store the URL in the database. Perhaps then you need to ask why?
If it really is an open shut case as you suggest, then why have you not opened a Trac ticket on WP Core saying so and suggesting what be done and gotten props on the WordPress 4.0 release? The time and thanks of all those people who you say are struggling with the consequences of this?
Exactly how would we handle multiple sites and a single installation that have different content on one site to another? How would we determine which is why without a base URL to match against in the sites and blogs table? What about the scenarios currently catered for by the domain mapping plugin? Will I need installs for each and every site now?
Or perhaps there are good practical reasons for having the URL in the database
I recommend you do the following:
1. A question on WordPress stack exchange asking why the URL of the root of the WP install must be saved in the database, and why it can't just be defined in wp-config.php
2. Ask core developers on twitter, they're usually friendly and nice to reply. Except Otto. Otto does not tolerate fools
3. Join IRC and enter the #wordpress room on freenode, or the #wordpress-dev room, and ask. A smattering of mid to high level developers and core developers, including project leads, will be able to see your question. Perhaps the person who originally wrote the code can explain their reasoning to you?
This way you can get a more varied response. The WordPress developers are not stupid, and the project has a use for these URLs in the database ( and as I mentioned with wp-config.php constants, methods of providing alternatives ).