Skip to content

Commit

Permalink
Merge branch 'master' into release/1.6
Browse files Browse the repository at this point in the history
* master:
  Working on Doc Blocks
  Fixed broken unit test from #740
  fix error
  periods

# Conflicts:
#	includes/admin/class-addon-activation-banner.php
  • Loading branch information
Devin Walker committed Jul 18, 2016
2 parents 77d30d6 + e6ffb7b commit 92a654c
Show file tree
Hide file tree
Showing 28 changed files with 114 additions and 112 deletions.
2 changes: 1 addition & 1 deletion includes/admin/EDD_SL_Plugin_Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public function show_changelog() {
}

if( ! current_user_can( 'update_plugins' ) ) {
wp_die( __( 'You do not have permission to install plugin updates', 'edd' ), __( 'Error', 'edd' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to install plugin updates.', 'edd' ), __( 'Error', 'edd' ), array( 'response' => 403 ) );
}

$response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
Expand Down
8 changes: 5 additions & 3 deletions includes/admin/class-addon-activation-banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
* https://github.com/WordImpress/Give-Activation-Banner
*/


// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class Give_Addon_Activation_Banner
*/
class Give_Addon_Activation_Banner {

/**
Expand Down Expand Up @@ -201,6 +203,7 @@ public function give_addon_activation_admin_notice() {

/**
* Ignore Nag
*
* This is the action that allows the user to dismiss the banner it basically sets a tag to their user meta data
*/
public function give_addon_notice_ignore() {
Expand All @@ -218,5 +221,4 @@ public function give_addon_notice_ignore() {
}
}

}

}
2 changes: 1 addition & 1 deletion includes/admin/class-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function show_notices() {
if ( current_user_can( 'edit_give_payments' ) ) {
switch ( $_GET['give-message'] ) {
case 'customer-deleted' :
$notices['updated']['give-customer-deleted'] = esc_attr__( 'Donor successfully deleted', 'give' );
$notices['updated']['give-customer-deleted'] = esc_attr__( 'Donor successfully deleted.', 'give' );
break;
}
}
Expand Down
10 changes: 5 additions & 5 deletions includes/admin/class-give-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,14 @@ public function give_settings( $active_tab ) {
),
array(
'name' => __( 'Thousands Separator', 'give' ),
'desc' => __( 'The symbol (typically , or .) to separate thousands', 'give' ),
'desc' => __( 'The symbol (typically , or .) to separate thousands.', 'give' ),
'id' => 'thousands_separator',
'type' => 'text_small',
'default' => ',',
),
array(
'name' => __( 'Decimal Separator', 'give' ),
'desc' => __( 'The symbol (usually , or .) to separate decimal points', 'give' ),
'desc' => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
'id' => 'decimal_separator',
'type' => 'text_small',
'default' => '.',
Expand Down Expand Up @@ -379,13 +379,13 @@ public function give_settings( $active_tab ) {
),
array(
'name' => __( 'PayPal Email', 'give' ),
'desc' => __( 'Enter your PayPal account\'s email', 'give' ),
'desc' => __( 'Enter your PayPal account\'s email.', 'give' ),
'id' => 'paypal_email',
'type' => 'text_email',
),
array(
'name' => __( 'PayPal Page Style', 'give' ),
'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default', 'give' ),
'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
'id' => 'paypal_page_style',
'type' => 'text',
),
Expand Down Expand Up @@ -615,7 +615,7 @@ public function give_settings( $active_tab ) {
array(
'id' => 'donation_notification_subject',
'name' => __( 'Donation Notification Subject', 'give' ),
'desc' => __( 'Enter the subject line for the donation notification email', 'give' ),
'desc' => __( 'Enter the subject line for the donation notification email.', 'give' ),
'type' => 'text',
'default' => __( 'New Donation - #{payment_id}', 'give' )
),
Expand Down
10 changes: 5 additions & 5 deletions includes/admin/customers/customer-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function give_customer_save_note( $args ) {
}

if ( empty( $customer_note ) ) {
give_set_error( 'empty-customer-note', __( 'A note is required', 'give' ) );
give_set_error( 'empty-customer-note', __( 'A note is required.', 'give' ) );
}

if ( give_get_errors() ) {
Expand Down Expand Up @@ -277,7 +277,7 @@ function give_customer_delete( $args ) {
}

if ( ! $confirm ) {
give_set_error( 'customer-delete-no-confirm', __( 'Please confirm you want to delete this donor', 'give' ) );
give_set_error( 'customer-delete-no-confirm', __( 'Please confirm you want to delete this donor.', 'give' ) );
}

if ( give_get_errors() ) {
Expand Down Expand Up @@ -318,14 +318,14 @@ function give_customer_delete( $args ) {

} else {

give_set_error( 'give-donor-delete-failed', __( 'Error deleting donor', 'give' ) );
give_set_error( 'give-donor-delete-failed', __( 'Error deleting donor.', 'give' ) );
$redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $customer_id );

}

} else {

give_set_error( 'give-customer-delete-invalid-id', __( 'Invalid Donor ID', 'give' ) );
give_set_error( 'give-customer-delete-invalid-id', __( 'Invalid Donor ID.', 'give' ) );
$redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors' );

}
Expand Down Expand Up @@ -386,7 +386,7 @@ function give_disconnect_customer_user_id( $args ) {
} else {

$output['success'] = false;
give_set_error( 'give-disconnect-user-fail', __( 'Failed to disconnect user from donor', 'give' ) );
give_set_error( 'give-disconnect-user-fail', __( 'Failed to disconnect user from donor.', 'give' ) );
}

do_action( 'give_post_customer_disconnect_user_id', $customer_id );
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/payments/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function give_update_payment_details( $data ) {
$updated = $payment->save();

if ( 0 === $updated ) {
wp_die( esc_attr__( 'Error Updating Payment', 'give' ), esc_attr__( 'Error', 'give' ), array( 'response' => 400 ) );
wp_die( esc_attr__( 'Error Updating Payment.', 'give' ), esc_attr__( 'Error', 'give' ), array( 'response' => 400 ) );
}

$customer_changed = false;
Expand All @@ -88,7 +88,7 @@ function give_update_payment_details( $data ) {
$names = isset( $data['give-new-customer-name'] ) ? sanitize_text_field( $data['give-new-customer-name'] ) : '';

if ( empty( $email ) || empty( $names ) ) {
wp_die( esc_attr__( 'New Customers require a name and email address', 'give' ) );
wp_die( esc_attr__( 'New Customers require a name and email address.', 'give' ) );
}

$customer = new Give_Customer( $email );
Expand All @@ -103,7 +103,7 @@ function give_update_payment_details( $data ) {
// Failed to crete the new donor, assume the previous donor
$customer_changed = false;
$customer = new Give_Customer( $curr_customer_id );
give_set_error( 'give-payment-new-customer-fail', __( 'Error creating new donor', 'give' ) );
give_set_error( 'give-payment-new-customer-fail', __( 'Error creating new donor.', 'give' ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion includes/admin/reporting/export/export-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
function give_process_batch_export_form() {

if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'give-batch-export' ) ) {
wp_die( __( 'Nonce verification failed', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'Nonce verification failed.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php';
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/reporting/export/export-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function give_do_ajax_export() {
if ( ! $export->is_writable ) {
$json_args = array(
'error' => true,
'message' => __( 'Export location or file not writable', 'give' )
'message' => __( 'Export location or file not writable.', 'give' )
);
echo json_encode($json_args);
exit;
Expand All @@ -74,7 +74,7 @@ function give_do_ajax_export() {

echo json_encode( array(
'error' => true,
'message' => __( 'No data found for export parameters', 'give' )
'message' => __( 'No data found for export parameters.', 'give' )
) );
exit;

Expand Down
2 changes: 1 addition & 1 deletion includes/admin/reporting/pdf-reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function give_generate_pdf( $data ) {
}

if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'give_generate_pdf' ) ) {
wp_die( __( 'Nonce verification failed', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'Nonce verification failed.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

require_once GIVE_PLUGIN_DIR . '/includes/libraries/fpdf/fpdf.php';
Expand Down
8 changes: 4 additions & 4 deletions includes/api/class-give-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1646,12 +1646,12 @@ public function process_api_key( $args ) {

if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'give-api-nonce' ) ) {

wp_die( esc_attr__( 'Nonce verification failed', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( esc_attr__( 'Nonce verification failed.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );

}

if ( empty( $args['user_id'] ) ) {
wp_die( esc_attr__( 'User ID Required', 'give' ), esc_attr__( 'Error', 'give' ), array( 'response' => 401 ) );
wp_die( esc_attr__( 'User ID Required.', 'give' ), esc_attr__( 'Error', 'give' ), array( 'response' => 401 ) );
}

if ( is_numeric( $args['user_id'] ) ) {
Expand All @@ -1663,9 +1663,9 @@ public function process_api_key( $args ) {
$process = isset( $args['give_api_process'] ) ? strtolower( $args['give_api_process'] ) : false;

if ( $user_id == get_current_user_id() && ! give_get_option( 'allow_user_api_keys' ) && ! current_user_can( 'manage_give_settings' ) ) {
wp_die( sprintf( __( 'You do not have permission to %s API keys for this user', 'give' ), $process ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( sprintf( __( 'You do not have permission to %s API keys for this user.', 'give' ), $process ), __( 'Error', 'give' ), array( 'response' => 403 ) );
} elseif ( ! current_user_can( 'manage_give_settings' ) ) {
wp_die( sprintf( __( 'You do not have permission to %s API keys for this user', 'give' ), $process ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( sprintf( __( 'You do not have permission to %s API keys for this user.', 'give' ), $process ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

switch ( $process ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/class-give-customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function __get( $key ) {

} else {

return new WP_Error( 'give-customer-invalid-property', sprintf( __( 'Can\'t get property %s', 'give' ), $key ) );
return new WP_Error( 'give-customer-invalid-property', sprintf( __( 'Can\'t get property %s.', 'give' ), $key ) );

}

Expand Down
2 changes: 1 addition & 1 deletion includes/class-give-donate-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function __get( $key ) {

} else {

return new WP_Error( 'give-form-invalid-property', sprintf( __( 'Can\'t get property %s', 'give' ), $key ) );
return new WP_Error( 'give-form-invalid-property', sprintf( __( 'Can\'t get property %s.', 'give' ), $key ) );

}

Expand Down
6 changes: 3 additions & 3 deletions includes/class-give-license-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function activate_license() {

if ( ! wp_verify_nonce( $_REQUEST[ $this->item_shortname . '_license_key-nonce' ], $this->item_shortname . '_license_key-nonce' ) ) {

wp_die( __( 'Nonce verification failed', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'Nonce verification failed.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );

}

Expand Down Expand Up @@ -259,7 +259,7 @@ public function deactivate_license() {

if ( ! wp_verify_nonce( $_REQUEST[ $this->item_shortname . '_license_key-nonce' ], $this->item_shortname . '_license_key-nonce' ) ) {

wp_die( __( 'Nonce verification failed', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'Nonce verification failed.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );

}

Expand Down Expand Up @@ -341,7 +341,7 @@ public function notices() {

case 'no_activations_left' :

$message = __( 'This license does not have any activations left', 'give' );
$message = __( 'This license does not have any activations left.', 'give' );
break;

case 'expired' :
Expand Down
22 changes: 11 additions & 11 deletions includes/emails/class-give-email-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,52 +277,52 @@ function give_setup_email_tags() {
),
array(
'tag' => 'name',
'description' => __( 'The donor\'s first name', 'give' ),
'description' => __( 'The donor\'s first name.', 'give' ),
'function' => 'give_email_tag_first_name'
),
array(
'tag' => 'fullname',
'description' => __( 'The donor\'s full name, first and last', 'give' ),
'description' => __( 'The donor\'s full name, first and last.', 'give' ),
'function' => 'give_email_tag_fullname'
),
array(
'tag' => 'username',
'description' => __( 'The donor\'s user name on the site, if they registered an account', 'give' ),
'description' => __( 'The donor\'s user name on the site, if they registered an account.', 'give' ),
'function' => 'give_email_tag_username'
),
array(
'tag' => 'user_email',
'description' => __( 'The donor\'s email address', 'give' ),
'description' => __( 'The donor\'s email address.', 'give' ),
'function' => 'give_email_tag_user_email'
),
array(
'tag' => 'billing_address',
'description' => __( 'The donor\'s billing address', 'give' ),
'description' => __( 'The donor\'s billing address.', 'give' ),
'function' => 'give_email_tag_billing_address'
),
array(
'tag' => 'date',
'description' => __( 'The date of the donation', 'give' ),
'description' => __( 'The date of the donation.', 'give' ),
'function' => 'give_email_tag_date'
),
array(
'tag' => 'price',
'description' => __( 'The total price of the donation', 'give' ),
'description' => __( 'The total price of the donation.', 'give' ),
'function' => 'give_email_tag_price'
),
array(
'tag' => 'payment_id',
'description' => __( 'The unique ID number for this donation', 'give' ),
'description' => __( 'The unique ID number for this donation.', 'give' ),
'function' => 'give_email_tag_payment_id'
),
array(
'tag' => 'receipt_id',
'description' => __( 'The unique ID number for this donation receipt', 'give' ),
'description' => __( 'The unique ID number for this donation receipt.', 'give' ),
'function' => 'give_email_tag_receipt_id'
),
array(
'tag' => 'payment_method',
'description' => __( 'The method of payment used for this donation', 'give' ),
'description' => __( 'The method of payment used for this donation.', 'give' ),
'function' => 'give_email_tag_payment_method'
),
array(
Expand Down Expand Up @@ -527,7 +527,7 @@ function give_email_tag_donation( $payment_id ) {
$payment = new Give_Payment( $payment_id );
$form_title = give_get_payment_form_title( $payment->meta, false, '-' );

return ! empty( $form_title ) ? $form_title : __( 'There was an error retrieving this donation title', 'give' );
return ! empty( $form_title ) ? $form_title : __( 'There was an error retrieving this donation title.', 'give' );

}

Expand Down
2 changes: 1 addition & 1 deletion includes/emails/class-give-emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function build_email( $message ) {
public function send( $to, $subject, $message, $attachments = '' ) {

if ( ! did_action( 'init' ) && ! did_action( 'admin_init' ) ) {
_doing_it_wrong( __FUNCTION__, __( 'You cannot send email with Give_Emails until init/admin_init has been reached', 'give' ), null );
_doing_it_wrong( __FUNCTION__, __( 'You cannot send email with Give_Emails until init/admin_init has been reached.', 'give' ), null );

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/gateways/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function give_no_gateway_error() {
$gateways = give_get_enabled_payment_gateways();

if ( empty( $gateways ) ) {
give_set_error( 'no_gateways', __( 'You must enable a payment gateway to use Give', 'give' ) );
give_set_error( 'no_gateways', __( 'You must enable a payment gateway to use Give.', 'give' ) );
} else {
give_unset_error( 'no_gateways' );
}
Expand Down
Loading

0 comments on commit 92a654c

Please sign in to comment.