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

Rename licence -> license throughout codebase #2554

Merged
merged 10 commits into from
Aug 7, 2023
Merged

Conversation

jom
Copy link
Member

@jom jom commented Aug 3, 2023

Built off of #2552

While working on #2552, I realized we have a very brittle setup with the usage of licence vs (US) license. This finally standardizes it to use license and migrates the licenses appropriately. Our strings should previously all been updated, but this switches over the code/options.

Changes proposed in this Pull Request

  • Migrate licence to license in code and options.

Testing instructions

  • On trunk, activate licenses for products.
  • Switch to this branch (note: needs an asset rebuild) and ensure licenses aren't lost. Try activating, deactivating, etc and see how it goes.

Deprecated Code

  • WP_Job_Manager_Helper::has_licenced_products -> WP_Job_Manager_Helper::has_licensed_products
  • WP_Job_Manager_Helper::get_plugin_licence -> WP_Job_Manager_Helper::get_plugin_license
  • WP_Job_Manager_Helper::licence_output -> WP_Job_Manager_Helper::licence_output
  • WP_Job_Manager_Helper::activate_licence -> WP_Job_Manager_Helper::activate_license
  • WP_Job_Manager_Helper::deactivate_licence -> WP_Job_Manager_Helper::deactivate_license

@jom jom requested a review from a team August 3, 2023 09:38
@jom jom self-assigned this Aug 3, 2023
$this->add_error( $product_slug, __( 'license is not active.', 'wp-job-manager' ) );
return;
}
$this->api->deactivate(
[
'api_product_id' => $product_slug,
'licence_key' => $licence['licence_key'],
'email' => $licence['email'],
'license_key' => $license['license_key'],
Copy link
Member Author

Choose a reason for hiding this comment

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

This is changed from the API's request method.

Copy link
Contributor

@aaronfc aaronfc left a comment

Choose a reason for hiding this comment

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

Code looks good! (This is a brave change 😨 🔥 )

I have left some comments and have reviewed the code in detail. I will do tests later.

includes/helper/class-wp-job-manager-helper.php Outdated Show resolved Hide resolved
includes/helper/class-wp-job-manager-helper-api.php Outdated Show resolved Hide resolved
Copy link
Contributor

@aaronfc aaronfc left a comment

Choose a reason for hiding this comment

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

Working like a charm 🔥

@jom
Copy link
Member Author

jom commented Aug 4, 2023

@aaronfc Thanks for the review! I'll hold off merging until the parent PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants