-
Notifications
You must be signed in to change notification settings - Fork 821
Remove Pocket sharing service ahead of July 2025 shutdown #43795
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
96afcd6
31c0a34
56ce76b
8833e04
2d509bb
10a0f3f
50a1b06
50f7c4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: removed | ||
|
||
Remove Pocket SVG icons, font codepoints, and logo data ahead of Mozilla's July 2025 shutdown. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: removed | ||
|
||
Remove Pocket support from social menu icon functions and CSS styling ahead of Mozilla's July 2025 shutdown. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: removed | ||
|
||
Remove the Pocket sharing service ahead of Mozilla's July 2025 shutdown. Existing Pocket configurations will gracefully degrade with no broken functionality. Users are provided with alternative read-later service suggestions in the sharing settings. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
"whatsapp", | ||
"telegram", | ||
"pinterest", | ||
"pocket", | ||
"reddit", | ||
"nextdoor", | ||
"print", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,10 +153,6 @@ li.service.share-tumblr span::before { | |
content: '\f214'; | ||
} | ||
|
||
li.service.share-pocket span::before { | ||
content: '\f224'; | ||
} | ||
|
||
li.service.share-pinterest span::before { | ||
content: '\f209'; | ||
} | ||
|
@@ -366,13 +362,6 @@ body.settings_page_sharing .advanced input[type="submit"] { | |
height: 20px; | ||
} | ||
|
||
.preview-pocket .option-smart-on { | ||
background: url(images/smart-pocket.png) no-repeat top left; | ||
background-size: 60px 20px; | ||
width: 60px; | ||
height: 20px; | ||
} | ||
|
||
.preview-item.share-deprecated { | ||
opacity: 0.5; | ||
} | ||
|
@@ -410,9 +399,6 @@ body.settings_page_sharing .advanced input[type="submit"] { | |
background-image: url(images/[email protected]); | ||
} | ||
|
||
.preview-pocket .option-smart-on { | ||
background-image: url(images/[email protected]); | ||
} | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2907,141 +2907,6 @@ function init() { | |
} | ||
} | ||
|
||
/** | ||
* Pocket sharing service. | ||
*/ | ||
class Share_Pocket extends Sharing_Source { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of deleting the class altogether, I would recommend leveraging our |
||
/** | ||
* Service short name. | ||
* | ||
* @var string | ||
*/ | ||
public $shortname = 'pocket'; | ||
|
||
/** | ||
* Service icon font code. | ||
* | ||
* @var string | ||
*/ | ||
public $icon = '\f224'; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param int $id Sharing source ID. | ||
* @param array $settings Sharing settings. | ||
*/ | ||
public function __construct( $id, array $settings ) { | ||
parent::__construct( $id, $settings ); | ||
|
||
if ( 'official' === $this->button_style ) { | ||
$this->smart = true; | ||
} else { | ||
$this->smart = false; | ||
} | ||
} | ||
|
||
/** | ||
* Service name. | ||
* | ||
* @return string | ||
*/ | ||
public function get_name() { | ||
return __( 'Pocket', 'jetpack' ); | ||
} | ||
|
||
/** | ||
* Process sharing request. Add actions that need to happen when sharing here. | ||
* | ||
* @param WP_Post $post Post object. | ||
* @param array $post_data Array of information about the post we're sharing. | ||
* | ||
* @return void | ||
*/ | ||
public function process_request( $post, array $post_data ) { | ||
// Record stats | ||
parent::process_request( $post, $post_data ); | ||
|
||
$pocket_url = esc_url_raw( 'https://getpocket.com/save/?url=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&title=' . rawurlencode( $this->get_share_title( $post->ID ) ) ); | ||
|
||
parent::redirect_request( $pocket_url ); | ||
} | ||
|
||
/** | ||
* Get the markup of the sharing button. | ||
* | ||
* @param WP_Post $post Post object. | ||
* | ||
* @return string | ||
*/ | ||
public function get_display( $post ) { | ||
if ( $this->smart ) { | ||
$post_count = 'horizontal'; | ||
|
||
$button = ''; | ||
$button .= '<div class="pocket_button">'; | ||
$button .= sprintf( '<a href="https://getpocket.com/save" class="pocket-btn" data-lang="%s" data-save-url="%s" data-pocket-count="%s" >%s</a>', 'en', esc_attr( $this->get_share_url( $post->ID ) ), $post_count, esc_attr__( 'Pocket', 'jetpack' ) ); | ||
$button .= '</div>'; | ||
|
||
return $button; | ||
} else { | ||
return $this->get_link( $this->get_process_request_url( $post->ID ), _x( 'Pocket', 'share to', 'jetpack' ), __( 'Click to share on Pocket', 'jetpack' ), 'share=pocket', 'sharing-pocket-' . $post->ID ); | ||
} | ||
} | ||
|
||
/** | ||
* AMP display for Pocket. | ||
* | ||
* @param \WP_Post $post The current post being viewed. | ||
*/ | ||
public function get_amp_display( $post ) { | ||
$attrs = array( | ||
'data-share-endpoint' => esc_url_raw( 'https://getpocket.com/save/?url=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&title=' . rawurlencode( $this->get_share_title( $post->ID ) ) ), | ||
); | ||
|
||
return $this->build_amp_markup( $attrs ); | ||
} | ||
|
||
/** | ||
* Add content specific to a service in the footer. | ||
*/ | ||
public function display_footer() { | ||
if ( $this->smart ) : | ||
?> | ||
<script> | ||
( function () { | ||
var currentScript = document.currentScript; | ||
|
||
// Don't use Pocket's default JS as it we need to force init new Pocket share buttons loaded via JS. | ||
function jetpack_sharing_pocket_init() { | ||
var script = document.createElement( 'script' ); | ||
var prev = currentScript || document.getElementsByTagName( 'script' )[ 0 ]; | ||
script.setAttribute( 'async', true ); | ||
script.setAttribute( 'src', 'https://widgets.getpocket.com/v1/j/btn.js?v=1' ); | ||
prev.parentNode.insertBefore( script, prev ); | ||
} | ||
|
||
if ( document.readyState === 'loading' ) { | ||
document.addEventListener( 'DOMContentLoaded', jetpack_sharing_pocket_init ); | ||
} else { | ||
jetpack_sharing_pocket_init(); | ||
} | ||
document.body.addEventListener( 'is.post-load', jetpack_sharing_pocket_init ); | ||
} )(); | ||
</script> | ||
<?php | ||
else : | ||
$this->js_dialog( | ||
$this->shortname, | ||
array( | ||
'width' => 450, | ||
'height' => 450, | ||
) | ||
); | ||
endif; | ||
} | ||
} | ||
|
||
/** | ||
* Telegram sharing service. | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
social-logos
is an npm package and might be used by many codebases, we should be careful about removing this part here, as it can break the existing code that might still be using it. We may deprecate the icon instead and remove it in the future.