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

Issues/1944 #2374

Merged
merged 175 commits into from
Dec 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
f66fbed
Add new caching method
ravinderk Nov 2, 2017
22f0f04
Add caching logic for payment
ravinderk Nov 2, 2017
0ecaff7
Update last_updated meta key when cpt updated
ravinderk Nov 2, 2017
b4a4172
Cache donor query
ravinderk Nov 2, 2017
fe8a78d
Cache donor object
ravinderk Nov 2, 2017
bb82df6
Add get_group cache fx
ravinderk Nov 2, 2017
2fe2f45
Update set_cache fx usage
ravinderk Nov 2, 2017
ed1f64c
Add global constant to disable cache
ravinderk Nov 2, 2017
5091ce9
Add todo
ravinderk Nov 2, 2017
b67f3a7
Remove cache when cpt payment meta updated
ravinderk Nov 2, 2017
bdb3277
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 7, 2017
f6b7e7a
Merge branch 'release/1.8.17' into release/2.0
ravinderk Nov 7, 2017
ea3a597
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 7, 2017
12d47f8
Remo duplicate give_get_attribute_str fx defination
ravinderk Nov 7, 2017
3b3ad9b
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 7, 2017
a9d5034
Update get all payment meta backward compatibility code
ravinderk Nov 7, 2017
ae4a194
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 7, 2017
195d193
Merge branch 'release/1.8.17' into release/2.0
ravinderk Nov 7, 2017
4023a61
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 7, 2017
68312b3
Increate get_post_metadata priority to save fro conflict
ravinderk Nov 7, 2017
be7c9d6
Merge branch 'release/1.8.17' into release/2.0
ravinderk Nov 7, 2017
ef3669c
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 7, 2017
48875cd
Fix broken unit tests
ravinderk Nov 7, 2017
7eaf820
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 7, 2017
b2a9779
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 10, 2017
662ebe4
add gibe_get_attribute_str undefined fn
ravinderk Nov 10, 2017
acd59b3
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 10, 2017
0c64743
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 15, 2017
53dff99
Update fn docs
ravinderk Nov 15, 2017
a81e98c
Refactor get_group cache helper fn
ravinderk Nov 15, 2017
4718e37
Add set_group cache helper fn
ravinderk Nov 15, 2017
f169a72
Update core with group cache fns
ravinderk Nov 15, 2017
2b563ee
Add delete_group cache helper fn
ravinderk Nov 15, 2017
b039dfd
Use delete_group cache helper fn
ravinderk Nov 15, 2017
88f4648
Re setup payment object after deleting cache
ravinderk Nov 15, 2017
6d9fdc5
Return mixed instead of null/bool from get_group
ravinderk Nov 15, 2017
aa6720f
Set $address default value
ravinderk Nov 15, 2017
5be0131
Do not delete cache for forms and log
ravinderk Nov 15, 2017
aad905b
Delete donor cache when update donor
ravinderk Nov 15, 2017
cfd8d86
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 15, 2017
61ee9d9
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 15, 2017
81404f1
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 15, 2017
6c2d4bd
Delete donor cache when donor updates
ravinderk Nov 15, 2017
866f80e
Add logic to generate incremental cache key
ravinderk Nov 15, 2017
77efd82
Add filter to overwrite cache key name
ravinderk Nov 15, 2017
9aebecb
Get cache group name dynamically
ravinderk Nov 15, 2017
67cf9dc
Improve code formatting
ravinderk Nov 15, 2017
e434a0b
Add helper doc
ravinderk Nov 15, 2017
4dd84ee
Improve code formatting
ravinderk Nov 15, 2017
7a21872
Remove cache logic from Give_DB_Donors::get_donors
ravinderk Nov 15, 2017
5493caf
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 16, 2017
d646cf4
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 16, 2017
8f695ad
Add cache core setting
ravinderk Nov 16, 2017
5a3be0c
Add default cache setting on install
ravinderk Nov 16, 2017
c40d461
Improve code formatting
ravinderk Nov 16, 2017
b5062de
Integrate cache core setting logic to Give_Cache
ravinderk Nov 16, 2017
5567872
Set non persistent cache to default for group
ravinderk Nov 16, 2017
82d0d61
Fix typo
ravinderk Nov 16, 2017
9184090
Fix typo
ravinderk Nov 16, 2017
d494df0
Delete cache when delete all donor meta
ravinderk Nov 16, 2017
c3df121
Add comment
ravinderk Nov 16, 2017
a8a8318
Improve code formatting
ravinderk Nov 16, 2017
7c6ac73
Flush cache when creates new donor
ravinderk Nov 16, 2017
b8fd0d2
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 16, 2017
c3c5d54
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 17, 2017
9d38249
Delete payment caches when donor deleted
ravinderk Nov 20, 2017
2216cdb
Add todo
ravinderk Nov 20, 2017
b2d4970
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 20, 2017
f70e9c9
Move code to related file
ravinderk Nov 20, 2017
3305a3c
Refactor group caching functions
ravinderk Nov 20, 2017
3b18f33
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 20, 2017
7a4da6c
Remove unwanted param from cache class
ravinderk Nov 20, 2017
eb109c0
Enabled cache by default
ravinderk Nov 20, 2017
fb47d42
Remove todo
ravinderk Nov 20, 2017
84cdd04
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 21, 2017
920e61e
Add logic to delete cache when form and donor updates
ravinderk Nov 21, 2017
1117364
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 21, 2017
57386e0
Make sure that cache always get unique timestamp
ravinderk Nov 21, 2017
4310057
Delete donation cache on donation update
ravinderk Nov 21, 2017
abe8d6d
Refactor code
ravinderk Nov 21, 2017
e0cc529
Store calculated payment in cache
ravinderk Nov 21, 2017
f38f515
Add payment meta filter support to get_meta
ravinderk Nov 21, 2017
a22d424
Refactor code
ravinderk Nov 21, 2017
e0c1480
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 22, 2017
134d998
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 22, 2017
bf94a2f
Set default caching version
ravinderk Nov 22, 2017
4b7afd2
Set default caching version if not found
ravinderk Nov 22, 2017
ce4f957
Do not update cache version if give-db-queries update itself
ravinderk Nov 22, 2017
df1c085
Improve code formatting
ravinderk Nov 22, 2017
a90becc
Do not update cache version if give-db-queries update itself pass2
ravinderk Nov 22, 2017
7076993
Immediatly delete cache after deleting any key
ravinderk Nov 22, 2017
5e049be
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 22, 2017
ed954b7
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 23, 2017
e0f33c7
Add cache incrementor logic
ravinderk Nov 23, 2017
23166dd
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 23, 2017
d54f621
Update Give_Cache key generation logic
ravinderk Nov 23, 2017
0515a0d
Use Give_Cache key logic to generate key
ravinderk Nov 23, 2017
ef83e56
Must run incrementor when update form and donor
ravinderk Nov 23, 2017
87e668f
Cache query for form dropdown
ravinderk Nov 23, 2017
33f9566
Apply caching to give_get_payment_form_title fn
ravinderk Nov 23, 2017
1adeb8b
Fix typo
ravinderk Nov 23, 2017
dc7b30c
Apply caching to give_get_payment_form_title fn pass2
ravinderk Nov 23, 2017
4d5bd7c
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 23, 2017
3a5206b
Add logic to delete only Give cache
ravinderk Nov 23, 2017
c837e63
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 24, 2017
54f9cfb
Delete cache only when save core settings
ravinderk Nov 24, 2017
9e420b4
Minor refactor give_bc_v20_get_payment_meta fn
ravinderk Nov 24, 2017
093a4fa
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 27, 2017
6a0e377
Add todo
ravinderk Nov 27, 2017
20a56a7
Add helper function to enable cache and disable cache
ravinderk Nov 27, 2017
6ed9ae4
Stop cache while running upgrade
ravinderk Nov 27, 2017
e9a0a92
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 27, 2017
5c19d03
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 27, 2017
26eab3d
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 27, 2017
2ded50a
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 28, 2017
78b0772
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 28, 2017
a0c80ea
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 28, 2017
64be228
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 28, 2017
2dea4fb
Increase per_post for upgrades
ravinderk Nov 28, 2017
887355c
Set default cache to null
ravinderk Nov 28, 2017
fb71cde
Improve code formatting
ravinderk Nov 28, 2017
98ad729
Add caching for backward compatibility
ravinderk Nov 28, 2017
3df1a62
Improve code formatting
ravinderk Nov 28, 2017
82fce62
Update cache key name
ravinderk Nov 28, 2017
a55ba36
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 29, 2017
018a60e
Check is_null for cached data
ravinderk Nov 29, 2017
0be1d4c
Return null if cache does not exist
ravinderk Nov 29, 2017
37d881e
Store payment query cache
ravinderk Nov 29, 2017
769fbd5
Improve get payment group by fn
ravinderk Nov 29, 2017
be5a7b7
Update give_count_payments fn
ravinderk Nov 29, 2017
3accab9
Add comment
ravinderk Nov 29, 2017
584d75f
Improve code formatting
ravinderk Nov 30, 2017
ec7c4b2
Add set_db_query and get_db_query cache helper fn and refactor code
ravinderk Nov 30, 2017
e671774
Delete pre upgrade cache for donations
ravinderk Nov 30, 2017
d3ad41d
Delete pre upgrade cache for donors with customer metatype
ravinderk Nov 30, 2017
893239f
do not delete data while upgrade to 2.0
ravinderk Nov 30, 2017
a5972dd
Update v20_rename_donor_tables update dependancies
ravinderk Nov 30, 2017
72e17d0
Update donor name update upgrade priorities
ravinderk Nov 30, 2017
d11b3c4
Merge branch 'release/2.0' into issues/1944
ravinderk Nov 30, 2017
62207bf
Do not abort upgrade script if client disconnected.
ravinderk Nov 30, 2017
2c1c767
Fix typo
ravinderk Nov 30, 2017
1e73849
Do not store payment meta cache while retrieving new donation meta key
ravinderk Nov 30, 2017
c08b9e5
Do not store payment meta cache while retrieving new donation meta key
ravinderk Nov 30, 2017
06df0b3
Fix - on click save changes button should not show popup and should s…
mehul0810 Nov 30, 2017
b800d7c
Code Formatting
mehul0810 Nov 30, 2017
21ab8dd
Minor Selector change and ran gulp
mehul0810 Nov 30, 2017
8283230
Minor Selector change again
mehul0810 Nov 30, 2017
ce59fff
Simplified Code for improvement
mehul0810 Dec 1, 2017
1caaf0d
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 1, 2017
3c5f2a0
Store donation meta cache for old payments
ravinderk Dec 1, 2017
6080aba
Add comment
ravinderk Dec 1, 2017
0c4ec67
Do not need to update default donor register email content to db
ravinderk Dec 1, 2017
498cb40
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 4, 2017
1a9327b
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 5, 2017
0b9c484
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 5, 2017
405ad37
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 5, 2017
9ba5810
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 5, 2017
5bd2ab7
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 5, 2017
986f5c1
Merge remote-tracking branch 'origin/issues/1944' into issues/1944
ravinderk Dec 5, 2017
1aa36b9
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 6, 2017
2398f63
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 6, 2017
0f5ced1
Add missing code from code conflict
ravinderk Dec 6, 2017
5894e73
Remove extra setting field `Remove Data on Uninstall`
ravinderk Dec 6, 2017
67d9bac
Add cache setting indicator to system info
ravinderk Dec 6, 2017
d23c78c
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 7, 2017
17f6a6d
Merge remote-tracking branch 'origin/issues/1944' into issues/1944
ravinderk Dec 7, 2017
d66064d
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 7, 2017
3f49de3
Uninstall new table while uninstall plugin
ravinderk Dec 7, 2017
cbb3495
Insert new meta key instead of overwrite old meta key
ravinderk Dec 7, 2017
5538daa
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 7, 2017
f139541
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 7, 2017
e5d7bcb
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 12, 2017
647dde4
Fix new meta key backward compatibility
ravinderk Dec 12, 2017
af66a1c
Merge branch 'release/2.0' into issues/1944
ravinderk Dec 13, 2017
ea2ff6f
Merge remote-tracking branch 'origin/issues/1944' into issues/1944
ravinderk Dec 13, 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
1 change: 1 addition & 0 deletions assets/js/admin/admin-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2716,6 +2716,7 @@ var give_setting_edit = false;
});

