Skip to content

Commit

Permalink
Restore PHPCS ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
dlh01 committed Dec 2, 2024
1 parent 640f0d6 commit e701463
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions admin/class-admin-apple-bulk-export-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ public function register_page() {
* @access public
*/
public function build_page() {
$post_ids = isset( $_GET['post_ids'] ) ? sanitize_text_field( wp_unslash( $_GET['post_ids'] ) ) : null;
$action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '';
$post_ids = isset( $_GET['post_ids'] ) ? sanitize_text_field( wp_unslash( $_GET['post_ids'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended

if ( ! $post_ids ) {
wp_safe_redirect( esc_url_raw( menu_page_url( $this->plugin_slug . '_index', false ) ) );
wp_safe_redirect( esc_url_raw( menu_page_url( $this->plugin_slug . '_index', false ) ) ); // phpcs:ignore WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit

if ( ! defined( 'APPLE_NEWS_UNIT_TESTS' ) || ! APPLE_NEWS_UNIT_TESTS ) {
exit;
}
Expand All @@ -98,15 +99,15 @@ public function build_page() {
}

// Override text within the partial depending on the action.
$apple_page_title = match ( $action ) {
$apple_page_title = match ( $action ) {
'apple_news_push_post' => __( 'Bulk Export Articles', 'apple-news' ),
'apple_news_delete_post' => __( 'Bulk Delete Articles', 'apple-news' ),
};
$apple_page_description = match ( $action ) {
'apple_news_push_post' => __( 'The following articles will be exported.', 'apple-news' ),
'apple_news_delete_post' => __( 'The following articles will be deleted.', 'apple-news' ),
};
$apple_submit_text = match ( $action ) {
$apple_submit_text = match ( $action ) {
'apple_news_push_post' => __( 'Export', 'apple-news' ),
'apple_news_delete_post' => __( 'Delete', 'apple-news' ),
};
Expand Down
8 changes: 4 additions & 4 deletions admin/class-admin-apple-index-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ public function page_router() {
} else {
$url = menu_page_url( $this->plugin_slug . '_bulk_export', false );

if ( isset( $_GET['article'] ) ) {
$post_ids = is_array( $_GET['article'] ) ? array_map( 'intval', $_GET['article'] ) : (int) $_GET['article'];
if ( isset( $_GET['article'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$post_ids = is_array( $_GET['article'] ) ? array_map( 'intval', $_GET['article'] ) : (int) $_GET['article']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$url = add_query_arg(
[
'action' => 'apple_news_push_post',
Expand All @@ -161,8 +161,8 @@ public function page_router() {
} else {
$url = menu_page_url( $this->plugin_slug . '_bulk_export', false );

if ( isset( $_GET['article'] ) ) {
$post_ids = is_array( $_GET['article'] ) ? array_map( 'intval', $_GET['article'] ) : (int) $_GET['article'];
if ( isset( $_GET['article'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$post_ids = is_array( $_GET['article'] ) ? array_map( 'intval', $_GET['article'] ) : (int) $_GET['article']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$url = add_query_arg(
[
'action' => 'apple_news_delete_post',
Expand Down
2 changes: 1 addition & 1 deletion includes/apple-push-api/request/class-request.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ private function request( $verb, $url, $data = [] ) {
}

if ( 'DELETE' === $verb ) {
$args['timeout'] = 5;
$args['timeout'] = 5; // phpcs:ignore WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout
}

/**
Expand Down

0 comments on commit e701463

Please sign in to comment.