-
Notifications
You must be signed in to change notification settings - Fork 800
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
Classic Theme Helper: Copy Social Links code to Classic Theme Helper package #38593
Classic Theme Helper: Copy Social Links code to Classic Theme Helper package #38593
Conversation
…n both package and Jetpack module to prevent fatal errors
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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 appearing at the bottom of this PR are passing or skipped. Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
|
||
// @phan-suppress-next-line PhanUndeclaredFunction -- Function checked with function_exists - see https://github.com/phan/phan/issues/1204. | ||
$this->publicize = function_exists( 'publicize_init' ) ? publicize_init() : null; | ||
$publicize_services = $this->publicize->get_services( 'connected' ); |
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.
What happens here if $this->publicize
is null?
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.
Good question. I've no idea at this stage, but I'll make sure to look into that when requiring the package in the next PR.
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.
Thanks for working on this one @coder-karen!
Changes look sensible to me before testing.
As of now, there is only two things that I can think of that might need changes.
- I'm not sure how much sense does all of the logic if
Publicize
orpublicize_init
don't exist. I see there is a wrapper insidecustomize_register(
checking it, but I feel like maybe it would need to be early on. Should it be even before that? Maybe return early in the constructor? I have added an inline comment in a place where I think the absence of Publicize will create a Fatal - I would change is the filename
projects/packages/classic-theme-helper/src/social-links.php
toprojects/packages/classic-theme-helper/src/class-social-links.php
.
Thanks for testing @darssen !
Good questions, thanks! What I'll do is make sure to investigate that when requiring the package in the next PR. None of that moved functionality should be running here, only the existing functionality. I'll add a note to the issue for the next step: https://github.com/Automattic/vulcan/issues/432
Yes, I did initially try that, and it resulted in some issues for me (a fatal error). I had added that as something to try and rename in the next PR - added in the above issue. The issue seemed related to the Jetpack autoloader. Had you come across this before? I know Featured Content was also in a class so I was looking at what was done there originally. |
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.
This tested well with all types of sites.
Fixes https://github.com/Automattic/vulcan/issues/431
Proposed changes:
social-links.php
.Other information:
Jetpack product discussion
https://github.com/Automattic/vulcan/issues/431
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Self-hosted and Atomic:
/wp-admin/admin.php?page=jetpack#/sharing
and add a connection.credsflow....
in the SS (internal only).Simple:
https://wordpress.com/marketing/connections/yoursite.com