Skip to content

Commit

Permalink
Merge pull request #9621 from awesomemotive/release/3.1.0.6
Browse files Browse the repository at this point in the history
Adding EDD 3.1.0.6
  • Loading branch information
cklosowski committed Feb 10, 2023
2 parents be58f6f + e1d9aba commit 2edf84d
Show file tree
Hide file tree
Showing 23 changed files with 228 additions and 145 deletions.
2 changes: 1 addition & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Support Ticket

We recommend all users with support questions email us via the support form found at [easydigitaldownloads.com/support/](https://easydigitaldownloads.com/support/). GitHub is used for core development only, and is not the place to seek help or report non-developer issues for Easy Digital Downloads, or EDD addons or themes.

Before opening a support ticket, please also review our [documentation](http://docs.easydigitaldownloads.com) for assistance with common issues and FAQs.
Before opening a support ticket, please also review our [documentation](https://easydigitaldownloads.com/docs) for assistance with common issues and FAQs.

If reporting a bug, please be as descriptive as possible and include links to screenshots or screenshares that demonstrate the issue.
2 changes: 1 addition & 1 deletion easy-digital-downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The easiest way to sell digital products with WordPress.
* Author: Easy Digital Downloads
* Author URI: https://easydigitaldownloads.com
* Version: 3.1.0.5
* Version: 3.1.0.6
* Text Domain: easy-digital-downloads
* Domain Path: languages
* Requires PHP: 5.6
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-edd-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private function add_system_notices() {
'is_dismissible' => false,
'message' => array(
sprintf( __( 'The files in %s are not currently protected.', 'easy-digital-downloads' ), '<code>' . $upload_directory . '</code>' ),
__( 'To protect them, you must add this <a href="https://docs.easydigitaldownloads.com/article/682-protected-download-files-on-nginx">NGINX redirect rule</a>.', 'easy-digital-downloads' ),
__( 'To protect them, you must add this <a href="https://easydigitaldownloads.com/docs/download-files-not-protected-on-nginx/">NGINX redirect rule</a>.', 'easy-digital-downloads' ),
sprintf( __( 'If you have already done this, or it does not apply to your site, you may permenently %s.', 'easy-digital-downloads' ), '<a href="' . esc_url( $dismiss_notice_url ) . '">' . __( 'dismiss this notice', 'easy-digital-downloads' ) . '</a>' )
)
) );
Expand Down
12 changes: 8 additions & 4 deletions includes/admin/downloads/contextual-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ function edd_downloads_contextual_help() {
);

$screen->add_help_tab( array(
'id' => 'edd-purchase-shortcode',
'title' => __( 'Purchase Shortcode', 'easy-digital-downloads' ),
'content' =>
'id' => 'edd-purchase-shortcode',
'title' => __( 'Purchase Shortcode', 'easy-digital-downloads' ),
'content' =>
'<p>' . __( '<strong>Purchase Shortcode</strong> - If the automatic output of the purchase button has been disabled via the Download Configuration box, a shortcode can be used to output the button or link.', 'easy-digital-downloads' ) . '</p>' .
'<p><code>[purchase_link id="#" price="1" text="Add to Cart" color="blue"]</code></p>' .
'<ul>
Expand All @@ -109,7 +109,11 @@ function edd_downloads_contextual_help() {
<li><strong>color</strong> - <em>' . implode( '</em> | <em>', $colors ) . '</em></li>
<li><strong>class</strong> - ' . __( 'One or more custom CSS classes you want applied to the button.', 'easy-digital-downloads' ) . '</li>
</ul>' .
'<p>' . sprintf( __( 'For more information, see <a href="%s">using Shortcodes</a> on the WordPress.org Codex or <a href="%s">Easy Digital Downloads Documentation</a>', 'easy-digital-downloads' ), 'https://codex.wordpress.org/Shortcode', 'https://docs.easydigitaldownloads.com/article/229-purchaselink' ) . '</p>'
'<p>' . sprintf(
__( 'For more information, see <a href="%s">using Shortcodes</a> on the WordPress.org Codex or <a href="%s">Easy Digital Downloads Documentation</a>', 'easy-digital-downloads' ),
'https://codex.wordpress.org/Shortcode',
'https://easydigitaldownloads.com/docs/purchase_link-shortcode/'
) . '</p>'
) );

/**
Expand Down
21 changes: 11 additions & 10 deletions includes/admin/reporting/export/class-batch-export-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ public function get_data() {
$data = array();

$args = array(
'number' => 30,
'offset' => ( $this->step * 30 ) - 30,
'status' => $this->status,
'order' => 'ASC',
'orderby' => 'date_created',
'type' => 'sale',
'status__not_in' => array( 'trash' ),
'number' => 30,
'offset' => ( $this->step * 30 ) - 30,
'status' => $this->status,
'order' => 'ASC',
'orderby' => 'date_created',
'type' => 'sale',
);

if ( ! empty( $this->start ) || ! empty( $this->end ) ) {
$args['date_query'] = $this->get_date_query();
}

if ( 'all' === $args['status'] ) {
if ( in_array( $args['status'], array( 'any', 'all' ), true ) ) {
unset( $args['status'] );
$args['status__not_in'] = array( 'trash' );
}

$orders = edd_get_orders( $args );
Expand Down Expand Up @@ -241,14 +241,15 @@ public function get_data() {
public function get_percentage_complete() {
$args = array(
'fields' => 'ids',
'status' => $this->status,
);

if ( ! empty( $this->start ) || ! empty( $this->end ) ) {
$args['date_query'] = $this->get_date_query();
}

if ( 'any' !== $this->status ) {
$args['status'] = $this->status;
if ( in_array( $args['status'], array( 'any', 'all' ), true ) ) {
unset( $args['status'] );
}

$total = edd_count_orders( $args );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,20 @@ public function get_data() {
$data = array();

$args = array(
'number' => 30,
'offset' => ( $this->step * 30 ) - 30,
'status' => $this->status,
'order' => 'ASC',
'orderby' => 'date_created',
'status__not_in' => array( 'trash' ),
'number' => 30,
'offset' => ( $this->step * 30 ) - 30,
'status' => $this->status,
'order' => 'ASC',
'orderby' => 'date_created',
);

if ( ! empty( $this->start ) || ! empty( $this->end ) ) {
$args['date_created_query'] = $this->get_date_query();
}

if ( 'any' === $args['status'] || 'all' === $args['status'] ) {
if ( in_array( $args['status'], array( 'any', 'all' ), true ) ) {
unset( $args['status'] );
$args['status__not_in'] = array( 'trash' );
}

add_filter( 'edd_orders_query_clauses', array( $this, 'query_clauses' ), 10, 2 );
Expand Down Expand Up @@ -236,14 +236,15 @@ public function get_data() {
public function get_percentage_complete() {
$args = array(
'fields' => 'ids',
'status' => $this->status,
);

if ( ! empty( $this->start ) || ! empty( $this->end ) ) {
$args['date_created_query'] = $this->get_date_query();
}

if ( 'any' !== $this->status ) {
$args['status'] = $this->status;
if ( in_array( $args['status'], array( 'any', 'all' ), true ) ) {
unset( $args['status'] );
}

$total = edd_count_orders( $args );
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/settings/register-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ function edd_get_registered_settings() {
'tax_help' => array(
'id' => 'tax_help',
'name' => '',
'desc' => sprintf( __( 'Visit the <a href="%s" target="_blank">Tax setup documentation</a> for further information. <p class="description">If you need VAT support, there are options listed on the documentation page.</p>', 'easy-digital-downloads' ), 'https://docs.easydigitaldownloads.com/article/238-tax-settings' ),
'desc' => sprintf( __( 'Visit the <a href="%s" target="_blank">Tax setup documentation</a> for further information. <p class="description">If you need VAT support, there are options listed on the documentation page.</p>', 'easy-digital-downloads' ), 'https://easydigitaldownloads.com/docs/tax-settings/' ),
'type' => 'descriptive_text',
),
'prices_include_tax' => array(
Expand Down Expand Up @@ -1837,9 +1837,9 @@ function edd_get_registered_settings_sections() {
*/
function edd_get_pages( $force = false ) {

$pages_options = array( '' => '' ); // Blank option
$pages_options = array( '' => __( 'None', 'easy-digital-downloads' ) );

if ( ( ! isset( $_GET['page'] ) || 'edd-settings' != $_GET['page'] ) && ! $force ) {
if ( ( ! isset( $_GET['page'] ) || 'edd-settings' !== $_GET['page'] ) && ! $force ) {
return $pages_options;
}

Expand Down
4 changes: 2 additions & 2 deletions includes/admin/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ class="button-secondary"/>
<?php
printf(
__( 'Each column loaded from the CSV needs to be mapped to an order field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See <a href="%s" target="_blank">this guide</a> for assistance with importing payment records.', 'easy-digital-downloads' ),
'https://docs.easydigitaldownloads.com/category/1337-importexport'
'https://easydigitaldownloads.com/docs/importing-exporting-orders/'
);
?>
</p>
Expand Down Expand Up @@ -799,7 +799,7 @@ class="button-secondary"/>
<?php
printf(
__( 'Each column loaded from the CSV needs to be mapped to a Download product field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See <a href="%s" target="_blank">this guide</a> for assistance with importing Download products.', 'easy-digital-downloads' ),
'https://docs.easydigitaldownloads.com/category/1337-importexport'
'https://easydigitaldownloads.com/docs/importing-exporting-products/'
);
?>
</p>
Expand Down
2 changes: 1 addition & 1 deletion includes/class-easy-digital-downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private function setup_constants() {

// Plugin version.
if ( ! defined( 'EDD_VERSION' ) ) {
define( 'EDD_VERSION', '3.1.0.5' );
define( 'EDD_VERSION', '3.1.0.6' );
}

// Plugin Root File.
Expand Down
2 changes: 0 additions & 2 deletions includes/database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,4 @@ This table's data is intended to be immutable. However, some column data is also
| total | This is the total amount of the order. |
| date_created | The date this row was created. |
| date_modified | The date this row was last modified. |
| date_completed | The date the order was marked as completed by the gateway. |
| date_refundable | The date after which that the order can no longer be reunded. |
| uuid | A unique identifying string representing this row. |
4 changes: 2 additions & 2 deletions includes/gateways/paypal-standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function edd_register_paypal_gateway_settings( $gateway_settings ) {

$pdt_desc = sprintf(
__( 'Enter your PayPal Identity Token in order to enable Payment Data Transfer (PDT). This allows payments to be verified without relying on the PayPal IPN. See our <a href="%s" target="_blank">documentation</a> for further information.', 'easy-digital-downloads' ),
'https://docs.easydigitaldownloads.com/article/918-paypal-standard'
'https://easydigitaldownloads.com/docs/paypal-legacy-gateways-standard-express-pro-advanced/'
);

$paypal_settings['paypal_identify_token'] = array(
Expand All @@ -84,7 +84,7 @@ function edd_register_paypal_gateway_settings( $gateway_settings ) {

$desc = sprintf(
__( 'If you are unable to use Payment Data Transfer and payments are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying purchases. See our <a href="%s" target="_blank">FAQ</a> for further information.', 'easy-digital-downloads' ),
'https://docs.easydigitaldownloads.com/article/190-payments-not-marked-as-complete'
'https://easydigitaldownloads.com/docs/paypal-payments-not-marked-as-complete/'
);

$paypal_settings['disable_paypal_verification'] = array(
Expand Down
12 changes: 8 additions & 4 deletions includes/gateways/paypal/admin/connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ function process_connect() {
'country_code' => edd_get_shop_country(),
'currency_code' => edd_get_currency(),
'return_url' => get_settings_url()
) )
) ),
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
) );

if ( is_wp_error( $response ) ) {
Expand Down Expand Up @@ -245,7 +246,8 @@ function get_and_save_credentials() {
'grant_type' => 'authorization_code',
'code' => $_POST['auth_code'],
'code_verifier' => $partner_details->nonce
)
),
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
) );

if ( is_wp_error( $response ) ) {
Expand All @@ -272,7 +274,8 @@ function get_and_save_credentials() {
'Authorization' => sprintf( 'Bearer %s', $body->access_token ),
'Content-Type' => 'application/json',
'timeout' => 15
)
),
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
) );

if ( is_wp_error( $response ) ) {
Expand Down Expand Up @@ -748,7 +751,8 @@ function get_merchant_status( $merchant_id, $nonce = '' ) {
'mode' => edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE,
'merchant_id' => $merchant_id,
'nonce' => $nonce
) )
) ),
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
) );

