Completed
Push — update/api-site-endpoint-sync-... ( 48cc87...68d970 )
by Jeremy
48:09 queued 32:59
created

SAL_Site   F

Complexity

Total Complexity 116

Size/Duplication

Total Lines 631
Duplicated Lines 13.79 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
wmc 116
lcom 2
cbo 2
dl 87
loc 631
rs 1.969
c 0
b 0
f 0

96 Methods

Rating   Name   Duplication   Size   Complexity  
has_videopress() 0 1 ?
upgraded_filetypes_enabled() 0 1 ?
is_mapped_domain() 0 1 ?
is_redirect() 0 1 ?
is_headstart_fresh() 0 1 ?
featured_images_enabled() 0 1 ?
has_wordads() 0 1 ?
get_frame_nonce() 0 1 ?
allowed_file_types() 0 1 ?
get_post_formats() 0 1 ?
is_private() 0 1 ?
is_following() 0 1 ?
get_subscribers_count() 0 1 ?
get_locale() 0 1 ?
is_jetpack() 0 1 ?
get_jetpack_modules() 0 1 ?
A __construct() 0 4 1
A get_id() 0 3 1
A get_name() 0 3 1
A get_description() 0 3 1
A get_url() 0 3 1
A get_post_count() 0 3 1
A get_quota() 0 3 1
is_module_active() 0 1 ?
is_vip() 0 1 ?
is_multisite() 0 1 ?
is_single_user_site() 0 1 ?
get_plan() 0 1 ?
get_ak_vp_bundle_enabled() 0 1 ?
get_podcasting_archive() 0 1 ?
get_jetpack_seo_front_page_description() 0 1 ?
get_jetpack_seo_title_formats() 0 1 ?
get_verification_services_codes() 0 1 ?
before_render() 0 1 ?
after_render() 0 1 ?
after_render_options() 0 1 ?
wrap_post() 0 1 ?
is_a8c_publication() 0 1 ?
A is_automated_transfer() 0 17 1
A is_wpcom_atomic() 0 3 1
A is_wpcom_store() 0 3 1
A woocommerce_is_active() 0 3 1
A get_post_by_id() 0 16 2
B validate_access() 0 28 7
A current_user_can_access_post_type() 15 15 5
A get_post_type_object() 0 3 1
B is_post_type_allowed() 27 27 7
A get_whitelisted_post_types() 16 16 1
C user_can_view_post() 29 55 17
B get_post_id_by_name() 0 25 6
A get_post_by_name() 0 8 2
A user_can_manage() 0 3 1
A get_xmlrpc_url() 0 4 1
A get_registered_date() 0 10 3
A get_capabilities() 0 23 1
A is_visible() 0 16 3
A get_logo() 0 24 4
A get_timezone() 0 3 1
A get_gmt_offset() 0 3 1
A get_login_url() 0 3 1
A get_admin_url() 0 3 1
A get_unmapped_url() 0 3 1
A get_theme_slug() 0 3 1
A get_header_image() 0 3 1
A get_background_color() 0 3 1
A get_image_default_link_type() 0 3 1
A get_image_thumbnail_width() 0 3 1
A get_image_thumbnail_height() 0 3 1
A get_image_thumbnail_crop() 0 3 1
A get_image_medium_width() 0 3 1
A get_image_medium_height() 0 3 1
A get_image_large_width() 0 3 1
A get_image_large_height() 0 3 1
A get_permalink_structure() 0 3 1
A get_default_post_format() 0 3 1
A get_default_category() 0 3 1
A get_show_on_front() 0 3 1
A is_custom_front_page() 0 3 1
A get_default_likes_enabled() 0 3 1
A get_default_sharing_status() 0 9 2
A get_default_comment_status() 0 3 1
A default_ping_status() 0 3 1
A is_publicize_permanently_disabled() 0 7 2
A get_page_on_front() 0 3 1
A get_page_for_posts() 0 3 1
A is_headstart() 0 3 1
A get_wordpress_version() 0 4 1
A is_domain_only() 0 4 2
A get_blog_public() 0 3 1
A has_pending_automated_transfer() 0 17 1
A signup_is_store() 0 3 1
A get_roles() 0 3 1
A get_design_type() 0 4 2
A get_site_goals() 0 4 2
A get_launch_status() 0 3 1
A get_site_segment() 0 3 1

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complex Class

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like SAL_Site often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use SAL_Site, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
require_once dirname( __FILE__ ) . '/class.json-api-date.php';
4
require_once dirname( __FILE__ ) . '/class.json-api-post-base.php';
5
6
/**
7
 * Base class for the Site Abstraction Layer (SAL)
8
 * Note that this is the site "as seen by user $user_id with token $token", which
9
 * is why we pass the token to the platform; these site instances are value objects
10
 * to be used in the context of a single request for a single user.
11
 * Also note that at present this class _assumes_ you've "switched to"
12
 * the site in question, and functions like `get_bloginfo( 'name' )` will
13
 * therefore return the correct value
14
 **/
