Test Failed
Push — master ( e52611...5d5118 )
by Paul
04:30
created

SiteReviewsSummaryButton   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 52
dl 0
loc 70
ccs 0
cts 49
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A fields() 0 65 1
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Shortcodes;
4
5
use GeminiLabs\SiteReviews\Shortcodes\SiteReviewsButton;
6
7
class SiteReviewsSummaryButton extends SiteReviewsButton
8
{
9
	/**
10
	 * @return array
11
	 */
12
	public function fields()
13
	{
14
		return [[
15
			'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' )),
16
			'minWidth' => 320,
17
			'type' => 'container',
18
		],[
19
			'label' => esc_html__( 'Title', 'site-reviews' ),
20
			'name' => 'title',
21
			'tooltip' => esc_attr__( 'Enter a custom shortcode heading.', 'site-reviews' ),
22
			'type' => 'textbox',
23
		],
24
		$this->getTypes(),
25
		$this->getTerms(),
26
		[
27
			'label' => esc_html__( 'Post ID', 'site-reviews' ),
28
			'name' => 'assigned_to',
29
			'tooltip' => esc_attr__( 'Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page.', 'site-reviews' ),
30
			'type' => 'textbox',
31
		],[
32
			'label' => esc_html__( 'Schema', 'site-reviews' ),
33
			'name' => 'schema',
34
			'options' => [
35
				'true' => esc_html__( 'Enable rich snippets', 'site-reviews' ),
36
				'false' => esc_html__( 'Disable rich snippets', 'site-reviews' ),
37
			],
38
			'tooltip' => esc_attr__( 'Rich snippets are disabled by default.', 'site-reviews' ),
39
			'type' => 'listbox',
40
		],[
41
			'label' => esc_html__( 'Classes', 'site-reviews' ),
42
			'name' => 'class',
43
			'tooltip' => esc_attr__( 'Add custom CSS classes to the shortcode.', 'site-reviews' ),
44
			'type' => 'textbox',
45
		],[
46
			'columns' => 2,
47
			'items' => [[
48
				'type' => 'checkbox',
49
				'name' => 'hide_bars',
50
				'text' => esc_html__( 'Bars', 'site-reviews' ),
51
				'tooltip' => esc_attr__( 'Hide the percentage bars?', 'site-reviews' ),
52
			],[
53
				'type' => 'checkbox',
54
				'name' => 'hide_if_empty',
55
				'text' => esc_html__( 'If Empty', 'site-reviews' ),
56
				'tooltip' => esc_attr__( 'Hide the summary if no reviews are found?', 'site-reviews' ),
57
			],[
58
				'type' => 'checkbox',
59
				'name' => 'hide_rating',
60
				'text' => esc_html__( 'Rating', 'site-reviews' ),
61
				'tooltip' => esc_attr__( 'Hide the rating?', 'site-reviews' ),
62
			],[
63
				'type' => 'checkbox',
64
				'name' => 'hide_stars',
65
				'text' => esc_html__( 'Stars', 'site-reviews' ),
66
				'tooltip' => esc_attr__( 'Hide the stars?', 'site-reviews' ),
67
			],[
68
				'type' => 'checkbox',
69
				'name' => 'hide_summary',
70
				'text' => esc_html__( 'Summary', 'site-reviews' ),
71
				'tooltip' => esc_attr__( 'Hide the summary text?', 'site-reviews' ),
72
			]],
73
			'layout' => 'grid',
74
			'label' => esc_html__( 'Hide', 'site-reviews' ),
75
			'spacing' => 5,
76
			'type' => 'container',
77
		]];
78
	}
79
}
80