PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.2
Jetpack – WP Security, Backup, Speed, & Growth v16.2
16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 All 502 releases
← All changes | modules/publicize.php +11 -20 14.2.216.2 View file →
@@ -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
@@ -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;