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

Move Calypso redirect option to Jetpack options #7732

Merged
merged 1 commit into from
Sep 4, 2017

Conversation

vindl
Copy link
Member

@vindl vindl commented Sep 1, 2017

Instead of using a separate site option for Calypso redirect switch, let's utilize existing Jetpack options functionality. This was suggested by @beaulebens in #7702.

Testing instructions

  1. Use a Jetpack connected test site.
  2. Since the option will not be set, change this line to:
    if ( Jetpack::get_option( 'edit_links_calypso_redirect', true ) && ! is_admin() ) {
  3. Open a post or page from your site's front end and verify that edit links redirect correctly to Calypso.
    Test with supported Custom Post Types too (Portfolios and Testimonials).

@vindl vindl added [Status] Needs Review This PR is ready for review. [Type] Janitorial labels Sep 1, 2017
@vindl vindl self-assigned this Sep 1, 2017
@vindl vindl requested review from kraftbj, beaulebens, rralian, dereksmart and a team September 1, 2017 05:45
@vindl vindl requested a review from a team as a code owner September 1, 2017 05:45
@vindl vindl added this to the 5.3 milestone Sep 1, 2017
@dereksmart
Copy link
Member

dereksmart commented Sep 1, 2017

So this won't automatically delete it on deactivation nor deletion. We are pretty careful about what data we delete on deactivation, since we very often suggest either deactivation/reinstall of Jetpack as a debug process, and we don't want users losing settings while trying to fix something.

Actually, currently we don't really clean up anything on deactivation, other than the connection options, and we clean the same options on disconnect from wp.com. Check the [plugin_deactivation] method, which is hooked to register_deactivation_hook().

@jeremysawesome
Copy link

Confirmed the edit redirect using the Testing Instructions. The code itself looks good to me 👍

It sounds like we might need to do a bit more to include this option in the plugin cleanup?

Also, I'm not sure if we want to look into the Reset Options beta link that @beaulebens mentioned in his comment here: #7702 (comment)

Copy link
Contributor

@gwwar gwwar left a comment

Choose a reason for hiding this comment

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

Tests well for me 👍

Copy link
Contributor

@kraftbj kraftbj left a comment

Choose a reason for hiding this comment

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

The cleanup pieces are secondary to this PR, but this sets us up to be able to clean them up in a Jetpack-wide way.

@vindl
Copy link
Member Author

vindl commented Sep 4, 2017

So this won't automatically delete it on deactivation nor deletion. We are pretty careful about what data we delete on deactivation, since we very often suggest either deactivation/reinstall of Jetpack as a debug process, and we don't want users losing settings while trying to fix something.

Actually, currently we don't really clean up anything on deactivation, other than the connection options, and we clean the same options on disconnect from wp.com. Check the [plugin_deactivation] method, which is hooked to register_deactivation_hook().

Thanks for the clarification @dereksmart, I updated the PR summary to account for that. I somehow misunderstood that part from the original comment and assumed that cleanup would be automatic.

If that is the case, I don't know why should we make an exception for this option and clean it up? I don't see how it's different when compared to other Jetpack settings/options and I think it should be handled in the same way.

@vindl
Copy link
Member Author

vindl commented Sep 4, 2017

It sounds like we might need to do a bit more to include this option in the plugin cleanup?

@jeremysawesome I don't think it should be included in the plugin cleanup (see my previous comment).

Also, I'm not sure if we want to look into the Reset Options beta link that @beaulebens mentioned in his comment here: #7702 (comment)

It doesn't look like we need to do anything else in order for this option to be picked up by Reset Options. For more info you can check out this function.

In conclusion, the changes in this PR look sufficient to me, but please let me know if y'all don't agree.

@dereksmart
Copy link
Member

I don't know why should we make an exception for this option and clean it up?

I can't think of any reason why we'd want to either! I wanted to make it clear that it wasn't going to, since it sounded like that was a goal judging by the original PR comment, but this change as it it LGTM!

@dereksmart dereksmart merged commit f4cd94c into master Sep 4, 2017
@dereksmart dereksmart deleted the update/move-calypso-edit-option branch September 4, 2017 14:03
@dereksmart
Copy link
Member

pushed to 5.3 48e387b

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

Successfully merging this pull request may close these issues.

6 participants