$('.give_email_api_notification_status_setting input:checked').change();

// Render setting tab.
give_render_responsive_tabs();
});
Expand Down
97 changes: 0 additions & 97 deletions includes/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,101 +332,4 @@ function __give_update_log_form_id( $new_form_id, $payment_id ) {
Give()->logs->delete_cache();
}

/**
* Update Donor Information when User Profile is updated from admin.
* Note: for internal use only.
*
* @param int $user_id
*
* @access public
* @since 2.0
*
* @return bool
*/
function give_update_donor_name_on_user_update( $user_id = 0 ) {

if ( current_user_can( 'edit_user', $user_id ) ) {

$donor = new Give_Donor( $user_id, true );

// Bailout, if donor doesn't exists.
if ( ! $donor ) {
return false;
}

// Get User First name and Last name.
$first_name = ( $_POST['first_name'] ) ? give_clean( $_POST['first_name'] ) : get_user_meta( $user_id, 'first_name', true );
$last_name = ( $_POST['last_name'] ) ? give_clean( $_POST['last_name'] ) : get_user_meta( $user_id, 'last_name', true );
$full_name = strip_tags( wp_unslash( trim( "{$first_name} {$last_name}" ) ) );

// Assign User First name and Last name to Donor.
Give()->donors->update( $donor->id, array( 'name' => $full_name ) );
Give()->donor_meta->update_meta( $donor->id, '_give_donor_first_name', $first_name );
Give()->donor_meta->update_meta( $donor->id, '_give_donor_last_name', $last_name );

}
}

