Open srueegger opened 1 month ago
What's the exact command that you are using? Have you tried the --precise
flag?
FWIW I cannot reproduce this.
I just did wp search-replace wordpress-cevelop wordpress-develop wp_post*
on my local wordpress-develop.local
site and the font URLs were replaced as expected in the source code.
My guess is that the URLs are JSON encoded (related https://github.com/wp-cli/search-replace-command/issues/186)
So the error is definitely reproducible for me. I have installed a standard Wordpress under the domain “domaina.dvl.to”. And uploaded the following fonts in the fullsite editor.
Then i set this font as the default for headings and texts.
Fonts: testfonts.zip
This works fine:
Then I simply copied the DocumentRoot and database and let the domain “domainb.dvl.to” point to it.
Then I use “wp search-replace” to change the domains, the process is also executed:
When opening the domain, you can see that the fonts I have uploaded do not work. It is interesting to note that the fonts that are predefined in the WordPress theme “twentytwentyfour” seem to work perfectly.
Browser Console:
Source Code with wrong Domain:
I can reproduce this issue and it is indeed related to encoded value. When fonts are uploaded, entry is created in posts table and post_content
looks like this:
{"src":"http:\/\/foo.local\/wp-content\/uploads\/fonts\/SZc83FzrJKuqFbwMKk6EtUf57DtOmCc.woff2","fontWeight":"400","fontStyle":"normal","fontFamily":"\"Alex Brush\"","preview":"https:\/\/s.w.org\/images\/fonts\/17.7\/previews\/alex-brush\/alex-brush-400-normal.svg"}
When I try to generate sql after replacing the domain, eg:
wp search-replace 'http://foo.local' 'http://bar.local' --export=sample.sql
Then value shown above is not updated to new domain.
Bug Report
Describe the current, buggy behavior
The command “wp search-replace” does not work as expected. With WordPress 6.5 the Gutenberg Full-Site-Editor got the possibility to add fonts (as direct upload or as direct download from Google Fonts).
If you now change the URL of a WordPress installation with “wp search-replace”, the URL of your own fonts is not adjusted - which means that the font files cannot be loaded.
Describe how other contributors can replicate this bug
Describe what you would expect as the correct outcome
The domain of the fonts should also be changed via “wp search-replace”.
Let us know what environment you are running this on