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

Social Logos: update icon font #28849

Merged
merged 3 commits into from
Feb 8, 2023
Merged

Social Logos: update icon font #28849

merged 3 commits into from
Feb 8, 2023

Conversation

jeherve
Copy link
Member

@jeherve jeherve commented Feb 8, 2023

Fixes #7148

Proposed changes:

  • It adds some new logos, that one can see directly by loading yoursite.com/wp-content/plugins/jetpack/_inc/social-logos/social-logos.html
  • It removes the handling of an eot file when declaring the icon font. This is no longer necessary with modern browsers.

See discussion in #28694 and commit 84c2ece for more details.

This is needed for #28694.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

  • Old discussion: p1HpG7-3An-p2

Does this pull request change what data or activity we track or use?

  • No

Testing instructions:

  • Load yoursite.com/wp-content/plugins/jetpack/_inc/social-logos/social-logos.html
  • Check the Mastodon logo, it should be displayed properly.
  • Go to Jetpack > Settings > Sharing
  • Enable the Sharing buttons
  • Go to Settings > Sharing
  • Play with the settings, the buttons should be displayed properly.
  • Go to your site's frontend, the sharing buttons should also be displayed nicely.
  • Try in different browsers just to be sure.

Fixes #7148

- It adds some new logos, that one can see directly by loading `yoursite.com/wp-content/plugins/jetpack/_inc/social-logos/social-logos.html`
- It removes the handling of an `eot` file when declaring the icon font. This is no longer necessary with modern browsers.

See discussion below and commit 84c2ece for more details.

This is needed for #28694.
@jeherve jeherve self-assigned this Feb 8, 2023
@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Feb 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: March 7, 2023.
  • Scheduled code freeze: February 28, 2023.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run

bin/jetpack-downloader test jetpack update/social-logos-icon-font

to get started. More details: p9dueE-5Nn-p2

@jeherve jeherve added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] In Progress labels Feb 8, 2023
@kraftbj kraftbj enabled auto-merge (squash) February 8, 2023 21:52
@kraftbj kraftbj merged commit 12231ae into trunk Feb 8, 2023
@kraftbj kraftbj deleted the update/social-logos-icon-font branch February 8, 2023 22:09
@github-actions github-actions bot removed the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Feb 8, 2023
@github-actions github-actions bot added this to the jetpack/11.9 milestone Feb 8, 2023
@jeherve jeherve added the [Status] Needs Testing We need to add this change to the testing call for this month's release label Feb 9, 2023
jeherve added a commit that referenced this pull request Feb 9, 2023
@samiff samiff removed the [Status] Needs Testing We need to add this change to the testing call for this month's release label Feb 27, 2023
jeherve added a commit that referenced this pull request Mar 13, 2023
Follow-up to #28849

In #28849, we moved away from using a base64-encoded font and an eot file for multiple reasons:

- #6076
- #7148
- #28694 (comment)

Instead, we switched to loading 3 files from local paths:

- woff2, supported by all modern browsers: https://caniuse.com/woff2
- woff and ttf, around for compatibility with old browsers: https://css-tricks.com/snippets/css/using-font-face-in-css/

Given how widespread woff2 support looks like today, we may be able to use just that. We will, however, need to revert to a base64-encoded font to avoid CORS issues when the files are served from a CDN, like Photon CDN:

Access to font at 'https://c0.wp.com/p/jetpack/11.9/_inc/social-logos/social-logos.woff2' from origin 'https://yoursite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Both approaches seem to be problematic:

- base64-encoded fonts are broken for some people.
- fonts loaded via a path have CORS issues for everyone using a CDN. => This seems like the biggest problem for us right now, given that Jetpack includes such a CDN.

This commit is consequently not a perfect solution. Switching to SVGs, as discussed in #28861, seems to be the path forward.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Sharing Post sharing, sharing buttons [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Normal [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sharing: issues decoding Social Logos font on pages including sharing buttons
3 participants