Easy Digital Downloads - Version 2.8.18

Version Description

Download this release

Release Info

Developer cklosows
Plugin Icon 128x128 Easy Digital Downloads
Version 2.8.18
Comparing to
See all releases

Code changes from version 2.8.17 to 2.8.18

easy-digital-downloads.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Easy Digital Downloads
7
  * Author URI: https://easydigitaldownloads.com
8
- * Version: 2.8.17
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.8.17
29
  */
30
 
31
  // Exit if accessed directly.
@@ -206,7 +206,7 @@ final class Easy_Digital_Downloads {
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
- define( 'EDD_VERSION', '2.8.17' );
210
  }
211
 
212
  // Plugin Folder Path.
@@ -470,7 +470,7 @@ endif; // End if class_exists check.
470
  * Example: <?php $edd = EDD(); ?>
471
  *
472
  * @since 1.4
473
- * @return object|Easy_Digital_Downloads The one true Easy_Digital_Downloads Instance.
474
  */
475
  function EDD() {
476
  return Easy_Digital_Downloads::instance();
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Easy Digital Downloads
7
  * Author URI: https://easydigitaldownloads.com
8
+ * Version: 2.8.18
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
+ * @version 2.8.18
29
  */
30
 
31
  // Exit if accessed directly.
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
+ define( 'EDD_VERSION', '2.8.18' );
210
  }
211
 
212
  // Plugin Folder Path.
470
  * Example: <?php $edd = EDD(); ?>
471
  *
472
  * @since 1.4
473
+ * @return object|Easy_Digital_Downloads The one true Easy_Digital_Downloads Instance.
474
  */
