ddev / ddev-xhgui

XHGui service for a DDEV project
Apache License 2.0
10 stars 5 forks source link

Update Worpress README.md instructions #39

Closed nickchomey closed 1 week ago

nickchomey commented 2 weeks ago

The Issue

Wordpress instructions out of date

How This PR Solves The Issue

Manual Testing Instructions

n/a

Automated Testing Overview

n/a

Related Issue Link(s)

38

tyler36 commented 2 weeks ago

Thank you for the PR. I'm not a WP developer, so I'm grateful for the update.

Instructions work well on WP 6.6.1.

I'm happy to merge this when the tests pass.

tyler36 commented 2 weeks ago

Some thoughts

  1. I'm not entirely sure on the best place to add the code in wp-config.ddev.php. Should it be inside the getenv( 'IS_DDEV_PROJECT' ) or outside? Perhaps we can clarify in this PR?

  2. On reflection, I wonder if we updating wp.config.ddev.php is the best approach.

    Taking control of wp.config.ddev.php means the file no longer gets updated if/when DDEV want to make changes to it. Maybe we could do something like in ddev-browsersync and have our own wp-config-ddev-xhgui?

nickchomey commented 1 week ago

The fact of the matter is that ddev's approach to WordPress' wp-config.php files is not at all appropriate. It's too at-odds with how wp does things, existing wp-config files, wp cli, and more.

I've been working hard on a WordPress addon for a few months that does a better job, and is almost ready, though doesn't support Bedrock yet. There's an issue open to convert it all to use env variables and .env files.

I haven't cut a release yet, but you're welcome to git clone and install locally to test it out. It makes it dead simple to install a fresh wp site, import a new site (which has standard wp-config structure), change db urls (using a better go-based tool than the wpcli search-replace command). The main effort was to support relative paths/multiple urls via traefik middlewares, but even once i "succeeded" I found all sorts of little edge cases that make it ultimately impossible. So db search replace is the only possibility.

https://github.com/nickchomey/ddev-wordpress

Anyway, as far as this PR goes, I have to figure it can just be merged. Nothing changed at all except how the profiler code is acquired, and the path changed in wp-config.