From b618d4c4c88b6eccb816718aadab6cbc06b12cec Mon Sep 17 00:00:00 2001 From: Torsten Landsiedel Date: Fri, 4 Nov 2022 11:14:26 +0100 Subject: [PATCH 1/2] Fix coding standards issue Short array syntax is not allowed --- wpmeetup-widget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpmeetup-widget.php b/wpmeetup-widget.php index 94d346f..f80cf51 100644 --- a/wpmeetup-widget.php +++ b/wpmeetup-widget.php @@ -56,7 +56,7 @@ public function __construct() { * @return array */ public function get_meetups() { - $meetups = []; + $meetups = array(); $api_data = get_transient( 'wpmg_wpmeetup_meetups' ); From 3988c558f178d8b9bcd2166e042a93927d3b8c68 Mon Sep 17 00:00:00 2001 From: Torsten Landsiedel Date: Fri, 4 Nov 2022 11:25:37 +0100 Subject: [PATCH 2/2] Update phpcs ignores Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS okay. --- wpmeetup-widget.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wpmeetup-widget.php b/wpmeetup-widget.php index f80cf51..67dcf9c 100644 --- a/wpmeetup-widget.php +++ b/wpmeetup-widget.php @@ -87,10 +87,10 @@ public function get_meetups() { */ public function widget( $args, $instance ) { - echo $args['before_widget']; // WPCS: XSS okay. + echo $args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput if ( ! empty( $instance['title'] ) ) { - echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; // WPCS: XSS okay. + echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput } $widget_args = apply_filters( @@ -127,7 +127,7 @@ public function widget( $args, $instance ) {