PluginProbe ʕ •ᴥ•ʔ
Jetpack – WP Security, Backup, Speed, & Growth / 13.6.2
Jetpack – WP Security, Backup, Speed, & Growth v13.6.2
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 14.3.1 14.4.2 14.5.1 14.6.1 14.7.1 14.8.1 14.9.2 15.0.3 15.1.2 15.2.1 15.3.2 15.4.1 15.5.1 15.6.1 15.7.2 15.8.1 15.9.2 16.0.2 16.1.3 16.2-a.5 16.2-a.3 16.1.2 16.2-a.1 16.1.1 16.1 16.1-beta 16.1-beta.2 16.1-beta.3 16.1-a.5 16.1-a.3 16.0.1 16.1-a.1 16.0 16.0-beta 16.0-a.7 16.0-a.5 15.9.1 16.0-a.3 16.0-a.1 15.9 15.9-beta 15.9-a.7 15.9-a.5 15.9-a.3 15.9-a.1 15.8 15.8-beta 15.8-a.7 15.8-a.5 5.2.5 5.3.4 5.4.4 5.5.5 5.6.5 5.7.5 5.8.4 5.9.4 6.0.4 6.1 6.1.1 6.1.2 6.1.3 6.1.4 6.1.5 6.2 6.2.1 6.2.2 6.2.3 6.2.4 6.2.5 6.3 6.3.1 6.3.2 6.3.3 6.3.4 6.3.5 6.3.6 6.3.7 6.4 6.4.1 6.4.2 6.4.3 6.4.4 6.4.5 6.4.6 6.5 6.5.1 6.5.2 6.5.3 6.5.4 6.6 6.6.1 6.6.2 6.6.3 6.6.4 6.6.5 6.7 6.7.1 6.7.2 6.7.3 6.7.4 6.8 6.8.1 6.8.2 6.8.3 6.8.4 6.8.5 6.9 6.9.1 6.9.2 6.9.3 6.9.4 7.0 7.0.1 7.0.2 7.0.3 7.0.4 7.0.5 7.1 7.1.1 7.1.2 7.1.3 7.1.4 7.1.5 7.2 7.2.1 7.2.1.1 7.2.2 7.2.3 7.2.4 7.2.5 7.3 7.3.0.1 7.3.1 7.3.1.1 7.3.2 7.3.3 7.3.4 7.3.5 7.4 7.4.1 7.4.2 7.4.3 7.4.4 7.4.5 7.5 7.5.0.1 7.5.1 7.5.2 7.5.3 7.5.4 7.5.5 7.5.6 7.5.7 7.6 7.6.1 7.6.2 7.6.3 7.6.4 7.7 7.7.1 7.7.2 7.7.3 7.7.4 7.7.5 7.7.6 7.8 7.8.1 7.8.2 7.8.3 7.8.4 7.9 7.9.1 7.9.2 7.9.3 7.9.4 8.0 8.0.1 8.0.2 8.0.3 8.1 8.1.1 8.1.2 8.1.3 8.1.4 8.2 8.2.0.1 8.2.1 8.2.2 8.2.3 8.2.4 8.2.5 8.2.6 8.3 8.3.1 8.3.2 8.3.3 8.4 8.4.1 8.4.2 8.4.3 8.4.4 8.4.5 8.5 8.5.1 8.5.2 8.5.3 8.6 8.6.1 8.6.2 8.6.3 8.6.4 8.7 8.7.0.1 8.7.1 8.7.2 8.7.3 8.7.4 8.8 8.8.1 8.8.2 8.8.3 8.8.4 8.8.5 8.9 8.9.1 8.9.2 8.9.3 8.9.4 9.0 9.0.1 9.0.2 9.0.3 9.0.4 9.0.5 9.1 9.1.1 9.1.2 9.1.3 9.2 9.2.1 9.2.2 9.2.3 9.2.4 9.3 9.3.1 9.3.2 9.3.3 9.3.4 9.3.5 9.4 9.4.1 9.4.2 9.4.3 9.4.4 9.5 9.5.1 9.5.2 9.5.3 9.5.4 9.5.5 9.6 9.6.1 9.6.2 9.6.3 9.6.4 9.7 9.7.1 9.7.2 15.7-beta.2 9.7.3 15.7.1 9.8 15.8-a.1 9.8.1 15.8-a.3 9.8.2 2.0.9 9.8.3 2.1.7 9.9 2.2.10 9.9.1 2.3.10 9.9.2 2.4.7 9.9.3 2.5.5 2.6.6 2.7.5 2.8.5 2.9.6 3.0.6 3.1.5 3.2.5 3.3.6 3.4.6 3.5.6 3.6.4 3.7.5 3.8.5 3.9.10 4.0.7 4.1.4 4.2.5 4.3.5 4.4.5 4.5.3 4.6.3 4.7.4 4.8.5 4.9.3 5.0.3 5.1.4 trunk 10.0 10.0.1 10.0.2 10.1 10.1.1 10.1.2 10.2 10.2.1 10.2.2 10.2.3 10.3 10.3.1 10.3.2 10.4 10.4.1 10.4.2 10.5 10.5.1 10.5.2 10.5.3 10.6 10.6.1 10.6.2 10.7 10.7.1 10.7.2 10.8 10.8.1 10.8.2 10.9 10.9.1 10.9.2 10.9.3 11.0 11.0.1 11.0.2 11.1 11.1.1 11.1.2 11.1.3 11.1.4 11.2 11.2.1 11.2.2 11.3 11.3.1 11.3.2 11.3.3 11.3.4 11.4 11.4.1 11.4.2 11.5 11.5.1 11.5.2 11.5.3 11.6 11.6.1 11.6.2 11.7 11.7.1 11.7.2 11.7.3 11.8 11.8.3 11.8.4 11.8.5 11.8.6 11.9 11.9.1 11.9.2 11.9.3 12.0 12.0.1 12.0.2 12.1 12.1.1 12.1.2 12.2 12.2.1 12.2.2 12.3 12.3.1 12.4 12.4.1 12.5 12.5.1 12.6 12.6.1 12.6.2 12.6.3 12.7 12.7.1 12.7.2 12.8 12.8.1 12.8.2 12.9 12.9.1 12.9.2 12.9.3 12.9.4 13.0 13.0.1 13.1 13.1.1 13.1.2 13.1.3 13.1.4 13.2 13.2.1 13.2.2 13.2.3 13.3 13.3.1 13.3.2 13.4 13.4.1 13.4.2 13.4.3 13.4.4 13.5 13.5.1 13.6 13.6.1 13.7 13.7.1 13.8 13.8.1 13.8.2 13.9 13.9.1 14.0 14.1 14.2 14.2.1 14.3 14.4 14.4.1 14.5 14.6 14.7 14.8 14.9 14.9.1 15.0 15.0.1 15.0.2 15.1 15.1.1 15.2 15.3 15.3.1 15.4 15.5 15.6 15.7 15.7-a.1 15.7-a.3 15.7-a.5 15.7-a.7 15.7-beta
jetpack / sal / class.json-api-site-jetpack.php
jetpack / sal Last commit date
class.json-api-date.php 3 years ago class.json-api-links.php 2 years ago class.json-api-metadata.php 2 years ago class.json-api-platform-jetpack.php 3 years ago class.json-api-platform.php 3 years ago class.json-api-post-base.php 2 years ago class.json-api-post-jetpack.php 4 years ago class.json-api-site-base.php 2 years ago class.json-api-site-jetpack-base.php 3 years ago class.json-api-site-jetpack.php 2 years ago class.json-api-token.php 2 years ago
class.json-api-site-jetpack.php
718 lines
1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 /**
3 * This class extends the Abstract_Jetpack_Site class, which includes providing
4 * the implementation for functions that were declared in that class.
5 *
6 * @see class.json-api-site-jetpack-base.php for more context on some of
7 * the functions extended here.
8 *
9 * @package automattic/jetpack
10 */
11 use Automattic\Jetpack\Status\Host;
12 use Automattic\Jetpack\Sync\Functions;
13
14 require_once __DIR__ . '/class.json-api-site-jetpack-base.php';
15 require_once __DIR__ . '/class.json-api-post-jetpack.php';
16
17 /**
18 * Base class for Jetpack_Site. This code runs on Jetpack (.org) sites.
19 */
20 class Jetpack_Site extends Abstract_Jetpack_Site {
21
22 /**
23 * Retrieves a Jetpack option's value, given the option name.
24 *
25 * @param string $name the name of the Jetpack option, without the 'jetpack' prefix (eg. 'log' for 'jetpack_log').
26 *
27 * @return mixed
28 */
29 protected function get_mock_option( $name ) {
30 return get_option( 'jetpack_' . $name );
31 }
32
33 /**
34 * If a Jetpack constant name has been defined, this will return the value of the constant.
35 *
36 * @param string $name the name of the Jetpack constant to check.
37 *
38 * @return mixed
39 */
40 protected function get_constant( $name ) {
41 if ( defined( $name ) ) {
42 return constant( $name );
43 }
44 return null;
45 }
46
47 /**
48 * Returns the site URL for the current network.
49 *
50 * @return string
51 */
52 protected function main_network_site() {
53 return network_site_url();
54 }
55
56 /**
57 * Returns the WordPress version for the current site.
58 *
59 * @return string
60 */
61 protected function wp_version() {
62 global $wp_version;
63 return $wp_version;
64 }
65
66 /**
67 * Returns the maximum upload size allowed in php.ini.
68 *
69 * @return int
70 */
71 protected function max_upload_size() {
72 return wp_max_upload_size();
73 }
74
75 /**
76 * This function returns the value of the 'WP_MEMORY_LIMIT' constant converted to an integer byte value.
77 *
78 * @return int
79 */
80 protected function wp_memory_limit() {
81 return wp_convert_hr_to_bytes( WP_MEMORY_LIMIT );
82 }
83
84 /**
85 * This function returns the value of the 'WP_MAX_MEMORY_LIMIT' constant converted to an integer byte value.
86 *
87 * @return int
88 */
89 protected function wp_max_memory_limit() {
90 return wp_convert_hr_to_bytes( WP_MAX_MEMORY_LIMIT );
91 }
92
93 /**
94 * Returns true if the site is within a system with a multiple networks, false otherwise.
95 *
96 * @see /projects/packages/status/src/class-status.php
97 *
98 * @return bool
99 */
100 protected function is_main_network() {
101 return Jetpack::is_multi_network();
102 }
103
104 /**
105 * Returns true if Multisite is enabled, false otherwise.
106 *
107 * @return bool
108 */
109 public function is_multisite() {
110 return (bool) is_multisite();
111 }
112
113 /**
114 * Returns true if the current site is a single user site, false otherwise.
115 *
116 * @return bool
117 */
118 public function is_single_user_site() {
119 return (bool) Jetpack::is_single_user_site();
120 }
121
122 /**
123 * Returns true if is_vcs_checkout discovers a version control checkout, false otherwise.
124 *
125 * @see projects/packages/sync/src/class-functions.php.
126 *
127 * @return bool
128 */
129 protected function is_version_controlled() {
130 return Functions::is_version_controlled();
131 }
132
133 /**
134 * Returns true if the site has file write access, false otherwise.
135 *
136 * @see projects/packages/sync/src/class-functions.php.
137 *
138 * @return bool
139 */
140 protected function file_system_write_access() {
141 return Functions::file_system_write_access();
142 }
143
144 /**
145 * Returns true if the current theme supports the $feature_name, false otherwise.
146 *
147 * @param string $feature_name the name of the Jetpack feature.
148 *
149 * @return bool
150 */
151 protected function current_theme_supports( $feature_name ) {
152 return current_theme_supports( $feature_name );
153 }
154
155 /**
156 * Gets theme support arguments to be checked against the specific Jetpack feature.
157 *
158 * @param string $feature_name the name of the Jetpack feature to check against.
159 *
160 * @return array
161 */
162 protected function get_theme_support( $feature_name ) {
163 return get_theme_support( $feature_name );
164 }
165
166 /**
167 * Fetch a list of active plugins that are using Jetpack Connection.
168 *
169 * @return array An array of active plugins (by slug) that are using Jetpack Connection.
170 */
171 protected function get_connection_active_plugins() {
172 $plugins = $this->get_mock_option( 'connection_active_plugins' );
173
174 return is_array( $plugins ) ? array_keys( $plugins ) : array();
175 }
176
177 /**
178 * Gets updates and then stores them in the jetpack_updates option, returning an array with the option schema.
179 *
180 * @return array
181 */
182 public function get_updates() {
183 return (array) Jetpack::get_updates();
184 }
185
186 /**
187 * Returns the Jetpack blog ID for a site.
188 *
189 * @return int
190 */
191 public function get_id() {
192 return $this->platform->token->blog_id;
193 }
194
195 /**
196 * Returns true if a site has the 'videopress' option enabled, false otherwise.
197 *
198 * @return bool
199 */
200 public function has_videopress() {
201 // TODO - this only works on wporg site - need to detect videopress option for remote Jetpack site on WPCOM.
202 $videopress = Jetpack_Options::get_option( 'videopress', array() );
203 if ( isset( $videopress['blog_id'] ) && $videopress['blog_id'] > 0 ) {
204 return true;
205 }
206
207 return false;
208 }
209
210 /**
211 * Returns VideoPress storage used, in MB.
212 *
213 * @see class.json-api-site-jetpack-shadow.php on WordPress.com for implementation. Only applicable on WordPress.com.
214 *
215 * @return float
216 */
217 public function get_videopress_storage_used() {
218 return 0;
219 }
220
221 /**
222 * Sets the upgraded_filetypes_enabled Jetpack option to true as a default.
223 *
224 * Only relevant for WordPress.com sites:
225 * See wpcom_site_has_upgraded_upload_filetypes at /wpcom/wp-content/mu-plugins/misc.php.
226 *
227 * @return bool
228 */
229 public function upgraded_filetypes_enabled() {
230 return true;
231 }
232
233 /**
234 * Sets the is_mapped_domain Jetpack option to true as a default.
235 *
236 * Primarily used in WordPress.com to confirm the current blog's domain does or doesn't match the primary redirect.
237 *
238 * @see /wpcom/wp-content/mu-plugins/insecure-content-helpers.php within WordPress.com.
239 *
240 * @return bool
241 */
242 public function is_mapped_domain() {
243 return true;
244 }
245
246 /**
247 * Fallback to the home URL since all Jetpack sites don't have an unmapped *.wordpress.com domain.
248 *
249 * @return string
250 */
251 public function get_unmapped_url() {
252 // Fallback to the home URL since all Jetpack sites don't have an unmapped *.wordpress.com domain.
253 return $this->get_url();
254 }
255
256 /**
257 * Whether the domain is a site redirect or not. Defaults to false on a Jetpack site.
258 *
259 * Primarily used in WordPress.com where it is determined if a HTTP status check is a redirect or not and whether an exception should be thrown.
260 *
261 * @see /wpcom/wp-includes/Requests/Response.php within WordPress.com.
262 *
263 * @return bool
264 */
265 public function is_redirect() {
266 return false;
267 }
268
269 /**
270 * Whether or not the current user is following this blog. Defaults to false.
271 *
272 * @return bool
273 */
274 public function is_following() {
275 return false;
276 }
277
278 /**
279 * Points to the user ID of the site owner
280 *
281 * @return null for Jetpack sites
282 */
283 public function get_site_owner() {
284 return null;
285 }
286
287 /**
288 * Whether or not the Jetpack 'wordads' module is active on the site.
289 *
290 * @return bool
291 */
292 public function has_wordads() {
293 return Jetpack::is_module_active( 'wordads' );
294 }
295
296 /**
297 * Defaults to false on Jetpack sites, however is used on WordPress.com sites. This nonce is used for previews on Jetpack sites.
298 *
299 * @see /wpcom/public.api/rest/sal/class.json-api-site-jetpack-shadow.php.
300 *
301 * @return bool
302 */
303 public function get_frame_nonce() {
304 return false;
305 }
306
307 /**
308 * Defaults to false on Jetpack sites, however is used on WordPress.com sites,
309 * where it creates a nonce to be used with iframed block editor requests to a Jetpack site.
310 *
311 * @see /wpcom/public.api/rest/sal/class.json-api-site-jetpack-shadow.php.
312 *
313 * @return bool
314 */
315 public function get_jetpack_frame_nonce() {
316 return false;
317 }
318
319 /**
320 * Defaults to false on Jetpack sites, however is used on WordPress.com sites, where it returns true if the headstart-fresh blog sticker is present.
321 *
322 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
323 *
324 * @return bool
325 */
326 public function is_headstart_fresh() {
327 return false;
328 }
329
330 /**
331 * Returns the allowed mime types and file extensions for a site.
332 *
333 * @return array
334 */
335 public function allowed_file_types() {
336 $allowed_file_types = array();
337
338 // https://codex.wordpress.org/Uploading_Files.
339 $mime_types = get_allowed_mime_types();
340 foreach ( $mime_types as $type => $mime_type ) {
341 $extras = explode( '|', $type );
342 foreach ( $extras as $extra ) {
343 $allowed_file_types[] = $extra;
344 }
345 }
346
347 return $allowed_file_types;
348 }
349
350 /**
351 * Return site's privacy status.
352 *
353 * @return bool Is site private?
354 */
355 public function is_private() {
356 return (int) $this->get_atomic_cloud_site_option( 'blog_public' ) === -1;
357 }
358
359 /**
360 * Return site's coming soon status.
361 *
362 * @return bool Is site "Coming soon"?
363 */
364 public function is_coming_soon() {
365 return $this->is_private() && (int) $this->get_atomic_cloud_site_option( 'wpcom_coming_soon' ) === 1;
366 }
367
368 /**
369 * Return site's launch status.
370 *
371 * @return string|bool Launch status ('launched', 'unlaunched', or false).
372 */
373 public function get_launch_status() {
374 return $this->get_atomic_cloud_site_option( 'launch-status' );
375 }
376
377 /**
378 * Given an option name, returns false if the site isn't WoA or doesn't have the ability to retrieve cloud site options.
379 * Otherwise, if the option name exists amongst Jetpack options, the option value is returned.
380 *
381 * @param string $option The option name to check.
382 *
383 * @return string|bool
384 */
385 public function get_atomic_cloud_site_option( $option ) {
386 if ( ! ( new Host() )->is_woa_site() ) {
387 return false;
388 }
389
390 $jetpack = Jetpack::init();
391 if ( ! method_exists( $jetpack, 'get_cloud_site_options' ) ) {
392 return false;
393 }
394
395 $result = $jetpack->get_cloud_site_options( array( $option ) );
396 if ( ! array_key_exists( $option, $result ) ) {
397 return false;
398 }
399
400 return $result[ $option ];
401 }
402
403 /**
404 * Defaults to false instead of returning the current site plan.
405 *
406 * @see /modules/masterbar/admin-menu/class-dashboard-switcher-tracking.php.
407 *
408 * @return bool
409 */
410 public function get_plan() {
411 return false;
412 }
413
414 /**
415 * Defaults to 0 for the number of WordPress.com subscribers - this is filled in on the WordPress.com side.
416 *
417 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
418 *
419 * @return int
420 */
421 public function get_subscribers_count() {
422 return 0;
423 }
424
425 /**
426 * Defaults to false - this is filled on the WordPress.com side in multiple locations.
427 *
428 * @see WPCOM_JSON_API_GET_Site_Endpoint::decorate_jetpack_response.
429 * @return bool
430 */
431 public function get_capabilities() {
432 return false;
433 }
434
435 /**
436 * Returns the language code for the current site.
437 *
438 * @return string
439 */
440 public function get_locale() {
441 return get_bloginfo( 'language' );
442 }
443
444 /**
445 * The flag indicates that the site has Jetpack installed.
446 *
447 * @return bool
448 */
449 public function is_jetpack() {
450 return true;
451 }
452
453 /**
454 * The flag indicates that the site is connected to WP.com via Jetpack Connection.
455 *
456 * @return bool
457 */
458 public function is_jetpack_connection() {
459 return true;
460 }
461
462 /**
463 * Returns the current site's Jetpack version.
464 *
465 * @return string
466 */
467 public function get_jetpack_version() {
468 return JETPACK__VERSION;
469 }
470
471 /**
472 * Empty function declaration - this function is filled out on the WordPress.com side, returning true if the site has an AK / VP bundle.
473 *
474 * @see /wpcom/public.api/rest/sal/class.json-api-site-jetpack-shadow.php.
475 */
476 public function get_ak_vp_bundle_enabled() {}
477
478 /**
479 * Returns the front page meta description for current site.
480 *
481 * @see /modules/seo-tools/class-jetpack-seo-utils.php.
482 *
483 * @return string
484 */
485 public function get_jetpack_seo_front_page_description() {
486 return Jetpack_SEO_Utils::get_front_page_meta_description();
487 }
488
489 /**
490 * Returns custom title formats from site option.
491 *
492 * @see /modules/seo-tools/class-jetpack-seo-titles.php.
493 *
494 * @return array
495 */
496 public function get_jetpack_seo_title_formats() {
497 return Jetpack_SEO_Titles::get_custom_title_formats();
498 }
499
500 /**
501 * Returns website verification codes. Allowed keys include: google, pinterest, bing, yandex, facebook.
502 *
503 * @see /modules/verification-tools/blog-verification-tools.php.
504 *
505 * @return array
506 */
507 public function get_verification_services_codes() {
508 return get_option( 'verification_services_codes', null );
509 }
510
511 /**
512 * Returns null for Jetpack sites. For WordPress.com sites this returns the value of the 'podcasting_archive' option.
513 *
514 * @see /wpcom/public.api/rest/sal/class.json-api-site-wpcom.php.
515 *
516 * @return null
517 */
518 public function get_podcasting_archive() {
519 return null;
520 }
521
522 /**
523 * Defaulting to true, this function is expanded out on the WordPress.com side, returning an error if the site is not connected or not communicating to us.
524 *
525 * @see /wpcom/public.api/rest/sal/class.json-api-site-jetpack-shadow.php.
526 *
527 * @return bool
528 */
529 public function is_connected_site() {
530 return true;
531 }
532
533 /**
534 * Defaulting to false and not relevant for Jetpack sites, this is expanded on the WordPress.com side for a specific wp.com/start 'WP for teams' flow.
535 *
536 * @see /wpcom/public.api/rest/sal/class.json-api-site-wpcom.php.
537 *
538 * @return bool
539 */
540 public function is_wpforteams_site() {
541 return false;
542 }
543
544 /**
545 * Returns true if a user has got the capability that is being checked, false otherwise.
546 *
547 * @param string $role The capability to check.
548 *
549 * @return bool
550 */
551 public function current_user_can( $role ) {
552 return current_user_can( $role );
553 }
554
555 /**
556 * Check if full site editing should be considered as currently active. Full site editing
557 * requires the FSE plugin to be installed and activated, as well the current
558 * theme to be FSE compatible. The plugin can also be explicitly disabled via the
559 * a8c_disable_full_site_editing filter.
560 *
561 * @since 7.7.0
562 *
563 * @return bool true if full site editing is currently active.
564 */
565 public function is_fse_active() {
566 if ( ! Jetpack::is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' ) ) {
567 return false;
568 }
569 return function_exists( '\A8C\FSE\is_full_site_editing_active' ) && \A8C\FSE\is_full_site_editing_active();
570 }
571
572 /**
573 * Check if site should be considered as eligible for full site editing. Full site editing
574 * requires the FSE plugin to be installed and activated. For this method to return true
575 * the current theme does not need to be FSE compatible. The plugin can also be explicitly
576 * disabled via the a8c_disable_full_site_editing filter.
577 *
578 * @since 8.1.0
579 *
580 * @return bool true if site is eligible for full site editing
581 */
582 public function is_fse_eligible() {
583 if ( ! Jetpack::is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' ) ) {
584 return false;
585 }
586 return function_exists( '\A8C\FSE\is_site_eligible_for_full_site_editing' ) && \A8C\FSE\is_site_eligible_for_full_site_editing();
587 }
588
589 /**
590 * Check if site should be considered as eligible for use of the core Site Editor.
591 * The Site Editor requires a block based theme to be active.
592 *
593 * @since 12.2 Uses wp_is_block_theme() to determine if site is eligible instead of gutenberg_is_fse_theme().
594 * @return bool true if site is eligible for the Site Editor
595 */
596 public function is_core_site_editor_enabled() {
597 return wp_is_block_theme();
598 }
599
600 /**
601 * Return the last engine used for an import on the site. Not used in Jetpack.
602 *
603 * @see /wpcom/public.api/rest/sal/class.json-api-site-wpcom.php.
604 *
605 * @return null
606 */
607 public function get_import_engine() {
608 return null;
609 }
610
611 /**
612 * Post functions
613 */
614
615 /**
616 * Wrap a WP_Post object with SAL methods, returning a Jetpack_Post object.
617 *
618 * @param WP_Post $post A WP_Post object.
619 * @param string $context The post request context (for example 'edit' or 'display').
620 *
621 * @return Jetpack_Post
622 */
623 public function wrap_post( $post, $context ) {
624 return new Jetpack_Post( $this, $post, $context );
625 }
626
627 /**
628 * Get the option storing the Anchor podcast ID that identifies a site as a podcasting site.
629 *
630 * @return string
631 */
632 public function get_anchor_podcast() {
633 return $this->get_atomic_cloud_site_option( 'anchor_podcast' );
634 }
635
636 /**
637 * Get user interactions with a site. Not used in Jetpack.
638 *
639 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
640 *
641 * @return null
642 */
643 public function get_user_interactions() {
644 return null;
645 }
646
647 /**
648 * Get site deleted status. Not used in Jetpack.
649 *
650 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
651 *
652 * @return bool
653 */
654 public function is_deleted() {
655 return false;
656 }
657
658 /**
659 * Detect whether a site is WordPress.com Staging Site. Not used in Jetpack.
660 *
661 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
662 *
663 * @return false
664 */
665 public function is_wpcom_staging_site() {
666 return false;
667 }
668
669 /**
670 * Get site option for the production blog id (if is a WP.com Staging Site). Not used in Jetpack.
671 *
672 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
673 *
674 * @return null
675 */
676 public function get_wpcom_production_blog_id() {
677 return null;
678 }
679
680 /**
681 * Get site option for the staging blog ids (if it has them). Not used in Jetpack.
682 *
683 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
684 *
685 * @return null
686 */
687 public function get_wpcom_staging_blog_ids() {
688 return null;
689 }
690
691 /**
692 * Get site option for the admin interface on WordPress.com Atomic sites. Not used in Jetpack.
693 *
694 * @return null
695 */
696 public function get_wpcom_admin_interface() {
697 return null;
698 }
699
700 /**
701 * Get Zendesk site meta. Not used in Jetpack.
702 *
703 * @return null
704 */
705 public function get_zendesk_site_meta() {
706 return null;
707 }
708
709 /**
710 * Detect whether there's a pending plan for this site. Not used in Jetpack.
711 *
712 * @return false
713 */
714 public function is_pending_plan() {
715 return false;
716 }
717 }
718