475
  function EDD() {
476
  return Easy_Digital_Downloads::instance();
includes/admin/reporting/export/class-batch-export-earnings-report.php CHANGED
@@ -50,6 +50,67 @@ class EDD_Batch_Earnings_Report_Export extends EDD_Batch_Export {
50
  header( "Expires: 0" );
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /**
54
  * Output the CSV columns.
55
  *
@@ -61,17 +122,7 @@ class EDD_Batch_Earnings_Report_Export extends EDD_Batch_Export {
61
  * @return array $cols CSV header.
62
  */
63
  public function print_csv_cols() {
64
- $cols = array(
65
- __( 'Monthly Sales Activity', 'easy-digital-downloads' ),
66
- __( 'Sales', 'easy-digital-downloads' ),
67
- __( 'Refunds', 'easy-digital-downloads' ),
68
- __( 'Revoked', 'easy-digital-downloads' ),
69
- __( 'Abandoned', 'easy-digital-downloads' ),
70
- __( 'Failed', 'easy-digital-downloads' ),
71
- __( 'Cancelled', 'easy-digital-downloads' ),
72
- __( 'Net Activity', 'easy-digital-downloads' )
73
- );
74
-
75
  $col_data = '';
76
 
77
  for ( $i = 0; $i < count( $cols ); $i++ ) {
@@ -90,19 +141,19 @@ class EDD_Batch_Earnings_Report_Export extends EDD_Batch_Export {
90
  }
91
  }
92
 
93
- // Subtract 2 for `Net Activity` and `Monthly Sales Activity` column
94
- $statuses = count( $cols ) - 2;
95
 
96
  $col_data .= ',';
97
- for ( $i = 0; $i < $statuses; $i++ ) {
98
- $col_data .= __( 'Count', 'easy-digital-downloads' ) . ',' . __( 'Gross Amount', 'easy-digital-downloads' );
 
99
 
100
- if ( $i == ( $statuses - 1 ) ) {
101
- $col_data .= "\r\n";
102
- } else {
103
- $col_data .= ",";
104
  }
105
  }
 
106
 
107
  $this->stash_step_data( $col_data );
108
 
@@ -144,30 +195,40 @@ class EDD_Batch_Earnings_Report_Export extends EDD_Batch_Export {
144
  }
145
  }
146
 
147
- $row_data .= isset( $data['publish']['count'] ) ? $data['publish']['count'] . ',' : 0 . ',';
148
-
149
- $publish_total = isset( $data['publish']['amount'] ) ? $data['publish']['amount'] : 0;
150
- $refunded_total = isset( $data['refunded']['amount'] ) ? $data['refunded']['amount'] : 0;
151
- $cancelled_total = isset( $data['cancelled']['amount'] ) ? $data['cancelled']['amount'] : 0;
152
 
153
- $row_data .= '"' . edd_format_amount( $publish_total + $refunded_total + $cancelled_total ) . '",';
 
 
 
 
 
154
 
155
- $row_data .= isset( $data['refunded']['count'] ) ? $data['refunded']['count'] . ',' : 0 . ',';
156
- $row_data .= isset( $data['refunded']['amount'] ) ? '"-' . edd_format_amount( $data['refunded']['amount'] ) . '"' . ',' : 0 . ',';
157
 
158
- $row_data .= isset( $data['revoked']['count'] ) ? $data['revoked']['count'] . ',' : 0 . ',';
159
- $row_data .= isset( $data['revoked']['amount'] ) ? '"' . edd_format_amount( $data['revoked']['amount'] ) . '"' . ',' : 0 . ',';
160
 
161
- $row_data .= isset( $data['abandoned']['count'] ) ? $data['abandoned']['count'] . ',' : 0 . ',';
162
- $row_data .= isset( $data['abandoned']['amount'] ) ? '"' . edd_format_amount( $data['abandoned']['amount'] ) . '"' . ',' : 0 . ',';
 
 
163
 
164
- $row_data .= isset( $data['failed']['count'] ) ? $data['failed']['count'] . ',' : 0 . ',';
165
- $row_data .= isset( $data['failed']['amount'] ) ? '"' . edd_format_amount( $data['failed']['amount'] ) . '"' . ',' : 0 . ',';
166
 
167
- $row_data .= isset( $data['cancelled']['count'] ) ? $data['cancelled']['count'] . ',' : 0 . ',';
168
- $row_data .= isset( $data['cancelled']['amount'] ) ? '"' . edd_format_amount( $data['cancelled']['amount'] ) . '"' . ',' : 0 . ',';
169
 
170
- $row_data .= isset( $data['publish']['amount'] ) ? '"' . edd_format_amount( $data['publish']['amount'] ) . '"' . ',' : 0;
 
 
 
 
 
 
 
171
 
172
  $row_data .= "\r\n";
173
 
@@ -192,22 +253,21 @@ class EDD_Batch_Earnings_Report_Export extends EDD_Batch_Export {
192
 
193
  $data = array();
194
 
195
- $start_date = date( 'Y-m-d', strtotime( $this->start ) );
196
- $maybe_end_date = date( 'Y-m-d', strtotime( 'first day of +1 month', strtotime( $start_date ) ) );
197
 
198
  if ( $this->count() == 0 ) {
199
- $end_date = date( 'Y-m-d', strtotime( $this->end ) );
200
  } else {
201
- $end_date = date( 'Y-m-d', strtotime( 'first day of +1 month', strtotime( $start_date ) ) );
202
  }
203
 
204
  if ( $this->step > 1 ) {
205
- $start_date = date( 'Y-m-d', strtotime( 'first day of +' . ( $this->step - 1 ) . ' month', strtotime( $start_date ) ) );
206
 
207
  if ( date( 'Y-m', strtotime( $start_date ) ) == date( 'Y-m', strtotime( $this->end ) ) ) {
208
- $end_date = date( 'Y-m-d', strtotime( $this->end ) );
209
  } else {
210
- $end_date = date( 'Y-m-d', strtotime( 'first day of +1 month', strtotime( $start_date ) ) );
211
  }
212
  }
213
 
@@ -215,8 +275,9 @@ class EDD_Batch_Earnings_Report_Export extends EDD_Batch_Export {
215
  return false;
216
  }
217
 
218
- $totals = $wpdb->get_results( $wpdb->prepare(
219
- "SELECT SUM(meta_value) AS total, DATE_FORMAT(posts.post_date, '%%m') AS m, YEAR(posts.post_date) AS y, COUNT(DISTINCT posts.ID) AS count, posts.post_status AS status
 
220
  FROM {$wpdb->posts} AS posts
221
  INNER JOIN {$wpdb->postmeta} ON posts.ID = {$wpdb->postmeta}.post_ID
222
  WHERE posts.post_type IN ('edd_payment')
@@ -226,36 +287,32 @@ class EDD_Batch_Earnings_Report_Export extends EDD_Batch_Export {
226
  GROUP BY YEAR(posts.post_date), MONTH(posts.post_date), posts.post_status
227
  ORDER by posts.post_date ASC", $start_date, $end_date ), ARRAY_A );
228
 
229
- foreach ( $totals as $total ) {
230
- $data[ $total['status'] ] = array(
231
- 'count' => $total['count'],
232
- 'amount' => $total['total']
 
233
  );
234
  }
235
 
236
- if ( empty( $data ) ) {
237
- $data = array(
238
- 'publish' => array(
239
- 'count' => 0,
240
- 'amount' => 0
241
- ),
242
- 'refunded' => array(
243
- 'count' => 0,
244
- 'amount' => 0
245
- ),
246
- 'cancelled' => array(
247
- 'count' => 0,
248
- 'amount' => 0
249
- ),
250
- 'revoked' => array(
251
- 'count' => 0,
252
- 'amount' => 0
253
- ),
254
- );
255
  }
256
 
257
  $data = apply_filters( 'edd_export_get_data', $data );
258
- $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data );
259
 
260
  return $data;
261
  }
50
  header( "Expires: 0" );
51
  }
52
 
53
+ /**
54
+ * Get the column headers for the Earnings Report
55
+ *
56
+ * @since 2.8.18
57
+ * @return array
58
+ */
59
+ public function get_csv_cols() {
60
+
61
+ // Always start with the date column.
62
+ $pre_status_columns = array(
63
+ __( 'Monthly Sales Activity', 'easy-digital-downloads' ),
64
+ __( 'Gross Activity', 'easy-digital-downloads' ),
65
+ );
66
+
67
+ $status_cols = $this->get_status_cols();
68
+
69
+ // Append the arrays together so it starts with the date, then include the status list.
70
+ $cols = array_merge( $pre_status_columns, $status_cols );
71
+
72
+ // Include the 'net' after all other columns.
73
+ $cols[] = __( 'Net Activity', 'easy-digital-downloads' );
74
+
75
+ return $cols;
76
+
77
+ }
78
+
79
+ /**
80
+ * Specifically retrieve the headers for supported order statuses.
81
+ *
82
+ * @since 2.8.18
83
+ * @return array
84
+ */
85
+ public function get_status_cols() {
86
+ $status_cols = edd_get_payment_statuses();
87
+ $supported_statuses = $this->get_supported_statuses();
88
+
89
+ foreach ( $status_cols as $id => $label ) {
90
+ if ( ! in_array( $id, $supported_statuses ) ) {
91
+ unset( $status_cols[ $id ] );
92
+ }
93
+ }
94
+
95
+ return array_values( $status_cols );
96
+ }
97
+
98
+ /**
99
+ * Get a list of the statuses supported in this report.
100
+ *
101
+ * @since 2.8.18
102
+ * @return array The status keys supported (not Labels)
103
+ */
104
+ public function get_supported_statuses() {
105
+ $statuses = edd_get_payment_statuses();
106
+
107
+ // Unset a few statuses we don't need in the report:
108
+ unset( $statuses['pending'], $statuses['processing'], $statuses['preapproval'] );
109
+ $supported_statuses = array_keys( $statuses );
110
+
111
+ return apply_filters( 'edd_export_earnings_supported_statuses', $supported_statuses );
112
+ }
113
+
114
  /**
115
  * Output the CSV columns.
116
  *
122
  * @return array $cols CSV header.
123
  */
124
  public function print_csv_cols() {
125
+ $cols = $this->get_csv_cols();
 
 
 
 
 
 
 
 
 
 
126
  $col_data = '';
127
 
128
  for ( $i = 0; $i < count( $cols ); $i++ ) {
141
  }
142
  }
143
 
144
+ $statuses = $this->get_supported_statuses();
145
+ $number_cols = count( $statuses ) + 2;
146
 
147
  $col_data .= ',';
148
+ for ( $i = 1; $i <= $number_cols; $i++ ) {
149
+ $col_data .= __( 'Order Count', 'easy-digital-downloads' ) . ',';
150
+ $col_data .= __( 'Gross Amount', 'easy-digital-downloads' );
151
 
152
+ if ( $number_cols !== $i ) {
153
+ $col_data .= ',';
 
 
154
  }
155
  }
156
+ $col_data .= "\r\n";
157
 
158
  $this->stash_step_data( $col_data );
159
 
195
  }
196
  }
197
 
198
+ $supported_statuses = $this->get_supported_statuses();
 
 
 
 
199
 
200
+ $gross_count = 0;
201
+ $gross_amount = 0;
202
+ foreach ( $supported_statuses as $status ) {
203
+ $gross_count += absint( $data[ $status ]['count'] );
204
+ $gross_amount += $data[ $status ]['amount'];
205
+ }
206
 
207
+ $row_data .= $gross_count . ',';
208
+ $row_data .= '"' . edd_format_amount( $gross_amount ) . '",';
209
 
210
+ foreach ( $data as $status => $status_data ) {
211
+ $row_data .= isset( $data[ $status ]['count'] ) ? $data[ $status ]['count'] . ',' : 0 . ',';
212
 
213
+ $column_amount = isset( $data[ $status ]['amount'] ) ? edd_format_amount( $data[ $status ]['amount'] ) : 0;
214
+ if ( ! empty( $column_amount ) && 'refunded' == $status ) {
215
+ $column_amount = '-' . $column_amount;
216
+ }
217
 
218
+ $row_data .= isset( $data[ $status ]['amount'] ) ? '"' . $column_amount . '"' . ',' : 0 . ',';
219
+ }
220
 
221
+ // Allows extensions with other 'completed' statuses to alter net earnings, like recurring.
222
+ $completed_statuses = apply_filters( 'edd_export_earnings_completed_statuses', array( 'publish', 'revoked' ) );
223
 
224
+ $net_count = 0;
225
+ $net_amount = 0;
226
+ foreach ( $completed_statuses as $status ) {
227
+ $net_count += absint( $data[ $status ]['count'] );
228
+ $net_amount += floatval( $data[ $status ]['amount'] );
229
+ }
230
+ $row_data .= $net_count . ',';
231
+ $row_data .= '"' . edd_format_amount( $net_amount ) . '"';
232
 
233
  $row_data .= "\r\n";
234
 
253
 
254
  $data = array();
255
 
256
+ $start_date = date( 'Y-m-d 00:00:00', strtotime( $this->start ) );
 
257
 
258
  if ( $this->count() == 0 ) {
259
+ $end_date = date( 'Y-m-d 23:59:59', strtotime( $this->end ) );
260
  } else {
261
+ $end_date = date( 'Y-m-d 23:59:59', strtotime( 'first day of +1 month', strtotime( $start_date ) ) );
262
  }
263
 
264
  if ( $this->step > 1 ) {
265
+ $start_date = date( 'Y-m-d 00:00:00', strtotime( 'first day of +' . ( $this->step - 1 ) . ' month', strtotime( $start_date ) ) );
266
 
267
  if ( date( 'Y-m', strtotime( $start_date ) ) == date( 'Y-m', strtotime( $this->end ) ) ) {
268
+ $end_date = date( 'Y-m-d 23:59:59', strtotime( $this->end ) );
269
  } else {
270
+ $end_date = date( 'Y-m-d 23:59:59', strtotime( 'first day of +1 month', strtotime( $start_date ) ) );
271
  }
272
  }
273
 
275
  return false;
276
  }