15
abstract class SAL_Site {
16
	public $blog_id;
17
	public $platform;
18
19
	public function __construct( $blog_id, $platform ) {
20
		$this->blog_id = $blog_id;
21
		$this->platform = $platform;
22
	}
23
24
	public function get_id() {
25
		return $this->blog_id;
26
	}
27
28
	public function get_name() {
29
		return (string) htmlspecialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
30
	}
31
32
	public function get_description() {
33
		return (string) htmlspecialchars_decode( get_bloginfo( 'description' ), ENT_QUOTES );
34
	}
35
36
	public function get_url() {
37
		return (string) home_url();
38
	}
39
40
	public function get_post_count() {
41
		return (int) wp_count_posts( 'post' )->publish;
42
	}
43
44
	public function get_quota() {
45
		return null;
46
	}
47
48
	abstract public function has_videopress();
49
50
	abstract public function upgraded_filetypes_enabled();
51
52
	abstract public function is_mapped_domain();
53
54
	abstract public function is_redirect();
55
56
	abstract public function is_headstart_fresh();
57
58
	abstract public function featured_images_enabled();
59
60
	abstract public function has_wordads();
61
62
	abstract public function get_frame_nonce();
63
64
	abstract public function allowed_file_types();
65
66
	abstract public function get_post_formats();
67
68
	abstract public function is_private();
69
70
	abstract public function is_following();
71
72
	abstract public function get_subscribers_count();
73
74
	abstract public function get_locale();
75
76
	abstract public function is_jetpack();
77
78
	abstract public function get_jetpack_modules();
79
80
	abstract public function is_module_active( $module );
81
82
	abstract public function is_vip();
83
84
	abstract public function is_multisite();
85
86
	abstract public function is_single_user_site();
87
88
	abstract public function get_plan();
89
90
	abstract public function get_ak_vp_bundle_enabled();
91
92
	abstract public function get_podcasting_archive();
93
94
	abstract public function get_jetpack_seo_front_page_description();
95
96
	abstract public function get_jetpack_seo_title_formats();
97
98
	abstract public function get_verification_services_codes();
99
100
	abstract public function before_render();
101
102
	abstract public function after_render( &$response );
103
104
	// TODO - factor this out? Seems an odd thing to have on a site
105
	abstract public function after_render_options( &$options );
106
107
	// wrap a WP_Post object with SAL methods
108
	abstract public function wrap_post( $post, $context );
109
110
	abstract protected function is_a8c_publication( $post_id );
111
112
	public function is_automated_transfer() {
113
		/**
114
		 * Filter if a site is an automated-transfer site.
115
		 *
116
		 * @module json-api
117
		 *
118
		 * @since 6.4.0
119
		 *
120
		 * @param bool is_automated_transfer( $this->blog_id )
121
		 * @param int  $blog_id Blog identifier.
122
		 */
123
		return apply_filters(
124
			'jetpack_site_automated_transfer',
125
			false,
126
			$this->blog_id
127
		);
128
	}
129
130
	public function is_wpcom_atomic() {
131
		return false;
132
	}
133
134
	public function is_wpcom_store() {
135
		return false;
136
	}
137
138
	public function woocommerce_is_active() {
139
		return false;
140
	}
141
142
	public function get_post_by_id( $post_id, $context ) {
143
		// Remove the skyword tracking shortcode for posts returned via the API.
144
		remove_shortcode( 'skyword-tracking' );
145
		add_shortcode( 'skyword-tracking', '__return_empty_string' );
146
147
		$post = get_post( $post_id, OBJECT, $context );
148
149
		if ( ! $post ) {
150
			return new WP_Error( 'unknown_post', 'Unknown post', 404 );
151
		}
152
153
		$wrapped_post = $this->wrap_post( $post, $context );
154
155
		// validate access
156
		return $this->validate_access( $wrapped_post );
157
	}
158
159
	/**
160
	 * Validate current user can access the post
161
	 *
162
	 * @return WP_Error or post
163
	 */
164
	private function validate_access( $post ) {
165
		$context = $post->context;
166
167
		if (
168
			! $this->is_post_type_allowed( $post->post_type )
169
			&& ! $this->is_a8c_publication( $post->ID )
170
		) {
171
			return new WP_Error( 'unknown_post', 'Unknown post', 404 );
172
		}
173
174
		switch ( $context ) {
175
		case 'edit' :
176
			if ( ! current_user_can( 'edit_post', $post ) ) {
177
				return new WP_Error( 'unauthorized', 'User cannot edit post', 403 );
178
			}
179
			break;
180
		case 'display' :
181
			$can_view = $this->user_can_view_post( $post );
182
			if ( is_wp_error( $can_view ) ) {
183
				return $can_view;
184
			}
185
			break;
186
		default :
187
			return new WP_Error( 'invalid_context', 'Invalid API CONTEXT', 400 );
188
		}
189
190
		return $post;
191
	}
192
193 View Code Duplication
	public function current_user_can_access_post_type( $post_type, $context ) {
194
		$post_type_object = $this->get_post_type_object( $post_type );
195
		if ( ! $post_type_object ) {
196
			return false;
197
		}
198
199
		switch( $context ) {
200
			case 'edit':
201
				return current_user_can( $post_type_object->cap->edit_posts );
202
			case 'display':
203
				return $post_type_object->public || current_user_can( $post_type_object->cap->read_private_posts );
204
			default:
205
				return false;
206
		}
207
	}
208
209
	protected function get_post_type_object( $post_type ) {
210
		return get_post_type_object( $post_type );
211
	}
212
213
	// copied from class.json-api-endpoints.php
214 View Code Duplication
	public function is_post_type_allowed( $post_type ) {
215
		// if the post type is empty, that's fine, WordPress will default to post
216
		if ( empty( $post_type ) ) {
217
			return true;
218
		}
219
220
		// allow special 'any' type
221
		if ( 'any' == $post_type ) {
222
			return true;
223
		}
224
225
		// check for allowed types
226
		if ( in_array( $post_type, $this->get_whitelisted_post_types() ) ) {
227
			return true;
228
		}
229
230
		if ( $post_type_object = get_post_type_object( $post_type ) ) {
231
			if ( ! empty( $post_type_object->show_in_rest ) ) {
232
				return $post_type_object->show_in_rest;
233
			}
234
			if ( ! empty( $post_type_object->publicly_queryable ) ) {
235
				return $post_type_object->publicly_queryable;
236
			}
237
		}
238
239
		return ! empty( $post_type_object->public );
240
	}
241
242
	// copied from class.json-api-endpoints.php
243
	/**
244
	 * Gets the whitelisted post types that JP should allow access to.
245
	 *
246
	 * @return array Whitelisted post types.
247
	 */
248 View Code Duplication
	public function get_whitelisted_post_types() {
249
		$allowed_types = array( 'post', 'page', 'revision' );
250
251
		/**
252
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
253
		 *
254
		 * @module json-api
255
		 *
256
		 * @since 2.2.3
257
		 *
258
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
259
		 */
260
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
261
262
		return array_unique( $allowed_types );
263
	}
264
265
	// copied and modified a little from class.json-api-endpoints.php
266
	private function user_can_view_post( $post ) {
267
		if ( !$post || is_wp_error( $post ) ) {
268
			return false;
269
		}
270
271 View Code Duplication
		if ( 'inherit' === $post->post_status ) {
272
			$parent_post = get_post( $post->post_parent );
273
			$post_status_obj = get_post_status_object( $parent_post->post_status );
274
		} else {
275
			$post_status_obj = get_post_status_object( $post->post_status );
276
		}
277
278
		$authorized = (
279
			$post_status_obj->public ||
280
			( is_user_logged_in() &&
281
				(
282
					( $post_status_obj->protected    && current_user_can( 'edit_post', $post->ID ) ) ||
283
					( $post_status_obj->private      && current_user_can( 'read_post', $post->ID ) ) ||
284
					( 'trash' === $post->post_status && current_user_can( 'edit_post', $post->ID ) ) ||
285
					'auto-draft' === $post->post_status
286
				)
287
			)
288
		);
289
290
		if ( ! $authorized ) {
291
			return new WP_Error( 'unauthorized', 'User cannot view post', 403 );
292
		}
293
294 View Code Duplication
		if (
295
			-1 == get_option( 'blog_public' ) &&
296
			/**
297
			 * Filter access to a specific post.
298
			 *
299
			 * @module json-api
300
			 *
301
			 * @since 3.4.0
302
			 *
303
			 * @param bool current_user_can( 'read_post', $post->ID ) Can the current user access the post.
304
			 * @param WP_Post $post Post data.
305
			 */
306
			! apply_filters(
307
				'wpcom_json_api_user_can_view_post',
308
				current_user_can( 'read_post', $post->ID ),
309
				$post
310
			)
311
		) {
312
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
313
		}
314
315 View Code Duplication
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
316
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
317
		}
318
319
		return true;
320
	}
