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.7 #1657

Merged
merged 128 commits into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
37a2e47
Fix: delete only log related cahce
ravinderk Apr 14, 2017
91e0d4f
Add: Give_Cache class
ravinderk Apr 14, 2017
ed9302e
Update: deprecate give_get_cache_key
ravinderk Apr 14, 2017
c198787
Refactore: rename fx
ravinderk Apr 14, 2017
c885f93
Update: Give_Cache
ravinderk Apr 14, 2017
60876a4
Update: give_get_cache_key fx
ravinderk Apr 14, 2017
adb84dd
Update: Give_Cache & tests
ravinderk Apr 14, 2017
57aee0b
Update: Give_Cache & tests
ravinderk Apr 14, 2017
6ef8b9f
Fix: get log cache with Give_Cache
ravinderk Apr 14, 2017
ce62ad3
Fix: check if expiration key exist in give cache option or not
ravinderk Apr 14, 2017
c73559f
Refactor: get sales log from Give Cache
ravinderk Apr 14, 2017
7a33ff9
Update: Give_Cache
ravinderk Apr 14, 2017
088aec1
Refactor: delete fx for logging
ravinderk Apr 14, 2017
85b2366
Add: todo
ravinderk Apr 14, 2017
d79286b
Fix: use core send email fx
ravinderk Apr 17, 2017
52489e5
Add: upgrdae script to remove stat and cache trasients
ravinderk Apr 17, 2017
e0fed3d
Add: Give_Cache::get_options_like fx to get list of options
ravinderk Apr 17, 2017
90a748d
Update: Give_Cache docs block
ravinderk Apr 17, 2017
831b393
Refactor: implement Give_cache for stats transients
ravinderk Apr 17, 2017
7d41457
Fix: allow custom cache key name to get and set cache
ravinderk Apr 17, 2017
4fbbfb1
Update: renamed fx name in unit test
ravinderk Apr 17, 2017
aca1649
Fix: return wp_error if any while deleting cached values
ravinderk Apr 17, 2017
daa129a
Fix: do not delete invalida cache keys
ravinderk Apr 17, 2017
83d29d4
Fix: unit test for Give_Cache:delete_all_expired
ravinderk Apr 17, 2017
cfb01ae
Add: test for Give_Cache::get_options_like
ravinderk Apr 17, 2017
f9af10b
Fix: remove error_log
ravinderk Apr 17, 2017
4b93ec3
Merge pull request #1621 from ravinderk/issues/1577
Apr 17, 2017
53e3058
Merge pull request #1622 from ravinderk/issues/1617
Apr 18, 2017
7908df4
Refacore: replace trasient with Give_Cache in give_test_ajax_works fx
ravinderk Apr 18, 2017
bbccb74
Refacore: replace trasient with Give_Cache in give_addon_ons_get_feed fx
ravinderk Apr 18, 2017
a7cd1da
Refacore: replace trasient with Give_Cache in total_items fx
ravinderk Apr 18, 2017
f2d4b3e
Refacore: replace trasient with Give_Cache in hide_promo fx
ravinderk Apr 18, 2017
08b1d1c
Refacore: replace trasient with Give_Cache in find_or_initialize_tran…
ravinderk Apr 18, 2017
df2d71e
Refacore: replace trasient with Give_Cache in get_contributors fx
ravinderk Apr 18, 2017
3eaf259
Refacore: replace trasient with Give_Cache in give_estimated_monthly_…
ravinderk Apr 18, 2017
5b11100
Refacore: replace trasient with Give_Cache in give_get_total_earnings fx
ravinderk Apr 18, 2017
595310f
Update: add old trasient to delete option upgrdae script
ravinderk Apr 18, 2017
4e3972b
Refacore: replace trasient with Give_Cache in give_run_install fx
ravinderk Apr 18, 2017
0d9eb84
Refacore: replace trasient with Give_Cache in give_hide_subscription_…
ravinderk Apr 18, 2017
0c1d8ea
Merge branch 'master' into release/1.8.7
ravinderk Apr 18, 2017
8c97bb0
Merge branch 'release/1.8.7' into feature/update-transients-with-give…
ravinderk Apr 18, 2017
7e1958c
Fix: do not show notice if hide shortly
ravinderk Apr 18, 2017
77b7865
Refacore: replace trasient with Give_Cache in Give_Batch_Customers_E…
ravinderk Apr 18, 2017
1c2bff7
Refacore: replace trasient with Give_Cache in get_data fx
ravinderk Apr 18, 2017
f7c53f0
Refacore: replace user api key related trasient with Give_Cache
ravinderk Apr 18, 2017
7988b11
Fix: api count related caching issue
ravinderk Apr 18, 2017
e91714f
Update: make second argument optional in Give_Cache::get_key
ravinderk Apr 18, 2017
7c09d05
Fix: delete cached value
ravinderk Apr 18, 2017
b07c6ad
Update: Give_Cahce::delete_all_expired now can delete all options for…
ravinderk Apr 18, 2017
95329d0
Update: delete all cache options when tests end
ravinderk Apr 18, 2017
aa99c01
Update: implements Give_Cache in tests
ravinderk Apr 18, 2017
7ac2e1b
Fix: #1626
ravinderk Apr 19, 2017
6d236df
Merge pull request #1628 from ravinderk/issues/1626
Apr 19, 2017
be26dae
Spacing
DevinWalker Apr 25, 2017
77f6d4e
Added lines after website name appears #1569
DevinWalker Apr 25, 2017
75ee270
Added the donation amount to the new offline donation message #1569
DevinWalker Apr 25, 2017
01ad73e
Added missing heading to admin notification email #1569
DevinWalker Apr 26, 2017
dcd0c70
Merge pull request #1633 from WordImpress/issue/1569
Apr 26, 2017
a1cb995
Remove: give_clear_user_history_cache fx
ravinderk Apr 26, 2017
320049f
Fix: prevent action to firing twice
ravinderk Apr 26, 2017
12ed9b2
Update: should be string
ravinderk Apr 26, 2017
bab7af3
Fix: delete cache when any donation updates
ravinderk Apr 26, 2017
39a6e9d
Fix: fire give_action from & params
ravinderk Apr 26, 2017
825dd0c
Remove: duplicate give_estimated_monthly_stats delete cache fx
ravinderk Apr 26, 2017
1d4b548
Fix: recalculate earnings instead income
ravinderk Apr 26, 2017
d418ae5
Fix: do not need to store give_earnings_total to transients
ravinderk Apr 26, 2017
8fd2bd6
Update: generate earning totals in give_get_total_earnings forcefully
ravinderk Apr 26, 2017
9185b76
Fix: recalculate earnings when delete test transactions instead of se…
ravinderk Apr 26, 2017
21f9417
Update: bump plugin version to 1.8.7
ravinderk Apr 27, 2017
ecd58ff
Add: give_init action hook
ravinderk Apr 27, 2017
a4e8f92
Merge pull request #1635 from ravinderk/feature/add_hook
Apr 27, 2017
8ce40a4
Merge pull request #1634 from ravinderk/feature/version_update
Apr 27, 2017
ecd7c48
Merge pull request #1627 from ravinderk/feature/update-transients-wit…
Apr 27, 2017
54bb46c
Fox: make donation form content and background fixed
ravinderk Apr 28, 2017
d1f18ea
Merge pull request #1637 from ravinderk/issues/1636
Apr 28, 2017
3a09d34
typo fixes
Benunc Apr 28, 2017
ede407c
Merge pull request #1639 from Benunc/master
Apr 28, 2017
aacbeda
Early escaping not necessary when passing through filter
DevinWalker Apr 28, 2017
7a9941d
Add spaces before and after from Danish krone #1632
DevinWalker Apr 28, 2017
77209a0
Merge pull request #1640 from WordImpress/issue/1632
Apr 28, 2017
2650b53
Update real looking address to be super fake #1620
DevinWalker Apr 28, 2017
ec839ce
Merge pull request #1641 from WordImpress/issue/1620
Apr 28, 2017
2e315f7
Don’t echo short code output, return it. #1614
DevinWalker Apr 28, 2017
a92d205
Remove donor gravatars shortcake not in use
DevinWalker Apr 28, 2017
e7f67e8
Merge pull request #1642 from WordImpress/issue/1614
Apr 28, 2017
5ae8473
Merge branch 'master' into release/1.8.7
DevinWalker Apr 28, 2017
dc3d7af
Merge branch 'release/1.8.7' of ssh://github.com/WordImpress/Give int…
DevinWalker Apr 28, 2017
320e1a2
Improved error message #1624
DevinWalker Apr 28, 2017
317affb
Improved formatting
DevinWalker Apr 28, 2017
f8ed29a
Merge pull request #1643 from WordImpress/issue/1624
Apr 28, 2017
a07c07e
No need to escape early when passing through filters
DevinWalker Apr 28, 2017
dba5deb
New “Processing” post type status registered #1615
DevinWalker Apr 28, 2017
9efbd62
Code formatted
DevinWalker Apr 28, 2017
4c73fad
Merge pull request #1644 from WordImpress/issue/1615
Apr 29, 2017
a5a5bae
Update: prevent give_init hook to fire multiple times
ravinderk May 1, 2017
e179fe2
Merge remote-tracking branch 'upstream/release/1.8.7' into release/1.8.7
ravinderk May 1, 2017
98e5559
Compared latest WP Sessions with included library and merged #1646
DevinWalker May 1, 2017
df0adba
No early escaping needed when being filtered
DevinWalker May 1, 2017
243c025
Uncomment out session cookie method #1646
DevinWalker May 1, 2017
5865718
Removed comment
DevinWalker May 1, 2017
3789ef6
Merge pull request #1647 from WordImpress/issue/1646
May 1, 2017
718786c
Removed unnecessary escaping
DevinWalker May 1, 2017
e3310ad
No need to escape when filtered
DevinWalker May 3, 2017
9a62d85
Updated to latest version which included minor bug fix
DevinWalker May 4, 2017
d4ff719
Enable auto_updater() method #1648
DevinWalker May 4, 2017
81152fb
No need for escaping
DevinWalker May 4, 2017
6a702b2
Attempting to delete license from db when deactivated #1648
DevinWalker May 4, 2017
dc52197
Remove: do not need savin feature for license setting page
ravinderk May 4, 2017
ff7e4fc
Fix: remove license key from give-settings on addon deactivation
ravinderk May 4, 2017
a9c89fe
Add: license key to give-settings on plugin activation
ravinderk May 4, 2017
e4c75db
Command: improve code formatting
ravinderk May 4, 2017
047424b
Merge branch 'issue/1648' into issues/1649
ravinderk May 4, 2017
7902e85
Merge pull request #1650 from ravinderk/issues/1649
May 4, 2017
a7c938a
Fix: show inactive licensed addon notice on plugin page
ravinderk May 4, 2017
3b1bdc5
Update: add plugin page specific css
ravinderk May 4, 2017
5d8aa23
Fix: typo
ravinderk May 4, 2017
5bf9fbc
Touched up the CSS so that notices are in the same container #1649
DevinWalker May 4, 2017
3d81487
Allow messages to be in the same container
DevinWalker May 4, 2017
d4745d2
Fixed bug with license key not being saved to settings properly #1649
DevinWalker May 4, 2017
35572c2
Merge pull request #1652 from WordImpress/ravinderk-issues/1649
May 4, 2017
326cc1a
Updated readme for 1.8.7
DevinWalker May 4, 2017
ce2b88a
I noticed that these params are shared between the reset-stats and de…
DevinWalker May 4, 2017
15b2c2f
“Reset” is not “delete” because there’s no resetting going on #1654
DevinWalker May 4, 2017
49121d0
Merge pull request #1655 from WordImpress/issue/1654
May 4, 2017
db5fd4a
Fixed typo #1653
DevinWalker May 4, 2017
f5a1734
No escaping needed
DevinWalker May 4, 2017
ea38768
Typo file #1653
DevinWalker May 4, 2017
ee7184a
Merge pull request #1656 from WordImpress/issue/1653
May 4, 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: 1 addition & 1 deletion assets/js/admin/admin-scripts.min.js

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions assets/js/frontend/give.all.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions assets/js/frontend/give.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ function give_open_form_modal($form_wrap, $form) {
jQuery.magnificPopup.open({
mainClass : give_global_vars.magnific_options.main_class,
closeOnBgClick : give_global_vars.magnific_options.close_on_bg_click,
fixedContentPos: true,
fixedBgPos: true,
items: {
src: $form,
type: 'inline'
Expand Down
2 changes: 1 addition & 1 deletion assets/js/frontend/give.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 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.6
* Version: 1.8.7
* Text Domain: give
* Domain Path: /languages
* GitHub Plugin URI: https://github.com/WordImpress/Give
Expand Down Expand Up @@ -214,6 +214,14 @@ public static function instance() {
self::$instance->template_loader = new Give_Template_Loader();
self::$instance->email_access = new Give_Email_Access();


/**
* Fire the action after Give core loads
*
* @since 1.8.7
*/
do_action( 'give_init', self::$instance );

}

return self::$instance;
Expand Down Expand Up @@ -260,7 +268,7 @@ private function setup_constants() {

// Plugin version
if ( ! defined( 'GIVE_VERSION' ) ) {
define( 'GIVE_VERSION', '1.8.6' );
define( 'GIVE_VERSION', '1.8.7' );
}

// Plugin Folder Path
Expand Down Expand Up @@ -305,6 +313,7 @@ private function includes() {
$give_options = give_get_settings();

require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
require_once GIVE_PLUGIN_DIR . 'includes/scripts.php';
require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
Expand Down
64 changes: 56 additions & 8 deletions includes/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function give_get_actions() {

$_get_action = ! empty( $_GET['give_action'] ) ? $_GET['give_action'] : null;

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

Expand All @@ -46,10 +46,9 @@ function give_get_actions() {
}

add_action( 'init', 'give_get_actions' );
add_action( 'admin_init', 'give_get_actions' );

/**
* Hooks Give actions, when present in the $_POST superglobal. Every give_action
* Hooks Give actions, when present in the $_POST super global. Every give_action
* present in $_POST is called using WordPress's do_action function. These
* functions are called on init.
*
Expand All @@ -62,8 +61,8 @@ function give_post_actions() {
$_post_action = ! empty( $_POST['give_action'] ) ? $_POST['give_action'] : null;


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

Expand All @@ -81,7 +80,6 @@ function give_post_actions() {
}

add_action( 'init', 'give_post_actions' );
add_action( 'admin_init', 'give_post_actions' );

/**
* Connect WordPress user with Donor.
Expand All @@ -92,6 +90,7 @@ function give_post_actions() {
* @return void
*/
function give_connect_donor_to_wpuser( $user_id, $user_data ){
/* @var Give_Customer $donor */
$donor = new Give_Customer( $user_data['user_email'] );

// Validate donor id and check if do nor is already connect to wp user or not.
Expand Down Expand Up @@ -159,7 +158,56 @@ function give_donor_batch_export_complete( $data ) {
&& ! empty( $data['forms'] )
&& isset( $data['give_export_option']['query_id'] )
) {
delete_transient( $data['give_export_option']['query_id'] );
Give_Cache::delete( Give_Cache::get_key( $data['give_export_option']['query_id'] ) );
}
}
add_action('give_file_export_complete', 'give_donor_batch_export_complete' );

/**
* Print css for wordpress setting pages.
*
* @since 1.8.7
*/
function give_admin_quick_css() {
/* @var WP_Screen $screen */
$screen = get_current_screen();

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

switch ( true ) {
case ( 'plugins' === $screen->base ):
?>
<style>
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.give-addon-notice-tr .dashicons {
color: #f56e28;
}
tr.give-addon-notice-tr td{
border-left: 4px solid #00a0d2;
}

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

tr.active.update + tr.give-addon-notice-tr .notice{
margin: 5px 20px 5px 40px;
}
</style>
<?php
}
}
add_action( 'admin_head', 'give_admin_quick_css' );
10 changes: 5 additions & 5 deletions includes/admin/EDD_SL_Plugin_Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Allows plugins to use their own update API.
*
* @author Easy Digital Downloads
* @version 1.6.11
* @version 1.6.12
*/
class EDD_SL_Plugin_Updater {

Expand Down Expand Up @@ -279,8 +279,8 @@ public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
// Convert sections into an associative array, since we're getting an object, but Core expects an array.
if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) {
$new_sections = array();
foreach ( $_data->sections as $key => $key ) {
$new_sections[ $key ] = $key;
foreach ( $_data->sections as $key => $value ) {
$new_sections[ $key ] = $value;
}

$_data->sections = $new_sections;
Expand All @@ -289,8 +289,8 @@ public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
// Convert banners into an associative array, since we're getting an object, but Core expects an array.
if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) {
$new_banners = array();
foreach ( $_data->banners as $key => $key ) {
$new_banners[ $key ] = $key;
foreach ( $_data->banners as $key => $value ) {
$new_banners[ $key ] = $value;
}

$_data->banners = $new_banners;
Expand Down
9 changes: 6 additions & 3 deletions includes/admin/add-ons.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,21 @@ function give_add_ons_page() {
function give_add_ons_get_feed() {

$addons_debug = false; //set to true to debug
$cache = get_transient( 'give_add_ons_feed' );
$cache = Give_Cache::get( 'give_add_ons_feed', true );

if ( $cache === false || $addons_debug === true && WP_DEBUG === true ) {
$feed = wp_remote_get( 'https://givewp.com/downloads/feed/', array( 'sslverify' => false ) );

if ( ! is_wp_error( $feed ) ) {
if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
$cache = wp_remote_retrieve_body( $feed );
set_transient( 'give_add_ons_feed', $cache, 3600 );
Give_Cache::set( 'give_add_ons_feed', $cache, HOUR_IN_SECONDS, true );
}
} else {
$cache = '<div class="error"><p>' . esc_html__( 'There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give' ) . '</div>';
$cache = sprintf(
'<div class="error"><p>%s</p></div>',
esc_html__( 'There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give' )
);
}
}

Expand Down
4 changes: 2 additions & 2 deletions includes/admin/admin-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ function give_hide_subscription_notices() {
// Transient key name.
$transient_key = "_give_hide_license_notices_shortly_{$current_user->ID}_{$notice_id}";

if ( get_transient( $transient_key ) ) {
if ( Give_Cache::get( $transient_key, true ) ) {
return;
}

// Hide notice for 24 hours.
set_transient( $transient_key, true, 24 * HOUR_IN_SECONDS );
Give_Cache::set( $transient_key, true, DAY_IN_SECONDS, true );

// Redirect user.
wp_safe_redirect( remove_query_arg( '_give_hide_license_notices_shortly', $_SERVER['REQUEST_URI'] ) );
Expand Down
Loading