277
 
278
+ $statuses = $this->get_supported_statuses();
279
+ $totals = $wpdb->get_results( $wpdb->prepare(
280
+ "SELECT SUM(meta_value) AS total, COUNT(DISTINCT posts.ID) AS count, posts.post_status AS status
281
  FROM {$wpdb->posts} AS posts
282
  INNER JOIN {$wpdb->postmeta} ON posts.ID = {$wpdb->postmeta}.post_ID
283
  WHERE posts.post_type IN ('edd_payment')
287
  GROUP BY YEAR(posts.post_date), MONTH(posts.post_date), posts.post_status
288
  ORDER by posts.post_date ASC", $start_date, $end_date ), ARRAY_A );
289
 
290
+ $total_data = array();
291
+ foreach ( $totals as $row ) {
292
+ $total_data[ $row['status'] ] = array(
293
+ 'count' => $row['count'],
294
+ 'amount' => $row['total']
295
  );
296
  }
297
 
298
+ foreach ( $statuses as $status ) {
299
+
300
+ if ( ! isset( $total_data[ $status ] ) ) {
301
+ $data[ $status ] = array(
302
+ 'count' => 0,
303
+ 'amount' => 0,
304
+ );
305
+ } else {
306
+ $data[ $status ] = array(
307
+ 'count' => $total_data[ $status ]['count'],
308
+ 'amount' => $total_data[ $status ]['amount'],
309
+ );
310
+ }
311
+
 
 
 
 
 
312
  }
313
 
314
  $data = apply_filters( 'edd_export_get_data', $data );
315
+ $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data, $start_date, $end_date );
316
 
317
  return $data;
318
  }
includes/admin/settings/register-settings.php CHANGED
@@ -1914,7 +1914,7 @@ function edd_upload_callback( $args ) {
1914
  $class = edd_sanitize_html_class( $args['field_class'] );
1915
 
1916
  $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1917
- $html = '<input type="text" class="' . sanitize_html_class( $size ) . '-text" id="edd_settings[' . edd_sanitize_key( $args['id'] ) . ']" clas="' . $class . '" name="edd_settings[' . esc_attr( $args['id'] ) . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
1918
  $html .= '<span>&nbsp;<input type="button" class="edd_settings_upload_button button-secondary" value="' . __( 'Upload File', 'easy-digital-downloads' ) . '"/></span>';
1919
  $html .= '<label for="edd_settings[' . edd_sanitize_key( $args['id'] ) . ']"> ' . wp_kses_post( $args['desc'] ) . '</label>';
1920
 
1914
  $class = edd_sanitize_html_class( $args['field_class'] );
1915
 
1916
  $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1917
+ $html = '<input type="text" class="' . sanitize_html_class( $size ) . '-text" id="edd_settings[' . edd_sanitize_key( $args['id'] ) . ']" class="' . $class . '" name="edd_settings[' . esc_attr( $args['id'] ) . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
1918
  $html .= '<span>&nbsp;<input type="button" class="edd_settings_upload_button button-secondary" value="' . __( 'Upload File', 'easy-digital-downloads' ) . '"/></span>';
1919
  $html .= '<label for="edd_settings[' . edd_sanitize_key( $args['id'] ) . ']"> ' . wp_kses_post( $args['desc'] ) . '</label>';
1920
 
includes/admin/tracking.php CHANGED
@@ -7,7 +7,7 @@
7
  * @copyright Copyright (c) 2015, Pippin Williamson
8
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
  * @since 1.8.2
10
- */
11
 
12
  // Exit if accessed directly
13
  if ( !defined( 'ABSPATH' ) ) exit;
@@ -98,6 +98,7 @@ class EDD_Tracking {
98
 
99
  $data['active_plugins'] = $active_plugins;
100
  $data['inactive_plugins'] = $plugins;
 
101
  $data['products'] = wp_count_posts( 'download' )->publish;
102
  $data['download_label'] = edd_get_label_singular( true );
103
  $data['locale'] = ( $data['wp_version'] >= 4.7 ) ? get_user_locale() : get_locale();
@@ -264,9 +265,9 @@ class EDD_Tracking {
264
  $source = substr( md5( get_bloginfo( 'name' ) ), 0, 10 );
265
  $extensions_url = 'https://easydigitaldownloads.com/downloads/?utm_source=' . $source . '&utm_medium=admin&utm_term=notice&utm_campaign=EDDUsageTracking';
266
  echo '<div class="updated"><p>';
267
- echo sprintf( __( 'Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and our newsletter and immediately be emailed a discount to the EDD shop, valid towards the <a href="%s" target="_blank">purchase of extensions</a>. No sensitive data is tracked.', 'easy-digital-downloads' ), $extensions_url );
268
- echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'easy-digital-downloads' ) . '</a>';
269
- echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'easy-digital-downloads' ) . '</a>';
270
  echo '</p></div>';
271
  }
