PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | modules/widgets/milestone/class-milestone-widget.php +8 -3 12.2.3 → 16.3-a.1 View file →
@@ -6,8 +6,12 @@
6 6 */
7 7
8 8 use Automattic\Jetpack\Assets;
9 9
10 +if ( ! defined( 'ABSPATH' ) ) {
11 + exit( 0 );
12 +}
13 +
10 14 /**
11 15 * Class Milestone_Widget
12 16 */
13 17 class Milestone_Widget extends WP_Widget {
@@ -134,11 +138,11 @@
134 138 public static function sanitize_color_hex( $hex, $prefix = '#' ) {
135 139 $hex = trim( $hex );
136 140
137 141 /* Strip recognized prefixes. */
138 - if ( 0 === strpos( $hex, '#' ) ) {
142 + if ( str_starts_with( $hex, '#' ) ) {
139 143 $hex = substr( $hex, 1 );
140 - } elseif ( 0 === strpos( $hex, '%23' ) ) {
144 + } elseif ( str_starts_with( $hex, '%23' ) ) {
141 145 $hex = substr( $hex, 3 );
142 146 }
143 147
144 148 if ( 0 !== preg_match( '/^[0-9a-fA-F]{6}$/', $hex ) ) {
@@ -231,9 +235,9 @@
231 235 $config['content_id'] = $widget_id . '-content';
232 236
233 237 self::$config_js['instances'][] = $config;
234 238
235 - echo sprintf( '<div id="%s" class="milestone-content">', esc_html( $config['content_id'] ) );
239 + printf( '<div id="%s" class="milestone-content">', esc_html( $config['content_id'] ) );
236 240
237 241 echo '<div class="milestone-header">';
238 242 echo '<strong class="event">' . esc_html( $instance['event'] ) . '</strong>';
239 243 echo '<span class="date">' . esc_html( date_i18n( get_option( 'date_format' ), $data['milestone'] ) ) . '</span>';
@@ -631,8 +635,9 @@
631 635 /**
632 636 * Form
633 637 *
634 638 * @param array $instance Widget instance.
639 + * @return string|void
635 640 */
636 641 public function form( $instance ) {
637 642 $instance = $this->sanitize_instance( $instance );
638 643