Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.8.15 with licensing fix and current completed issues #2225

Merged
merged 99 commits into from
Oct 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
eb7c59f
Comment Improvement
mehul0810 Oct 10, 2017
77f994b
Added Support for currency settings to each donation
mehul0810 Oct 10, 2017
2746649
Formatting function changes
mehul0810 Oct 11, 2017
adcdae8
Added Required Unit Tests
mehul0810 Oct 11, 2017
2574074
Implemented required changes to make give_format_amount work as required
mehul0810 Oct 11, 2017
5bd4daf
Added more checks for unit tests of currency formatting
mehul0810 Oct 11, 2017
cdb7c61
Code Improvement
mehul0810 Oct 11, 2017
8b9379f
Minor change
mehul0810 Oct 11, 2017
68dc0ed
Tweaked decimals
mehul0810 Oct 11, 2017
823d698
Setup and Save Currency Information Settings
mehul0810 Oct 11, 2017
5b221a3
Clean unsanitized Data
mehul0810 Oct 11, 2017
557448e
Reduce number of parameters used in function
mehul0810 Oct 11, 2017
9407a93
Passed the third arguments in array format
mehul0810 Oct 11, 2017
01af297
Properly format currency settings
mehul0810 Oct 11, 2017
c5c7593
Formattting improved
mehul0810 Oct 11, 2017
79dfa47
Minor formatting and currency fix
mehul0810 Oct 11, 2017
16c830a
Added Give Clean function
mehul0810 Oct 11, 2017
c09dddc
Added support for logs based on currency settings and currency on don…
mehul0810 Oct 11, 2017
05c44cd
Merge remote-tracking branch 'upstream/release/1.8.14' into issue/2153
mehul0810 Oct 11, 2017
b0b47f9
Merge remote-tracking branch 'upstream/release/1.8.14' into issue/2153
mehul0810 Oct 12, 2017
b9b442a
Merge branch 'issue/2153' of https://github.com/mehul0810/Give into i…
mehul0810 Oct 12, 2017
3a14f99
Merge remote-tracking branch 'upstream/release/1.8.15' into issue/2153
mehul0810 Oct 12, 2017
f588fd8
Update give_get_currencies fx
ravinderk Oct 12, 2017
246efb3
Do not set currency setting to database
ravinderk Oct 12, 2017
a9ab2b6
Update currency related formatting function
ravinderk Oct 12, 2017
0b1aeef
Add test for formatting functions
ravinderk Oct 12, 2017
5a047c3
Update give_get_currency_formatting_settings fx
ravinderk Oct 12, 2017
e0fab71
Update give_get_currency_formatting_settings fx
ravinderk Oct 12, 2017
6461b4b
Update give_get_currency fx
ravinderk Oct 12, 2017
8af20a6
Improve var name
ravinderk Oct 12, 2017
c6c8535
Update give_get_currencies fx
ravinderk Oct 12, 2017
ae6efe9
Update zero decimal currency
ravinderk Oct 13, 2017
0a36df7
Update code doc
ravinderk Oct 13, 2017
a8fab39
Update default currency setting
ravinderk Oct 13, 2017
6336dfd
Map postal code to zip during importing
BhargavBhandari90 Oct 13, 2017
ad0df1a
Fix - issue #2165
BhargavBhandari90 Oct 13, 2017
b4a4a24
Fix - issue #2192
BhargavBhandari90 Oct 13, 2017
f8b9804
Merge pull request #2206 from BhargavBhandari90/issue/2165
Oct 13, 2017
9e7225e
Merge pull request #2207 from BhargavBhandari90/issue/2192
Oct 13, 2017
abd07d4
Fix - issue #2195
BhargavBhandari90 Oct 13, 2017
afe454e
Merge pull request #2209 from BhargavBhandari90/issue/2195
Oct 13, 2017
8f37b8f
Merge branch 'master' into release/1.8.15
DevinWalker Oct 13, 2017
7cd6a8c
Add check with strtolower
BhargavBhandari90 Oct 14, 2017
24095ca
Merge branch 'master' into issue/2153
ravinderk Oct 16, 2017
6a68fb8
Merge remote-tracking branch 'upstream/release/1.8.15' into issue/2153
ravinderk Oct 16, 2017
711414b
Set Shortcode attributes and set session variable
mehul0810 Oct 16, 2017
e6b505d
Minor variable name change
mehul0810 Oct 16, 2017
c130b08
Fix broken unit test
ravinderk Oct 16, 2017
fda3f52
Added Filter as per shortcode attributes and code improvement
mehul0810 Oct 16, 2017
8047958
Fix give_get_currencies fx backward compatibility
ravinderk Oct 16, 2017
44dccb6
Update code docs
ravinderk Oct 16, 2017
18ebc10
Merge pull request #2182 from mehul0810/issue/2153
ravinderk Oct 16, 2017
4536cae
Add new filter
ravinderk Oct 16, 2017
76ca720
Merge pull request #2213 from ravinderk/hotfix/add-filter
ravinderk Oct 16, 2017
c4a8235
Passing ID when getting currency through give_get_currency().
emgk Oct 16, 2017
73cdda3
Improve give_get_currency fx
ravinderk Oct 16, 2017
eb93919
Pass form id or donation and extra data to give_get_currecncy
ravinderk Oct 16, 2017
e0f13d5
Fix wrong @since
ravinderk Oct 16, 2017
1626dcb
Deprecate give_currency_decimal_filter function
ravinderk Oct 16, 2017
fe3c749
Remove give_currency_decimal_filter from core
ravinderk Oct 16, 2017
2536d02
Merge pull request #2205 from BhargavBhandari90/issue/2164-v2
Oct 16, 2017
23efa91
Merge branch 'master' into release/1.8.15
DevinWalker Oct 16, 2017
c838041
Merge Conflict Solved
mehul0810 Oct 17, 2017
041a72a
Improve code doc
ravinderk Oct 17, 2017
f1d4b79
Fix failing unit test
ravinderk Oct 17, 2017
e7cb90c
Currency of donation must be non empty
ravinderk Oct 17, 2017
73e7c81
Revert "Map postal code to zip during importing"
ravinderk Oct 17, 2017
89cf0d2
Merge pull request #2218 from WordImpress/revert-2205-issue/2164-v2
ravinderk Oct 17, 2017
86654fb
Add Multi label function check #2164
raftaar1191 Oct 17, 2017
109090c
Add Zip and postal code multipal label option #2164
raftaar1191 Oct 17, 2017
a9d1d67
Remove Repetation of code #2164
raftaar1191 Oct 17, 2017
39bf1af
Refix Multi label function check #2164
raftaar1191 Oct 17, 2017
4386c40
Add Country multipal label option #2164
raftaar1191 Oct 17, 2017
ba00097
Improve code formatting
ravinderk Oct 17, 2017
8a50f1d
Use language translate fx
ravinderk Oct 17, 2017
d3a199e
Improve code formatting
ravinderk Oct 17, 2017
1b80cce
Fix typo
ravinderk Oct 17, 2017
0ce22a4
Improve get_columns function
ravinderk Oct 17, 2017
b2fc23d
Use language translate fx #2164
raftaar1191 Oct 17, 2017
e8765e1
Merge pull request #2219 from raftaar1191/issues-2164
ravinderk Oct 17, 2017
3c7fd6e
Merge pull request #2214 from emgk/currency-fix
ravinderk Oct 17, 2017
e89c409
Refactor history page table header code
ravinderk Oct 17, 2017
489dceb
Improve history page column content code
ravinderk Oct 17, 2017
bb64421
Merge remote-tracking branch 'mehul/issue/2156_new' into issue/2156_new
ravinderk Oct 17, 2017
d6cf2e7
Merge branch 'release/1.8.15' into issue/2156_new
ravinderk Oct 17, 2017
0620a1d
give_amount_format does not accept third param
ravinderk Oct 17, 2017
f06b60a
Merge pull request #2212 from mehul0810/issue/2156_new
ravinderk Oct 17, 2017
e5233e0
Use currency code to get formatting settings rather then id
ravinderk Oct 17, 2017
7a22491
Improve code doc
ravinderk Oct 17, 2017
2fbe153
Pass currency code instead of donation id to give_format_amount
ravinderk Oct 17, 2017
a80e293
Improve condition in give_get_currency_formatting_settings fx
ravinderk Oct 17, 2017
fb1c4d3
Fix EUR default formatting settings
ravinderk Oct 17, 2017
b1cd5d7
Fix typo in phpunit test
ravinderk Oct 17, 2017
679a3f3
fix php-doc for give_update_meta
Oct 18, 2017
08d65c5
Merge pull request #2222 from jaydeeprami/fix-php_doc
Oct 18, 2017
295ae7f
Formatting improvements
DevinWalker Oct 18, 2017
ada9e61
Resolved issue with endless looping because of URL mismatches.
DevinWalker Oct 18, 2017
a02c840
Removed error_log and added @updated
DevinWalker Oct 18, 2017
67c809a
1. Added changlog
DevinWalker Oct 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions assets/js/admin/admin-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,8 @@ var give_setting_edit = false;
});
self.process_step(parseInt(response.step), data, self);
}
// Reset the form for preventing multiple ajax request.
$('#give-tools-recount-form')[0].reset();
}
}).fail(function (response) {
/**
Expand Down
4 changes: 2 additions & 2 deletions assets/js/admin/admin-scripts.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: WordImpress
* Author URI: https://wordimpress.com
* Version: 1.8.14
* Version: 1.8.15
* Text Domain: give
* Domain Path: /languages
* GitHub Plugin URI: https://github.com/WordImpress/Give
Expand Down Expand Up @@ -180,7 +180,7 @@ final class Give {
/**
* Give notices Object
*
* @since 2.0
* @since 1.8.9
* @access public
*
* @var Give_Notices $notices
Expand Down Expand Up @@ -324,7 +324,7 @@ private function setup_constants() {

// Plugin version
if ( ! defined( 'GIVE_VERSION' ) ) {
define( 'GIVE_VERSION', '1.8.14' );
define( 'GIVE_VERSION', '1.8.15' );
}

// Plugin Folder Path
Expand Down
99 changes: 64 additions & 35 deletions includes/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function give_get_actions() {
$_get_action = ! empty( $_GET['give_action'] ) ? $_GET['give_action'] : null;

// Add backward compatibility to give-action param ( $_GET )
if( empty( $_get_action ) ) {
if ( empty( $_get_action ) ) {
$_get_action = ! empty( $_GET['give-action'] ) ? $_GET['give-action'] : null;
}

Expand Down Expand Up @@ -62,7 +62,7 @@ function give_post_actions() {


// Add backward compatibility to give-action param ( $_POST ).
if( empty( $_post_action ) ) {
if ( empty( $_post_action ) ) {
$_post_action = ! empty( $_POST['give-action'] ) ? $_POST['give-action'] : null;
}

Expand All @@ -85,31 +85,34 @@ function give_post_actions() {
* Connect WordPress user with Donor.
*
* @since 1.7
*
* @param int $user_id User ID
* @param array $user_data User Data
*
* @return void
*/
function give_connect_donor_to_wpuser( $user_id, $user_data ){
function give_connect_donor_to_wpuser( $user_id, $user_data ) {
/* @var Give_Donor $donor */
$donor = new Give_Donor( $user_data['user_email'] );

// Validate donor id and check if do nor is already connect to wp user or not.
if( $donor->id && ! $donor->user_id ) {
if ( $donor->id && ! $donor->user_id ) {

// Update donor user_id.
if( $donor->update( array( 'user_id' => $user_id ) ) ) {
if ( $donor->update( array( 'user_id' => $user_id ) ) ) {
$donor_note = sprintf( esc_html__( 'WordPress user #%d is connected to #%d', 'give' ), $user_id, $donor->id );
$donor->add_note( $donor_note );

// Update user_id meta in payments.
if( ! empty( $donor->payment_ids ) && ( $donations = explode( ',', $donor->payment_ids ) ) ) {
foreach ( $donations as $donation ) {
if ( ! empty( $donor->payment_ids ) && ( $donations = explode( ',', $donor->payment_ids ) ) ) {
foreach ( $donations as $donation ) {
give_update_meta( $donation, '_give_payment_user_id', $user_id );
}
}
}
}
}

add_action( 'give_insert_user', 'give_connect_donor_to_wpuser', 10, 2 );


Expand All @@ -118,41 +121,62 @@ function give_connect_donor_to_wpuser( $user_id, $user_data ){
*
* Note: if location of site changes then run cron to validate licenses
*
* @since 1.7
* @since 1.7
* @updated 1.8.15 - Resolved issue with endless looping because of URL mismatches.
* @return void
*/
function give_validate_license_when_site_migrated() {
// Store current site address if not already stored.
$homeurl = home_url();
if( ! get_option( 'give_site_address_before_migrate' ) ) {
$home_url_parts = parse_url( home_url() );
$home_url = isset( $home_url_parts['host'] ) ? $home_url_parts['host'] : false;
$home_url .= isset( $home_url_parts['path'] ) ? $home_url_parts['path'] : '';
$site_address_before_migrate = get_option( 'give_site_address_before_migrate' );

// Need $home_url to proceed
if ( ! $home_url ) {
return;
}

// Save site address
if ( ! $site_address_before_migrate ) {
// Update site address.
update_option( 'give_site_address_before_migrate', $homeurl );
update_option( 'give_site_address_before_migrate', $home_url );

return;
}

if( $homeurl !== get_option( 'give_site_address_before_migrate' ) ) {
// Backwards compat. for before when we were storing URL scheme.
if ( strpos( $site_address_before_migrate, 'http' ) ) {
$site_address_before_migrate = parse_url( $site_address_before_migrate );
$site_address_before_migrate = isset( $site_address_before_migrate['host'] ) ? $site_address_before_migrate['host'] : false;
// Add path for multisite installs.
$site_address_before_migrate .= isset( $site_address_before_migrate['path'] ) ? $site_address_before_migrate['path'] : '';
}

// If the two URLs don't match run CRON.
if ( $home_url !== $site_address_before_migrate ) {
// Immediately run cron.
wp_schedule_single_event( time() , 'give_validate_license_when_site_migrated' );
wp_schedule_single_event( time(), 'give_validate_license_when_site_migrated' );

// Update site address.
update_option( 'give_site_address_before_migrate', home_url() );
update_option( 'give_site_address_before_migrate', $home_url );
}

}
add_action( 'init', 'give_validate_license_when_site_migrated' );

add_action( 'admin_init', 'give_validate_license_when_site_migrated' );


/**
* Processing after donor batch export complete
*
* @since 1.8
*
* @param $data
*/
function give_donor_batch_export_complete( $data ) {
// Remove donor ids cache.
if(
if (
isset( $data['class'] )
&& 'Give_Batch_Donors_Export' === $data['class']
&& ! empty( $data['forms'] )
Expand All @@ -161,7 +185,8 @@ function give_donor_batch_export_complete( $data ) {
Give_Cache::delete( Give_Cache::get_key( $data['give_export_option']['query_id'] ) );
}
}
add_action('give_file_export_complete', 'give_donor_batch_export_complete' );

add_action( 'give_file_export_complete', 'give_donor_batch_export_complete' );

/**
* Print css for wordpress setting pages.
Expand All @@ -172,44 +197,48 @@ function give_admin_quick_css() {
/* @var WP_Screen $screen */
$screen = get_current_screen();

if( ! ( $screen instanceof WP_Screen ) ) {
if ( ! ( $screen instanceof WP_Screen ) ) {
return false;
}

switch ( true ) {
case ( 'plugins' === $screen->base || 'plugins-network' === $screen->base ):
?>
<style>
tr.active.update + tr.give-addon-notice-tr td{
box-shadow:none;
-webkit-box-shadow:none;
tr.active.update + tr.give-addon-notice-tr td {
box-shadow: none;
-webkit-box-shadow: none;
}

tr.active + tr.give-addon-notice-tr td {
position: relative;
top: -1px;
}

tr.active + tr.give-addon-notice-tr .notice {
margin: 5px 20px 15px 40px;
}
tr.active + tr.give-addon-notice-tr td{
position: relative;
top:-1px;
}
tr.active + tr.give-addon-notice-tr .notice{
margin: 5px 20px 15px 40px;
}

tr.give-addon-notice-tr .dashicons {
color: #f56e28;
}
tr.give-addon-notice-tr td{
color: #f56e28;
}

tr.give-addon-notice-tr td {
border-left: 4px solid #00a0d2;
}

tr.give-addon-notice-tr td{
padding: 0!important;
tr.give-addon-notice-tr td {
padding: 0 !important;
}

tr.active.update + tr.give-addon-notice-tr .notice{
tr.active.update + tr.give-addon-notice-tr .notice {
margin: 5px 20px 5px 40px;
}
</style>
<?php
}
}

add_action( 'admin_head', 'give_admin_quick_css' );


Expand Down Expand Up @@ -244,7 +273,7 @@ function give_set_donation_levels_max_min_amount( $form_id ) {

// Set Minimum and Maximum amount for Multi Level Donation Forms
give_update_meta( $form_id, '_give_levels_minimum_amount', $min_amount ? give_sanitize_amount_for_db( $min_amount ) : 0 );
give_update_meta( $form_id, '_give_levels_maximum_amount', $max_amount? give_sanitize_amount_for_db( $max_amount ) : 0 );
give_update_meta( $form_id, '_give_levels_maximum_amount', $max_amount ? give_sanitize_amount_for_db( $max_amount ) : 0 );
}

add_action( 'give_pre_process_give_forms_meta', 'give_set_donation_levels_max_min_amount', 30 );
2 changes: 1 addition & 1 deletion includes/admin/payments/class-payments-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public function column_default( $payment, $column_name ) {

case 'amount' :
$amount = ! empty( $payment->total ) ? $payment->total : 0;
$value = give_currency_filter( give_format_amount( $amount, array( 'sanitize' => false ) ), give_get_payment_currency_code( $payment->ID ) );
$value = give_currency_filter( give_format_amount( $amount, array( 'sanitize' => false, 'donation_id' => $payment->ID ) ), give_get_payment_currency_code( $payment->ID ) );
$value .= sprintf( '<br><small>%1$s %2$s</small>', __( 'via', 'give' ), give_get_gateway_admin_label( $payment->gateway ) );
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function get_data() {
$totals = 0;
}

$total = round( $total, give_currency_decimal_filter() );
$total = round( $total, give_get_price_decimals() );

$this->store_data( 'give_temp_recount_earnings', $total );

Expand Down
Loading