| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | 2 | /** |
| 3 | 3 | * Module Name: Jetpack Social |
| 4 | - * Module Description: Jetpack Social makes it easy to share your site’s posts on several social media networks automatically when you publish a new post. | |
| 4 | + * Module Description: Auto‑share your posts to social networks and track engagement in one place. | |
| 5 | 5 | * Sort Order: 10 |
| 6 | 6 | * Recommendation Order: 7 |
| 7 | 7 | * First Introduced: 2.0 |
| 8 | 8 | * Requires Connection: Yes |
| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | * Requires User Connection: Yes |
| 10 | 10 | * Auto Activate: No |
| 11 | 11 | * Module Tags: Social, Recommended |
| 12 | 12 | * Feature: Engagement |
| 13 | - * Additional Search Queries: facebook, jetpack publicize, tumblr, linkedin, social, tweet, connections, sharing, social media, automated, automated sharing, auto publish, auto tweet and like, auto tweet, facebook auto post, facebook posting | |
| 13 | + * Additional Search Queries: facebook, bluesky, threads, mastodon, instagram, jetpack publicize, tumblr, linkedin, social, tweet, connections, sharing, social media, automated, automated sharing, auto publish, auto tweet and like, auto tweet, facebook auto post, facebook posting | |
| 14 | 14 | * |
| 15 | 15 | * @package automattic/jetpack |
| 16 | 16 | */ |
| 17 | 17 | |
| @@ -16,36 +16,27 @@ | ||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | // phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files. |
| 19 | 19 | |
| 20 | +use Automattic\Jetpack\Status\Host; | |
| 21 | + | |
| 22 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 23 | + exit( 0 ); | |
| 24 | +} | |
| 25 | + | |
| 20 | 26 | /** |
| 21 | 27 | * Class Jetpack_Publicize |
| 28 | + * | |
| 29 | + * @phan-constructor-used-for-side-effects | |
| 22 | 30 | */ |
| 23 | 31 | class Jetpack_Publicize { |
| 24 | 32 | /** |
| 25 | - * Current status about Jetpack modules. | |
| 26 | - * | |
| 27 | - * @var Automattic\Jetpack\Modules | |
| 28 | - */ | |
| 29 | - public $modules; | |
| 30 | - | |
| 31 | - /** | |
| 32 | - * If Publicize is executing within Jetpack. | |
| 33 | - * | |
| 34 | - * @var bool | |
| 35 | - */ | |
| 36 | - public $in_jetpack = true; | |
| 37 | - | |
| 38 | - /** | |
| 39 | 33 | * Jetpack_Publicize constructor. |
| 40 | 34 | */ |
| 41 | 35 | public function __construct() { |
| 42 | 36 | global $publicize_ui; |
| 43 | 37 | |
| 44 | - $this->modules = new Automattic\Jetpack\Modules(); | |
| 45 | - $this->in_jetpack = ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'enable_module_configurable' ) ) ? true : false; | |
| 46 | - | |
| 47 | - if ( $this->in_jetpack ) { | |
| 38 | + if ( ! ( new Host() )->is_wpcom_simple() ) { | |
| 48 | 39 | Jetpack::enable_module_configurable( __FILE__ ); |
| 49 | 40 | |
| 50 | 41 | /* |
| 51 | 42 | * The Publicize Options array does not currently have UI since it is being added |
| @@ -96,9 +87,9 @@ | ||
| 96 | 87 | |
| 97 | 88 | // None of this should be the case, but we can get here with a broken user connection. If that's the case |
| 98 | 89 | // then we want to stop loading any more of the module code. |
| 99 | 90 | if ( |
| 100 | - ! ( new Automattic\Jetpack\Modules() )->is_active( 'publicize' ) | |
| 91 | + ! Jetpack::is_module_active( 'publicize' ) | |
| 101 | 92 | || ! Jetpack::connection()->has_connected_user() |
| 102 | 93 | || ! $publicize |
| 103 | 94 | ) { |
| 104 | 95 | return; |