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

WooCommerce_Services: Set the Jetpack object with the jetpack_loaded action #14211

Merged
merged 1 commit into from
Dec 16, 2019

Conversation

kbrown9
Copy link
Member

@kbrown9 kbrown9 commented Dec 11, 2019

Currently, the WC_Services_Installer class calls Jetpack::init() when the file is loaded. Jetpack::init() should be called only after all of the plugins have been loaded. To fix this, set the Jetpack instance using the jetpack_loaded action hook, which provides the Jetpack object after all of the plugins have been loaded.

Changes proposed in this Pull Request:

  • Set the Jetpack instance using the jetpack_loaded action hook.

Is this a new feature or does it add/remove features to an existing part of Jetpack?

  • This changes an existing part of Jetpack.

Testing instructions:

We'll test this by checking that the WooCommerce Services plugin is successfully installed via the JITM.

Test Site Setup
  • Jetpack must be installed, activated, and connected.
  • WooCommerce must be installed and activated.
  • WooCommerces Services must not be installed.
Test Steps
  1. On wp-admin, navigate to WooCommerce -> Orders.
  2. You should see a JITM at the top of the page with an "INSTALL WOOCOMMERCE SERVICES" button. Click that button to install the WooCommerce Services plugin.
  3. Navigate to Plugins and ensure that the WooCommerce Services plugin was successfully installed and activated.

Proposed changelog entry for your changes:

  • tbd

Currently, this class calls Jetpack::init() when the file is loaded.
Jetpack::init() should be called only after all of the plugins have been
loaded. To fix this, set the Jetpack object using the 'jetpack_loaded'
action hook, which provides the Jetpack object after all of the plugins
have been loaded.
@kbrown9 kbrown9 added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Focus] Jetpack DNA labels Dec 11, 2019
@kbrown9 kbrown9 requested review from zinigor and a team December 11, 2019 21:14
@kbrown9 kbrown9 self-assigned this Dec 11, 2019
@jetpackbot
Copy link

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: January 14, 2020.
Scheduled code freeze: January 7, 2020

Generated by 🚫 dangerJS against 12a593d

@jeherve jeherve added this to the 8.1 milestone Dec 12, 2019
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Dec 12, 2019
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to work in my tests. 🚢

@kraftbj kraftbj merged commit bd2a44b into master Dec 16, 2019
@kraftbj kraftbj deleted the fix/wc_services_jp_init branch December 16, 2019 22:07
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Dec 16, 2019
jeherve added a commit that referenced this pull request Dec 20, 2019
zinigor added a commit that referenced this pull request Dec 30, 2019
* Changelog: 8.1 additions

* Changelog: add #13858

* Changelog: add #13963

* Changelog: add #14174

* Changelog: add #14178

* Changelog: add #14175

* Changelog: add #14192

* Changelog: add #14196

* Changelog: add #14182

* Changelog: add #14218

* Changelog: add #14214

* Changelog: add #13757

* Changelog: add #14190

* Changelog: add #14131

* Changelog: add #14101

* Changelog: add #14203

* Changelog: add #14211

* Changelog: add #14224

* Changelog: add #14230

* Changelog: add #14241

* Changelog: add #14249

* Changelog: add #14264

* Changelog: add #14263

* Changelog: add #14256

* Changelog: add #10189

* Changelog: add #14240

* Changelog: add #14239

Also added some new entries to the testing file.

Co-authored-by: Igor Zinovyev <[email protected]>
zinigor added a commit that referenced this pull request Dec 30, 2019
* Changelog: 8.1 additions

* Changelog: add #13858

* Changelog: add #13963

* Changelog: add #14174

* Changelog: add #14178

* Changelog: add #14175

* Changelog: add #14192

* Changelog: add #14196

* Changelog: add #14182

* Changelog: add #14218

* Changelog: add #14214

* Changelog: add #13757

* Changelog: add #14190

* Changelog: add #14131

* Changelog: add #14101

* Changelog: add #14203

* Changelog: add #14211

* Changelog: add #14224

* Changelog: add #14230

* Changelog: add #14241

* Changelog: add #14249

* Changelog: add #14264

* Changelog: add #14263

* Changelog: add #14256

* Changelog: add #10189

* Changelog: add #14240

* Changelog: add #14239

Also added some new entries to the testing file.

Co-authored-by: Igor Zinovyev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Jetpack DNA [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants