Conversation
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: January 10, 2019. |
jeherve
left a comment
There was a problem hiding this comment.
Switching this back to "In Progress", since the block is broken and some things will need to be updated in Jetpack to make it work:
Automattic/wp-calypso#28366 (review)
This PR will also need a rebase.
modules/subscriptions.php
Outdated
| $show_subscribers_total = (bool) $instance['show_subscribers_total']; | ||
| $subscribers_total = $this->fetch_subscriber_count(); // Only used for the shortcode [total-subscribers] | ||
|
|
||
| if ( $instance['show_only_email_and_button'] ) { |
There was a problem hiding this comment.
Why do we want to remove that information from the block? Wouldn't it be nice if folks could opt to use or customize that information?
There was a problem hiding this comment.
This allows the published post/form to conform to @MichaelArestad 's design, https://wp.me/pafL3P-4w-p2
The idea was that anyone who wants to add things to their subscription form could simply add other block types above, below, to the side of it, etc. and include anything they want.
007614e to
d6066a3
Compare
|
D21385-code. (newly created revision) |
d6066a3 to
d936078
Compare
| $subscriptions = new Jetpack_Subscriptions_Widget(); | ||
| $subscriber_info = $subscriptions->fetch_subscriber_count(); | ||
| // Get the most up to date subscriber count when request is not a test | ||
| if ( ! defined( 'TESTING_IN_JETPACK' ) ) { |
There was a problem hiding this comment.
does Jetpack side knows when the site gets a new subscriber? could we delete the transient at that point?
There was a problem hiding this comment.
@lezama I don't believe it does. There is an increment_subscriber_count function,
jetpack/modules/subscriptions.php
Line 984 in d7a1fad
I believe the way it works is that subscribers confirm their subscription via the email they receive from wpcom, and the Jetpack site simply drops its transient and queries wpcom if the transient is more than an hour old to get the latest confirmed subscriber count.
…nd_button'], removing outdated comment
2ff7441 to
2a40a51
Compare
| $subscriptions = new Jetpack_Subscriptions_Widget(); | ||
| $subscriber_info = $subscriptions->fetch_subscriber_count(); | ||
| // Get the most up to date subscriber count when request is not a test | ||
| if ( ! defined( 'TESTING_IN_JETPACK' ) ) { |
There was a problem hiding this comment.
Lets use Jetpack_Constant class here instead.
…stead of defined()
…by save is sufficient
* Add first version of the Changelog and testing list for 6.9 * Changelog: add #10710 * changelog: add #10538 * changelog: add #10741 * changelog: add #10749 * changelog: add #10664 * changelog: add #10224 * changelog: add #10788 * Changelog: add #10560 * Chanegelog: add #10812 * changelog: add #10556 * Changelog: add #10668 * Changelog: add #10846 * Changelog: add #10947 * Changelog: add #10962 * Changelog: add #10956 * Changelog: add #10940 * Changelog: add #10934 * Changelog: add #10912 * changelog: add #10866 * changelog: add #10924 * Changelog: add #10936 * Changelog: add #10833 * changelog: add #10867 * Changelog: add #10960 * Changelog: add #10888 * changelog: add #10840 * changelog: add #10972 * Changelog: add #10979 * changelog: add #10909 * Changelog: add #10958 * Changelog: add #10981 * Changelog: add #10564 * Changelog: add #10809 * Changelog: add #10982 * Changelog: add #10706 * Changelog: add #10978 * Changelog: add #10132 * Changelog: add #11022 * Changelog: add #11024 * Changelog: add #10875 * Changelog: add #11030 * Changelog: add #11053 * Changelog: add #10880 * Changelog: add #9359 * Changelog: add #11037 * Update block list * Changelog: add #11060 * Changelog: add #10755 * changelog: add #11000 * Changelog: add #10786 * Changelog: add #10945 * Changelog: add #10597





This pull request adds the Gutenberg Subscription block.
The Subscription block invites visitors to sign up to be notified when there are new posts on a site.
When the block has focus in the editor, editors can toggle whether to show the number of subscribers in the block. When it doesn't have focus, editors will see the number of subscribers if they toggled that on.
Testing instructions:
Note that the block still is going to receive some CSS ❤️(cc @MichaelArestad) , so please focus on testing its functionality for now.
Checkout this Jetpack branch and the corresponding Calypso branch,
Gutenpack Subscription Block (Take two) wp-calypso#28887
Run the command to build the Subscription block from your wp-calypso repo directory:
Connect Jetpack if it isn't connected
Create a new post and add the Jetpack Subscription Block.
Toggle the "show number of subscribers". Confirm that you see the number of subscribers when the block loses focus.
Publish the post. Confirm that you see it on the frontend.
Subscribe by using the block with a user or two (they will have to be a connected Jetpack user)
Confirm that you see the number of subscribed users on the frontend (when the toggle was enabled for the block in the editor) and the editor when the block doesn't have focus.
Proposed changelog entry for your changes:
No changelog entry needed.