321
322
	/**
323
	 * Get post ID by name
324
	 *
325
	 * Attempts to match name on post title and page path
326
	 *
327
	 * @param string $name
328
	 *
329
	 * @return int|object Post ID on success, WP_Error object on failure
330
	 */
331
	public function get_post_id_by_name( $name ) {
332
		$name = sanitize_title( $name );
333
334
		if ( ! $name ) {
335
			return new WP_Error( 'invalid_post', 'Invalid post', 400 );
336
		}
337
338
		$posts = get_posts( array(
339
			'name' => $name,
340
			'numberposts' => 1,
341
			'post_type' => $this->get_whitelisted_post_types(),
342
		) );
343
344
		if ( ! $posts || ! isset( $posts[0]->ID ) || ! $posts[0]->ID ) {
345
			$page = get_page_by_path( $name );
346
347
			if ( ! $page ) {
348
				return new WP_Error( 'unknown_post', 'Unknown post', 404 );
349
			}
350
351
			return $page->ID;
352
		}
353
354
		return (int) $posts[0]->ID;
355
	}
356
357
	/**
358
	 * Get post by name
359
	 *
360
	 * Attempts to match name on post title and page path
361
	 *
362
	 * @param string $name
363
	 * @param string $context (display or edit)
364
	 *
365
	 * @return object Post object on success, WP_Error object on failure
366
	 **/
