GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 20f741...122957 )
by Christian
02:43
created

Widget::is_podlove_publisher_active()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 6
rs 10
1
<?php
0 ignored issues
show
Coding Style introduced by
This file is missing a doc comment.
Loading history...
introduced by
Class file names should be based on the class name with "class-" prepended. Expected class-widget.php, but found widget.php.
Loading history...
2
3
namespace PodloveSubscribeButton;
4
5
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
0 ignored issues
show
Coding Style introduced by
"include_once" is a statement not a function; no parentheses are required
Loading history...
Coding Style introduced by
File is being unconditionally included; use "require_once" instead
Loading history...
6
7
class Widget extends \WP_Widget {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for class Widget
Loading history...
8
9
	public static $widget_settings = array(
0 ignored issues
show
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
10
		'infotext',
11
		'title',
12
		'size',
13
		'style',
14
		'format',
15
		'autowidth',
16
		'button',
17
		'color',
18
	);
19
20
	public function __construct() {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function __construct()
Loading history...
21
		parent::__construct(
22
			'podlove_subscribe_button_wp_plugin_widget',
23
			( \PodloveSubscribeButton\is_podlove_publisher_active() ? 'Podlove Subscribe Button (WordPress plugin)' : 'Podlove Subscribe Button' ),
24
			array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ), )
0 ignored issues
show
introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
25
		);
26
27
	}
28
29
	public function widget( $args, $instance ) {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function widget()
Loading history...
30
		// Fetch the (network)button by it's name
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
31
		if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name( $instance[ 'button' ] ) ) {
0 ignored issues
show
introduced by
Variable assignment found within a condition. Did you mean to do a comparison?
Loading history...
Coding Style introduced by
Assignments must be the first block of code on a line
Loading history...
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
32
			return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args['button'] );
0 ignored issues
show
introduced by
A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.
Loading history...
33
		}
34
35
		echo $args[ 'before_widget' ];
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$args'.
Loading history...
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
36
		echo $args[ 'before_title' ] . apply_filters( 'widget_title', $instance[ 'title' ] ) . $args[ 'after_title' ];
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$args'.
Loading history...
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'apply_filters'.
Loading history...
37
38
		echo $button->render(
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$button'.
Loading history...
39
			\PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'size' ),
40
			\PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'autowidth' ),
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'PodloveSubscribeButton'.
Loading history...
41
			\PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'style' ),
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'PodloveSubscribeButton'.
Loading history...
42
			\PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'format' ),
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'PodloveSubscribeButton'.
Loading history...
43
			\PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'color' )
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'PodloveSubscribeButton'.
Loading history...
44
		);
45
46
		if ( strlen( $instance[ 'infotext' ] ) ) {
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
47
			echo wpautop( $instance[ 'infotext' ] );
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'wpautop'.
Loading history...
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
48
		}
49
50
		echo $args[ 'after_widget' ];
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$args'.
Loading history...
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
51
52
	}
53
54
	public function form( $instance ) {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function form()
Loading history...
55
		$title     = isset( $instance[ 'title' ] )     ? $instance[ 'title' ]     : '';
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
introduced by
Expected 1 space before "?"; 5 found
Loading history...
introduced by
Expected 1 space before ":"; 5 found
Loading history...
56
		$button    = isset( $instance[ 'button' ] )    ? $instance[ 'button' ]    : '';
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
introduced by
Expected 1 space before "?"; 4 found
Loading history...
introduced by
Expected 1 space before ":"; 4 found
Loading history...
57
		$size      = isset( $instance[ 'size' ] )      ? $instance[ 'size' ]      : 'big';
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
introduced by
Expected 1 space before "?"; 6 found
Loading history...
introduced by
Expected 1 space before ":"; 6 found
Loading history...
58
		$style     = isset( $instance[ 'style' ] )     ? $instance[ 'style' ]     : 'filled';
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
introduced by
Expected 1 space before "?"; 5 found
Loading history...
introduced by
Expected 1 space before ":"; 5 found
Loading history...
59
		$format    = isset( $instance[ 'format' ] )    ? $instance[ 'format' ]    : 'cover';
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
introduced by
Expected 1 space before "?"; 4 found
Loading history...
introduced by
Expected 1 space before ":"; 4 found
Loading history...
60
		$autowidth = isset( $instance[ 'autowidth' ] ) ? $instance[ 'autowidth' ] : true;
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
61
		$infotext  = isset( $instance[ 'infotext' ] )  ? $instance[ 'infotext' ]  : '';
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
introduced by
Expected 1 space before "?"; 2 found
Loading history...
introduced by
Expected 1 space before ":"; 2 found
Loading history...
62
		$color     = isset( $instance[ 'color' ] )     ? $instance[ 'color' ]     : '#75ad91';
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
introduced by
Expected 1 space before "?"; 5 found
Loading history...
introduced by
Expected 1 space before ":"; 5 found
Loading history...
63
64
		$buttons = \PodloveSubscribeButton\Model\Button::all();
65
		if ( is_multisite() ) {
66
			$network_buttons = \PodloveSubscribeButton\Model\NetworkButton::all();
67
		}
68
		?>
69
		<p>
70
			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'podlove-subscribe-button' ); ?></label>
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
introduced by
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
71
			<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $title; ?>" />
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$title'.
Loading history...
72
			<label for="<?php echo $this->get_field_id( 'color' ); ?>"><?php _e( 'Color', 'podlove-subscribe-button' ); ?></label>
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
introduced by
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
73
			<input class="podlove_subscribe_button_color" id="<?php echo $this->get_field_id( 'color' ); ?>" name="<?php echo $this->get_field_name( 'color' ); ?>" value="<?php echo $color; ?>" />
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$color'.
Loading history...
74
			<style type="text/css">
75
				.sp-replacer {
76
					display: flex;
77
				}
78
				.sp-preview {
79
					flex-grow: 10;
80
				}
81
			</style>
82
			<label for="<?php echo $this->get_field_id( 'button' ); ?>"><?php _e( 'Button', 'podlove-subscribe-button' ); ?></label>
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
introduced by
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
83
            <select class="widefat" id="<?php echo $this->get_field_id( 'button' ); ?>"
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
84
                    name="<?php echo $this->get_field_name( 'button' ); ?>">
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
85
				<?php if ( isset( $network_buttons ) && count( $network_buttons ) > 0 ) : ?>
86
                    <optgroup label="<?php _e( 'Local', 'podlove-subscribe-button' ); ?>">
0 ignored issues
show
introduced by
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
87
						<?php
88
						foreach ( $buttons as $subscribebutton ) {
89
							echo "<option value='" . $subscribebutton->name . "' " . selected( $subscribebutton->name, $button ) . " >" . $subscribebutton->title . " (" . $subscribebutton->name . ")</option>";
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$subscribebutton'.
Loading history...
Coding Style Comprehensibility introduced by
The string literal > does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal ( does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal )</option> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
90
						} ?>
0 ignored issues
show
Coding Style introduced by
Closing PHP tag must be on a line by itself
Loading history...
91
                    </optgroup>
92
                    <optgroup label="<?php _e( 'Network', 'podlove-subscribe-button' ); ?>">
0 ignored issues
show
introduced by
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
93
						<?php
94
						foreach ( $network_buttons as $subscribebutton ) {
95
							echo "<option value='" . $subscribebutton->name . "' " . selected( $subscribebutton->name, $button ) . " >" . $subscribebutton->title . " (" . $subscribebutton->name . ")</option>";
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$subscribebutton'.
Loading history...
Coding Style Comprehensibility introduced by
The string literal > does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal ( does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal )</option> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
96
						} ?>
0 ignored issues
show
Coding Style introduced by
Closing PHP tag must be on a line by itself
Loading history...
97
                    </optgroup>
98
				<?php else :
0 ignored issues
show
Coding Style introduced by
Opening PHP tag must be on a line by itself
Loading history...
99
					foreach ( $buttons as $subscribebutton ) {
100
						echo "<option value='" . $subscribebutton->name . "' " . selected( $subscribebutton->name, $button ) . " >" . $subscribebutton->title . " (" . $subscribebutton->name . ")</option>";
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$subscribebutton'.
Loading history...
Coding Style Comprehensibility introduced by
The string literal > does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal ( does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal )</option> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
101
					}
102
				endif; ?>
0 ignored issues
show
Coding Style introduced by
Closing PHP tag must be on a line by itself
Loading history...
103
            </select>
