PluginProbe ʕ •ᴥ•ʔ
Jetpack – WP Security, Backup, Speed, & Growth / 12.6.4
Jetpack – WP Security, Backup, Speed, & Growth v12.6.4
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 4 years ago class.json-api-metadata.php 3 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 3 years ago class.json-api-token.php 4 years ago
class.json-api-site-jetpack.php
679 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 * @return bool
429 */
430 public function get_capabilities() {
431 return false;
432 }
433
434 /**
435 * Returns the language code for the current site.
436 *
437 * @return string
438 */
439 public function get_locale() {
440 return get_bloginfo( 'language' );
441 }
442
443 /**
444 * The flag indicates that the site has Jetpack installed.
445 *
446 * @return bool
447 */
448 public function is_jetpack() {
449 return true;
450 }
451
452 /**
453 * The flag indicates that the site is connected to WP.com via Jetpack Connection.
454 *
455 * @return bool
456 */
457 public function is_jetpack_connection() {
458 return true;
459 }
460
461 /**
462 * Returns the current site's Jetpack version.
463 *
464 * @return string
465 */
466 public function get_jetpack_version() {
467 return JETPACK__VERSION;
468 }
469
470 /**
471 * Empty function declaration - this function is filled out on the WordPress.com side, returning true if the site has an AK / VP bundle.
472 *
473 * @see /wpcom/public.api/rest/sal/class.json-api-site-jetpack-shadow.php.
474 */
475 public function get_ak_vp_bundle_enabled() {}
476
477 /**
478 * Returns the front page meta description for current site.
479 *
480 * @see /modules/seo-tools/class-jetpack-seo-utils.php.
481 *
482 * @return string
483 */
484 public function get_jetpack_seo_front_page_description() {
485 return Jetpack_SEO_Utils::get_front_page_meta_description();
486 }
487
488 /**
489 * Returns custom title formats from site option.
490 *
491 * @see /modules/seo-tools/class-jetpack-seo-titles.php.
492 *
493 * @return array
494 */
495 public function get_jetpack_seo_title_formats() {
496 return Jetpack_SEO_Titles::get_custom_title_formats();
497 }
498
499 /**
500 * Returns website verification codes. Allowed keys include: google, pinterest, bing, yandex, facebook.
501 *
502 * @see /modules/verification-tools/blog-verification-tools.php.
503 *
504 * @return array
505 */
506 public function get_verification_services_codes() {
507 return get_option( 'verification_services_codes', null );
508 }
509
510 /**
511 * Returns null for Jetpack sites. For WordPress.com sites this returns the value of the 'podcasting_archive' option.
512 *
513 * @see /wpcom/public.api/rest/sal/class.json-api-site-wpcom.php.
514 *
515 * @return null
516 */
517 public function get_podcasting_archive() {
518 return null;
519 }
520
521 /**
522 * 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.
523 *
524 * @see /wpcom/public.api/rest/sal/class.json-api-site-jetpack-shadow.php.
525 *
526 * @return bool
527 */
528 public function is_connected_site() {
529 return true;
530 }
531
532 /**
533 * 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.
534 *
535 * @see /wpcom/public.api/rest/sal/class.json-api-site-wpcom.php.
536 *
537 * @return bool
538 */
539 public function is_wpforteams_site() {
540 return false;
541 }
542
543 /**
544 * Returns true if a user has got the capability that is being checked, false otherwise.
545 *
546 * @param string $role The capability to check.
547 *
548 * @return bool
549 */
550 public function current_user_can( $role ) {
551 return current_user_can( $role );
552 }
553
554 /**
555 * Check if full site editing should be considered as currently active. Full site editing
556 * requires the FSE plugin to be installed and activated, as well the current
557 * theme to be FSE compatible. The plugin can also be explicitly disabled via the
558 * a8c_disable_full_site_editing filter.
559 *
560 * @since 7.7.0
561 *
562 * @return bool true if full site editing is currently active.
563 */
564 public function is_fse_active() {
565 if ( ! Jetpack::is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' ) ) {
566 return false;
567 }
568 return function_exists( '\A8C\FSE\is_full_site_editing_active' ) && \A8C\FSE\is_full_site_editing_active();
569 }
570
571 /**
572 * Check if site should be considered as eligible for full site editing. Full site editing
573 * requires the FSE plugin to be installed and activated. For this method to return true
574 * the current theme does not need to be FSE compatible. The plugin can also be explicitly
575 * disabled via the a8c_disable_full_site_editing filter.
576 *
577 * @since 8.1.0
578 *
579 * @return bool true if site is eligible for full site editing
580 */
581 public function is_fse_eligible() {
582 if ( ! Jetpack::is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' ) ) {
583 return false;
584 }
585 return function_exists( '\A8C\FSE\is_site_eligible_for_full_site_editing' ) && \A8C\FSE\is_site_eligible_for_full_site_editing();
586 }
587
588 /**
589 * Check if site should be considered as eligible for use of the core Site Editor.
590 * The Site Editor requires a block based theme to be active.
591 *
592 * @since 12.2 Uses wp_is_block_theme() to determine if site is eligible instead of gutenberg_is_fse_theme().
593 * @return bool true if site is eligible for the Site Editor
594 */
595 public function is_core_site_editor_enabled() {
596 return wp_is_block_theme();
597 }
598
599 /**
600 * Return the last engine used for an import on the site. Not used in Jetpack.
601 *
602 * @see /wpcom/public.api/rest/sal/class.json-api-site-wpcom.php.
603 *
604 * @return null
605 */
606 public function get_import_engine() {
607 return null;
608 }
609
610 /**
611 * Post functions
612 */
613
614 /**
615 * Wrap a WP_Post object with SAL methods, returning a Jetpack_Post object.
616 *
617 * @param WP_Post $post A WP_Post object.
618 * @param string $context The post request context (for example 'edit' or 'display').
619 *
620 * @return Jetpack_Post
621 */
622 public function wrap_post( $post, $context ) {
623 return new Jetpack_Post( $this, $post, $context );
624 }
625
626 /**
627 * Get the option storing the Anchor podcast ID that identifies a site as a podcasting site.
628 *
629 * @return string
630 */
631 public function get_anchor_podcast() {
632 return $this->get_atomic_cloud_site_option( 'anchor_podcast' );
633 }
634
635 /**
636 * Get user interactions with a site. Not used in Jetpack.
637 *
638 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
639 *
640 * @return null
641 */
642 public function get_user_interactions() {
643 return null;
644 }
645
646 /**
647 * Detect whether a site is WordPress.com Staging Site. Not used in Jetpack.
648 *
649 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
650 *
651 * @return false
652 */
653 public function is_wpcom_staging_site() {
654 return false;
655 }
656
657 /**
658 * Get site option for the production blog id (if is a WP.com Staging Site). Not used in Jetpack.
659 *
660 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
661 *
662 * @return null
663 */
664 public function get_wpcom_production_blog_id() {
665 return null;
666 }
667
668 /**
669 * Get site option for the staging blog ids (if it has them). Not used in Jetpack.
670 *
671 * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php.
672 *
673 * @return null
674 */
675 public function get_wpcom_staging_blog_ids() {
676 return null;
677 }
678 }
679