367
	public function get_post_by_name( $name, $context ) {
368
		$post_id = $this->get_post_id_by_name( $name );
369
		if ( is_wp_error( $post_id ) ) {
370
			return $post_id;
371
		}
372
373
		return $this->get_post_by_id( $post_id, $context );
374
	}
375
376
	function user_can_manage() {
377
		current_user_can( 'manage_options' );
378
	}
379
380
	function get_xmlrpc_url() {
381
		$xmlrpc_scheme = apply_filters( 'wpcom_json_api_xmlrpc_scheme', parse_url( get_option( 'home' ), PHP_URL_SCHEME ) );
382
		return site_url( 'xmlrpc.php', $xmlrpc_scheme );
383
	}
384
385
	function get_registered_date() {
386
		if ( function_exists( 'get_blog_details' ) ) {
387
			$blog_details = get_blog_details();
388
			if ( ! empty( $blog_details->registered ) ) {
389
				return WPCOM_JSON_API_Date::format_date( $blog_details->registered );
390
			}
391
		}
392
393
		return '0000-00-00T00:00:00+00:00';
394
	}
395
396
	function get_capabilities() {
397
		return array(
398
			'edit_pages'          => current_user_can( 'edit_pages' ),
399
			'edit_posts'          => current_user_can( 'edit_posts' ),
400
			'edit_others_posts'   => current_user_can( 'edit_others_posts' ),
401
			'edit_others_pages'   => current_user_can( 'edit_others_pages' ),
402
			'delete_posts'        => current_user_can( 'delete_posts' ),
403
			'delete_others_posts' => current_user_can( 'delete_others_posts' ),
404
			'edit_theme_options'  => current_user_can( 'edit_theme_options' ),
405
			'edit_users'          => current_user_can( 'edit_users' ),
406
			'list_users'          => current_user_can( 'list_users' ),
407
			'manage_categories'   => current_user_can( 'manage_categories' ),
408
			'manage_options'      => current_user_can( 'manage_options' ),
409
			'moderate_comments'   => current_user_can( 'moderate_comments' ),
410
			'activate_wordads'    => wpcom_get_blog_owner() === (int) get_current_user_id(),
411
			'promote_users'       => current_user_can( 'promote_users' ),
412
			'publish_posts'       => current_user_can( 'publish_posts' ),
413
			'upload_files'        => current_user_can( 'upload_files' ),
414
			'delete_users'        => current_user_can( 'delete_users' ),
415
			'remove_users'        => current_user_can( 'remove_users' ),
416
			'view_stats'          => stats_is_blog_user( $this->blog_id )
417
		);
418
	}