$response_code = wp_remote_retrieve_response_code( $response );
Expand Down
2 changes: 1 addition & 1 deletion includes/gateways/paypal/admin/notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
echo wp_kses( sprintf(
/* Translators: %1$s opening anchor tag; %2$s closing anchor tag */
__( 'A new, improved PayPal experience is now available in Easy Digital Downloads. You can learn more about the new integration in %1$sour documentation%2$s.', 'easy-digital-downloads' ),
'<a href="https://docs.easydigitaldownloads.com/article/2410-paypal#migration" target="_blank">',
'<a href="https://easydigitaldownloads.com/docs/paypal-setup/#upgrade" target="_blank">',
'</a>'
), array( 'a' => array( 'href' => true, 'target' => true ) ) );
?>
Expand Down
4 changes: 2 additions & 2 deletions includes/gateways/paypal/admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function documentation_settings_field() {
<?php
echo wp_kses( sprintf(
__( 'To learn more about the PayPal gateway, visit <a href="%s" target="_blank">our documentation</a>.', 'easy-digital-downloads' ),
'https://docs.easydigitaldownloads.com/article/2410-paypal'
'https://easydigitaldownloads.com/docs/paypal-setup/'
), array( 'a' => array( 'href' => true, 'target' => true ) ) )
?>
</p>
Expand All @@ -147,7 +147,7 @@ function documentation_settings_field() {
<?php
echo wp_kses( sprintf(
__( 'PayPal requires an SSL certificate to accept payments. You can learn more about obtaining an SSL certificate in our <a href="%s" target="_blank">SSL setup article</a>.', 'easy-digital-downloads' ),
'https://docs.easydigitaldownloads.com/article/994-how-to-set-up-ssl'
'https://easydigitaldownloads.com/docs/do-i-need-an-ssl-certificate/'
), array( 'a' => array( 'href' => true, 'target' => true ) ) );
?>
</p>
Expand Down
3 changes: 2 additions & 1 deletion includes/gateways/paypal/class-paypal-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ private function generate_access_token() {
),
'body' => array(
'grant_type' => 'client_credentials'
)
),
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
) );

