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

Subscriptions: Add a clear message when an email having many pending confirmations tries to subscribe a site. #14275

Merged
merged 4 commits into from
Jan 14, 2020

Conversation

htdat
Copy link
Member

@htdat htdat commented Dec 22, 2019

Fixes #2278
Similar PRs: #9093 and #2599

Changes proposed in this Pull Request:

  • For A12s, see 23696-pb for the reason I am implementing flooded_email status.

Before - unclear message:

Screen Shot on 2019-12-22 at 20:03:36

After (with this fix) - clearer error message:

Screen Shot on 2019-12-22 at 20:11:29

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

  • It improves the current Subscription feature.

Testing instructions:

  • Use your test email, try to subscribe at least 5 WP.com and Jetpack sites without clicking confirmation links. Some suggestions: jetpack.com, en.blog.wordpress.com (es, ja, fr blog sites too).
  • Go to your testing Jetpack site
  • Try to subscribe with this email
  • Get redirected to a link like this http://site.com/?subscribe=many_pending_subs#blog_subscription-3, AND see the message in the "after" screenshot above.

Proposed changelog entry for your changes:

  • Subscriptions: Add a clear message when an email having many pending confirmations tries to subscribe a site.

@htdat htdat added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Subscriptions All subscription-related things such as paid and unpaid, user management, and newsletter settings. [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Dec 22, 2019
@htdat htdat requested a review from a team December 22, 2019 13:18
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello htdat! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D37046-code before merging this PR. Thank you!

@jetpackbot
Copy link

jetpackbot commented Dec 22, 2019

Warnings
⚠️

pre-commit hook was skipped for one or more commits

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS against 4df8fe4

@htdat
Copy link
Member Author

htdat commented Dec 22, 2019

pre-commit hook was skipped for one or more commits

This is intentional as I am following the style of the current code.

@kraftbj
Copy link
Contributor

kraftbj commented Dec 25, 2019

Thanks! For the code styling, the intent of the changed line test is for updated code to get current styling to reduce the need (and size of) the more massive "PHPCS everything!" PRs. Merging those back to wp.com isn't the most fun thing!

@htdat
Copy link
Member Author

htdat commented Dec 26, 2019

@kraftbj Gotcha, thanks for the explanation! So should I fix all style coding issues in this PR or I keep it as-is now?

@jeherve jeherve added this to the 8.2 milestone Jan 7, 2020
modules/subscriptions/views.php Outdated Show resolved Hide resolved
modules/subscriptions/views.php Outdated Show resolved Hide resolved
modules/subscriptions/views.php Outdated Show resolved Hide resolved
@@ -150,6 +150,12 @@ static function render_widget_status_messages( $instance ) {
__( 'Manage your email preferences.', 'jetpack' )
); ?></p>
<?php break;
case 'many_pending_subs' : ?>
<p class="error"><?php printf( __( 'You already have several pending email subscriptions. <br /> Approve or delete a few subscriptions at <a href="%1$s" title="%2$s" target="_blank">subscribe.wordpress.com</a> before continuing.', 'jetpack' ),
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if several is the right word here, since this can happen with just a few pending subs. Should we remove that word?

Copy link
Member Author

@htdat htdat Jan 7, 2020

Choose a reason for hiding this comment

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

several means more than two but not many. (I checked on the Oxford dictionary :D) Basically, I think its meaning is similar to "a few"?

Originally, I used "a few" too and then I followed the same message in WP.com side
https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions/views.php#L177

Copy link
Member

Choose a reason for hiding this comment

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

I'll let a native chime in on this :)

cc @kraftbj

@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jan 7, 2020
@jeherve
Copy link
Member

jeherve commented Jan 7, 2020

So should I fix all style coding issues in this PR or I keep it as-is now?

I would suggest adhering to coding standards in the lines you changed. In a follow-up PR, you could then update the code around it to follow the same pattern.

@matticbot
Copy link
Contributor

htdat, Your synced wpcom patch D37046-code has been updated.

@htdat htdat added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jan 7, 2020
@htdat htdat force-pushed the fix/many-pending-sub-confirmations branch from 01fff0d to b368167 Compare January 7, 2020 14:49
@htdat
Copy link
Member Author

htdat commented Jan 7, 2020

I would suggest adhering to coding standards in the lines you changed. In a follow-up PR, you could then update the code around it to follow the same pattern.

Thanks, Jeremy. I've updated code per your feedback and follow up coding standards.
When this PR is ready to merge, I will create another PR to fix the code around it.

modules/subscriptions/views.php Outdated Show resolved Hide resolved
modules/subscriptions/views.php Outdated Show resolved Hide resolved
@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jan 8, 2020
@matticbot
Copy link
Contributor

htdat, Your synced wpcom patch D37046-code has been updated.

@htdat htdat removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jan 11, 2020
@htdat htdat added the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Jan 11, 2020
@htdat
Copy link
Member Author

htdat commented Jan 11, 2020

I've added a new commit to address the recent feedback. Thank you, @jeherve.
Hope it's OK now :D

@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 Jan 13, 2020
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.

This tests well for me now.

wp_kses(
/* translators: 1: Link to Subscription Management page https://subscribe.wordpress.com/, 2: Description of this link */
__( 'You already have several pending email subscriptions. <br /> Approve or delete a few subscriptions at <a href="%1$s" title="%2$s" target="_blank" rel="noopener noreferrer">subscribe.wordpress.com</a> before continuing.', 'jetpack' ),
self::$allowed_html_tags_for_message
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nice way to keep things tidy and makes it easily reusable in the future. Cool.

@kraftbj kraftbj merged commit dd76244 into master Jan 14, 2020
@kraftbj kraftbj deleted the fix/many-pending-sub-confirmations branch January 14, 2020 16:40
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Jan 14, 2020
@kraftbj
Copy link
Contributor

kraftbj commented Jan 14, 2020

r201611-wpcom

jeherve added a commit that referenced this pull request Jan 17, 2020
jeherve added a commit that referenced this pull request Jan 27, 2020
* [not verified] Rebase from the master branch and resolve conflict after #14275 is merged

* Fix the space issue (again)

* Add rel attribute

Co-Authored-By: Jeremy Herve <jeremy@jeremy.hu>

* Fix PHPCS error for switch statement

* Update wording.

Co-authored-by: Jeremy Herve <jeremy@tagada.hu>
Co-authored-by: Brandon Kraft <public@brandonkraft.com>
jeherve added a commit that referenced this pull request Jan 28, 2020
* [not verified] Remove empty readme section

* Initial changelog for 8.2

* Changelog: add #14220

* Changelog: add #14252

* Changelog: add #14291

* Changelog: add #14309

* Changelog: add #14304

* Changelog: add general connection log.

* Changelog: add #14275

* Changelog: add #14313

* Changelog: add #14213

* Changelog: add #14357

* Add sync testing instructions

* Add 8.1.1 changelog back

See eeaafab and 61757eb

* Changelog: add #14371

* Changelog: add #14386

* Changelog: add #14471

* Changelog: add #14325

* Changelog: add #14194

* Changelog: add #14340

* Changelog: add #14418

* Changelog: add #14417

* Changelog: add #14075

* Changelog: add #14467

* Changelog: add #14307

* Changelog: add #14326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Subscriptions All subscription-related things such as paid and unpaid, user management, and newsletter settings. Touches WP.com Files [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subscriptions: Notify email-only subscribers when they have too many pending subscriptions
5 participants