419
420
	function is_visible() {
421
		if ( is_user_logged_in() ) {
422
			$current_user = wp_get_current_user();
423
			$visible      = (array) get_user_meta( $current_user->ID, 'blog_visibility', true );
424
425
			$is_visible = true;
426
			if ( isset( $visible[ $this->blog_id ] ) ) {
427
				$is_visible = (bool) $visible[ $this->blog_id ];
428
			}
429
430
			// null and true are visible
431
			return $is_visible;
432
		}
433
434
		return null;
435
	}
436
437
	function get_logo() {
438
439
		// Set an empty response array.
440
		$logo_setting = array(
441
			'id'    => (int) 0,
442
			'sizes' => array(),
443
			'url'   => '',
444
		);
445
446
		// Get current site logo values.
447
		$logo = get_option( 'site_logo' );
448
449
		// Update the response array if there's a site logo currenty active.
450
		if ( $logo && 0 != $logo['id'] ) {
451
			$logo_setting['id']  = $logo['id'];
452
			$logo_setting['url'] = $logo['url'];
453
454
			foreach ( $logo['sizes'] as $size => $properties ) {
455
				$logo_setting['sizes'][ $size ] = $properties;
456
			}
457
		}
458
459
		return $logo_setting;
460
	}
461
462
	function get_timezone() {
463
		return (string) get_option( 'timezone_string' );
464
	}
465
466
	function get_gmt_offset() {
467
		return (float) get_option( 'gmt_offset' );
468
	}
469
470
	function get_login_url() {
471
		return wp_login_url();
472
	}
473
474
	function get_admin_url() {
475
		return get_admin_url();
476
	}
477
478
	function get_unmapped_url() {
479
		return get_site_url( get_current_blog_id() );
480
	}
481
482
	function get_theme_slug() {
483
		return get_option( 'stylesheet' );
484
	}
485
486
	function get_header_image() {
487
		return get_theme_mod( 'header_image_data' );
488
	}
489
490
	function get_background_color() {
491
		return get_theme_mod( 'background_color' );
492
	}
493
494
	function get_image_default_link_type() {
495
		return get_option( 'image_default_link_type' );
496
	}
497
498
	function get_image_thumbnail_width() {
499
		return (int) get_option( 'thumbnail_size_w' );
500
	}
501
502
	function get_image_thumbnail_height() {
503
		return (int) get_option( 'thumbnail_size_h' );
504
	}