$body = json_decode( wp_remote_retrieve_body( $response ) );
Expand Down
28 changes: 22 additions & 6 deletions includes/gateways/paypal/ipn.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ function listen_for_ipn() {
'post' => '/cgi-bin/webscr HTTP/1.1',

),
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
);

// Get response.
Expand Down Expand Up @@ -244,14 +245,29 @@ function listen_for_ipn() {

ipn_debug_log( 'subscription ' . $subscription->id . ': preparing to insert renewal payment' );

// when a user makes a recurring payment.
$payment_id = $subscription->add_payment(
array(
'amount' => $amount,
'transaction_id' => $transaction_id,
)
// Build the array for adding a subscription order.
$subscription_payment_args = array(
'amount' => $amount,
'transaction_id' => $transaction_id,
);

// Create a DateTime object of the payment_date, so we can adjust as needed.
$subscription_payment_date = new \DateTime( $posted['payment_date'] );

// To make sure we don't inadverntatly fail, make sure the date was parsed correctly before working with it.
if ( $subscription_payment_date instanceof \DateTime ) {
/**
* Convert to GMT, as that is what EDD 3.0 expects the times to be in.
*/
$subscription_payment_date->setTimezone( new \DateTimeZone( 'GMT' ) );

// Now add the date into the arguments for creating the renewal payment.
$subscription_payment_args['date'] = $subscription_payment_date->format( 'Y-m-d H:i:s' );
}

// when a user makes a recurring payment.
$payment_id = $subscription->add_payment( $subscription_payment_args );

if ( ! empty( $payment_id ) ) {
ipn_debug_log( 'subscription ' . $subscription->id . ': renewal payment was recorded successfully, preparing to renew subscription' );
$subscription->renew( $payment_id );
Expand Down
24 changes: 11 additions & 13 deletions includes/process-purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -731,11 +731,11 @@ function edd_purchase_form_validate_user_login() {

// Start an array to collect valid user data.
$valid_user_data = array(
'user_id' => 0
'user_id' => 0,
);

$user_login = ! empty( $_POST['edd_user_login'] ) ? sanitize_text_field( $_POST['edd_user_login'] ) : '';
$user_pass = ! empty( $_POST['edd_user_pass'] ) ? sanitize_text_field( $_POST['edd_user_pass'] ) : '';
$user_pass = ! empty( $_POST['edd_user_pass'] ) ? $_POST['edd_user_pass'] : '';

// Username.
if ( empty( $user_login ) && edd_no_guest_checkout() ) {
Expand All @@ -747,19 +747,17 @@ function edd_purchase_form_validate_user_login() {

if ( ! $user instanceof WP_User ) {
return $valid_user_data;
} else {
// Re-populate the valid user data array.
$valid_user_data = array(
'user_id' => $user->ID,
'user_login' => $user->user_login,
'user_email' => $user->user_email,
'user_first' => $user->first_name,
'user_last' => $user->last_name,
'user_pass' => $user_pass,
);
}

return (array) $valid_user_data;
// Populate the valid user data array.
return array(
'user_id' => $user->ID,
'user_login' => $user->user_login,
'user_email' => $user->user_email,
'user_first' => $user->first_name,
'user_last' => $user->last_name,
'user_pass' => $user_pass,
);
}

/**
Expand Down
Loading

0 comments on commit 2edf84d

Please sign in to comment.