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

Use new "Deactivate License" endpoint for deactivating licenses on WPJMCOM #2585

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

fjorgemota
Copy link
Member

@fjorgemota fjorgemota commented Sep 20, 2023

Part of #2417

Changes proposed in this Pull Request

  • Change endpoint used to deactivate licenses in WP_Job_Manager_Helper_API

Testing instructions

On a WPJM installation based on this version of the plugin:

  1. Install a WPJM addon;
  2. Activate the license for that addon
  3. Make sure the license is correctly associated with the host of your WP installation on wpjobmanager.com
  4. Deactivate the license for that addon via WPJM UI (just click on the "Deactivate License" button)
  5. Make sure the license is correctly disassociated with the host of your WP installation on wpjobmanager.com

@fjorgemota fjorgemota marked this pull request as draft September 20, 2023 23:08
@fjorgemota fjorgemota self-assigned this Sep 20, 2023
Comment on lines +161 to +164
if ( ! is_array( $response ) || ! array_key_exists( 'success', $response ) ) {
return false;
}
return $response;
Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about adding some handling here to return the same format that we have for errors here, like we have on WPJMCOM for maximum compatibility.

However, I decided to just return false here whenever success isn't present on the $response because I think it matches the return value of the method more.

@fjorgemota fjorgemota requested a review from a team September 22, 2023 01:03
@fjorgemota fjorgemota marked this pull request as ready for review September 22, 2023 01:03
@fjorgemota fjorgemota linked an issue Sep 25, 2023 that may be closed by this pull request
4 tasks
Copy link
Contributor

@gikaragia gikaragia left a comment

Choose a reason for hiding this comment

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

Looks great!

@fjorgemota fjorgemota merged commit e15265f into trunk Oct 3, 2023
8 checks passed
@fjorgemota fjorgemota deleted the change/deactivate-license branch October 3, 2023 15:16
@gikaragia gikaragia mentioned this pull request Oct 4, 2023
@yscik yscik added this to the 1.42.0 milestone Oct 4, 2023
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.

Use new endpoints for license management
3 participants