-
Notifications
You must be signed in to change notification settings - Fork 2k
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
SEO Tools: add archive_title page title token #56084
Conversation
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-14596 |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~10 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~179 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
Otherwise, a WPorg JP site on say 10.1 would see the option to add an Archive Title in Calypso, but it would fail at saving it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the version check added in e4e21fa look ok?
Yup. Although you could use the isJetpackMinimumVersion
utility, to have less work to do?
/** | |
* Returns true if the Jetpack site is running a version meeting the specified | |
* minimum, or false if the Jetpack site is running an older version. Returns | |
* null if the version cannot be determined or if not a Jetpack site. | |
* | |
* @param {object} state Global state tree | |
* @param {number} siteId Site ID | |
* @param {string} version Minimum version | |
* @returns {?boolean} Whether running minimum version | |
*/ | |
export default function isJetpackMinimumVersion( state, siteId, version ) { |
Thanks! Totally missed that one. |
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/6581579 Thank you @samiff for including a screenshot in the description! This is really helpful for our translators. |
@jeherve Small snag here, Would this work, or is there a better way? let shouldShowSeoArchiveTitleButton = false;
if ( isJetpackMinimumVersion( state, siteId, '10.2-alpha' ) ) {
shouldShowSeoArchiveTitleButton = true;
} else if (
! isJetpackSite( state, siteId ) &&
hasActiveSiteFeature( state, siteId, FEATURE_ADVANCED_SEO )
) {
// For non-AT Business plan sites which get SEO features.
shouldShowSeoArchiveTitleButton = true;
} |
Yeah, that sounds good to me. |
Translation for this Pull Request has now been finished. |
Changes proposed in this Pull Request
Related (prerequisite): Automattic/jetpack#20920
This PR:
archive_title
token for custom Archive page titles.Date
token button for Archives (but we still tokenize existing [date] usage).Date
button will only be replaced with theArchive Title
button on Jetpack versions>= 10.2-alpha
Testing instructions
Screenshot for Translators: