@@ -150,6 +150,8 @@ private function should_mock_ppec_gateway() {
150150 return true ;
151151 }
152152
153+ // phpcs:disable WordPress.Security.NonceVerification
154+
153155 // Checks that require Subscriptions.
154156 if ( class_exists ( \WC_Subscriptions::class ) ) {
155157 // My Account > Subscriptions > (Subscription).
@@ -160,15 +162,15 @@ private function should_mock_ppec_gateway() {
160162 }
161163
162164 // Changing payment method?
163- if ( is_wc_endpoint_url ( 'order-pay ' ) && isset ( $ _GET ['change_payment_method ' ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
165+ if ( is_wc_endpoint_url ( 'order-pay ' ) && isset ( $ _GET ['change_payment_method ' ] ) ) {
164166 $ subscription = wcs_get_subscription ( absint ( get_query_var ( 'order-pay ' ) ) );
165167
166168 return ( $ subscription && PPECHelper::PPEC_GATEWAY_ID === $ subscription ->get_payment_method () );
167169 }
168170
169171 // Early renew (via modal).
170- if ( isset ( $ _GET ['process_early_renewal ' ], $ _GET ['subscription_id ' ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
171- $ subscription = wcs_get_subscription ( absint ( $ _GET ['subscription_id ' ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
172+ if ( isset ( $ _GET ['process_early_renewal ' ], $ _GET ['subscription_id ' ] ) ) {
173+ $ subscription = wcs_get_subscription ( absint ( $ _GET ['subscription_id ' ] ) );
172174
173175 return ( $ subscription && PPECHelper::PPEC_GATEWAY_ID === $ subscription ->get_payment_method () );
174176 }
@@ -185,7 +187,6 @@ private function should_mock_ppec_gateway() {
185187 }
186188
187189 // Are we editing an order or subscription tied to PPEC?
188- // phpcs:ignore WordPress.Security.NonceVerification
189190 $ order_id = wc_clean ( wp_unslash ( $ _GET ['id ' ] ?? $ _GET ['post ' ] ?? $ _POST ['post_ID ' ] ?? '' ) );
190191 if ( $ order_id ) {
191192 $ order = wc_get_order ( $ order_id );
@@ -199,9 +200,7 @@ private function should_mock_ppec_gateway() {
199200 * @psalm-suppress UndefinedClass
200201 */
201202 $ post_type_or_page = class_exists ( OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled ()
202- // phpcs:ignore WordPress.Security.NonceVerification
203203 ? wc_clean ( wp_unslash ( $ _GET ['page ' ] ?? '' ) )
204- // phpcs:ignore WordPress.Security.NonceVerification
205204 : wc_clean ( wp_unslash ( $ _GET ['post_type ' ] ?? $ _POST ['post_type ' ] ?? '' ) );
206205 if ( $ post_type_or_page === 'shop_subscription ' || $ post_type_or_page === 'wc-orders--shop_subscription ' ) {
207206 return true ;
0 commit comments