Skip to content

Commit

Permalink
(general cleanup) - Removed excess spacing and tabs from line ends
Browse files Browse the repository at this point in the history
  • Loading branch information
thisismyurl committed Nov 27, 2016
1 parent a97791b commit 567d755
Show file tree
Hide file tree
Showing 73 changed files with 672 additions and 672 deletions.
2 changes: 1 addition & 1 deletion wpsc-admin/ajax-and-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function wpsc_admin_ajax() {

/**
* The function that changes the main currency in the DB
*
*
* @uses $wpdb WordPress database object for queries
*/
function wpsc_change_currency() {
Expand Down
34 changes: 17 additions & 17 deletions wpsc-admin/display-upgrades.page.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,28 @@ function wpse_license_page_display_licenses () {
*/
function wpec_licenses_action_stuff() {
//Activate a new Product License

if( ! current_user_can( 'manage_options' ) ) {
return;
}

if ( isset( $_POST['product_license_key'] ) && $_POST['product_license_key'] == 'true' ) {
if ( isset( $_POST['product_license'] ) && $_POST['product_license'] != '' ) {

//Do stuff
$params = array (
'license' => sanitize_text_field( $_POST['product_license'] ),
'url' => home_url()
);

$activation = false;
if ( isset( $_POST['submit_values'] ) && $_POST['submit_values'] == 'submit_values' ) {
$activation = true;
$params['wpec_lic_action'] = 'activate_license';
} elseif ( isset( $_POST['reset_values'] ) && $_POST['reset_values'] == 'reset_values' ) {
$params['wpec_lic_action'] = 'deactivate_license';
}

$response = wp_remote_post(
'https://wpecommerce.org/',
array(
Expand All @@ -104,12 +104,12 @@ function wpec_licenses_action_stuff() {
'body' => $params
)
);

// Make sure there are no errors
if ( is_wp_error( $response ) ) {
return;
}

// Decode license data
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
$active_licenses = get_option( 'wpec_licenses_active_products', array() );
Expand All @@ -127,7 +127,7 @@ function wpec_licenses_action_stuff() {
update_option( 'wpec_licenses_active_products', $active_licenses );
delete_option( 'wpec_product_' . $license_data->item_id . '_license_active' );
}


echo '<div class="updated"><p>'.esc_html( $license_data->message ).'</p></div>';
} else {
Expand All @@ -139,7 +139,7 @@ function wpec_licenses_action_stuff() {
add_action( 'wpsc_upgrades_license_activation', 'wpec_licenses_action_stuff' );

function wpec_lic_weekly_license_check() {

if( ! empty( $_POST['product_license_key'] ) ) {
return; // Don't fire when saving settings
}
Expand All @@ -148,10 +148,10 @@ function wpec_lic_weekly_license_check() {
if( empty( $active_licenses ) ) {
return;
}

foreach ( (array) $active_licenses as $license ) {
$license_info = get_option( 'wpec_product_' . $license . '_license_active' );

// data to send in our API request
$api_params = array(
'wpec_lic_action'=> 'check_license',
Expand All @@ -176,7 +176,7 @@ function wpec_lic_weekly_license_check() {
}

$license_data = json_decode( wp_remote_retrieve_body( $response ) );
update_option( 'wpec_product_' . $license . '_license_active', $license_data );
update_option( 'wpec_product_' . $license . '_license_active', $license_data );
}
}
add_action( 'wpsc_weekly_cron_task', 'wpec_lic_weekly_license_check' ); // For testing use admin_init
Expand All @@ -185,14 +185,14 @@ function wpec_license_notices() {
if( ! current_user_can( 'manage_options' ) ) {
return;
}

$active_licenses = get_option( 'wpec_licenses_active_products', array() );
if( empty( $active_licenses ) ) {
return;
}

$messages = array();

foreach ( (array) $active_licenses as $license ) {
$license = get_option( 'wpec_product_' . $license . '_license_active' );
if( is_object( $license ) && 'valid' !== $license->license && empty( $showed_invalid_message ) ) {
Expand All @@ -203,7 +203,7 @@ function wpec_license_notices() {
);
$showed_invalid_message = true;
}
}
}
}

if( ! empty( $messages ) ) {
Expand All @@ -212,6 +212,6 @@ function wpec_license_notices() {
echo '<p>' . $message . '</p>';
echo '</div>';
}
}
}
}
add_action( 'admin_notices', 'wpec_license_notices' );
2 changes: 1 addition & 1 deletion wpsc-admin/includes/display-items-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function wpsc_stock_control_forms() {
if ( ! isset( $product_meta['unpublish_when_none_left'] ) ) {
$product_meta['unpublish_when_none_left'] = '';
}

if ( ! isset( $product_meta['stock_limit_notify'] ) ) {
$product_meta['stock_limit_notify'] = '';
}
Expand Down
4 changes: 2 additions & 2 deletions wpsc-admin/includes/product-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function wpsc_admin_submit_product( $post_ID, $post ) {
} else {
$post_data['meta']['_wpsc_stock'] = isset( $post_data['meta']['_wpsc_stock'] ) ? (int) $post_data['meta']['_wpsc_stock'] : 0;
}

// Update low stock notifications
if ( isset( $post_data['meta']['_wpsc_stock'] ) && isset( $post_data['meta']['_wpsc_product_metadata'] ) && ( $post_data['meta']['_wpsc_stock'] > $post_data['meta']['_wpsc_product_metadata']['stock_limit_notify'] ) ) {
// Check if notification has been sent
Expand All @@ -62,7 +62,7 @@ function wpsc_admin_submit_product( $post_ID, $post ) {
delete_product_meta( $product_id, 'stock_limit_notify_sent' );
}
}

unset($post_data['meta']['_wpsc_limited_stock']);
if(!isset($post_data['quantity_limited'])) $post_data['quantity_limited'] = '';
if(!isset($post_data['special'])) $post_data['special'] = '';
Expand Down
2 changes: 1 addition & 1 deletion wpsc-admin/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function _wpsc_action_enqueue_media_scripts() {
'getGalleryNonce' => wp_create_nonce( 'wpsc_ajax_get_gallery_' . $id )
) );
}

if ( 'edit-wpsc-product' == $current_screen->id ) {
wp_enqueue_script( 'wpsc-quick-edit', WPSC_URL . '/wpsc-admin/js/quick-edit.js', array( 'jquery', 'inline-edit-post' ), WPSC_VERSION, true );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Sputnik_Library_TwitterOAuth_Internal {
/* Set timeout default. */
public $timeout = 30;
/* Set connect timeout. */
public $connecttimeout = 30;
public $connecttimeout = 30;
/* Verify SSL Cert. */
public $ssl_verifypeer = FALSE;
/* Respons format. */
Expand Down Expand Up @@ -73,7 +73,7 @@ function getRequestToken($oauth_callback = NULL) {
$parameters = array();
if (!empty($oauth_callback)) {
$parameters['oauth_callback'] = $oauth_callback;
}
}
$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
$token = OAuthUtil::parse_parameters($request);
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
Expand Down Expand Up @@ -124,7 +124,7 @@ function getAccessToken($oauth_verifier = FALSE) {
* "user_id" => "9436992",
* "screen_name" => "abraham",
* "x_auth_expires" => "0")
*/
*/
function getXAuthToken($username, $password) {
$parameters = array();
$parameters['x_auth_username'] = $username;
Expand All @@ -146,7 +146,7 @@ function get($url, $parameters = array()) {
}
return $response;
}

/**
* POST wrapper for oAuthRequest.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (c) 2009 Abraham Williams - http://abrah.am - abraham@poseurte.ch

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
Expand All @@ -8,10 +8,10 @@ copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
* The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
* where the Signature Base String is the text and the key is the concatenated values (each first
* encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
* The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
* where the Signature Base String is the text and the key is the concatenated values (each first
* encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
* character (ASCII code 38) even if empty.
* - Chapter 9.2 ("HMAC-SHA1")
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* The PLAINTEXT method does not provide any security protection and SHOULD only be used
* The PLAINTEXT method does not provide any security protection and SHOULD only be used
* over a secure channel such as HTTPS. It does not use the Signature Base String.
* - Chapter 9.4 ("PLAINTEXT")
*/
Expand All @@ -11,8 +11,8 @@ public function get_name() {
}

/**
* oauth_signature is set to the concatenated encoded values of the Consumer Secret and
* Token Secret, separated by a '&' character (ASCII code 38), even if either secret is
* oauth_signature is set to the concatenated encoded values of the Consumer Secret and
* Token Secret, separated by a '&' character (ASCII code 38), even if either secret is
* empty. The result MUST be encoded again.
* - Chapter 9.4.1 ("Generating Signatures")
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in
* [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for
* EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a
* verified way to the Service Provider, in a manner which is beyond the scope of this
* The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in
* [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for
* EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a
* verified way to the Service Provider, in a manner which is beyond the scope of this
* specification.
* - Chapter 9.3 ("RSA-SHA1")
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function init() {

// Load DG scripts and styles
add_action( 'wp_enqueue_scripts', array( 'WPSC_Payment_Gateway_Paypal_Digital_Goods', 'dg_script' ) );

// Express Checkout for DG Button
add_action( 'wpsc_cart_item_table_form_actions_left', array( $this, 'add_ecs_button' ), 2, 2 );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ final class PHP_Merchant_Exception extends Exception {
PHPME_HTTP_REQUEST_FAILED => 'HTTP request failed: %s',
PHPME_INVALID_RESPONSE => 'Invalid response from payment gateway',
);

public static function addCodes( $codes ) {
if ( ! is_array( $codes ) )
return;

self::$message += $codes;
}

private $other_args;

public function __construct( $code, $message_args = array(), $other_args = array() ) {
$this->message_args = (array) $message_args;
$this->message = vsprintf( self::$messages[$code], $this->message_args );
$this->other_args = (array) $other_args;
$this->code = $code;

parent::__construct( $this->message, $code );
}

public function getArguments() {
return $this->other_args;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
function phpme_map( $from_array, $map, $return_type = 'Array' ) {
$return = array();

foreach ( $map as $to_key => $from_key ) {
if ( isset( $from_array[$from_key] ) )
$return[$to_key] = $from_array[$from_key];
}

if ( $return_type == 'Object' )
$return = (Object) $return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
abstract class PHP_Merchant_HTTP
{
public function __construct() {

}

abstract public function get( $url, $args = array() );
abstract public function post( $url, $args = array() );
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ abstract class PHP_Merchant_Response
protected $options = array();
protected $errors = array();
protected $response = '';

public function __construct( $response_str ) {
$this->response = $response_str;
}

public function is_successful() {
return $this->is_successful;
}

public function get( $name ) {
if ( ! isset( $this->options[$name] ) )
return null;
return $this->options[$name];
}

public function get_response_string() {
return $this->response;
}

public function get_errors() {
return $this->errors;
}

public function has_errors() {
return ! empty( $this->errors );
}

public function get_error() {
return empty( $this->errors ) ? false : $this->errors[0];
}
Expand Down
Loading

0 comments on commit 567d755

Please sign in to comment.