Skip to content

Commit

Permalink
Merge branch 'release/1.8.6' into mathetos-release/1.9
Browse files Browse the repository at this point in the history
* release/1.8.6:
  Thou shalt not support PHP 5.2
  Improved payment status language
  Reordered to fix travis error
  Attempting to fix broken PHPunit tests
  Fix: typo in currency section setting
  Fix: generate level class and id with price_id instead of
  fix #1592
  Update README.md
  Update Documentation.
  Text update
  Removed duplicate
  returns array of objects
  Return “all” rather than empty to prevent conflicts with level ID 0
  Remove space
  Prettier nonce failure notice #1571
  Code reformatting
  Removed unused variables
  Removed unused code #1571

# Conflicts:
#	assets/js/admin/admin-scripts.min.js
  • Loading branch information
Devin Walker committed Mar 30, 2017
2 parents df9112f + 170e3e1 commit 730aa83
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ language: php
sudo: false

php:
- 5.2
- 5.3
- 5.4
- 5.5
Expand All @@ -25,6 +24,7 @@ matrix:
before_script:
- bash tests/bin/install.sh wordpress_test root '' localhost $WP_VERSION
- bash tests/bin/travis.sh before
- composer install

script: phpunit -c phpunit.xml

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ We know how important fundraising online is to accomplish your goals. For many n

### Why Give? ###

Prior to Give there was no single go-to solution for accepting donations on WordPress. Sure, Gravity Forms and WooCommerce are great plugins but they're not developed to work specifically for donations. This can often lead to your users being confused by unnecessary cart systems, incorrect terminology, or lack of flexibility. As an admin, you may have wrestled with the various other WordPress donation plugins. Dealing with the lack of documentation and unreliable support can be an all too common occurrence and a real pain.
Before Give there was no single go-to solution for accepting donations on WordPress. Sure, Gravity Forms and WooCommerce are great plugins, but they're not developed to work specifically for donations. This can often lead to your users being confused by unnecessary cart systems, incorrect terminology, or lack of flexibility. As an admin, you may have wrestled with the various other WordPress donation plugins. Dealing with the lack of documentation and unreliable support can be an all too common occurrence and a real pain.

There's a better way. Now you have Give.

### Simple and Pain Free Giving ###
### Simple and Pain-Free Giving ###

Give works great right in WordPress in a way that you're already familiar in working. Simply install and activate the plugin to get started. The backbone of Give lies within its forms. Forms are what allow you to accept donations anywhere on your website. When creating a form you may specify whether the form is a single or multi-level amount. As well, forms can accept a user provided donation amount.
Give works great right in WordPress in a way that you're already familiar with working. Simply install and activate the plugin to get started. The backbone of Give lies within its forms. Forms are what allow you to accept donations anywhere on your website. When creating a form, you may specify whether the form is a single or multi-level amount. As well, forms can accept a user provided donation amount.

### First Time Users ###