272
  }
7
  * @copyright Copyright (c) 2015, Pippin Williamson
8
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
  * @since 1.8.2
10
+ */
11
 
12
  // Exit if accessed directly
13
  if ( !defined( 'ABSPATH' ) ) exit;
98
 
99
  $data['active_plugins'] = $active_plugins;
100
  $data['inactive_plugins'] = $plugins;
101
+ $data['active_gateways'] = array_keys( edd_get_enabled_payment_gateways() );
102
  $data['products'] = wp_count_posts( 'download' )->publish;
103
  $data['download_label'] = edd_get_label_singular( true );
104
  $data['locale'] = ( $data['wp_version'] >= 4.7 ) ? get_user_locale() : get_locale();
265
  $source = substr( md5( get_bloginfo( 'name' ) ), 0, 10 );
266
  $extensions_url = 'https://easydigitaldownloads.com/downloads/?utm_source=' . $source . '&utm_medium=admin&utm_term=notice&utm_campaign=EDDUsageTracking';
267
  echo '<div class="updated"><p>';
268
+ echo sprintf( __( 'Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and our newsletter and immediately be emailed a discount to the EDD shop, valid towards the <a href="%s" target="_blank">purchase of extensions</a>. No sensitive data is tracked.', 'easy-digital-downloads' ), $extensions_url );
269
+ echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'easy-digital-downloads' ) . '</a>';
270
+ echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'easy-digital-downloads' ) . '</a>';
271
  echo '</p></div>';
272
  }
273
  }
