elementor / elementor/one-click-accessibility
[Bug] Bedrock: site url mismatch - home_url() should be site_url()
- Dominant language
- JavaScript
- Stars
- 95
- Forks
- 43
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 2
Description
### Environment
- Plugin version: 4.0.3
- WordPress: 6.9
- PHP: 8.3
- Installation: Bedrock (Composer-based, WP core in `/wp` subdirectory)
### Problem
On Bedrock installations, the plugin fails to connect with error:
```
Site Url Guard Request Failed!: site url mismatch (HTTP 400)
```
### Root Cause
In `classes/services/client.php`, line 54:
```php
'site_url' => trailingslashit( home_url() ),
```
The plugin sends `home_url()` to the API, but the OAuth token contains `site_url()`.
On Bedrock setups:
- `home_url()` = `https://example.com/`
- `site_url()` = `https://example.com/wp/`
This causes a mismatch.
### Proposed Fix
Change line 54 from:
```php
'site_url' => trailingslashit( home_url() ),
```
To:
```php
'site_url' => trailingslashit( site_url() ),
```
### Impact
- **Bedrock installations**: Fixes the issue
- **Standard WordPress**: No impact (home_url = site_url)
### Tested
We applied this fix locally and confirmed it works.
Contributor guide
Research direction
Start at classes/services/client.php line 54 and compare the URL sent in the site_url request field with the URL stored in the OAuth token. Done means Bedrock installations send the /wp/ site URL without causing the site URL mismatch, while standard WordPress installations continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100