104
			<?php
105
			$customize_options = array(
106
				'size'      => array(
107
					'name'    => __( 'Size', 'podlove-subscribe-button' ),
108
					'options' => \PodloveSubscribeButton\Model\Button::$size
0 ignored issues
show
introduced by
Each array item in a multi-line array declaration must end in a comma
Loading history...
109
				),
110
				'style'     => array(
111
					'name'    => __( 'Style', 'podlove-subscribe-button' ),
112
					'options' => \PodloveSubscribeButton\Model\Button::$style
0 ignored issues
show
introduced by
Each array item in a multi-line array declaration must end in a comma
Loading history...
113
				),
114
				'format'    => array(
115
					'name'    => __( 'Format', 'podlove-subscribe-button' ),
116
					'options' => \PodloveSubscribeButton\Model\Button::$format
0 ignored issues
show
introduced by
Each array item in a multi-line array declaration must end in a comma
Loading history...
117
				),
118
				'autowidth' => array(
119
					'name'    => __( 'Autowidth', 'podlove-subscribe-button' ),
120
					'options' => \PodloveSubscribeButton\Model\Button::$width
0 ignored issues
show
introduced by
Each array item in a multi-line array declaration must end in a comma
Loading history...
121
				)
0 ignored issues
show
introduced by
Each array item in a multi-line array declaration must end in a comma
Loading history...
122
			);
123
124
			foreach ( $customize_options as $slug => $properties ) : ?>
0 ignored issues
show
Coding Style introduced by
Closing PHP tag must be on a line by itself
Loading history...
125
				<label for="<?php echo $this->get_field_id( $slug ); ?>"><?php echo $properties[ 'name' ]; ?></label>
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$properties'.
Loading history...
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
126
				<select class="widefat" id="<?php echo $this->get_field_id( $slug ); ?>" name="<?php echo $this->get_field_name( $slug ); ?>">
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
127
					<option value="default" <?php echo ( $$slug == 'default' ? 'selected="selected"' : '' ); ?>><?php printf( __( 'Default %s', 'podlove-subscribe-button' ), $properties[ 'name' ] ) ?></option>
0 ignored issues
show
introduced by
Found: ==. Use strict comparisons (=== or !==).
Loading history...
introduced by
Use Yoda Condition checks, you must.
Loading history...
Coding Style introduced by
Inline PHP statement must end with a semicolon
Loading history...
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '__'.
Loading history...
introduced by
A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.
Loading history...
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$properties'.
Loading history...
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
128
					<optgroup>
129
						<?php foreach ( $properties[ 'options' ] as $property => $name ) : ?>
0 ignored issues
show
introduced by
Array keys must NOT be surrounded by spaces if they only contain a string or an integer.
Loading history...
130
						<option value="<?php echo $property; ?>" <?php echo ( $$slug == $property ? 'selected="selected"' : '' ); ?>><?php echo $name; ?></option>
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$property'.
Loading history...
introduced by
Found: ==. Use strict comparisons (=== or !==).
Loading history...
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$name'.
Loading history...
131
						<?php endforeach; ?>
132
					</optgroup>
133
				</select>
134
			<?php endforeach; ?>
135
			<label for="<?php echo $this->get_field_id( 'infotext' ); ?>"><?php _e( 'Description', 'podlove-subscribe-button' ); ?></label>
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
introduced by
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
136
			<textarea class="widefat" rows="10" id="<?php echo $this->get_field_id( 'infotext' ); ?>" name="<?php echo $this->get_field_name( 'infotext' ); ?>"><?php echo $infotext; ?></textarea>
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$infotext'.
Loading history...
137
		</p>
138
		<?php
139
140
	}
141
142
	public function update( $new_instance, $old_instance ) {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function update()
Loading history...
143
		$instance = array();
144
145
		foreach ( self::$widget_settings as $setting ) {
146
			$instance[ $setting ] = ( ! empty( $new_instance[ $setting ] ) ) ? strip_tags( $new_instance[ $setting ] ) : '';
0 ignored issues
show
introduced by
strip_tags() is discouraged. Use the more comprehensive wp_strip_all_tags() instead.
Loading history...
147
		}
148
149
		return $instance;
150
151
	}
152
153
} // END class
154