add_action( 'edit_user_profile_update', 'give_update_donor_name_on_user_update', 10 );
add_action( 'personal_options_update', 'give_update_donor_name_on_user_update', 10 );


/**
* Updates the email address of a donor record when the email on a user is updated
* Note: for internal use only.
*
* @since 1.4.3
* @access public
*
* @param int $user_id User ID.
* @param WP_User|bool $old_user_data User data.
*
* @return bool
*/
function give_update_donor_email_on_user_update( $user_id = 0, $old_user_data = false ) {

$donor = new Give_Donor( $user_id, true );

if ( ! $donor ) {
return false;
}

$user = get_userdata( $user_id );

if ( ! empty( $user ) && $user->user_email !== $donor->email ) {

$success = Give()->donors->update( $donor->id, array( 'email' => $user->user_email ) );

if ( $success ) {
// Update some payment meta if we need to
$payments_array = explode( ',', $donor->payment_ids );

if ( ! empty( $payments_array ) ) {

foreach ( $payments_array as $payment_id ) {

give_update_payment_meta( $payment_id, 'email', $user->user_email );

}

}

/**
* Fires after updating donor email on user update.
*
* @since 1.4.3
*
* @param WP_User $user WordPress User object.
* @param Give_Donor $donor Give donor object.
*/
do_action( 'give_update_donor_email_on_user_update', $user, $donor );

}

}

}

