Skip to content
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

Font Files do not export/import properly via XML/WXR exporter. #59109

Open
peterwilsoncc opened this issue Feb 16, 2024 · 7 comments
Open

Font Files do not export/import properly via XML/WXR exporter. #59109

peterwilsoncc opened this issue Feb 16, 2024 · 7 comments
Labels
[Feature] Font Library [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended

Comments

@peterwilsoncc
Copy link
Contributor

peterwilsoncc commented Feb 16, 2024

Description

When exporting and importing content via the WordPress Importer font faces are not imported to the new domain correctly.

This can result in broken designs as the templates imported from the original site are referring to font files on the old site.

When imported with the Download and import file attachments option checked the font files should be:

  • uploaded to the new site
  • URLs updated to point to their new location

For clarity, this is referring to the XML/WXR exporter available via the WP Dashboard's Tools > Export menu.

Step-by-step reproduction instructions

  1. Create multiple sites running WordPress trunk (one for export, one for import)
  2. On the exporter site:
    1. Edit the 2024 home page
    2. Download Open Sans from Google Fonts (ie, visit the site and download them to your computer)
    3. Open the style editor > typography > Manage Fonts > Upload
    4. Upload the Open Sans files (standard will do, don't worry about condensed, etc)
    5. Close the model once upload is complete
    6. Go through each of the element types and change the font to Open Sans
    7. Use the Yoast Faker CLI tool to create some fake content (this will include attachments)
    8. Visit Tools > Export and download all content
    9. Keep this site running for the next step
  3. On the importer site:
    1. Install and activate the WordPress Importer plugin
    2. Note: For localhosts you may need to change this line to use wp_remote_get()
    3. Visit Tools > Import > WordPress > Run Importer
    4. Check the box to import attachments at the bottom of the screen
    5. Shut down the exporter site
    6. Visit the importer site's front end
    7. Observe the fonts use system defaults
    8. In the browser network tools observe the fonts are trying to make request to the exporter site
    9. Open the style editor > typography > Manage Fonts
    10. Observe the Open Sans fonts are marked as installed locally via uploads
    11. When looking at the content created, you'll notice the media file URLs have been updated in the content to refer to the importer site's URL

Screenshots, screen recording, code snippet

Screenshot from localhost (importer site), notice font face URLs refer to wp-dev.local (exporter site)

Screen Shot 2024-02-16 at 1 05 03 pm

Environment info

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@peterwilsoncc peterwilsoncc added the [Type] Bug An existing feature does not function as intended label Feb 16, 2024
@matiasbenedetto
Copy link
Contributor

Hi, thanks for testing and reporting this issue.

The export of the installed fonts is not implemented yet.
It's being discussed in this ticket: #54226

Closing this one as duplicated of #54226

@matiasbenedetto matiasbenedetto closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2024
@matiasbenedetto
Copy link
Contributor

Thinking twice, this is not about the theme exporter but the site exporter, so I'm re-opening the ticket.

@priethor priethor added the [Priority] High Used to indicate top priority items that need quick attention label Feb 16, 2024
@priethor priethor moved this to 📥 Todo in WordPress 6.5 Editor Tasks Feb 16, 2024
@peterwilsoncc peterwilsoncc changed the title Font Files do not export/import properly. Font Files do not export/import properly via XML/WXR exporter. Feb 16, 2024
@peterwilsoncc
Copy link
Contributor Author

Thanks Matias, I've updated the ticket's title and description to make it clearer the context is the WordPress post exporter rather than the theme folder exporter in the site editor.

@matiasbenedetto
Copy link
Contributor

I've started working on this here: WordPress/wordpress-develop#6173

@annezazu annezazu moved this from 📥 Todo to 🏗️ In Progress in WordPress 6.5 Editor Tasks Feb 26, 2024
@priethor
Copy link
Contributor

priethor commented Mar 1, 2024

What's the status of this, considering the core PR is closed?

@matiasbenedetto
Copy link
Contributor

What's the status of this, considering the core PR is closed?

The PR around exporting the data is needed because the data is exported by default. No changes to the WordPress core repo are needed.
The only change needed is the addition of font assets import capabilities in the WordPress-importer plugin and there's a PR in progress for that: WordPress/wordpress-importer#160

@getdave
Copy link
Contributor

getdave commented Mar 25, 2024

As this is not an Editor specific task but rather Importer I'm now removing it from the Editor board.

Thank you for all the work on this @matiasbenedetto and let's hope it gets merged to the Importers repo soon.

@getdave getdave moved this from 🏗️ In Progress to ✅ Done in WordPress 6.5 Editor Tasks Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Font Library [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants