Easy Digital Downloads - Version 2.6.1

Version Description

Download this release

Release Info

Developer mordauk
Plugin Icon 128x128 Easy Digital Downloads
Version 2.6.1
Comparing to
See all releases

Code changes from version 2.6 to 2.6.1

easy-digital-downloads.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Pippin Williamson and Company
7
  * Author URI: https://easydigitaldownloads.com
8
- * Version: 2.6
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
@@ -25,7 +25,7 @@
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
- * @version 2.6
29
  */
30
 
31
  // Exit if accessed directly.
@@ -195,7 +195,7 @@ final class Easy_Digital_Downloads {
195
 
196
  // Plugin version.
197
  if ( ! defined( 'EDD_VERSION' ) ) {
198
- define( 'EDD_VERSION', '2.6' );
199
  }
200
 
201
  // Plugin Folder Path.
@@ -296,6 +296,7 @@ final class Easy_Digital_Downloads {
296
  require_once EDD_PLUGIN_DIR . 'includes/process-purchase.php';
297
  require_once EDD_PLUGIN_DIR . 'includes/login-register.php';
298
  require_once EDD_PLUGIN_DIR . 'includes/shortcodes.php';
 
299
 
300
  if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
301
  require_once EDD_PLUGIN_DIR . 'includes/admin/add-ons.php';
@@ -329,7 +330,6 @@ final class Easy_Digital_Downloads {
329
  require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/graphing.php';
330
  require_once EDD_PLUGIN_DIR . 'includes/admin/settings/display-settings.php';
331
  require_once EDD_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
332
- require_once EDD_PLUGIN_DIR . 'includes/admin/tracking.php';
333
  require_once EDD_PLUGIN_DIR . 'includes/admin/tools.php';
334
  require_once EDD_PLUGIN_DIR . 'includes/admin/plugins.php';
335
  require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Pippin Williamson and Company
7
  * Author URI: https://easydigitaldownloads.com
8
+ * Version: 2.6.1
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
+ * @version 2.6.1
29
  */
30
 
31
  // Exit if accessed directly.
195
 
196
  // Plugin version.
197
  if ( ! defined( 'EDD_VERSION' ) ) {
198
+ define( 'EDD_VERSION', '2.6.1' );
199
  }
200
 
201
  // Plugin Folder Path.
296
  require_once EDD_PLUGIN_DIR . 'includes/process-purchase.php';
297
  require_once EDD_PLUGIN_DIR . 'includes/login-register.php';
298
  require_once EDD_PLUGIN_DIR . 'includes/shortcodes.php';
299
+ require_once EDD_PLUGIN_DIR . 'includes/admin/tracking.php'; // Must be loaded on frontend to ensure cron runs
300
 
301
  if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
302
  require_once EDD_PLUGIN_DIR . 'includes/admin/add-ons.php';
330
  require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/graphing.php';
331
  require_once EDD_PLUGIN_DIR . 'includes/admin/settings/display-settings.php';
332
  require_once EDD_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
 
333
  require_once EDD_PLUGIN_DIR . 'includes/admin/tools.php';
334
  require_once EDD_PLUGIN_DIR . 'includes/admin/plugins.php';
335
  require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
includes/admin/tracking.php CHANGED
@@ -36,8 +36,7 @@ class EDD_Tracking {
36
  */
37
  public function __construct() {
38
 
39
- $this->schedule_send();
40
-
41
  add_action( 'edd_settings_general_sanitize', array( $this, 'check_for_settings_optin' ) );
42
  add_action( 'edd_opt_into_tracking', array( $this, 'check_for_optin' ) );
43
  add_action( 'edd_opt_out_of_tracking', array( $this, 'check_for_optout' ) );
@@ -113,7 +112,7 @@ class EDD_Tracking {
113
  * @access private
114
  * @return void
115
  */
116
- public function send_checkin( $override = false ) {
117
 
118
  if( ! $this->tracking_allowed() && ! $override ) {
119
  return false;
@@ -121,7 +120,7 @@ class EDD_Tracking {
121
 
122
  // Send a maximum of once per week
123
  $last_send = $this->get_last_send();
124
- if( is_numeric( $last_send ) && $last_send > strtotime( '-1 week' ) ) {
125
  return false;
126
  }
127
 
@@ -219,10 +218,10 @@ class EDD_Tracking {
219
  /**
220
  * Schedule a weekly checkin
221
  *
222
- * @access private
223
  * @return void
224
  */
225
- private function schedule_send() {
226
  // We send once a week (while tracking is allowed) to check in, which can be used to determine active sites
227
  add_action( 'edd_weekly_scheduled_events', array( $this, 'send_checkin' ) );
228
  }
36
  */
37
  public function __construct() {
38
 
39
+ add_action( 'init', array( $this, 'schedule_send' ) );
 
40
  add_action( 'edd_settings_general_sanitize', array( $this, 'check_for_settings_optin' ) );
41
  add_action( 'edd_opt_into_tracking', array( $this, 'check_for_optin' ) );
42
  add_action( 'edd_opt_out_of_tracking', array( $this, 'check_for_optout' ) );
112
  * @access private
113
  * @return void
114
  */
115
+ public function send_checkin( $override = false, $ignore_last_checkin = false ) {
116
 
117
  if( ! $this->tracking_allowed() && ! $override ) {
118
  return false;
120
 
121
  // Send a maximum of once per week
122
  $last_send = $this->get_last_send();
123
+ if( is_numeric( $last_send ) && $last_send > strtotime( '-1 week' ) && ! $ignore_last_checkin ) {
124
  return false;
125
  }
126
 
218
  /**
219
  * Schedule a weekly checkin
220
  *
221
+ * @access public
222
  * @return void
223
  */
224
+ public function schedule_send() {
225
  // We send once a week (while tracking is allowed) to check in, which can be used to determine active sites
226
  add_action( 'edd_weekly_scheduled_events', array( $this, 'send_checkin' ) );
227
  }
includes/admin/upgrades/upgrade-functions.php CHANGED
@@ -24,15 +24,31 @@ function edd_do_automatic_upgrades() {
24
  $did_upgrade = false;
25
  $edd_version = preg_replace( '/[^0-9.].*/', '', get_option( 'edd_version' ) );
26
 
27
- if( version_compare( $edd_version, EDD_VERSION, '<' ) ) {
28
 
29
  edd_v26_upgrades();
 
 
 
 
 
 
30
  $did_upgrade = true;
31
 
32
  }
33
 
34
  if( $did_upgrade ) {
 
 
 
 
 
 
35
  update_option( 'edd_version', preg_replace( '/[^0-9.].*/', '', EDD_VERSION ) );
 
 
 
 
36
  }
37
 
38
  }
24
  $did_upgrade = false;
25
  $edd_version = preg_replace( '/[^0-9.].*/', '', get_option( 'edd_version' ) );
26
 
27
+ if( version_compare( $edd_version, '2.6', '<' ) ) {
28
 
29
  edd_v26_upgrades();
30
+
31
+ }
32
+
33
+ if( version_compare( $edd_version, EDD_VERSION, '<' ) ) {
34
+
35
+ // Let us know that an upgrade has happened
36
  $did_upgrade = true;
37
 
38
  }
39
 
40
  if( $did_upgrade ) {
41
+
42
+ // If it is a major version, send to what's new page
43
+ if( substr_count( EDD_VERSION, '.' ) < 2 ) {
44
+ set_transient( '_edd_activation_redirect', true, 30 );
45
+ }
46
+
47
  update_option( 'edd_version', preg_replace( '/[^0-9.].*/', '', EDD_VERSION ) );
48
+
49
+ // Send a check in. Note: this only sends if data tracking has been enabled
50
+ $tracking = new EDD_Tracking;
51
+ $tracking->send_checkin( false, true );
52
  }
53
 
54
  }
includes/admin/welcome.php CHANGED
@@ -34,7 +34,7 @@ class EDD_Welcome {
34
  public function __construct() {
35
  add_action( 'admin_menu', array( $this, 'admin_menus') );
36
  add_action( 'admin_head', array( $this, 'admin_head' ) );
37
- add_action( 'admin_init', array( $this, 'welcome' ) );
38
  }
39
 
40
  /**
34
  public function __construct() {
35
  add_action( 'admin_menu', array( $this, 'admin_menus') );
36
  add_action( 'admin_head', array( $this, 'admin_head' ) );
37
+ add_action( 'admin_init', array( $this, 'welcome' ), 11 );
38
  }
39
 
40
  /**
includes/gateways/paypal-standard.php CHANGED
@@ -777,7 +777,9 @@ add_filter( 'edd_get_payment_transaction_id-paypal', 'edd_paypal_get_payment_tra
777
  */
778
  function edd_paypal_link_transaction_id( $transaction_id, $payment_id ) {
779
 
780
- $paypal_base_url = 'https://www.paypal.com/webscr?cmd=_history-details-from-hub&id=';
 
 
781
  $transaction_url = '<a href="' . esc_url( $paypal_base_url . $transaction_id ) . '" target="_blank">' . $transaction_id . '</a>';
782
 
783
  return apply_filters( 'edd_paypal_link_payment_details_transaction_id', $transaction_url );
777
  */
778
  function edd_paypal_link_transaction_id( $transaction_id, $payment_id ) {
779
 
780
+ $payment = new EDD_Payment( $payment_id );
781
+ $sandbox = 'test' == $payment->mode ? 'sandbox.' : '';
782
+ $paypal_base_url = 'https://www.' . $sandbox . 'paypal.com/webscr?cmd=_history-details-from-hub&id=';
783
  $transaction_url = '<a href="' . esc_url( $paypal_base_url . $transaction_id ) . '" target="_blank">' . $transaction_id . '</a>';
784
 
785
  return apply_filters( 'edd_paypal_link_payment_details_transaction_id', $transaction_url );
includes/template-functions.php CHANGED
@@ -258,13 +258,22 @@ function edd_purchase_variable_pricing( $download_id = 0, $args = array() ) {
258
  $type = edd_single_price_option_mode( $download_id ) ? 'checkbox' : 'radio';
259
  $mode = edd_single_price_option_mode( $download_id ) ? 'multi' : 'single';
260
  $schema = edd_add_schema_microdata() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '';
261
-
 
 
 
 
 
 
 
 
 
262
  if ( edd_item_in_cart( $download_id ) && ! edd_single_price_option_mode( $download_id ) ) {
263
  return;
264
  }
265
 
266
  do_action( 'edd_before_price_options', $download_id ); ?>
267
- <div class="edd_price_options edd_<?php echo esc_attr( $mode ); ?>_mode">
268
  <ul>
269
  <?php
270
  if ( $prices ) :
258
  $type = edd_single_price_option_mode( $download_id ) ? 'checkbox' : 'radio';
259
  $mode = edd_single_price_option_mode( $download_id ) ? 'multi' : 'single';
260
  $schema = edd_add_schema_microdata() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '';
261
+
262
+ // Filter the class names for the edd_price_options div
263
+ $css_classes_array = apply_filters( 'edd_price_options_classes', array(
264
+ 'edd_price_options',
265
+ 'edd_' . esc_attr( $mode ) . '_mode'
266
+ ), $download_id );
267
+
268
+ // Sanitize those class names and form them into a string
269
+ $css_classes_string = implode( array_map( 'sanitize_html_class', $css_classes_array ), ' ' );
270
+
271
  if ( edd_item_in_cart( $download_id ) && ! edd_single_price_option_mode( $download_id ) ) {
272
  return;
273
  }
274
 
275
  do_action( 'edd_before_price_options', $download_id ); ?>
276
+ <div class="<?php echo esc_attr( rtrim( $css_classes_string ) ); ?>">
277
  <ul>
278
  <?php
279
  if ( $prices ) :
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://pippinsplugins.com/support-the-site
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce
7
  Requires at least: 4.0
8
  Tested up to: 4.6
9
- Stable Tag: 2.6
10
 
11
  License: GNU Version 2 or Any Later Version
12
 
@@ -214,7 +214,15 @@ Yes, through the addition of one or more of the add-on payment gateways, you can
214
 
215
  == Changelog ==
216
 
217
- = 2.6, June 22, 2016 =
 
 
 
 
 
 
 
 
218
  * New: Added filters to process the earnings as they are updated.
219
  * New: Profile Editor state field shows as dropdown when possible.
220
  * New: Public API query mode to allow extension developers the ability to create API endpoints that do not require API keys.
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce
7
  Requires at least: 4.0
8
  Tested up to: 4.6
9
+ Stable Tag: 2.6.1
10
 
11
  License: GNU Version 2 or Any Later Version
12
 
214
 
215
  == Changelog ==
216
 
217
+ = 2.6.1, June 24, 2016 =
218
+ * Fix: PayPal Standard transaction ID links don't link to PayPal Sandbox when payment was made in test mode.
219
+ * Fix: Opt-in tracking not sending after initial activation.
220
+ * Tweak: Welcome page not showing on upgrade.
221
+ * Tweak: Only show welcome page on major versions.
222
+ * New: If enabled, send checkin data when Easy Digital Downloads is upgraded.
223
+ * New: Add a filter for edd_price_options() that allows adding classes to the output.
224
+
225
+ = 2.6, June 23, 2016 =
226
  * New: Added filters to process the earnings as they are updated.
227
  * New: Profile Editor state field shows as dropdown when possible.
228
  * New: Public API query mode to allow extension developers the ability to create API endpoints that do not require API keys.