add_action( 'profile_update', 'give_update_donor_email_on_user_update', 10, 2 );


99 changes: 98 additions & 1 deletion includes/admin/admin-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -978,4 +978,101 @@ function __give_donor_personal_address_label( $address_label ) {
return $address_label;
}

add_action( 'give_donor_personal_address_label', '__give_donor_personal_address_label' );
add_action( 'give_donor_personal_address_label', '__give_donor_personal_address_label' );

/**
* Update Donor Information when User Profile is updated from admin.
* Note: for internal use only.
*
* @param int $user_id
*
* @access public
* @since 2.0
*
* @return bool
*/
function give_update_donor_name_on_user_update( $user_id = 0 ) {

if ( current_user_can( 'edit_user', $user_id ) ) {

$donor = new Give_Donor( $user_id, true );

// Bailout, if donor doesn't exists.
if ( ! $donor ) {
return false;
}

// Get User First name and Last name.
$first_name = ( $_POST['first_name'] ) ? give_clean( $_POST['first_name'] ) : get_user_meta( $user_id, 'first_name', true );
$last_name = ( $_POST['last_name'] ) ? give_clean( $_POST['last_name'] ) : get_user_meta( $user_id, 'last_name', true );
$full_name = strip_tags( wp_unslash( trim( "{$first_name} {$last_name}" ) ) );

// Assign User First name and Last name to Donor.
Give()->donors->update( $donor->id, array( 'name' => $full_name ) );
Give()->donor_meta->update_meta( $donor->id, '_give_donor_first_name', $first_name );
Give()->donor_meta->update_meta( $donor->id, '_give_donor_last_name', $last_name );

}
}

add_action( 'edit_user_profile_update', 'give_update_donor_name_on_user_update', 10 );
add_action( 'personal_options_update', 'give_update_donor_name_on_user_update', 10 );


