-
Notifications
You must be signed in to change notification settings - Fork 293
WordPress does not default to pretty permalinks in Playground #1644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In order for WordPress to default to pretty permalinks during install, it has to make a successful request to the site while pretty permalinks are enabled. I suspect:
|
I've been looking at this a bit this evening. Ultimately, we need to be able to handle PHP subrequests before the WordPress installation process is invoked. |
Can we enable pretty permalinks once WordPress is installed, though? Could be as a part of the boot protocol. |
@adamziel yep, I think that is good in the short term at least. I figured it would be good for WordPress installation to just work as usual in Playground by allowing subrequests during install, but if that is the only subrequest done during WP install, perhaps it is not worth it. I will look. |
Hm Subrequests should still work during the installation, I'm not sure why they don't. |
How can subrequests work if the PHP request handler hasn't been exposed outside of bootWordPress() yet? |
Ooh that's such a good question @brandonpayton, it challenges some architectural ideas behind
However, I vaguely remember disabling the networking in async function installWordPress(php: PHP) {
// Disables networking for the installation wizard
// to avoid loopback requests and also speed it up.
await withPHPIniValues(
php,
{
disable_functions: 'fsockopen',
allow_url_fopen: '0',
}, It would be nice and clean from the developer POV to support the same flow as we'd have with Apache/Nginx, so actually do the loopback during the installation. At the same time, it would be a worse user experience. Yeah, I'd say let's not support the actual loopback request for now in the name of faster boot/installation process. Two workarounds I can think of are:
Now, some developers might really need to go through the same code paths – I'd open a new issue to gather feedback, and only act on it once we validate there's an actual demand. |
@adamziel thanks for all your thoughts and background. I agree it probably makes sense to avoid slowing down Playground WP boot with a longer install process. And maybe we can revisit sometime in the future. For now, I was thinking it might be as simple as updating the Is there a reason we need to interact with the Either way, I'll grab this issue. It would be lovely to have permalink-dependent features working well out of the box. |
AFAIR WordPress caches the rewrite rules in the |
## Motivation for the change, related issues The WordPress installation process defaults to pretty permalinks if it can enable them and get a valid response from a loopback request. Unfortunately, at the time we run the WP installation process in Playground, the PHP request handler has not yet been put into place to handle those requests. In addition, even if the request handler was in place in time, @adamziel [mentioned](#1644 (comment)): > I vaguely remember disabling the networking in installWordPress made for a dramatic installation speedup in web browsers As a workaround, we can manually set the `permalink_structure` as part of WordPress installation within `bootWordPress()`. Closes #1644 ## Implementation details Manually sets the `permalink_structure` as part of WordPress installation within `bootWordPress()`. ## Testing Instructions (or ideally a Blueprint) Manual testing after creating nightly WP build which was pre-installed using this logic using Playground CLI. Loading the nightly build locally shows permalinks enabled.
WordPress defaults to pretty permalinks during install if pretty permalinks can be tested successfully during WordPress install.
See:
But the WP default in Playground is currently no pretty permalinks. This is unfortunate because features like built-in sitemap.xml support do not work when pretty permalinks are disabled.
The text was updated successfully, but these errors were encountered: