Passed
Push — add/multiplan ( 0816bf...806c57 )
by Virginia
04:04
created

Settings::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
/**
3
 * Contains the settings class for LSX
4
 *
5
 * @package lsx-health-plan
6
 */
7
8
namespace lsx_health_plan\classes\admin;
9
10
/**
11
 * Contains the settings for each post type \lsx_health_plan\classes\admin\Settings().
12
 */
13
class Settings {
14
15
	/**
16
	 * Holds class instance
17
	 *
18
	 * @since 1.0.0
19
	 *
20
	 * @var      object \lsx_health_plan\classes\admin\Settings()
21
	 */
22
	protected static $instance = null;
23
24
	/**
25
	 * Option key, and option page slug
26
	 *
27
	 * @var string
28
	 */
29
	protected $screen_id = 'lsx_health_plan_settings';
30
31
	/**
32
	 * An array of the post types for the Global Downloads field.
33
	 *
34
	 * @var array
35
	 */
36
	public $download_types = array();
37
38
	/**
39
	 * An array of the post types for the Global Defaults field.
40
	 *
41
	 * @var array
42
	 */
43
	//public $default_types = array();
0 ignored issues
show
Unused Code Comprehensibility introduced by
70% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
No space found before comment text; expected "// public $default_types = array();" but found "//public $default_types = array();"
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
44
45
	/**
46
	 * An array of the endpoints for the Endpoint Translation field.
47
	 *
48
	 * @var array
49
	 */
50
	public $endpoints = array();
51
52
	/**
53
	 * Constructor
54
	 */
55
	public function __construct() {
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
56
		$this->load_classes();
57
		add_action( 'cmb2_admin_init', array( $this, 'register_settings_page' ) );
58
		add_action( 'lsx_hp_settings_page', array( $this, 'generate_tabs' ), 1, 1 );
59
60
		add_action( 'lsx_hp_settings_page_general_top', array( $this, 'general_settings' ), 1, 1 );
61
		//add_action( 'lsx_hp_settings_page', array( $this, 'global_defaults' ), 3, 1 );
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
No space found before comment text; expected "// add_action( 'lsx_hp_settings_page', array( $this, 'global_defaults' ), 3, 1 );" but found "//add_action( 'lsx_hp_settings_page', array( $this, 'global_defaults' ), 3, 1 );"
Loading history...
62
		//add_action( 'lsx_hp_settings_page', array( $this, 'global_downloads' ), 5, 1 );
0 ignored issues
show
Coding Style introduced by
No space found before comment text; expected "// add_action( 'lsx_hp_settings_page', array( $this, 'global_downloads' ), 5, 1 );" but found "//add_action( 'lsx_hp_settings_page', array( $this, 'global_downloads' ), 5, 1 );"
Loading history...
63
		//add_action( 'lsx_hp_settings_page', array( $this, 'stat_disable' ), 6, 1 );
0 ignored issues
show
Coding Style introduced by
No space found before comment text; expected "// add_action( 'lsx_hp_settings_page', array( $this, 'stat_disable' ), 6, 1 );" but found "//add_action( 'lsx_hp_settings_page', array( $this, 'stat_disable' ), 6, 1 );"
Loading history...
64
		//add_action( 'lsx_hp_settings_page', array( $this, 'endpoint_translations' ), 7, 1 );
0 ignored issues
show
Coding Style introduced by
No space found before comment text; expected "// add_action( 'lsx_hp_settings_page', array( $this, 'endpoint_translations' ), 7, 1 );" but found "//add_action( 'lsx_hp_settings_page', array( $this, 'endpoint_translations' ), 7, 1 );"
Loading history...
65
		// add_action( 'lsx_hp_settings_page', array( $this, 'exercise_translations' ), 7, 1 );
66
		//add_action( 'lsx_hp_settings_page', array( $this, 'post_type_toggles' ), 9, 1 );
0 ignored issues
show
Coding Style introduced by
No space found before comment text; expected "// add_action( 'lsx_hp_settings_page', array( $this, 'post_type_toggles' ), 9, 1 );" but found "//add_action( 'lsx_hp_settings_page', array( $this, 'post_type_toggles' ), 9, 1 );"
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
67
	}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
68
69
	/**
70
	 * Return an instance of this class.
71
	 *
72
	 * @since 1.0.0
73
	 *
74
	 * @return    object \lsx_health_plan\classes\admin\Settings()    A single instance of this class.
75
	 */
76
	public static function get_instance() {
77
		// If the single instance hasn't been set, set it now.
78
		if ( null === self::$instance ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
79
			self::$instance = new self();
80
		}
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
81
		return self::$instance;
82
	}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
83
84
	/**
85
	 * Loads the variable classes and the static classes.
86
	 */
87
	private function load_classes() {
0 ignored issues
show
Coding Style introduced by
Expected 0 blank lines after opening function brace; 1 found
Loading history...
88
89
		$this->post_types = array(
0 ignored issues
show
Bug Best Practice introduced by
The property post_types does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
90
			'plan',
91
			'workout',
92
			'exercise',
93
			'meal',
94
			'recipe',
95
			//'tip',
0 ignored issues
show
Coding Style introduced by
No space found before comment text; expected "// 'tip'," but found "//'tip',"
Loading history...
96
		);
97
98
		foreach ( $this->post_types as $post_type ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
99
			$this->$post_type = require_once LSX_HEALTH_PLAN_PATH . 'classes/admin/settings/class-' . $post_type . '.php';
100
		}
101
	}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
102
103
	/**
104
	 * Sets the variables needed for the fields.
105
	 *
106
	 * @return void
107
	 */
108
	public function set_vars() {
0 ignored issues
show
Coding Style introduced by
Expected 0 blank lines after opening function brace; 1 found
Loading history...
109
110
		// $this->default_types  = array(
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
111
		// 	'page' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
112
		// 		'title'       => __( 'Warm Up', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
113
		// 		'description' => __( 'Set a default warm up routine.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
114
		// 		'limit'       => 1,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
115
		// 		'id'          => 'plan_warmup',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
116
		// 	),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
117
		// );
118
		// $this->download_types = array(
119
		// 	'page' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
120
		// 		'title'       => __( 'Warm Up', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
121
		// 		'description' => __( 'Set a default warm up routine.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
122
		// 		'limit'       => 1,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
123
		// 	),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
124
		// );
125
		// $this->endpoints      = array(
126
		// 	'endpoint_warm_up' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
127
		// 		'title'       => __( 'Warm Up Endpoint', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
128
		// 		'default'     => 'warm-up',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
129
		// 	),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
130
		// );
131
132
		if ( post_type_exists( 'meal' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
Unused Code introduced by
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
133
			// $this->download_types['meal']     = array(
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
134
			// 	'title'       => __( 'Meal Plan', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
135
			// 	'description' => __( 'Set a default meal plan.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
136
			// );
137
			// $this->default_types['meal']      = array(
138
			// 	'title'       => __( 'Meal Plan', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
139
			// 	'description' => __( 'Set a default meal plan.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
140
			// 	'id'          => 'connected_meals',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
141
			// );
142
			// $this->endpoints['endpoint_meal'] = array(
143
			// 	'title'       => __( 'Meal Endpoint', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
144
			// 	'default'     => 'meal',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
145
			// 	'description' => __( 'Define the tab slug which shows on the single plan page.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
146
			// );
147
			// $this->endpoints['endpoint_meal_archive'] = array(
148
			// 	'title'   => __( 'Meals Archive Endpoint', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
149
			// 	'default' => 'meals',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
150
			// );
151
			// $this->endpoints['meal_single_slug'] = array(
152
			// 	'title'   => __( 'Single Meal Slug', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
153
			// 	'default' => 'meal',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
154
			// );
155
		}
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
156
		if ( post_type_exists( 'recipe' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
Unused Code introduced by
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
157
			// $this->download_types['recipe'] = array(
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
158
			// 	'title'       => __( 'Recipe', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
159
			// 	'description' => __( 'Set a default recipe.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
160
			// );
161
			// $this->default_types['recipe'] = array(
162
			// 	'title'       => __( 'Recipe', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
163
			// 	'description' => __( 'Set a default recipe.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
164
			// 	'id'          => 'connected_recipes',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
165
			// );
166
			// $this->endpoints['endpoint_recipe'] = array(
167
			// 	'title'   => __( 'Recipes Endpoint', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
168
			// 	'default' => 'recipe',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
169
			// );
170
		}
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
171
		if ( post_type_exists( 'workout' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
Unused Code introduced by
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
172
			// $this->download_types['workout'] = array(
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
173
			// 	'title'       => __( 'Workout', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
174
			// 	'description' => __( 'Set a default workout routine PDF.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
175
			// );
176
			// $this->default_types['workout'] = array(
177
			// 	'title'       => __( 'Workout', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
178
			// 	'description' => __( 'Set a default workout routine.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
179
			// 	'id'          => 'connected_workouts',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
180
			// );
181
			// $this->endpoints['endpoint_workout_archive'] = array(
182
			// 	'title'   => __( 'Workouts Archive Endpoint', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
183
			// 	'default' => '',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
184
			// );
185
			// $this->endpoints['endpoint_workout'] = array(
186
			// 	'title'   => __( 'Single Workout Endpoint', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
187
			// 	'default' => 'workout',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
188
			// );
189
		}
190
191
		// $this->endpoints['login_slug'] = array(
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
192
		// 	'title'   => __( 'Login Slug', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
193
		// 	'default' => 'login',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
194
		// );
195
		// $this->endpoints['my_plan_slug'] = array(
196
		// 	'title'   => __( 'My Plan Slug', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
197
		// 	'default' => 'my-plan',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
198
		// );
199
		// $this->endpoints['plan_single_slug'] = array(
200
		// 	'title'   => __( 'Single Plan Slug', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
201
		// 	'default' => 'plan',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
202
		// );
203
		// $this->endpoints['endpoint_plan_archive'] = array(
204
		// 	'title'   => __( 'Plans Archive Endpoint', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
205
		// 	'default' => 'plans',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
206
		// );
207
208
		// if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
51% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
209
		// 	$this->endpoints['exercise'] = array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
210
		// 		'exercise_single' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
211
		// 			'title'   => __( 'Single Exercise Slug', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
212
		// 			'default' => 'exercise',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
213
		// 		),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
214
		// 		'exercise_archive' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
215
		// 			'title'   => __( 'Archive Exercise Slug', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
216
		// 			'default' => 'exercises',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
217
		// 		),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
218
		// 		'exercise_type' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
219
		// 			'title'   => __( 'Exercise Type Slug', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
220
		// 			'default' => 'exercise-type',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
221
		// 		),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
222
		// 		'exercise_equipment' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
223
		// 			'title'   => __( 'Equipment Slug', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
224
		// 			'default' => 'equipment',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
225
		// 		),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
226
		// 		'exercise_musclegroup' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
227
		// 			'title'   => __( 'Muscle Group Slug', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
228
		// 			'default' => 'muscle-group',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
229
		// 		),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
230
		// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
231
		// }
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
232
	}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
233
234
	/**
235
	 * Hook in and register a submenu options page for the Page post-type menu.
236
	 */
237
	public function register_settings_page() {
238
		$cmb = new_cmb2_box(
239
			array(
240
				'id'           => $this->screen_id,
241
				'title'        => esc_html__( 'Settings', 'lsx-health-plan' ),
242
				'object_types' => array( 'options-page' ),
243
				'option_key'   => 'lsx_health_plan_options', // The option key and admin menu page slug.
244
				'parent_slug'  => 'edit.php?post_type=plan', // Make options page a submenu item of the themes menu.
245
				'capability'   => 'manage_options', // Cap required to view options-page.
246
			)
247
		);
248
		do_action( 'lsx_hp_settings_page', $cmb );
249
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
250
251
	/**
252
	 * Registers the general settings.
253
	 *
254
	 * @param object $cmb new_cmb2_box().
255
	 * @return void
256
	 */
257
	public function general_settings( $cmb ) {
258
		if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
259
			$cmb->add_field(
260
				array(
261
					'name'       => __( 'Membership Product', 'lsx-health-plan' ),
262
					'id'         => 'membership_product',
263
					'type'       => 'post_search_ajax',
264
					'limit'      => 1,
265
					'sortable'   => false,
266
					'query_args' => array(
267
						'post_type'      => array( 'product' ),
268
						'post_status'    => array( 'publish' ),
269
						'posts_per_page' => -1,
270
					),
271
				)
272
			);
273
		}
274
275
		$cmb->add_field(
276
			array(
277
				'name'    =>  __( 'Login Slug', 'lsx-health-plan' ),
0 ignored issues
show
introduced by
Expected 1 space after "=>"; 2 found
Loading history...
278
				'id'      => 'login_slug',
279
				'type'    => 'input',
280
				'value'   => '',
281
				'default' => 'login',
282
			)
283
		);
284
285
	}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
286
287
	/**
288
	 * Registers the global default settings.
289
	 *
290
	 * @param object $cmb new_cmb2_box().
291
	 * @return void
292
	 */
293
	// public function global_defaults( $cmb ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
294
	// 	$cmb->add_field(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
295
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
296
	// 			'id'      => 'global_defaults_title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
297
	// 			'type'    => 'title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
298
	// 			'name'    => __( 'Global Defaults', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
299
	// 			'default' => __( 'Global Defaults', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
300
	// 			'description' => __( 'If you have not connected a specific post to your day plan, set a default option below.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
301
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
302
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
303
304
	// 	foreach ( $this->default_types as $type => $default_type ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
305
	// 		$limit    = 5;
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
306
	// 		$sortable = false;
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
307
	// 		if ( isset( $default_type['limit'] ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
308
	// 			$limit    = $default_type['limit'];
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
309
	// 			$sortable = true;
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
310
	// 		}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
311
312
	// 		if ( 'page' === $type && false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
313
	// 			$type = array( 'page', 'workout' );
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
314
	// 		}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
315
316
	// 		$cmb->add_field(
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
317
	// 			array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
318
	// 				'name'       => $default_type['title'],
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
319
	// 				'desc'       => $default_type['description'],
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
320
	// 				'id'         => $default_type['id'],
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
321
	// 				'type'       => 'post_search_ajax',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
322
	// 				'limit'      => $limit,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
323
	// 				'sortable'   => $sortable,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
324
	// 				'query_args' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
325
	// 					'post_type'      => $type,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
326
	// 					'post_status'    => array( 'publish' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
327
	// 					'posts_per_page' => -1,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
328
	// 				),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
329
	// 			)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
330
	// 		);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
331
	// 	}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
332
333
	// 	$cmb->add_field(
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
334
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
335
	// 			'id'   => 'settings_global_defaults_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
336
	// 			'type' => 'tab_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
337
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
338
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
339
	// }
340
341
	/**
342
	 * Registers the global dowloads settings
343
	 *
344
	 * @param object $cmb new_cmb2_box().
345
	 * @return void
346
	 */
347
	// public function global_downloads( $cmb ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
47% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
348
	// 	if ( ! function_exists( 'download_monitor' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
349
	// 		return;
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
350
	// 	}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
351
	// 	$page_url    = 'https://wordpress.org/plugins/download-monitor/';
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
352
	// 	$plugin_name = 'Download Monitor';
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
353
	// 	$description = sprintf(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
354
	// 		/* translators: %s: The subscription info */
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
355
	// 		__( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your plan here.', 'lsx-search' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
356
	// 		$page_url,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
357
	// 		$plugin_name
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
358
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
359
	// 	$cmb->add_field(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
360
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
361
	// 			'id'          => 'global_downloads_title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
362
	// 			'type'        => 'title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
363
	// 			'name'        => __( 'Global Downloads', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
364
	// 			'default'     => __( 'Global Downloads', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
365
	// 			'description' => $description,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
366
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
367
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
368
369
	// 	foreach ( $this->download_types as $type => $download_type ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
370
	// 		$limit    = 5;
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
371
	// 		$sortable = false;
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
372
	// 		if ( isset( $download_type['limit'] ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
373
	// 			$limit    = $download_type['limit'];
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
374
	// 			$sortable = true;
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
375
	// 		}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
376
377
	// 		$cmb->add_field(
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
378
	// 			array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
379
	// 				'name'       => $download_type['title'],
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
380
	// 				'id'         => 'download_' . $type,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
381
	// 				'type'       => 'post_search_ajax',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
382
	// 				'limit'      => $limit,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
383
	// 				'sortable'   => $sortable,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
384
	// 				'query_args' => array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
385
	// 					'post_type'      => array( 'dlm_download' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
386
	// 					'post_status'    => array( 'publish' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
387
	// 					'posts_per_page' => -1,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
388
	// 				),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
389
	// 			)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
390
	// 		);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
391
	// 	}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
392
	// 	$cmb->add_field(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
393
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
394
	// 			'id'   => 'settings_global_downloads_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
395
	// 			'type' => 'tab_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
396
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
397
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
398
	// }
399
400
	/**
401
	 * Registers the endpoint translation settings.
402
	 *
403
	 * @param object $cmb new_cmb2_box().
404
	 * @return void
405
	 */
406
	// public function endpoint_translations( $cmb ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
48% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
407
	// 	$cmb->add_field(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
408
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
409
	// 			'id'          => 'endpoints_title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
410
	// 			'type'        => 'title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
411
	// 			'name'        => __( 'Set Endpoint Translations', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
412
	// 			'default'     => __( 'Set Endpoint Translations', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
413
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
414
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
415
	// 	foreach ( $this->endpoints as $slug => $endpoint_vars ) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
416
	// 		if ( 'exercise' === $slug ) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
417
	// 			continue;
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
418
	// 		}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
419
420
	// 		$cmb->add_field(
0 ignored issues
show
Unused Code Comprehensibility introduced by
51% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
421
	// 			array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
422
	// 				'name'    => $slug,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
423
	// 				'id'      => $slug,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
424
	// 				'type'    => 'input',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
425
	// 				'value'   => '',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
426
	// 				'default' => $endpoint_vars['default'],
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
427
	// 			)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
428
	// 		);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
429
	// 	}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
430
	// 	$cmb->add_field(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
431
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
432
	// 			'id'            => 'settings_endpoints_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
433
	// 			'type'          => 'tab_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
434
	// 			'before_row'    => '<p style="margin-top:20px; font-style: italic;">Endpoint is a web address (URL) at which the user can gain access to it. You need to resave your permalinks after changing the endpoint settings.</p>',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
435
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
436
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
437
	// }
438
439
	/**
440
	 * Registers the endpoint translation settings.
441
	 *
442
	 * @param object $cmb new_cmb2_box().
443
	 * @return void
444
	 */
445
	// public function exercise_translations( $cmb ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
53% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
446
	// 	if ( isset( $this->endpoints['exercise'] ) && '' !== $this->endpoints['exercise'] && ! empty( $this->endpoints['exercise'] ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
447
	// 		$cmb->add_field(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
448
	// 			array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
449
	// 				'id'          => 'exercise_endpoints_title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
450
	// 				'type'        => 'title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
451
	// 				'name'        => __( 'Set Exercise Translations', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
452
	// 				'default'     => __( 'Set Exercise Translations', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
453
	// 				'description' => __( 'Change the exercise endpoints.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
454
	// 			)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
455
	// 		);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
456
457
	// 		foreach ( $this->endpoints['exercise'] as $slug => $endpoint_vars ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
51% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
458
	// 			$cmb->add_field(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
459
	// 				array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
460
	// 					'name'    => 'endpoint_' . $slug,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
461
	// 					'id'      => 'endpoint_' . $slug,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
462
	// 					'type'    => 'input',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
463
	// 					'value'   => '',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
464
	// 					'default' => $endpoint_vars['default'],
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 18; use block comment if you need indentation
Loading history...
465
	// 				)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
466
	// 			);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
467
	// 		}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
468
469
	// 		$cmb->add_field(
0 ignored issues
show
Unused Code Comprehensibility introduced by
49% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
470
	// 			array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
471
	// 				'id'            => 'settings_exercise_endpoints_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
472
	// 				'type'          => 'tab_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
473
	// 				'before_row'    => '<p style="margin-top:20px; font-style: italic;">If you need to translate the exercise URL slugs, do so below.</p>',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
474
	// 			)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
475
	// 		);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
476
	// 	}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
477
	// }
478
479
	/**
480
	 * Registers the post type toggle settings
481
	 *
482
	 * @param object $cmb new_cmb2_box().
483
	 * @return void
484
	 */
485
	// public function post_type_toggles( $cmb ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
52% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
486
	// 	$post_types = apply_filters( 'lsx_health_plan_post_types', isset( $this->post_types ) );
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
487
488
	// 	$cmb->add_field(
0 ignored issues
show
Unused Code Comprehensibility introduced by
51% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
489
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
490
	// 			'id'          => 'post_type_toggles_title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
491
	// 			'type'        => 'title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
492
	// 			'name'        => __( 'Disable Post Types', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
493
	// 			'default'     => __( 'Disable Post Types', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
494
	// 			'description' => __( 'Disable post types if you are wanting a minimal site.', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
495
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
496
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
497
498
	// 	foreach ( $post_types as $post_type ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
46% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
499
	// 		if ( 'plan' === $post_type || 'exercise' === $post_type || ( 'video' === $post_type && false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
500
	// 			continue;
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
501
	// 		}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
502
503
	// 		$cmb->add_field(
0 ignored issues
show
Unused Code Comprehensibility introduced by
46% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
504
	// 			array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
505
	// 				'name'    => $post_type . '_disabled',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
506
	// 				'id'      => $post_type . '_disabled',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
507
	// 				'type'    => 'checkbox',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
508
	// 				'value'   => 1,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
509
	// 				'default' => 0,
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 14; use block comment if you need indentation
Loading history...
510
	// 			)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
511
	// 		);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
512
	// 	}
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
513
514
	// 	$cmb->add_field(
0 ignored issues
show
Unused Code Comprehensibility introduced by
52% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
515
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
516
	// 			'id'   => 'settings_post_type_toggles_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
517
	// 			'type' => 'tab_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
518
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
519
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
520
521
		
522
	// }
523
524
	/**
525
	 * Registers the Profile Stat Toggle settings
526
	 *
527
	 * @param object $cmb new_cmb2_box().
528
	 * @return void
529
	 */
530
531
	// public function stat_disable( $cmb ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
532
	// 	$cmb->add_field(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
533
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
534
	// 			'id'      => 'stat_disable_title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
535
	// 			'type'    => 'title',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
536
	// 			'name'    => __( 'My Plans', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
537
	// 			'default' => __( 'My Plans', 'lsx-health-plan' ),
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
538
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
539
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
540
		
541
	// 	$cmb->add_field(
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
542
	// 		array(
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
543
	// 			'id'   => 'settings_stat_disable_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
544
	// 			'type' => 'tab_closing',
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 10; use block comment if you need indentation
Loading history...
545
	// 		)
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 6; use block comment if you need indentation
Loading history...
546
	// 	);
0 ignored issues
show
Coding Style introduced by
Expected 1 space before comment text but found 2; use block comment if you need indentation
Loading history...
547
	// }
548
549
	/**
550
	 * Enable Business Directory Search settings only if LSX Search plugin is enabled.
551
	 *
552
	 * @param object $cmb The CMB2() class.
553
	 * @param string $section either engine,archive or single.
0 ignored issues
show
Coding Style introduced by
Superfluous parameter comment
Loading history...
554
	 * @return void
555
	 */
556
	public function generate_tabs( $cmb ) {
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
557
		$tabs = $this->get_settings_tabs();
558
559
		foreach ( $tabs as $tab_key => $tab ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
560
			$cmb->add_field(
561
				array(
562
					'id'          => 'settings_' . $tab_key . '_title',
563
					'type'        => 'title',
564
					'name'        => $tab['title'],
565
					'default'     => $tab['title'],
566
					'description' => $tab['desc'],
567
				)
568
			);
569
			do_action( 'lsx_hp_settings_page_' . $tab_key . '_top', $cmb );
570
571
			do_action( 'lsx_hp_settings_page_' . $tab_key . '_middle', $cmb );
572
573
			do_action( 'lsx_hp_settings_page_' . $tab_key . '_bottom', $cmb );
574
575
			$cmb->add_field(
576
				array(
577
					'id'   => 'settings_' . $tab_key . '_closing',
578
					'type' => 'tab_closing',
579
				)
580
			);
581
		}
582
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
583
584
585
	/**
586
	 * Returns the tabs and their descriptions.
587
	 *
588
	 * @return array
589
	 */
590
	public function get_settings_tabs() {
591
		$tabs = array(
592
			'general' => array(
593
				'title' => __( 'General', 'lsx-health-plan' ),
594
				'desc'  => __( 'Control the sitewide settings for the LSX HP site.', 'lsx-health-plan' ),
595
			),
596
		);
597
598
		foreach ( $this->post_types as $post_type ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
599
			switch ( $post_type ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
600
				default:
601
					//if ( ! in_array( $post_type, \lsx\search\includes\get_restricted_post_types() ) ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
No space found before comment text; expected "// if ( ! in_array( $post_type, \lsx\search\includes\get_restricted_post_types() ) ) {" but found "//if ( ! in_array( $post_type, \lsx\search\includes\get_restricted_post_types() ) ) {"
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
602
						$temp_post_type = get_post_type_object( $post_type );
603
						if ( ! is_wp_error( $temp_post_type ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
604
							$page_url    = get_post_type_archive_link( $temp_post_type->name );
605
							$description = sprintf(
606
								/* translators: %s: The subscription info */
607
								__( 'Control the settings for your <a target="_blank" href="%1$s">%2$s</a> archive.', 'lsx-search' ),
608
								$page_url,
0 ignored issues
show
Bug introduced by
It seems like $page_url can also be of type false; however, parameter $args of sprintf() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

608
								/** @scrutinizer ignore-type */ $page_url,
Loading history...
609
								$temp_post_type->label
610
							);
611
612
							$tabs[ $post_type ] = array(
613
								'title' => $temp_post_type->label,
614
								'desc'  => $description,
615
							);
616
						}
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
617
					//}
0 ignored issues
show
Coding Style introduced by
No space found before comment text; expected "// }" but found "//}"
Loading history...
618
					break;
619
			}
620
		}
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
621
		return $tabs;
622
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
623
}
624