/**
* Updates the email address of a donor record when the email on a user is updated
* Note: for internal use only.
*
* @since 1.4.3
* @access public
*
* @param int $user_id User ID.
* @param WP_User|bool $old_user_data User data.
*
* @return bool
*/
function give_update_donor_email_on_user_update( $user_id = 0, $old_user_data = false ) {

$donor = new Give_Donor( $user_id, true );

if ( ! $donor ) {
return false;
}

$user = get_userdata( $user_id );

if ( ! empty( $user ) && $user->user_email !== $donor->email ) {

$success = Give()->donors->update( $donor->id, array( 'email' => $user->user_email ) );

if ( $success ) {
// Update some payment meta if we need to
$payments_array = explode( ',', $donor->payment_ids );

if ( ! empty( $payments_array ) ) {

foreach ( $payments_array as $payment_id ) {

give_update_payment_meta( $payment_id, 'email', $user->user_email );

}

}

/**
* Fires after updating donor email on user update.
*
* @since 1.4.3
*
* @param WP_User $user WordPress User object.
* @param Give_Donor $donor Give donor object.
*/
do_action( 'give_update_donor_email_on_user_update', $user, $donor );

}

}

}

add_action( 'profile_update', 'give_update_donor_email_on_user_update', 10, 2 );
33 changes: 22 additions & 11 deletions includes/admin/settings/class-settings-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,28 @@ public function get_settings() {
'id' => 'give_title_data_control_2',
'type' => 'title',
),
array(
'name' => __( 'Cache', 'give' ),
'desc' => __( 'If caching enabled then plugin start caching custom post type related queries and reduce load from your site.', 'give' ),
'id' => 'cache',
'type' => 'radio_inline',
'default' => 'enabled',
'options' => array(
'enabled' => __( 'Enabled', 'give' ),
'disabled' => __( 'Disabled', 'give' ),
),
),
array(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ravinderk This settings ( i.e. Remove Data on Uninstall) is duplicated in this PR. This happens when i add this PR to Give release 2.0

Check Screenshot for reference:
image

'name' => __( 'Remove Data on Uninstall', 'give' ),
'desc' => __( 'When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give' ),
'id' => 'uninstall_on_delete',
'type' => 'radio_inline',
'default' => 'disabled',
'options' => array(
'enabled' => __( 'Yes, Remove all data', 'give' ),
'disabled' => __( 'No, keep my Give settings and donation data', 'give' ),
),
),
array(
'name' => __( 'Default User Role', 'give' ),
'desc' => __( 'Assign default user roles for donors when donors opt to register as a WP User.', 'give' ),
Expand Down Expand Up @@ -95,17 +117,6 @@ public function get_settings() {
'disabled' => __( 'Disabled', 'give' ),
),
),
array(
'name' => __( 'Remove Data on Uninstall', 'give' ),
'desc' => __( 'When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give' ),
'id' => 'uninstall_on_delete',
'type' => 'radio_inline',
'default' => 'disabled',
'options' => array(
'enabled' => __( 'Yes, Remove all data', 'give' ),
'disabled' => __( 'No, keep my Give settings and donation data', 'give' ),
),
),
array(
'name' => __( 'Advanced Settings Docs Link', 'give' ),
'id' => 'advanced_settings_docs_link',
Expand Down
5 changes: 5 additions & 0 deletions includes/admin/tools/views/html-admin-page-system-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@
<td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of Give installed on your site.', 'give' ) ); ?></td>
<td><?php echo esc_html( GIVE_VERSION ); ?></td>
</tr>
<tr>
<td data-export-label="Give Cache"><?php _e( 'Give Cache', 'give' ); ?>:</td>
<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether cache is enabled in Give settings.', 'give' ) ); ?></td>
<td><?php echo give_is_setting_enabled( give_get_option('cache', 'enabled' ) ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
</tr>
<tr>
<td data-export-label="Upgraded From"><?php _e( 'Upgraded From', 'give' ); ?>:</td>
<td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of Give installed prior to the last update.', 'give' ) ); ?></td>
Expand Down
12 changes: 12 additions & 0 deletions includes/admin/upgrades/class-give-updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ public function __flush_resume_updates() {
* @access public
*/
public function __give_ajax_updates() {
// Disable cache.
Give_Cache::disable();

// Check permission.
if ( ! current_user_can( 'manage_give_settings' ) ) {
$this->send_ajax_response(
Expand All @@ -379,6 +382,12 @@ public function __give_ajax_updates() {
'error'
);
}

ignore_user_abort( true );

if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
set_time_limit( 0 );
}

// Set params.
$this->step = absint( $_POST['step'] );
Expand Down Expand Up @@ -487,6 +496,9 @@ public function send_ajax_response( $data, $type = '' ) {
// Set data.
$data = wp_parse_args( $data, $default );

// Enable cache.
Give_Cache::enable();

switch ( $type ) {
case 'success':
wp_send_json_success( $data );
Expand Down
Loading