Issues (4138)

includes/shortcodes.php (60 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
2
namespace lsx_health_plan\shortcodes;
3
4
/**
5
 * LSX Health Plan Conditional Helpers.
6
 *
7
 * @package lsx-health-plan
8
 */
9
10
/**
11
 * Only display the my account page is the user is logged out.
12
 *
13
 * @return string
14
 */
15
function restricted_content() {
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
16
	$content = '';
17
	if ( ! is_user_logged_in() ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
18
		ob_start();
19
		echo do_shortcode( '[woocommerce_my_account]' );
20
		$content = ob_get_clean();
21
	}
0 ignored issues
show
No blank line found after control structure
Loading history...
22
	return $content;
23
}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
24
25
/**
26
 * Outputs the my profile tabs on the frontpage,
27
 *
28
 * @return void
0 ignored issues
show
Function return type is void, but function contains return statement
Loading history...
29
 */
30
function my_profile_tabs() {
31
	ob_start();
32
	echo lsx_health_plan_my_profile_tabs(); // WPCS: XSS OK.
0 ignored issues
show
Are you sure lsx_health_plan_my_profile_tabs() of type void can be used in echo? ( Ignorable by Annotation )

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

32
	echo /** @scrutinizer ignore-type */ lsx_health_plan_my_profile_tabs(); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
33
	$content = ob_get_clean();
34
	return $content;
35
}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
36
37
/**
38
 * Outputs the my profile box on the frontpage.
39
 *
40
 * @return void
0 ignored issues
show
Function return type is void, but function contains return statement
Loading history...
41
 */
42
function my_profile_box() {
43
	ob_start();
44
	echo lsx_health_plan_my_profile_box(); // WPCS: XSS OK.
0 ignored issues
show
Are you sure lsx_health_plan_my_profile_box() of type void can be used in echo? ( Ignorable by Annotation )

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

44
	echo /** @scrutinizer ignore-type */ lsx_health_plan_my_profile_box(); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
45
	$content = ob_get_clean();
46
	return $content;
47
}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
48
49
/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$args" missing
Loading history...
50
 * Outputs all the plans on the frontpage.
51
 *
52
 * @return void
0 ignored issues
show
Function return type is void, but function contains return statement
Loading history...
53
 */
54
function all_plans_box( $args = array() ) {
0 ignored issues
show
Expected 0 blank lines after opening function brace; 1 found
Loading history...
55
56
	ob_start();
57
	echo lsx_health_plan_all_plans_block(); // WPCS: XSS OK.
0 ignored issues
show
Are you sure lsx_health_plan_all_plans_block() of type void can be used in echo? ( Ignorable by Annotation )

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

57
	echo /** @scrutinizer ignore-type */ lsx_health_plan_all_plans_block(); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
58
	$content = ob_get_clean();
59
	return $content;
60
}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
61
62
/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$args" missing
Loading history...
63
 * Outputs the my profile box on the frontpage.
64
 *
65
 * @return void
0 ignored issues
show
Function return type is void, but function contains return statement
Loading history...
66
 */
67
function day_plan_box( $args = array() ) {
68
	$defaults = array(
69
		'week_view'      => false,
70
		'show_downloads' => false,
71
		'plan'           => '',
72
	);
73
	$args     = wp_parse_args( $args, $defaults );
74
	ob_start();
75
	if ( false === $args['week_view'] ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
76
		echo lsx_health_plan_day_plan_block( $args ); // WPCS: XSS OK.
0 ignored issues
show
Are you sure lsx_health_plan_day_plan_block($args) of type void can be used in echo? ( Ignorable by Annotation )

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

76
		echo /** @scrutinizer ignore-type */ lsx_health_plan_day_plan_block( $args ); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
77
	} else {
78
		echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK.
0 ignored issues
show
Are you sure lsx_health_plan_week_plan_block($args) of type void can be used in echo? ( Ignorable by Annotation )

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

78
		echo /** @scrutinizer ignore-type */ lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
79
	}
0 ignored issues
show
No blank line found after control structure
Loading history...
80
	$content = ob_get_clean();
81
	return $content;
82
}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
83
84
/**
85
 * Outputs the my exercise shortcode box on the frontpage
86
 *
87
 * @param array $args
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
88
 * @return void
0 ignored issues
show
Function return type is void, but function contains return statement
Loading history...
89
 */
90
function exercise_box( $args = array() ) {
91
	$defaults = array(
92
		'include'       => '',
93
		'term'          => '',
94
		'taxonomy'      => '',
95
		'view_more'     => false,
96
		'columns'       => 3,
97
		'limit'         => 4,
98
		'post_type'     => 'exercise',
99
		'orderby'       => 'date',
100
		'order'         => 'DESC',
101
		'description'   => 'none',
102
		'link'          => 'item',
103
		'link_class'    => 'btn border-btn',
104
		'layout'        => 'grid',
105
		'image_size'    => 'lsx-thumbnail-square',
106
		'parent'        => false,
107
		'modal_content' => 'excerpt',
108
	);
109
	$args     = wp_parse_args( $args, $defaults );
110
	ob_start();
111
	echo lsx_health_plan_items( $args ); // WPCS: XSS OK.
0 ignored issues
show
Are you sure lsx_health_plan_items($args) of type void can be used in echo? ( Ignorable by Annotation )

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

111
	echo /** @scrutinizer ignore-type */ lsx_health_plan_items( $args ); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
112
	$content = ob_get_clean();
113
	return $content;
114
}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
115
116
/**
117
 * Outputs the my featured video box on the frontpage.
118
 *
119
 * @return void
0 ignored issues
show
Function return type is void, but function contains return statement
Loading history...
120
 */
121
function feature_video_box() {
122
	ob_start();
123
	echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK.
0 ignored issues
show
Are you sure lsx_health_plan_featured_video_block() of type void can be used in echo? ( Ignorable by Annotation )

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

123
	echo /** @scrutinizer ignore-type */ lsx_health_plan_featured_video_block(); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
124
	$content = ob_get_clean();
125
126
	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
127
	wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
128
	return $content;
129
}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
130
131
/**
132
 * Outputs the my featured recipes box on the frontpage.
133
 *
134
 * @return void
0 ignored issues
show
Function return type is void, but function contains return statement
Loading history...
135
 */
136
function feature_recipes_box() {
137
	ob_start();
138
	echo lsx_health_plan_featured_recipes_block(); // WPCS: XSS OK.
0 ignored issues
show
Are you sure lsx_health_plan_featured_recipes_block() of type void can be used in echo? ( Ignorable by Annotation )

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

138
	echo /** @scrutinizer ignore-type */ lsx_health_plan_featured_recipes_block(); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
139
	$content = ob_get_clean();
140
	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
141
	wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
142
	return $content;
143
}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
144
145
/**
146
 * Outputs the my featured tips box on the frontpage.
147
 *
148
 * @return void
0 ignored issues
show
Function return type is void, but function contains return statement
Loading history...
149
 */
150
function feature_tips_box() {
151
	ob_start();
152
	echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK.
0 ignored issues
show
Are you sure lsx_health_plan_featured_tips_block() of type void can be used in echo? ( Ignorable by Annotation )

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

152
	echo /** @scrutinizer ignore-type */ lsx_health_plan_featured_tips_block(); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
153
	$content = ob_get_clean();
154
	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
155
	wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
156
	return $content;
157
}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
158
159
/**
160
 * Prints out the WooCommerce My Account Notices.
161
 *
162
 * @return string
163
 */
164
function account_notices() {
165
	$content = '';
166
	if ( function_exists( 'wc_print_notices' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
167
		$content = wc_print_notices( true );
168
	}
0 ignored issues
show
No blank line found after control structure
Loading history...
169
	return $content;
170
}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
171