505
506
	function get_image_thumbnail_crop() {
507
		return get_option( 'thumbnail_crop' );
508
	}
509
510
	function get_image_medium_width() {
511
		return (int) get_option( 'medium_size_w' );
512
	}
513
514
	function get_image_medium_height() {
515
		return (int) get_option( 'medium_size_h' );
516
	}
517
518
	function get_image_large_width() {
519
		return (int) get_option( 'large_size_w' );
520
	}
521
522
	function get_image_large_height() {
523
		return (int) get_option( 'large_size_h' );
524
	}
525
526
	function get_permalink_structure() {
527
		return get_option( 'permalink_structure' );
528
	}
529
530
	function get_default_post_format() {
531
		return get_option( 'default_post_format' );
532
	}
533
534
	function get_default_category() {
535
		return (int) get_option( 'default_category' );
536
	}
537
538
	function get_show_on_front() {
539
		return get_option( 'show_on_front' );
540
	}
541
542
	function is_custom_front_page() {
543
		return ( 'page' === $this->get_show_on_front() );
544
	}
545
546
	function get_default_likes_enabled() {
547
		return (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
548
	}
549
550
	function get_default_sharing_status() {
551
		$default_sharing_status = false;
552
		if ( class_exists( 'Sharing_Service' ) ) {
553
			$ss                     = new Sharing_Service();
554
			$blog_services          = $ss->get_blog_services();
555
			$default_sharing_status = ! empty( $blog_services['visible'] );
556
		}
557
		return (bool) $default_sharing_status;
558
	}
559
560
	function get_default_comment_status() {
561
		return 'closed' !== get_option( 'default_comment_status' );
562
	}
563
564
	function default_ping_status() {
565
		return 'closed' !== get_option( 'default_ping_status' );
566
	}
567
568
	function is_publicize_permanently_disabled() {
569
		$publicize_permanently_disabled = false;
570
		if ( function_exists( 'is_publicize_permanently_disabled' ) ) {
571
			$publicize_permanently_disabled = is_publicize_permanently_disabled( $this->blog_id );
572
		}
573
		return $publicize_permanently_disabled;
574
	}
575
576
	function get_page_on_front() {
577
		return (int) get_option( 'page_on_front' );
578
	}
579
580
	function get_page_for_posts() {
581
		return (int) get_option( 'page_for_posts' );
582
	}
583
584
	function is_headstart() {
585
		return get_option( 'headstart' );
586
	}
587
588
	function get_wordpress_version() {
589
		global $wp_version;
590
		return $wp_version;
591
	}
592
593
	function is_domain_only() {
594
		$options = get_option( 'options' );
595
		return ! empty ( $options['is_domain_only'] ) ? (bool) $options['is_domain_only'] : false;
596
	}
597
598
	function get_blog_public() {
599
		return (int) get_option( 'blog_public' );
600
	}
601
602
	function has_pending_automated_transfer() {
603
		/**
604
		 * Filter if a site is in pending automated transfer state.
605
		 *
606
		 * @module json-api
607
		 *
608
		 * @since 6.4.0
609
		 *
610
		 * @param bool has_site_pending_automated_transfer( $this->blog_id )
611
		 * @param int  $blog_id Blog identifier.
612
		 */
613
		return apply_filters(
614
			'jetpack_site_pending_automated_transfer',
615
			false,
616
			$this->blog_id
617
		);
618
	}
619
620
	function signup_is_store() {
621
		return $this->get_design_type() === 'store';
622
	}
623
624
	function get_roles() {
625
		return new WP_Roles();
626
	}
627
628
	function get_design_type() {
629
		$options = get_option( 'options' );
630
		return empty( $options[ 'designType'] ) ? null : $options[ 'designType' ];
631
	}
632
633
	function get_site_goals() {
634
		$options = get_option( 'options' );
635
		return empty( $options[ 'siteGoals'] ) ? null : $options[ 'siteGoals' ];
636
	}
637
638
	function get_launch_status() {
639
		return false;
640
	}
641
642
	function get_site_segment() {
643
		return false;
644
	}
645
}
646