includes/class-edd-register-meta.php CHANGED
@@ -460,6 +460,11 @@ class EDD_Register_Meta {
460
  function sanitize_files( $files = array() ) {
461
  $files = $this->remove_blank_rows( $files );
462
 
 
 
 
 
 
463
  // Clean up filenames to ensure whitespaces are stripped
464
  foreach( $files as $id => $file ) {
465
 
460
  function sanitize_files( $files = array() ) {
461
  $files = $this->remove_blank_rows( $files );
462
 
463
+ // Files should always be in array format, even when there are none.
464
+ if ( ! is_array( $files ) ) {
465
+ $files = array();
466
+ }
467
+
468
  // Clean up filenames to ensure whitespaces are stripped
469
  foreach( $files as $id => $file ) {
470
 
includes/class-edd-session.php CHANGED
@@ -361,6 +361,16 @@ class EDD_Session {
361
  $start_session = false;
362
  }
363
 
 
 
 
 
 
 
 
 
 
 
364
  }
365
 
366
  return apply_filters( 'edd_start_session', $start_session );
361
  $start_session = false;
362
  }
363
 
364
+ if( is_admin() && false === strpos( $uri, 'wp-admin/admin-ajax.php' ) ) {
365
+ // We do not want to start sessions in the admin unless we're processing an ajax request
366
+ $start_session = false;
367
+ }
368
+
369
+ if( false !== strpos( $uri, 'wp_scrape_key' ) ) {
370
+ // Starting sessions while saving the file editor can break the save process, so don't start
371
+ $start_session = false;
372
+ }
373
+
374
  }
375
 
376
  return apply_filters( 'edd_start_session', $start_session );
includes/process-download.php CHANGED
@@ -262,9 +262,13 @@ function edd_process_download() {
262
 
263
  } elseif ( $direct && ( stristr( getenv( 'SERVER_SOFTWARE' ), 'nginx' ) || stristr( getenv( 'SERVER_SOFTWARE' ), 'cherokee' ) ) ) {
264
 
265
- // We need a path relative to the domain
266
- $file_path = str_ireplace( realpath( $_SERVER['DOCUMENT_ROOT'] ), '', $file_path );
267
- header( "X-Accel-Redirect: /$file_path" );
 
 
 
 
268
 
269
  }
270
 
262
 
263
  } elseif ( $direct && ( stristr( getenv( 'SERVER_SOFTWARE' ), 'nginx' ) || stristr( getenv( 'SERVER_SOFTWARE' ), 'cherokee' ) ) ) {
264
 
265
+ $ignore_x_accel_redirect_header = apply_filters( 'edd_ignore_x_accel_redirect', false );
266
+
267
+ if ( ! $ignore_x_accel_redirect_header ) {
268
+ // We need a path relative to the domain
269
+ $file_path = str_ireplace( realpath( $_SERVER['DOCUMENT_ROOT'] ), '', $file_path );
270
+ header( "X-Accel-Redirect: /$file_path" );
271
+ }
272
 
273
  }
274
 
languages/easy-digital-downloads.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2017 Easy Digital Downloads
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Easy Digital Downloads 2.8.16\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
- "POT-Creation-Date: 2017-12-21 21:34:32+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: WP-Translations (http://wp-translations.org/)\n"
13
  "Language-Team: WP-Translations <wpt@wp-translations.org>\n"
14
  "Language: en_US\n"
@@ -96,7 +96,7 @@ msgstr ""
96
  #: includes/emails/actions.php:53 includes/emails/template.php:243
97
  #: includes/error-tracking.php:40 includes/gateways/functions.php:221
98
  #: includes/gateways/manual.php:33 includes/gateways/paypal-standard.php:168
99
- #: includes/process-download.php:289 includes/process-download.php:822
100
  #: includes/query-filters.php:48 includes/user-functions.php:880
101
  #: includes/user-functions.php:905 includes/user-functions.php:958
102
  msgid "Error"
@@ -915,7 +915,6 @@ msgstr ""
915
  #: includes/admin/downloads/dashboard-columns.php:35
916
  #: includes/admin/reporting/class-download-reports-table.php:111
917
  #: includes/admin/reporting/export/class-batch-export-downloads.php:58
918
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:66
919
  #: includes/admin/reporting/graphing.php:334
920
  #: includes/admin/reporting/graphing.php:635
921
  #: includes/admin/reporting/logs.php:145
@@ -1920,19 +1919,16 @@ msgid "Refunded"
1920
  msgstr ""
1921
 
1922
  #: includes/admin/payments/class-payments-table.php:254
1923
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:68
1924
  #: includes/payments/functions.php:754
1925
  msgid "Revoked"
1926
  msgstr ""
1927
 
1928
  #: includes/admin/payments/class-payments-table.php:255
1929
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:70
1930
  #: includes/payments/functions.php:752
1931
  msgid "Failed"
1932
  msgstr ""
1933
 
1934
  #: includes/admin/payments/class-payments-table.php:256
1935
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:69
1936
  #: includes/payments/functions.php:753
1937
  msgid "Abandoned"
1938
  msgstr ""
@@ -2787,27 +2783,23 @@ msgstr ""
2787
  msgid "SKU"
2788
  msgstr ""
2789
 
2790
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:65
2791
  msgid "Monthly Sales Activity"
2792
  msgstr ""
2793
 
2794
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:67
2795
- msgid "Refunds"
2796
  msgstr ""
2797
 
2798
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:71
2799
- msgid "Cancelled"
2800
- msgstr ""
2801
-
2802
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:72
2803
  msgid "Net Activity"
2804
  msgstr ""
2805
 
2806
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:98
2807
- msgid "Count"
2808
  msgstr ""
2809
 
2810
- #: includes/admin/reporting/export/class-batch-export-earnings-report.php:98
2811
  msgid "Gross Amount"
2812
  msgstr ""
2813
 
@@ -4728,7 +4720,7 @@ msgstr ""
4728
  msgid "Copy Entire Log"
4729
  msgstr ""
4730
 
4731
- #: includes/admin/tracking.php:267
4732
  msgid ""
4733
  "Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and "
4734
  "our newsletter and immediately be emailed a discount to the EDD shop, valid "
@@ -4736,11 +4728,11 @@ msgid ""
4736
  "sensitive data is tracked."
4737
  msgstr ""
4738
 
4739
- #: includes/admin/tracking.php:268
4740
  msgid "Allow"
4741
  msgstr ""
4742
 
4743
- #: includes/admin/tracking.php:269
4744
  msgid "Do not allow"
4745
  msgstr ""
4746
 
@@ -6063,7 +6055,7 @@ msgid ""
6063
  "of a purchase. HTML is accepted. Available template tags:"
6064
  msgstr ""
6065
 
6066
- #: includes/deprecated-functions.php:517 includes/process-download.php:822
6067
  msgid "Sorry but you have hit your download limit for this file."
6068
  msgstr ""
6069
 
@@ -7121,23 +7113,23 @@ msgstr ""
7121
  msgid "File download error"
7122
  msgstr ""
7123
 
7124
- #: includes/process-download.php:288
7125
  msgid "You do not have permission to download this file"
7126
  msgstr ""
7127
 
7128
- #: includes/process-download.php:289
7129
  msgid "Purchase Verification Failed"
7130
  msgstr ""
7131
 
7132
- #: includes/process-download.php:898
7133
  msgid "Invalid file"
7134
  msgstr ""
7135
 
7136
- #: includes/process-download.php:905
7137
  msgid "The requested file could not be found. Error 404."
7138
  msgstr ""
7139
 
7140
- #: includes/process-download.php:906
7141
  msgid "File not found"
7142
  msgstr ""
7143
 
@@ -7427,6 +7419,14 @@ msgstr ""
7427
  msgid "Error removing email address from profile. Please try again later."
7428
  msgstr ""
7429
 
 
 
 
 
 
 
 
 
7430
  #: includes/template-functions.php:143
7431
  msgid "Free"
7432
  msgstr ""
1
+ # Copyright (C) 2018 Easy Digital Downloads
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Easy Digital Downloads 2.8.17\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
+ "POT-Creation-Date: 2018-02-06 18:16:29+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: WP-Translations (http://wp-translations.org/)\n"
13
  "Language-Team: WP-Translations <wpt@wp-translations.org>\n"
14
  "Language: en_US\n"
96
  #: includes/emails/actions.php:53 includes/emails/template.php:243
97
  #: includes/error-tracking.php:40 includes/gateways/functions.php:221
98
  #: includes/gateways/manual.php:33 includes/gateways/paypal-standard.php:168
99
+ #: includes/process-download.php:293 includes/process-download.php:826
100
  #: includes/query-filters.php:48 includes/user-functions.php:880
101
  #: includes/user-functions.php:905 includes/user-functions.php:958
102
  msgid "Error"
915
  #: includes/admin/downloads/dashboard-columns.php:35
916
  #: includes/admin/reporting/class-download-reports-table.php:111
917
  #: includes/admin/reporting/export/class-batch-export-downloads.php:58
 
918
  #: includes/admin/reporting/graphing.php:334
919
  #: includes/admin/reporting/graphing.php:635
920
  #: includes/admin/reporting/logs.php:145
1919
  msgstr ""
1920
 
1921
  #: includes/admin/payments/class-payments-table.php:254
 
1922
  #: includes/payments/functions.php:754
1923
  msgid "Revoked"
1924
  msgstr ""
1925
 
1926
  #: includes/admin/payments/class-payments-table.php:255
 
1927
  #: includes/payments/functions.php:752
1928
  msgid "Failed"
1929
  msgstr ""
1930
 
1931
  #: includes/admin/payments/class-payments-table.php:256
 
1932
  #: includes/payments/functions.php:753
1933
  msgid "Abandoned"
1934
  msgstr ""
2783
  msgid "SKU"
2784
  msgstr ""
2785
 
2786
+ #: includes/admin/reporting/export/class-batch-export-earnings-report.php:63
2787
  msgid "Monthly Sales Activity"
2788
  msgstr ""
2789
 
2790
+ #: includes/admin/reporting/export/class-batch-export-earnings-report.php:64
2791
+ msgid "Gross Activity"
2792
  msgstr ""
2793
 
2794
+ #: includes/admin/reporting/export/class-batch-export-earnings-report.php:73
 
 
 
 
2795
  msgid "Net Activity"
2796
  msgstr ""
2797
 
2798
+ #: includes/admin/reporting/export/class-batch-export-earnings-report.php:149
2799
+ msgid "Order Count"
2800
  msgstr ""
2801
 
2802
+ #: includes/admin/reporting/export/class-batch-export-earnings-report.php:150
2803
  msgid "Gross Amount"
2804
  msgstr ""
2805
 
4720
  msgid "Copy Entire Log"
4721
  msgstr ""
4722
 
4723
+ #: includes/admin/tracking.php:268
4724
  msgid ""
4725
  "Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and "
4726
  "our newsletter and immediately be emailed a discount to the EDD shop, valid "
4728
  "sensitive data is tracked."
4729
  msgstr ""
4730
 
4731
+ #: includes/admin/tracking.php:269
4732
  msgid "Allow"
4733
  msgstr ""
4734
 
4735
+ #: includes/admin/tracking.php:270
4736
  msgid "Do not allow"
4737
  msgstr ""
4738
 
6055
  "of a purchase. HTML is accepted. Available template tags:"
6056
  msgstr ""
6057
 
6058
+ #: includes/deprecated-functions.php:517 includes/process-download.php:826
6059
  msgid "Sorry but you have hit your download limit for this file."
6060
  msgstr ""
6061
 
7113
  msgid "File download error"
7114
  msgstr ""
7115
 
7116
+ #: includes/process-download.php:292
7117
  msgid "You do not have permission to download this file"
7118
  msgstr ""
7119
 
7120
+ #: includes/process-download.php:293
7121
  msgid "Purchase Verification Failed"
7122
  msgstr ""
7123
 
7124
+ #: includes/process-download.php:902
7125
  msgid "Invalid file"
7126
  msgstr ""
7127
 
7128
+ #: includes/process-download.php:909
7129
  msgid "The requested file could not be found. Error 404."
7130
  msgstr ""
7131
 
7132
+ #: includes/process-download.php:910
7133
  msgid "File not found"
7134
  msgstr ""
7135
 
7419
  msgid "Error removing email address from profile. Please try again later."
7420
  msgstr ""
7421
 
7422
+ #: includes/template-actions.php:19
7423
+ msgid "You need to log in to edit your profile."
7424
+ msgstr ""
7425
+
7426
+ #: includes/template-actions.php:32
7427
+ msgid "You are already logged in"
7428
+ msgstr ""
7429
+
7430
  #: includes/template-functions.php:143
7431
  msgid "Free"
7432
  msgstr ""
readme.txt CHANGED
@@ -5,8 +5,8 @@ Contributors: easydigitaldownloads, mordauk, sunnyratilal, chriscct7, section214
5
  Donate link: https://easydigitaldownloads.com/donate/
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce, ecommerce, ebook
7
  Requires at least: 4.4
8
- Tested up to: 4.9.1
9
- Stable Tag: 2.8.17
10
  License: GNU Version 2 or Any Later Version
11
 
12
  The easiest way to sell digital products with WordPress.
@@ -190,10 +190,19 @@ Yes. Easy Digital Downloads also includes default support for Amazon Payments an
190
 
191
  == Changelog ==
192
 
 
 
 
 
 
 
 
 
 
193
  = 2.8.17, January 1, 2018 =
194
 
195
  * Fix: Reverted Schema microdata change from SPAN to DIV tag as it broke some layouts
196
- * Tweak: IP addresses on payment View Order Details screens now links to ipinfo
197
 
198
  = 2.8.16, December 21, 2017 =
199
  * Fix: Hardened EDD actions for use with WP Cron.
5
  Donate link: https://easydigitaldownloads.com/donate/
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce, ecommerce, ebook
7
  Requires at least: 4.4
8
+ Tested up to: 4.9.4
9
+ Stable Tag: 2.8.18
10
  License: GNU Version 2 or Any Later Version
11
 
12
  The easiest way to sell digital products with WordPress.
190
 
191
  == Changelog ==
192
 
193
+ = 2.8.18, February 6, 2018 =
194
+
195
+ * Fix: Earnings report was incomplete and did not allow adding additional statuses.
196
+ * Fix: Incorrect HTML attribute on the upload modal.
197
+ * Fix: WordPress file editor was not working when Easy Digital Downloads was not active.
198
+ * Fix: Forced file data to be sanitized as an array.
199
+ * New: Added new filter to allow disabling X-Accel-Redirect when downloading files.
200
+ * New: Enabled gateways are now included in the opt-in telemetry data.
201
+
202
  = 2.8.17, January 1, 2018 =
203
 
204
  * Fix: Reverted Schema microdata change from SPAN to DIV tag as it broke some layouts
205
+ * Tweak: IP addresses on payment View Order Details screens now links to ipinfo
206
 
207
  = 2.8.16, December 21, 2017 =
208
  * Fix: Hardened EDD actions for use with WP Cron.