For new users, we suggest reviewing our [documentation](https://givewp.com/documentation "Visit the Give docs") to get an understanding of how the plugin works prior to using it. If you run into any trouble, [support](https://givewp.com/support "Visit the Give support page") is here to help you with your issues, questions, and concerns.
For new users, we suggest reviewing our [documentation](https://givewp.com/documentation "Visit the Give docs") to get an understanding of how the plugin works before using it. If you run into any trouble, [support](https://givewp.com/support "Visit the Give support page") is here to help you with your issues, questions, and concerns.

### Zero Commission Charges ###

We earn money by selling add-ons, not from the money you raise. What you raise is yours to keep to support your cause. Period. Add-ons are premium features that enable you to extend the functionality of Give. For example, you can use one of our add-ons to accept funds through your favorite payment gateway.

### Easy to Customize and Enhance ###

Give is built by [WordImpress](https://wordimpress.com "Visit the the developers of Give - WordImpress"), our plugins are built from the ground up to be intuitive and easy to use. Along with the plugin is a support team that is dedicated, fast to respond, and always willing to squash bugs and help troubleshoot.
Give is built by [WordImpress](https://wordimpress.com "Visit the the developers of Give - WordImpress"), our plugins are built from the ground up to be intuitive and easy to use. Along with the plugin is a support team that is dedicated, fast to respond, and always willing to squash bugs and helps troubleshoot.

### Connect with Give ###

Expand Down Expand Up @@ -55,15 +55,15 @@ The easiest way to install the plugin is through the [WordPress.org plugin repos

Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't need to leave your web browser. To do an automatic install of Give, log in to your WordPress dashboard, navigate to the Plugins menu and click "Add New".

In the search field type "Give" and click Search Plugins. Once you have found the plugin you can view details about it such as the the point release, rating and description, as well as install it by simply clicking "Install Now".
In the search field type "Give" and click Search Plugins. Once you have found the plugin you can view details about it such as the point release, rating, and description, as well as install it by simply clicking "Install Now".

### Manual installation ###

The manual installation method involves downloading the plugin and uploading it to your server via your favorite FTP application. The WordPress Codex contains [instructions on how to do this here](https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).

### Updating ###

Automatic updates should work like a charm; as always though, ensure you backup your site just in case.
Automatic updates should work like a charm; as always, though, ensure you backup your site just in case.

## Frequently Asked Questions ##

Expand All @@ -81,8 +81,8 @@ Yes! We call them "Give Stories". [You can read them all here](https://givewp.co

### How is Give better than *Gravity Forms* for accepting donations through WordPress? ###

First off, we love Gravity Forms. It's a great plugin and has a lot of good features for accepting donations. That being said, it lacks substantial reporting features many nonprofits find crucial to cause. In addition, there's a larger barrier to entry than Give. It's a premium only plugin and requires a developer license ($199/yr) to accept credit card and recurring payments on site.
First off, we love Gravity Forms. It's a great plugin and has a lot of good features for accepting donations. That being said, it lacks substantial reporting features many nonprofits find crucial to the cause. In addition, there's a larger barrier to entry than Give. It's a premium only plugin and requires a developer license ($199/yr) to accept credit card and recurring payments on site.

### How is Give better than *WooCommerce* for accepting donations on WordPress? ###

It's true. We also really like WooCommerce. It's hands-down the most robust eCommerce platform for WordPress. But that's also the issue. When accepting donations you don't need a cart system, shipping, or tax calculations. Additionally, customizing the plugin functionality and terminology for nonprofit needs is often a daunting task. You never want your users to receive an "invoice" for the donation as a "product" they "purchased." Rather, you'd like for them to receive a tax deductible receipt for the donation they gave. WooCommerce *can* do donations, but it was not designed for it. Nor is it very easy to setup and maintain across the various major version releases.
It's true. We also really like WooCommerce. It's hands-down the most robust eCommerce platform for WordPress. But that's also the issue. When accepting donations, you don't need a cart system, shipping, or tax calculations. Additionally, customizing the plugin functionality and terminology for nonprofit needs is often a daunting task. You never want your users to receive an "invoice" for the donation as a "product" they "purchased". Rather, you'd like for them to receive a tax deductible receipt for the donation they gave. WooCommerce *can* make donations, but it was not designed for it. Nor is it very easy to setup and maintain across the various major version releases.
7 changes: 4 additions & 3 deletions assets/js/admin/admin-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1360,9 +1360,10 @@ jQuery.noConflict();

// Get max level id.
$('input[type="hidden"].give-levels_id', $this).each(function (index, item) {
var $item = $(item);
if (max_level_id < $item.val()) {
max_level_id = $item.val();
var $item = $(item),
current_level = parseInt( $item.val() );
if (max_level_id < current_level ) {
max_level_id = current_level;
}
});

Expand Down
6 changes: 5 additions & 1 deletion assets/js/admin/admin-scripts.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion includes/admin/class-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public static function save() {
$current_tab = give_get_current_setting_tab();

if ( empty( $_REQUEST['_give-save-settings'] ) || ! wp_verify_nonce( $_REQUEST['_give-save-settings'], 'give-save-settings' ) ) {
die( __( 'Action failed. Please refresh the page and retry.', 'give' ) );
echo '<div class="notice error"><p>' . __( 'Action failed. Please refresh the page and retry.', 'give' ) . '</p></div>';
die();
}

/**
Expand Down
1 change: 0 additions & 1 deletion includes/admin/payments/view-order-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
$payment_date = strtotime( $payment->date );
$user_info = give_get_payment_meta_user_info( $payment_id );
$address = $payment->address;
$gateway = $payment->gateway;
$currency_code = $payment->currency;
$gateway = $payment->gateway;
$currency_code = $payment->currency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function set_properties( $request ) {
}
}

$this->price_id = ! empty( $request['give_price_option'] ) && 0 !== $request['give_price_option'] ? absint( $request['give_price_option'] ) : null;
$this->price_id = ! empty( $request['give_price_option'] ) && 'all' !== $request['give_price_option'] ? absint( $request['give_price_option'] ) : null;

}

Expand All @@ -94,8 +94,6 @@ public function set_properties( $request ) {
*/
public function csv_cols() {

$cols = array();

$columns = isset( $this->data['give_export_option'] ) ? $this->data['give_export_option'] : array();

// We need columns.
Expand Down Expand Up @@ -215,7 +213,7 @@ public function get_data() {
}
} else {

// Export all customers
// Export all donors.
$offset = 30 * ( $this->step - 1 );
$donors = Give()->customers->get_customers( array( 'number' => 30, 'offset' => $offset ) );

Expand Down
23 changes: 3 additions & 20 deletions includes/admin/reporting/export/export-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,6 @@ function give_export_earnings() {
add_action( 'give_earnings_export', 'give_export_earnings' );


/**
* Export all the customers to a CSV file.
*
* Note: The WordPress Database API is being used directly for performance
* reasons (workaround of calling all posts and fetch data respectively)
*
* @since 1.5
* @return void
*/
function give_export_all_customers() {
require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-customers.php';

$customer_export = new Give_Donors_Export();

$customer_export->export();
}

add_action( 'give_email_export', 'give_export_all_customers' );

/**
* Add a hook allowing extensions to register a hook on the batch export process
*
Expand All @@ -107,6 +88,7 @@ function give_register_batch_exporters() {

/**
* Register the payments batch exporter
*
* @since 1.5
*/
function give_register_payments_batch_export() {
Expand Down Expand Up @@ -134,6 +116,7 @@ function give_include_payments_batch_processor( $class ) {

/**
* Register the customers batch exporter
*
* @since 1.5.2
*/
function give_register_customers_batch_export() {
Expand Down Expand Up @@ -185,4 +168,4 @@ function give_include_forms_batch_processor( $class ) {
require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-forms.php';
}

}
}
3 changes: 0 additions & 3 deletions includes/admin/reporting/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ function give_reports_tab_export() {
'placeholder' => __( 'Choose one or more from categories', 'give' ),
)
);
$add_break = true;
}

if ( give_is_setting_enabled( give_get_option( 'tags' ) ) ) {
Expand All @@ -462,7 +461,6 @@ function give_reports_tab_export() {
'placeholder' => __( 'Choose one or more from tags', 'give' ),
)
);
$add_break = true;
}

wp_nonce_field( 'give_ajax_export', 'give_ajax_export' );
Expand Down Expand Up @@ -529,7 +527,6 @@ function give_reports_tab_export() {
<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
<input type="hidden" name="give-export-class" value="Give_Batch_Customers_Export"/>
<input type="hidden" name="give_export_option[query_id]" value="<?php echo uniqid( 'give_' ); ?>"/>
<input type="hidden" name="give_action" value="email_export"/>
</form>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/settings/class-settings-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function get_settings() {
'type' => 'give_docs_link',
),
array(
'type' => 'title',
'type' => 'sectionend',
'id' => 'give_title_general_settings_2'
)
);
Expand Down
2 changes: 1 addition & 1 deletion includes/ajax-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function give_check_for_form_price_variations() {
$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';

if ( isset( $_POST['all_prices'] ) ) {
$ajax_response .= '<option value="">' . esc_html__( 'All Levels', 'give' ) . '</option>';
$ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>';
}

foreach ( $variable_prices as $key => $price ) {
Expand Down
17 changes: 7 additions & 10 deletions includes/forms/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,17 +495,15 @@ function give_output_levels( $form_id ) {
}

$output = '';
$counter = 0;

switch ( $display_style ) {
case 'buttons':

$output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">';

foreach ( $prices as $price ) {
$counter ++;
$level_text = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-' . $counter . ' ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'give-default-level' : '' ), $form_id, $price );
$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-' . $price['_give_id']['level_id'] . ' ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'give-default-level' : '' ), $form_id, $price );

$output .= '<li>';
$output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'] ) . '">';
Expand Down Expand Up @@ -533,13 +531,12 @@ function give_output_levels( $form_id ) {
$output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">';

foreach ( $prices as $price ) {
$counter ++;
$level_text = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
$level_classes = apply_filters( 'give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-' . $counter . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
$level_classes = apply_filters( 'give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-' . $price['_give_id']['level_id'] . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );

$output .= '<li>';
$output .= '<input type="radio" data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" name="give-radio-donation-level" id="give-radio-level-' . $counter . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'checked="checked"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'] ) . '">';
$output .= '<label for="give-radio-level-' . $counter . '">' . $level_text . '</label>';
$output .= '<input type="radio" data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" name="give-radio-donation-level" id="give-radio-level-' . $price['_give_id']['level_id'] . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'checked="checked"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'] ) . '">';
$output .= '<label for="give-radio-level-' . $price['_give_id']['level_id'] . '">' . $level_text . '</label>';
$output .= '</li>';

}
Expand All @@ -558,13 +555,13 @@ function give_output_levels( $form_id ) {

case 'dropdown':

$output .= '<label for="give-donation-level" class="give-hidden">' . esc_html__( 'Choose Your Donation Amount', 'give' ) . ':</label>';
$output .= '<select id="give-donation-level-' . $form_id . '" class="give-select give-select-level give-donation-levels-wrap">';
$output .= '<label for="give-donation-level-select-' . $form_id . '" class="give-hidden">' . esc_html__( 'Choose Your Donation Amount', 'give' ) . ':</label>';
$output .= '<select id="give-donation-level-select-' . $form_id . '" class="give-select give-select-level give-donation-levels-wrap">';

//first loop through prices.
foreach ( $prices as $price ) {
$level_text = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $form_id . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $price['_give_id']['level_id'] . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );

$output .= '<option data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'selected="selected"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'] ) . '">';
$output .= $level_text;
Expand Down
2 changes: 1 addition & 1 deletion includes/payments/class-payments-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function init() {
* @since 1.0
* @access public
*
* @return object
* @return array
*/
public function get_payments() {

Expand Down
10 changes: 5 additions & 5 deletions templates/shortcode-receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@
$notice_type = 'success';
break;
case 'pending':
$notice_message = esc_html__( 'Payment Pending: Please contact the site owner for assistance.', 'give' );
$notice_message = esc_html__( 'Payment Pending: Your donation is currently processing..', 'give' );
$notice_type = 'warning';
break;
case 'refunded':
$notice_message = esc_html__( 'Payment Refunded: Please contact the site owner for assistance.', 'give' );
$notice_message = esc_html__( 'Payment Refunded: Your donation has been refunded.', 'give' );
$notice_type = 'warning';
break;
case 'preapproval':
$notice_message = esc_html__( 'Payment Preapproved: Please contact the site owner for assistance.', 'give' );
$notice_message = esc_html__( 'Payment Preapproved: Thank you for your donation.', 'give' );
$notice_type = 'warning';
break;
case 'failed':
$notice_message = esc_html__( 'Payment Failed: Please contact the site owner for assistance.', 'give' );
$notice_type = 'error';
break;
case 'cancelled':
$notice_message = esc_html__( 'Payment Cancelled: Please contact the site owner for assistance.', 'give' );
$notice_message = esc_html__( 'Payment Cancelled: Your donation has been cancelled.', 'give' );
$notice_type = 'error';
break;
case 'abandoned':
$notice_message = esc_html__( 'Payment Abandoned: Please contact the site owner for assistance.', 'give' );
$notice_message = esc_html__( 'Payment Abandoned: The this donation was not been completed.', 'give' );
$notice_type = 'error';
break;
case 'revoked':
Expand Down

0 comments on commit 730aa83

Please sign in to comment.