Skip to content

Commit

Permalink
ignoring a few unnecessary issues
Browse files Browse the repository at this point in the history
  • Loading branch information
faisal-alvi committed Jan 17, 2025
1 parent 195f151 commit 5942ffc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions includes/Framework/Api/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected function get_request_uri() {
$query = $this->get_request_query();
if ( $query ) {

$url_parts = parse_url( $uri );
$url_parts = parse_url( $uri ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url

// if the URL already has some query params, add to them
if ( ! empty( $url_parts['query'] ) ) {
Expand Down Expand Up @@ -645,7 +645,7 @@ public function set_tls_1_2_request( $handle, $r, $url ) {
return;
}

curl_setopt( $handle, CURLOPT_SSLVERSION, 6 );
curl_setopt( $handle, CURLOPT_SSLVERSION, 6 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_setopt
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@

<tr>
<td data-export-label="Environment"><?php esc_html_e( 'Environment', 'woocommerce-square' ); ?>:</td>
<td class="help"><?php echo wc_help_tip( esc_html__( 'The transaction environment for this gateway.', 'woocommerce-square' ) ); ?></td> // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
<td class="help"><?php echo wc_help_tip( esc_html__( 'The transaction environment for this gateway.', 'woocommerce-square' ) ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?></td>
<td><?php echo esc_html( $environment ); ?></td>
</tr>

<?php if ( $gateway->supports_tokenization() ) : ?>

<tr>
<td data-export-label="Tokenization Enabled"><?php esc_html_e( 'Tokenization Enabled', 'woocommerce-square' ); ?>:</td>
<td class="help"><?php echo wc_help_tip( esc_html__( 'Displays whether or not tokenization is enabled for this gateway.', 'woocommerce-square' ) ); ?></td> // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
<td class="help"><?php echo wc_help_tip( esc_html__( 'Displays whether or not tokenization is enabled for this gateway.', 'woocommerce-square' ) ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?></td>
<td>
<?php if ( $gateway->tokenization_enabled() ) : ?>
<mark class="yes">&#10004;</mark>
Expand All @@ -69,7 +69,7 @@

<tr>
<td data-export-label="Debug Mode"><?php esc_html_e( 'Debug Mode', 'woocommerce-square' ); ?>:</td>
<td class="help"><?php echo wc_help_tip( esc_html__( 'Displays whether or not debug logging is enabled for this gateway.', 'woocommerce-square' ) ); ?></td> // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
<td class="help"><?php echo wc_help_tip( esc_html__( 'Displays whether or not debug logging is enabled for this gateway.', 'woocommerce-square' ) ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?></td>
<td>
<?php if ( $gateway->debug_log() && $gateway->debug_checkout() ) : ?>
<?php echo esc_html__( 'Display at Checkout & Log', 'woocommerce-square' ); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function set_cert_file( $curl_handle ) {
return;
}

curl_setopt( $curl_handle, CURLOPT_SSLCERT, get_option( 'sv_wc_apple_pay_cert_path' ) );
curl_setopt( $curl_handle, CURLOPT_SSLCERT, get_option( 'sv_wc_apple_pay_cert_path' ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_setopt
}


Expand Down
1 change: 1 addition & 0 deletions includes/Framework/PaymentGateway/Payment_Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -2888,6 +2888,7 @@ protected function do_transaction_failed_result( \WC_Order $order, Payment_Gatew

// add transaction id if there is one
if ( $response->get_transaction_id() ) {
/* translators: Placeholders: %s - transaction ID */
$order_note .= ' ' . sprintf( esc_html__( 'Transaction ID %s', 'woocommerce-square' ), $response->get_transaction_id() );
}

Expand Down
14 changes: 7 additions & 7 deletions includes/Gateway/Digital_Wallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,9 @@ public function ajax_get_payment_request() {

try {
if ( 'product' === $context ) {
$product_id = ! empty( $_POST['product_id'] ) ? wc_clean( wp_unslash( $_POST['product_id'] ) ) : 0;
$quantity = ! empty( $_POST['quantity'] ) ? wc_clean( wp_unslash( $_POST['quantity'] ) ) : 1;
$attributes = ! empty( $_POST['attributes'] ) ? wc_clean( wp_unslash( $_POST['attributes'] ) ) : array();
$product_id = ! empty( $_POST['product_id'] ) ? wc_clean( wp_unslash( $_POST['product_id'] ) ) : 0; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$quantity = ! empty( $_POST['quantity'] ) ? wc_clean( wp_unslash( $_POST['quantity'] ) ) : 1; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$attributes = ! empty( $_POST['attributes'] ) ? wc_clean( wp_unslash( $_POST['attributes'] ) ) : array(); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized

try {
$payment_request = $this->get_product_payment_request( $product_id, $quantity, $attributes );
Expand Down Expand Up @@ -678,9 +678,9 @@ public function ajax_add_to_cart() {
check_ajax_referer( 'wc-square-add-to-cart', 'security' );

try {
$product_id = ! empty( $_POST['product_id'] ) ? wc_clean( wp_unslash( $_POST['product_id'] ) ) : 0;
$quantity = ! empty( $_POST['quantity'] ) ? wc_clean( wp_unslash( $_POST['quantity'] ) ) : 1;
$attributes = ! empty( $_POST['attributes'] ) ? wc_clean( wp_unslash( $_POST['attributes'] ) ) : array();
$product_id = ! empty( $_POST['product_id'] ) ? wc_clean( wp_unslash( $_POST['product_id'] ) ) : 0; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$quantity = ! empty( $_POST['quantity'] ) ? wc_clean( wp_unslash( $_POST['quantity'] ) ) : 1; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$attributes = ! empty( $_POST['attributes'] ) ? wc_clean( wp_unslash( $_POST['attributes'] ) ) : array(); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized

try {
$payment_request = $this->get_product_payment_request( $product_id, $quantity, $attributes, true );
Expand Down Expand Up @@ -838,7 +838,7 @@ public function ajax_recalculate_totals() {
if ( WC()->cart->needs_shipping() || $is_pay_for_order_page ) {
if ( ! empty( $_POST['shipping_contact'] ) ) {
$shipping_address = wp_parse_args(
wc_clean( wp_unslash( $_POST['shipping_contact'] ) ),
wc_clean( wp_unslash( $_POST['shipping_contact'] ) ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
array(
'countryCode' => null,
'state' => null,
Expand Down
4 changes: 2 additions & 2 deletions includes/Sync/Records/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function get_local_date( $format = null ) {

try {

$date = new \DateTime( date( (string) $format, $this->get_timestamp() ), new \DateTimeZone( 'UTC' ) );
$date = new \DateTime( date( (string) $format, $this->get_timestamp() ), new \DateTimeZone( 'UTC' ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
$timezone = new \DateTimeZone( wc_timezone_string() );
$offset = $timezone->getOffset( $date );
$timestamp = $date->getTimestamp() + $offset;
Expand All @@ -351,7 +351,7 @@ public function get_local_date( $format = null ) {
$timestamp = $this->get_timestamp();
}

return date( (string) $format, $timestamp );
return date( (string) $format, $timestamp ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
}


Expand Down

0 comments on commit 5942ffc

Please sign in to comment.