diff --git a/assets/src/css/admin/export.scss b/assets/src/css/admin/export.scss index 0ebdf0f09a..af5b205079 100644 --- a/assets/src/css/admin/export.scss +++ b/assets/src/css/admin/export.scss @@ -30,40 +30,6 @@ } } - ul.give-export-option { - border: 1px solid #e5e5e5; - display: flex; - margin: 0; - - li.give-export-option-fields { - width: 33%; - - ul { - li{ - padding-left: 25px; - } - - li.give-export-option-label { - border-bottom: 1px solid #e5e5e5; - padding: 15px 0 15px 0; - span { - margin: 15px 15px 15px 25px; - font-size: 15px; - font-weight: 500; - } - } - - li.give-export-option-start { - margin-top: 20px; - } - - li:last-child { - margin-bottom: 20px; - } - } - } - } - p.give-field-description { display: table; width: 100%; @@ -88,6 +54,49 @@ } } } + + .give-export-option { + display: flex; + flex-flow: row wrap; + border-top: 1px solid #e5e5e5; + border-left: 1px solid #e5e5e5; + + ul { + margin-bottom: 1rem; + + li { + position: relative; + margin-bottom: .70rem; + padding: 0 1rem; + + label { + display: block; + padding-left: 22px; + + input { + position: absolute; + top: 6px; + left: 15px; + } + } + } + + .give-export-option-label { + font-size: 15px; + font-weight: 500; + border-bottom: 1px solid #e5e5e5; + margin-bottom: 1rem; + padding: 1rem; + } + } + + & > li { + border-right: 1px solid #e5e5e5; + border-bottom: 1px solid #e5e5e5; + width: 33%; + margin-bottom: 0; + } + } } .give-export-donors { @@ -132,3 +141,23 @@ border: 1px solid #ddd; } } + +@media only screen and ( max-width: 1080px ) { + .give-tools-setting-page #give-export_donations-form .give-export-option > li { + width: 49.5%; + } +} + +@media only screen and ( max-width: 782px ) { + .give-tools-setting-page #give-export_donations-form .give-export-option > li { + width: 49.5%; + } + + .give-tools-setting-page #give-export_donations-form .give-export-option ul li label { + padding-left: 32px; + } + + .give-tools-setting-page #give-export_donations-form .give-export-option ul li label input { + top: 0; + } +} diff --git a/assets/src/css/admin/settings.scss b/assets/src/css/admin/settings.scss index 0bb7046dfe..c397421bed 100644 --- a/assets/src/css/admin/settings.scss +++ b/assets/src/css/admin/settings.scss @@ -24,6 +24,34 @@ overflow: visible; } + .give-subsubsub { + list-style: none; + margin: 8px 0 0; + padding: 0; + font-size: 13px; + float: left; + color: #666; + + li{ + display: inline-block; + margin: 0; + padding: 0; + white-space: nowrap; + } + + a{ + line-height: 2; + padding: .2em; + text-decoration: none; + } + + a.current { + color: #000; + font-weight: 600; + border: none; + } + } + .cmb2-wrap .cmb-type-checkbox input[type="checkbox"] { display: block; margin-bottom: 5px; @@ -153,6 +181,10 @@ div.give-field-description, display: none; } +.tablenav { + height: auto; +} + // CMB2 Checkbox Revised Styles .cmb-type-checkbox .cmb-td { width: 80%; diff --git a/assets/src/css/frontend/modal.scss b/assets/src/css/frontend/modal.scss index 40193a8773..864fd4e7cd 100644 --- a/assets/src/css/frontend/modal.scss +++ b/assets/src/css/frontend/modal.scss @@ -127,7 +127,6 @@ height: 85vh; overflow-y: auto; - #give-payment-mode-select, #give_purchase_form_wrap { display: block !important; } @@ -136,6 +135,10 @@ .give-btn-modal { display: none !important; } + + .give-form-title { + display: none; + } } .modal-fade-slide .give-modal--slide { diff --git a/assets/src/css/plugins/_settings.scss b/assets/src/css/plugins/_settings.scss index 75eadbc77e..6db070026e 100644 --- a/assets/src/css/plugins/_settings.scss +++ b/assets/src/css/plugins/_settings.scss @@ -11,7 +11,7 @@ $mfp-shadow: 0 0 8px rgba(0, 0, 0, 0.6) !default; // Sh $mfp-popup-padding-left: 8px !default; // Padding from left and from right side $mfp-popup-padding-left-mobile: 6px !default; // Same as above, but is applied when width of window is less than 800px -$mfp-z-index-base: 1040 !default; // Base z-index of popup +$mfp-z-index-base: 999999 !default; // Base z-index of popup // controls $mfp-include-arrows: true !default; // Include styles for nav arrows diff --git a/assets/src/js/admin/admin-scripts.js b/assets/src/js/admin/admin-scripts.js index bf137e0caa..612759d0b8 100644 --- a/assets/src/js/admin/admin-scripts.js +++ b/assets/src/js/admin/admin-scripts.js @@ -58,36 +58,45 @@ var give_setting_edit = false; * @since 1.8.14 */ var give_dismiss_notice = function () { - $('body').on('click', 'button.notice-dismiss', function () { - if ('give-invalid-license' !== jQuery(this).closest('div.give-notice').data('notice-id')) { - give_remove_give_message(); + $( 'body' ).on( 'click', 'button.notice-dismiss', function () { + if ( 'give-invalid-license' !== jQuery( this ).closest( 'div.give-notice' ).data( 'notice-id' ) ) { + give_remove_give_message( jQuery( this ).closest( 'div.give-notice' ).attr( 'id' ) ); } - }); + } ); }; /** * Remove give-message parameter from URL. * * @since 1.8.14 + * @since 2.1.4 Added new param key which remove the multiple message array from URL. + * + * @param key string to remove from url in multiple notices. */ - var give_remove_give_message = function () { + var give_remove_give_message = function ( key ) { var parameter = 'give-message', url = document.location.href, - urlparts = url.split('?'); + urlparts = url.split( '?' ), + key = ( + undefined === key + ) ? '' : key.replace( 'give-', '' ); - if (urlparts.length >= 2) { + if ( urlparts.length >= 2 ) { var urlBase = urlparts.shift(); - var queryString = urlparts.join('?'); + var queryString = urlparts.join( '?' ); + var prefix = encodeURIComponent( parameter ) + '='; + + var pars = queryString.split( /[&;]/g ); + for ( var i = pars.length; i -- > 0; ) { - var prefix = encodeURIComponent(parameter) + '='; - var pars = queryString.split(/[&;]/g); - for (var i = pars.length; i-- > 0;) { - if (pars[i].lastIndexOf(prefix, 0) !== -1) { - pars.splice(i, 1); + if ( pars[i].lastIndexOf( prefix, 0 ) !== - 1 || ( + '' !== key && pars[i].lastIndexOf( 'give-messages', 0 ) !== - 1 && pars[i].match( key + '$' ) + ) ) { + pars.splice( i, 1 ); } } - url = urlBase + '?' + pars.join('&'); - window.history.pushState('', document.title, url); // added this line to push the new url directly to url bar . + url = urlBase + '?' + pars.join( '&' ); + window.history.pushState( '', document.title, url ); // added this line to push the new url directly to url bar . } return url; }; @@ -656,6 +665,12 @@ var give_setting_edit = false; checked_cbs .prev( '.gateways-radio' ) .attr( 'checked', 'checked' ); + + if ( this.checked ) { + radio.removeAttr( 'disabled' ); + } else { + radio.attr( 'disabled', 'disabled' ); + } } else { if ( this.checked ) { radio.removeAttr( 'disabled' ); @@ -1566,7 +1581,7 @@ var give_setting_edit = false; ).render(); }); } - } + }; /** * Admin Status Select Field Change @@ -2436,9 +2451,35 @@ var give_setting_edit = false; sortable_options: { placeholder: 'give-ui-placeholder-state-highlight', start: function (event, ui) { + // Do not allow any row at position 0. + if (ui.item.next().hasClass('give-template')) { + ui.item.next().after(ui.item); + } + + let $rows = $('.give-row', $this).not('.give-template'); + + if ($rows.length) { + $rows.each(function (index, item) { + // Set name for fields. + let $fields = $('input[type="radio"].give-field', $(item)); + + // Preserve radio button values. + if ($fields.length) { + $fields.each(function () { + $(this).attr('data-give-checked', $(this).is(':checked') ); + }); + } + }); + } + $('body').trigger('repeater_field_sorting_start', [ui.item]); }, stop: function (event, ui) { + // Do not allow any row at position 0. + if (ui.item.next().hasClass('give-template')) { + ui.item.next().after(ui.item); + } + $('body').trigger('repeater_field_sorting_stop', [ui.item]); }, update: function (event, ui) { @@ -2447,7 +2488,8 @@ var give_setting_edit = false; ui.item.next().after(ui.item); } - var $rows = $('.give-row', $this).not('.give-template'); + var $rows = $('.give-row', $this).not('.give-template'), + $container = $(this).closest('.give-repeatable-fields-section-wrapper'); if ($rows.length) { var row_count = 1; @@ -2492,6 +2534,14 @@ var give_setting_edit = false; row_count++; }); + window.setTimeout( function () { + // Reset radio button values. + $( 'input[data-give-checked]', $container ).each( function ( index, radio ) { + radio = $( radio ); + radio.prop( 'checked', 'true' === radio.attr( 'data-give-checked' ) ) + } ); + }, 100 ); + // Fire event. $this.trigger('repeater_field_row_reordered', [ui.item]); } diff --git a/assets/src/js/frontend/give-misc.js b/assets/src/js/frontend/give-misc.js index 336771d5e2..3bb7bfd33a 100644 --- a/assets/src/js/frontend/give-misc.js +++ b/assets/src/js/frontend/give-misc.js @@ -93,8 +93,7 @@ jQuery( function( $ ) { } // Button to close notices on front-end. - const give_notice_close = jQuery( '.give-notice-close' ); - give_notice_close.on( 'click', function() { + $('body').on( 'click', '.give-notice-close', function() { $(this).hide(); const notice_container = $(this).closest( '.give_notices' ); notice_container.slideUp(); @@ -200,7 +199,7 @@ window.give_open_form_modal = function ( $form_wrap, $form ) { // Hide .give-hidden and .give-btn-modal if admin only want to show only button. if ( $form_wrap.hasClass( 'give-display-button-only' ) ) { - children = $form.children().not( '.give-hidden, .give-btn-modal' ); + children = $form.children().not( '.give-btn-modal' ); } //Hide all form elements besides the ones required for payment @@ -219,16 +218,17 @@ window.give_open_form_modal = function ( $form_wrap, $form ) { } ); }; - /** * Floating Labels Custom Events */ window.give_fl_trigger = function() { - if ( give_float_labels instanceof FloatLabels ) { - give_float_labels.rebuild(); + window.give_float_labels = 'undefined' === typeof window.give_float_labels ? {} : window.give_float_labels; + + if ( window.give_float_labels instanceof FloatLabels ) { + window.give_float_labels.rebuild(); } else { - var give_float_labels = new FloatLabels( '.float-labels-enabled', { + window.give_float_labels = new FloatLabels( '.float-labels-enabled', { exclude: '#give-amount, .give-select-level, [multiple]', prioritize: 'placeholder', prefix: 'give-fl-', diff --git a/give.php b/give.php index 835e4159e3..0ade7053bb 100644 --- a/give.php +++ b/give.php @@ -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: 2.1.3 + * Version: 2.1.4 * Text Domain: give * Domain Path: /languages * GitHub Plugin URI: https://github.com/WordImpress/Give @@ -395,7 +395,7 @@ private function setup_constants() { // Plugin version if ( ! defined( 'GIVE_VERSION' ) ) { - define( 'GIVE_VERSION', '2.1.3' ); + define( 'GIVE_VERSION', '2.1.4' ); } // Plugin Root File @@ -466,6 +466,7 @@ private function includes() { require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php'; require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php'; require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php'; + require_once GIVE_PLUGIN_DIR . 'includes/class-give-readme-parser.php'; require_once GIVE_PLUGIN_DIR . 'includes/class-give-scripts.php'; require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php'; diff --git a/includes/actions.php b/includes/actions.php index b611c65a78..2e901663a3 100644 --- a/includes/actions.php +++ b/includes/actions.php @@ -331,4 +331,122 @@ function give_update_log_form_id( $args ) { Give()->logs->delete_cache(); } -add_action( 'give_update_log_form_id', 'give_update_log_form_id' ); \ No newline at end of file +add_action( 'give_update_log_form_id', 'give_update_log_form_id' ); + +/** + * Verify addon dependency before addon update + * + * @since 2.1.4 + * + * @param $error + * @param $hook_extra + * + * @return WP_Error + */ +function __give_verify_addon_dependency_before_update( $error, $hook_extra ) { + // Bailout. + if ( is_wp_error( $error ) ) { + return $error; + } + + $plugin_base = strtolower( $hook_extra['plugin'] ); + $licensed_addon = array_map( 'strtolower', Give_License::get_licensed_addons() ); + + // Skip if not a Give addon. + if ( ! in_array( $plugin_base, $licensed_addon ) ) { + return $error; + } + + $plugin_base = strtolower( $plugin_base ); + $plugin_slug = str_replace( '.php', '', basename( $plugin_base ) ); + + /** + * Filter the addon readme.txt url + * + * @since 2.1.4 + */ + $url = apply_filters( + 'give_addon_readme_file_url', + "https://givewp.com/downloads/plugins/{$plugin_slug}/readme.txt", + $plugin_slug + ); + + $parser = new Give_Readme_Parser( $url ); + $give_min_version = $parser->requires_at_least(); + + + if ( version_compare( GIVE_VERSION, $give_min_version, '<' ) ) { + return new WP_Error( + 'Give_Addon_Update_Error', + sprintf( + __( 'Give version %s is required to update this add-on.', 'give' ), + $give_min_version + ) + ); + } + + return $error; +} + +add_filter( 'upgrader_pre_install', '__give_verify_addon_dependency_before_update', 10, 2 ); + +/** + * Function to add suppress_filters param if WPML add-on is activated. + * + * @since 2.1.4 + * + * @param array WP query argument for Total Goal. + * + * @return array WP query argument for Total Goal. + */ +function __give_wpml_total_goal_shortcode_agrs( $args ) { + $args['suppress_filters'] = true; + + return $args; +} + +/** + * Function to remove WPML post where filter in goal total amount shortcode. + * + * @since 2.1.4 + * @global SitePress $sitepress + */ +function __give_remove_wpml_parse_query_filter() { + global $sitepress; + remove_action('parse_query', array($sitepress, 'parse_query')); +} + + +/** + * Function to add WPML post where filter in goal total amount shortcode. + * + * @since 2.1.4 + * @global SitePress $sitepress + */ +function __give_add_wpml_parse_query_filter() { + global $sitepress; + add_action('parse_query', array($sitepress, 'parse_query')); +} + +/** + * Action all the hook that add support for WPML. + * + * @since 2.1.4 + */ +function give_add_support_for_wpml() { + if ( ! function_exists( 'is_plugin_active' ) ) { + include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); + } + + + if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) { + + add_filter( 'give_totals_goal_shortcode_query_args', '__give_wpml_total_goal_shortcode_agrs' ); + + // @see https://wpml.org/forums/topic/problem-with-query-filter-in-get_posts-function/#post-271309 + add_action( 'give_totals_goal_shortcode_before_render', '__give_remove_wpml_parse_query_filter', 99 ); + add_action( 'give_totals_goal_shortcode_after_render', '__give_add_wpml_parse_query_filter', 99 ); + } +} + +add_action( 'give_init', 'give_add_support_for_wpml', 1000 ); diff --git a/includes/admin/abstract-admin-settings-page.php b/includes/admin/abstract-admin-settings-page.php index 8ec6480d53..f39a65a394 100644 --- a/includes/admin/abstract-admin-settings-page.php +++ b/includes/admin/abstract-admin-settings-page.php @@ -207,7 +207,7 @@ public function output_sections() { } echo wp_kses_post( sprintf( - '

', + '

', implode( ' | ', $section_list ) ) ); } diff --git a/includes/admin/admin-actions.php b/includes/admin/admin-actions.php index 16a169cd36..9f937e8ef5 100644 --- a/includes/admin/admin-actions.php +++ b/includes/admin/admin-actions.php @@ -202,241 +202,245 @@ function _give_register_admin_notices() { }// End if(). // Add give message notices. - if ( ! empty( $_GET['give-message'] ) ) { - // Donation reports errors. - if ( current_user_can( 'view_give_reports' ) ) { - switch ( $_GET['give-message'] ) { - case 'donation_deleted' : - Give()->notices->register_notice( array( - 'id' => 'give-donation-deleted', - 'type' => 'updated', - 'description' => __( 'The donation has been deleted.', 'give' ), - 'show' => true, - ) ); - break; - case 'email_sent' : - Give()->notices->register_notice( array( - 'id' => 'give-payment-sent', - 'type' => 'updated', - 'description' => __( 'The donation receipt has been resent.', 'give' ), - 'show' => true, - ) ); - break; - case 'refreshed-reports' : - Give()->notices->register_notice( array( - 'id' => 'give-refreshed-reports', - 'type' => 'updated', - 'description' => __( 'The reports cache has been cleared.', 'give' ), - 'show' => true, - ) ); - break; - case 'donation-note-deleted' : - Give()->notices->register_notice( array( - 'id' => 'give-donation-note-deleted', - 'type' => 'updated', - 'description' => __( 'The donation note has been deleted.', 'give' ), - 'show' => true, - ) ); - break; - } - }// End if(). - - // Give settings notices and errors. - if ( current_user_can( 'manage_give_settings' ) ) { - switch ( $_GET['give-message'] ) { - case 'settings-imported' : - Give()->notices->register_notice( array( - 'id' => 'give-settings-imported', - 'type' => 'updated', - 'description' => __( 'The settings have been imported.', 'give' ), - 'show' => true, - ) ); - break; - case 'api-key-generated' : - Give()->notices->register_notice( array( - 'id' => 'give-api-key-generated', - 'type' => 'updated', - 'description' => __( 'API keys have been generated.', 'give' ), - 'show' => true, - ) ); - break; - case 'api-key-exists' : - Give()->notices->register_notice( array( - 'id' => 'give-api-key-exists', - 'type' => 'updated', - 'description' => __( 'The specified user already has API keys.', 'give' ), - 'show' => true, - ) ); - break; - case 'api-key-regenerated' : - Give()->notices->register_notice( array( - 'id' => 'give-api-key-regenerated', - 'type' => 'updated', - 'description' => __( 'API keys have been regenerated.', 'give' ), - 'show' => true, - ) ); - break; - case 'api-key-revoked' : - Give()->notices->register_notice( array( - 'id' => 'give-api-key-revoked', - 'type' => 'updated', - 'description' => __( 'API keys have been revoked.', 'give' ), - 'show' => true, - ) ); - break; - case 'sent-test-email' : - Give()->notices->register_notice( array( - 'id' => 'give-sent-test-email', - 'type' => 'updated', - 'description' => __( 'The test email has been sent.', 'give' ), - 'show' => true, - ) ); - break; - case 'matched-success-failure-page': - Give()->notices->register_notice( array( - 'id' => 'give-matched-success-failure-page', - 'type' => 'updated', - 'description' => __( 'You cannot set the success and failed pages to the same page', 'give' ), - 'show' => true, - ) ); - break; - }// End switch(). - }// End if(). - // Payments errors. - if ( current_user_can( 'edit_give_payments' ) ) { - switch ( $_GET['give-message'] ) { - case 'note-added' : - Give()->notices->register_notice( array( - 'id' => 'give-note-added', - 'type' => 'updated', - 'description' => __( 'The donation note has been added.', 'give' ), - 'show' => true, - ) ); - break; - case 'payment-updated' : - Give()->notices->register_notice( array( - 'id' => 'give-payment-updated', - 'type' => 'updated', - 'description' => __( 'The donation has been updated.', 'give' ), - 'show' => true, - ) ); - break; - } + $message_notices = give_get_admin_messages_key(); + if ( ! empty( $message_notices ) ) { + foreach ( $message_notices as $message_notice ) { + // Donation reports errors. + if ( current_user_can( 'view_give_reports' ) ) { + switch ( $message_notice ) { + case 'donation-deleted' : + Give()->notices->register_notice( array( + 'id' => 'give-donation-deleted', + 'type' => 'updated', + 'description' => __( 'The donation has been deleted.', 'give' ), + 'show' => true, + ) ); + break; + case 'email-sent' : + Give()->notices->register_notice( array( + 'id' => 'give-email-sent', + 'type' => 'updated', + 'description' => __( 'The donation receipt has been resent.', 'give' ), + 'show' => true, + ) ); + break; + case 'refreshed-reports' : + Give()->notices->register_notice( array( + 'id' => 'give-refreshed-reports', + 'type' => 'updated', + 'description' => __( 'The reports cache has been cleared.', 'give' ), + 'show' => true, + ) ); + break; + case 'donation-note-deleted' : + Give()->notices->register_notice( array( + 'id' => 'give-donation-note-deleted', + 'type' => 'updated', + 'description' => __( 'The donation note has been deleted.', 'give' ), + 'show' => true, + ) ); + break; + }// End switch(). + }// End if(). + + // Give settings notices and errors. + if ( current_user_can( 'manage_give_settings' ) ) { + switch ( $message_notice ) { + case 'settings-imported' : + Give()->notices->register_notice( array( + 'id' => 'give-settings-imported', + 'type' => 'updated', + 'description' => __( 'The settings have been imported.', 'give' ), + 'show' => true, + ) ); + break; + case 'api-key-generated' : + Give()->notices->register_notice( array( + 'id' => 'give-api-key-generated', + 'type' => 'updated', + 'description' => __( 'API keys have been generated.', 'give' ), + 'show' => true, + ) ); + break; + case 'api-key-exists' : + Give()->notices->register_notice( array( + 'id' => 'give-api-key-exists', + 'type' => 'updated', + 'description' => __( 'The specified user already has API keys.', 'give' ), + 'show' => true, + ) ); + break; + case 'api-key-regenerated' : + Give()->notices->register_notice( array( + 'id' => 'give-api-key-regenerated', + 'type' => 'updated', + 'description' => __( 'API keys have been regenerated.', 'give' ), + 'show' => true, + ) ); + break; + case 'api-key-revoked' : + Give()->notices->register_notice( array( + 'id' => 'give-api-key-revoked', + 'type' => 'updated', + 'description' => __( 'API keys have been revoked.', 'give' ), + 'show' => true, + ) ); + break; + case 'sent-test-email' : + Give()->notices->register_notice( array( + 'id' => 'give-sent-test-email', + 'type' => 'updated', + 'description' => __( 'The test email has been sent.', 'give' ), + 'show' => true, + ) ); + break; + case 'matched-success-failure-page': + Give()->notices->register_notice( array( + 'id' => 'give-matched-success-failure-page', + 'type' => 'updated', + 'description' => __( 'You cannot set the success and failed pages to the same page', 'give' ), + 'show' => true, + ) ); + break; + }// End switch(). + }// End if(). + + // Payments errors. + if ( current_user_can( 'edit_give_payments' ) ) { + switch ( $message_notice ) { + case 'note-added' : + Give()->notices->register_notice( array( + 'id' => 'give-note-added', + 'type' => 'updated', + 'description' => __( 'The donation note has been added.', 'give' ), + 'show' => true, + ) ); + break; + case 'payment-updated' : + Give()->notices->register_notice( array( + 'id' => 'give-payment-updated', + 'type' => 'updated', + 'description' => __( 'The donation has been updated.', 'give' ), + 'show' => true, + ) ); + break; + }// End switch(). + }// End if(). + + // Donor Notices. + if ( current_user_can( 'edit_give_payments' ) ) { + switch ( $message_notice ) { + case 'donor-deleted' : + Give()->notices->register_notice( array( + 'id' => 'give-donor-deleted', + 'type' => 'updated', + 'description' => __( 'The selected donor(s) has been deleted.', 'give' ), + 'show' => true, + ) ); + break; + + case 'donor-donations-deleted' : + Give()->notices->register_notice( array( + 'id' => 'give-donor-donations-deleted', + 'type' => 'updated', + 'description' => __( 'The selected donor(s) and the associated donation(s) has been deleted.', 'give' ), + 'show' => true, + ) ); + break; + + case 'confirm-delete-donor' : + Give()->notices->register_notice( array( + 'id' => 'give-confirm-delete-donor', + 'type' => 'updated', + 'description' => __( 'You must confirm to delete the selected donor(s).', 'give' ), + 'show' => true, + ) ); + break; + + case 'invalid-donor-id' : + Give()->notices->register_notice( array( + 'id' => 'give-invalid-donor-id', + 'type' => 'updated', + 'description' => __( 'Invalid Donor ID.', 'give' ), + 'show' => true, + ) ); + break; + + case 'donor-delete-failed' : + Give()->notices->register_notice( array( + 'id' => 'give-donor-delete-failed', + 'type' => 'error', + 'description' => __( 'Unable to delete selected donor(s).', 'give' ), + 'show' => true, + ) ); + break; + + case 'email-added' : + Give()->notices->register_notice( array( + 'id' => 'give-email-added', + 'type' => 'updated', + 'description' => __( 'Donor email added.', 'give' ), + 'show' => true, + ) ); + break; + + case 'email-removed' : + Give()->notices->register_notice( array( + 'id' => 'give-email-removed', + 'type' => 'updated', + 'description' => __( 'Donor email removed.', 'give' ), + 'show' => true, + ) ); + break; + + case 'email-remove-failed' : + Give()->notices->register_notice( array( + 'id' => 'give-email-remove-failed', + 'type' => 'updated', + 'description' => __( 'Failed to remove donor email.', 'give' ), + 'show' => true, + ) ); + break; + + case 'primary-email-updated' : + Give()->notices->register_notice( array( + 'id' => 'give-primary-email-updated', + 'type' => 'updated', + 'description' => __( 'Primary email updated for donor.', 'give' ), + 'show' => true, + ) ); + break; + + case 'primary-email-failed' : + Give()->notices->register_notice( array( + 'id' => 'give-primary-email-failed', + 'type' => 'updated', + 'description' => __( 'Failed to set primary email.', 'give' ), + 'show' => true, + ) ); + break; + + case 'reconnect-user' : + Give()->notices->register_notice( array( + 'id' => 'give-reconnect-user', + 'type' => 'updated', + 'description' => __( 'User has been successfully connected with Donor.', 'give' ), + 'show' => true, + ) ); + break; + + case 'profile-updated' : + Give()->notices->register_notice( array( + 'id' => 'give-profile-updated', + 'type' => 'updated', + 'description' => __( 'Donor information updated successfully.', 'give' ), + 'show' => true, + ) ); + break; + }// End switch(). + }// End if(). } - - // Donor Notices. - if ( current_user_can( 'edit_give_payments' ) ) { - switch ( $_GET['give-message'] ) { - case 'donor-deleted' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-deleted', - 'type' => 'updated', - 'description' => __( 'The selected donor(s) has been deleted.', 'give' ), - 'show' => true, - ) ); - break; - - case 'donor-donations-deleted' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-donations-deleted', - 'type' => 'updated', - 'description' => __( 'The selected donor(s) and the associated donation(s) has been deleted.', 'give' ), - 'show' => true, - ) ); - break; - - case 'confirm-delete-donor' : - Give()->notices->register_notice( array( - 'id' => 'give-confirm-delete-donor', - 'type' => 'updated', - 'description' => __( 'You must confirm to delete the selected donor(s).', 'give' ), - 'show' => true, - ) ); - break; - - case 'invalid-donor-id' : - Give()->notices->register_notice( array( - 'id' => 'give-invalid-donor-id', - 'type' => 'updated', - 'description' => __( 'Invalid Donor ID.', 'give' ), - 'show' => true, - ) ); - break; - - case 'donor-delete-failed' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-delete-failed', - 'type' => 'error', - 'description' => __( 'Unable to delete selected donor(s).', 'give' ), - 'show' => true, - ) ); - break; - - case 'email-added' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-email-added', - 'type' => 'updated', - 'description' => __( 'Donor email added.', 'give' ), - 'show' => true, - ) ); - break; - - case 'email-removed' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-email-removed', - 'type' => 'updated', - 'description' => __( 'Donor email removed.', 'give' ), - 'show' => true, - ) ); - break; - - case 'email-remove-failed' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-email-remove-failed', - 'type' => 'updated', - 'description' => __( 'Failed to remove donor email.', 'give' ), - 'show' => true, - ) ); - break; - - case 'primary-email-updated' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-primary-email-updated', - 'type' => 'updated', - 'description' => __( 'Primary email updated for donor.', 'give' ), - 'show' => true, - ) ); - break; - - case 'primary-email-failed' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-primary-email-failed', - 'type' => 'updated', - 'description' => __( 'Failed to set primary email.', 'give' ), - 'show' => true, - ) ); - break; - - case 'reconnect-user' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-reconnect-user', - 'type' => 'updated', - 'description' => __( 'User has been successfully connected with Donor.', 'give' ), - 'show' => true, - ) ); - break; - - case 'profile-updated' : - Give()->notices->register_notice( array( - 'id' => 'give-donor-profile-updated', - 'type' => 'updated', - 'description' => __( 'Donor information updated successfully.', 'give' ), - 'show' => true, - ) ); - break; - }// End switch(). - }// End if(). - }// End if(). + } } add_action( 'admin_notices', '_give_register_admin_notices', - 1 ); diff --git a/includes/admin/class-admin-settings.php b/includes/admin/class-admin-settings.php index 2eaad2de79..42051ab1e5 100644 --- a/includes/admin/class-admin-settings.php +++ b/includes/admin/class-admin-settings.php @@ -185,13 +185,23 @@ public static function show_messages() { if ( 0 < count( self::$errors ) ) { foreach ( self::$errors as $code => $message ) { - $notice_html .= '

' . $message . '

'; + $notice_html .= sprintf( + '', + $code, + $classes, + $message + ); } } if ( 0 < count( self::$messages ) ) { foreach ( self::$messages as $code => $message ) { - $notice_html .= '

' . $message . '

'; + $notice_html .= sprintf( + '', + $code, + $classes, + $message + ); } } diff --git a/includes/admin/donors/donor-actions.php b/includes/admin/donors/donor-actions.php index 38b3b24593..55af28e5f7 100644 --- a/includes/admin/donors/donor-actions.php +++ b/includes/admin/donors/donor-actions.php @@ -118,7 +118,7 @@ function give_edit_donor( $args ) { } if ( $output['success'] ) { - wp_redirect( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}&give-message=profile-updated" ) ); + wp_redirect( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}&give-messages[]=profile-updated" ) ); } exit; @@ -286,7 +286,7 @@ function give_donor_delete( $args ) { } } - $redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&give-message=donor-deleted' ); + $redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&give-messages[]=donor-deleted' ); } else { @@ -458,7 +458,7 @@ function give_add_donor_email( $args ) { ); } } else { - $redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor_id . '&give-message=email-added' ); + $redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor_id . '&give-messages[]=email-added' ); $output = array( 'success' => true, 'message' => __( 'Email successfully added to donor.', 'give' ), @@ -518,13 +518,13 @@ function give_remove_donor_email() { $donor = new Give_Donor( $_GET['id'] ); if ( $donor->remove_email( $_GET['email'] ) ) { - $url = add_query_arg( 'give-message', 'email-removed', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); + $url = add_query_arg( 'give-messages[]', 'email-removed', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); $user = wp_get_current_user(); $user_login = ! empty( $user->user_login ) ? $user->user_login : __( 'System', 'give' ); $donor_note = sprintf( __( 'Email address %1$s removed by %2$s', 'give' ), $_GET['email'], $user_login ); $donor->add_note( $donor_note ); } else { - $url = add_query_arg( 'give-message', 'email-remove-failed', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); + $url = add_query_arg( 'give-messages[]', 'email-remove-failed', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); } wp_safe_redirect( $url ); @@ -566,14 +566,14 @@ function give_set_donor_primary_email() { $donor = new Give_Donor( $_GET['id'] ); if ( $donor->set_primary_email( $_GET['email'] ) ) { - $url = add_query_arg( 'give-message', 'primary-email-updated', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); + $url = add_query_arg( 'give-messages[]', 'primary-email-updated', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); $user = wp_get_current_user(); $user_login = ! empty( $user->user_login ) ? $user->user_login : __( 'System', 'give' ); $donor_note = sprintf( __( 'Email address %1$s set as primary by %2$s', 'give' ), $_GET['email'], $user_login ); $donor->add_note( $donor_note ); } else { - $url = add_query_arg( 'give-message', 'primary-email-failed', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); + $url = add_query_arg( 'give-messages[]', 'primary-email-failed', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); } wp_safe_redirect( $url ); @@ -636,7 +636,7 @@ function give_delete_donor( $args ) { give_delete_donation( $donation_id ); } - $give_args['give-message'] = 'donor-donations-deleted'; + $give_args['give-messages[]'] = 'donor-donations-deleted'; } else { // Just set the donations to customer_id of 0. @@ -644,16 +644,16 @@ function give_delete_donor( $args ) { give_update_payment_meta( $donation_id, '_give_payment_customer_id', 0 ); } - $give_args['give-message'] = 'donor-deleted'; + $give_args['give-messages[]'] = 'donor-deleted'; } } else { - $give_args['give-message'] = 'donor-delete-failed'; + $give_args['give-messages[]'] = 'donor-delete-failed'; } } else { - $give_args['give-message'] = 'confirm-delete-donor'; + $give_args['give-messages[]'] = 'confirm-delete-donor'; } } else { - $give_args['give-message'] = 'invalid-donor-id'; + $give_args['give-messages[]'] = 'invalid-donor-id'; } } diff --git a/includes/admin/emails/class-donation-receipt-email.php b/includes/admin/emails/class-donation-receipt-email.php index 08d08815dd..708aab7d6a 100755 --- a/includes/admin/emails/class-donation-receipt-email.php +++ b/includes/admin/emails/class-donation-receipt-email.php @@ -284,7 +284,7 @@ public function send_donation_receipt( $payment_id ) { * @since 2.0 * @access public * - * @param array $data + * @param array $data Donation details. */ public function resend_donation_receipt( $data ) { $purchase_id = absint( $data['purchase_id'] ); @@ -311,9 +311,9 @@ public function resend_donation_receipt( $data ) { ) ); wp_redirect( add_query_arg( array( - 'give-message' => 'email_sent', - 'give-action' => false, - 'purchase_id' => false, + 'give-messages[]' => 'email-sent', + 'give-action' => false, + 'purchase_id' => false, ) ) ); exit; } diff --git a/includes/admin/emails/filters.php b/includes/admin/emails/filters.php index 3c9edb947b..68d5ec7d9b 100755 --- a/includes/admin/emails/filters.php +++ b/includes/admin/emails/filters.php @@ -38,7 +38,7 @@ function give_email_notification_row_actions_callback( $row_actions, $email ) { add_query_arg( array( 'give_action' => 'send_preview_email', 'email_type' => $email->config['id'], - 'give-message' => 'sent-test-email', + 'give-messages[]' => 'sent-test-email', ) ), 'give-send-preview-email' ), __( 'Send test email', 'give' ) ); diff --git a/includes/admin/forms/dashboard-columns.php b/includes/admin/forms/dashboard-columns.php index 48d7155d85..4429e629e6 100644 --- a/includes/admin/forms/dashboard-columns.php +++ b/includes/admin/forms/dashboard-columns.php @@ -312,6 +312,7 @@ function give_remove_month_filter( $dates ) { * Updates price when saving post * * @since 1.0 + * @since 2.1.4 If the donation amount is less than the Minimum amount then set the donation amount as Donation minimum amount. * * @param int $post_id Download (Post) ID * @@ -331,6 +332,16 @@ function give_price_save_quick_edit( $post_id ) { if ( isset( $_REQUEST['_give_regprice'] ) ) { give_update_meta( $post_id, '_give_set_price', give_sanitize_amount_for_db( strip_tags( stripslashes( $_REQUEST['_give_regprice'] ) ) ) ); } + + // Override the Donation minimum amount. + if ( + isset( $_REQUEST['_give_custom_amount'], $_REQUEST['_give_set_price'], $_REQUEST['_give_price_option'], $_REQUEST['_give_custom_amount_range'] ) + && 'set' === $_REQUEST['_give_price_option'] + && give_is_setting_enabled( $_REQUEST['_give_custom_amount'] ) + && give_maybe_sanitize_amount( $_REQUEST['_give_set_price'] ) < give_maybe_sanitize_amount( $_REQUEST['_give_custom_amount_range']['minimum'] ) + ) { + give_update_meta( $post_id, '_give_custom_amount_range_minimum', give_sanitize_amount_for_db( $_REQUEST['_give_set_price'] ) ); + } } add_action( 'save_post', 'give_price_save_quick_edit' ); diff --git a/includes/admin/give-metabox-functions.php b/includes/admin/give-metabox-functions.php index 4f550e215f..6d44df8be8 100644 --- a/includes/admin/give-metabox-functions.php +++ b/includes/admin/give-metabox-functions.php @@ -908,7 +908,7 @@ function give_email_preview_buttons( $field ) { array( 'give_action' => 'send_preview_email', 'email_type' => $field_id, - 'give-message' => 'sent-test-email', + 'give-messages[]' => 'sent-test-email', 'form_id' => $post->ID, ) ), 'give-send-preview-email' ), diff --git a/includes/admin/payments/actions.php b/includes/admin/payments/actions.php index 778ce22adf..9531eb3863 100644 --- a/includes/admin/payments/actions.php +++ b/includes/admin/payments/actions.php @@ -309,7 +309,7 @@ function give_update_payment_details( $data ) { */ do_action( 'give_updated_edited_donation', $payment_id ); - wp_safe_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&give-message=payment-updated&id=' . $payment_id ) ); + wp_safe_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&give-messages[]=payment-updated&id=' . $payment_id ) ); exit; } @@ -334,7 +334,7 @@ function give_trigger_donation_delete( $data ) { } give_delete_donation( $payment_id ); - wp_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&give-message=donation_deleted' ) ); + wp_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&give-messages[]=donation-deleted' ) ); give_die(); } } @@ -386,7 +386,7 @@ function give_trigger_payment_note_deletion( $data ) { wp_die( __( 'You do not have permission to edit payments.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) ); } - $edit_order_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&give-message=donation-note-deleted&id=' . absint( $data['payment_id'] ) ); + $edit_order_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&give-messages[]=donation-note-deleted&id=' . absint( $data['payment_id'] ) ); give_delete_payment_note( $data['note_id'], $data['payment_id'] ); diff --git a/includes/admin/payments/view-payment-details.php b/includes/admin/payments/view-payment-details.php index a468185682..55ee65f161 100644 --- a/includes/admin/payments/view-payment-details.php +++ b/includes/admin/payments/view-payment-details.php @@ -241,22 +241,21 @@
- - + 'email_links', + 'purchase_id' => $payment_id, + ), + admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment_id ) + ); + echo sprintf( '%2$s', - esc_url( - add_query_arg( - array( - 'give-action' => 'email_links', - 'purchase_id' => $payment_id, - ) - ) - ), - __( 'Resend Receipt', 'give' ) + esc_url( $url ), + esc_html__( 'Resend Receipt', 'give' ) ); } ?> diff --git a/includes/admin/reports/graphing.php b/includes/admin/reports/graphing.php index f27f949277..4a4ddf073b 100644 --- a/includes/admin/reports/graphing.php +++ b/includes/admin/reports/graphing.php @@ -809,7 +809,7 @@ function give_reports_refresh_button() { $url = wp_nonce_url( add_query_arg( array( 'give_action' => 'refresh_reports_transients', - 'give-message' => 'refreshed-reports' + 'give-messages[]' => 'refreshed-reports' ) ), 'give-refresh-reports' ); echo Give()->tooltips->render_link( array( diff --git a/includes/admin/settings/class-settings-cmb2-backward-compatibility.php b/includes/admin/settings/class-settings-cmb2-backward-compatibility.php index 09b96fa872..53377748ca 100644 --- a/includes/admin/settings/class-settings-cmb2-backward-compatibility.php +++ b/includes/admin/settings/class-settings-cmb2-backward-compatibility.php @@ -231,7 +231,7 @@ function get_filtered_addon_sections( $sections = array() ) { add_filter( 'gettext', array( $this, 'en_translation' ), 10, 2 ); $en_setting_fields = $this->prev_settings->give_settings( $this->current_tab ); remove_filter( 'gettext', array( $this, 'en_translation' ), 10 ); - + if ( ! empty( $setting_fields ) && ! empty( $setting_fields['fields'] ) ) { foreach ( $setting_fields['fields'] as $index => $field ) { @@ -639,7 +639,7 @@ public function output_sections() { return; } - echo '
diff --git a/includes/api/class-give-api.php b/includes/api/class-give-api.php index fd04e8571b..6645937188 100644 --- a/includes/api/class-give-api.php +++ b/includes/api/class-give-api.php @@ -1247,7 +1247,15 @@ public function get_stats( $args = array() ) { $i = 0; foreach ( $forms as $form_info ) { $donations['donations'][ $i ] = array( - $form_info->post_name => give_get_form_sales_stats( $form_info->ID ), + $form_info->post_name => $this->stats->get_sales( + $form_info->ID, + is_numeric( $args['startdate'] ) + ? strtotime( $args['startdate'] ) + : $args['startdate'], + is_numeric( $args['enddate'] ) + ? strtotime( $args['enddate'] ) + : $args['enddate'] + ), ); $i ++; } @@ -1255,7 +1263,15 @@ public function get_stats( $args = array() ) { if ( get_post_type( $args['form'] ) == 'give_forms' ) { $form_info = get_post( $args['form'] ); $donations['donations'][0] = array( - $form_info->post_name => give_get_form_sales_stats( $args['form'] ), + $form_info->post_name => $this->stats->get_sales( + $args['form'], + is_numeric( $args['startdate'] ) + ? strtotime( $args['startdate'] ) + : $args['startdate'], + is_numeric( $args['enddate'] ) + ? strtotime( $args['enddate'] ) + : $args['enddate'] + ), ); } else { $error['error'] = sprintf( /* translators: %s: form */ @@ -1862,23 +1878,23 @@ public function process_api_key( $args ) { case 'generate': if ( $this->generate_api_key( $user_id ) ) { Give_Cache::delete( Give_Cache::get_key( 'give_total_api_keys' ) ); - wp_redirect( add_query_arg( 'give-message', 'api-key-generated', 'edit.php?post_type=give_forms&page=give-tools&tab=api' ) ); + wp_redirect( add_query_arg( 'give-messages[]', 'api-key-generated', 'edit.php?post_type=give_forms&page=give-tools&tab=api' ) ); exit(); } else { - wp_redirect( add_query_arg( 'give-message', 'api-key-failed', 'edit.php?post_type=give_forms&page=give-tools&tab=api' ) ); + wp_redirect( add_query_arg( 'give-messages[]', 'api-key-failed', 'edit.php?post_type=give_forms&page=give-tools&tab=api' ) ); exit(); } break; case 'regenerate': $this->generate_api_key( $user_id, true ); Give_Cache::delete( Give_Cache::get_key( 'give_total_api_keys' ) ); - wp_redirect( add_query_arg( 'give-message', 'api-key-regenerated', 'edit.php?post_type=give_forms&page=give-tools&tab=api' ) ); + wp_redirect( add_query_arg( 'give-messages[]', 'api-key-regenerated', 'edit.php?post_type=give_forms&page=give-tools&tab=api' ) ); exit(); break; case 'revoke': $this->revoke_api_key( $user_id ); Give_Cache::delete( Give_Cache::get_key( 'give_total_api_keys' ) ); - wp_redirect( add_query_arg( 'give-message', 'api-key-revoked', 'edit.php?post_type=give_forms&page=give-tools&tab=api' ) ); + wp_redirect( add_query_arg( 'give-messages[]', 'api-key-revoked', 'edit.php?post_type=give_forms&page=give-tools&tab=api' ) ); exit(); break; default; diff --git a/includes/class-give-license-handler.php b/includes/class-give-license-handler.php index 131db0713f..743e014da1 100644 --- a/includes/class-give-license-handler.php +++ b/includes/class-give-license-handler.php @@ -106,6 +106,16 @@ class Give_License { */ private $api_url = 'https://givewp.com/edd-sl-api/'; + /** + * array of licensed addons + * + * @since 2.1.4 + * @access private + * + * @var array + */ + private static $licensed_addons = array(); + /** * Account URL * @@ -166,6 +176,9 @@ public function __construct( $_file, $_item_name, $_version, $_author, $_optname Give_Cache::set( 'give_cache_hide_license_notice_after_activation', true, DAY_IN_SECONDS ); } + // Add plugin to registered licenses list. + array_push( self::$licensed_addons, plugin_basename( $this->file ) ); + // Setup hooks $this->includes(); $this->hooks(); @@ -939,6 +952,20 @@ private function is_deactivating_license() { return $status; } + + /** + * Return licensed addons info + * + * Note: note only for internal logic + * + * @since 2.1.4 + * + * @return array + */ + static function get_licensed_addons() { + return self::$licensed_addons; + } + } endif; // end class_exists check. diff --git a/includes/class-give-readme-parser.php b/includes/class-give-readme-parser.php new file mode 100644 index 0000000000..9707541dd4 --- /dev/null +++ b/includes/class-give-readme-parser.php @@ -0,0 +1,60 @@ +file_url = $file_url; + $this->file_content = wp_remote_retrieve_body( wp_remote_get( $this->file_url ) ); + } + + /** + * Get required Give core minimum version for addon + * + * @since 2.1.4 + * @access public + * + * @return string + */ + public function requires_at_least() { + // Regex to extract Give core minimum version from the readme.txt file. + preg_match('|Requires Give:(.*)|i', $this->file_content, $_requires_at_least ); + + if( is_array( $_requires_at_least ) && 1 < count( $_requires_at_least ) ) { + $_requires_at_least = trim( $_requires_at_least[1] ); + }else{ + $_requires_at_least = null; + } + + return $_requires_at_least; + } +} diff --git a/includes/class-give-scripts.php b/includes/class-give-scripts.php index 7e46c41784..b225e1e6da 100644 --- a/includes/class-give-scripts.php +++ b/includes/class-give-scripts.php @@ -198,6 +198,7 @@ public function admin_localize_scripts() { 'import_failed' => __( 'Import failed', 'give' ), 'flush_success' => __( 'Flush success', 'give' ), 'flush_error' => __( 'Flush error', 'give' ), + 'no_form_selected' => __( 'No form selected', 'give' ), 'batch_export_no_class' => __( 'You must choose a method.', 'give' ), 'batch_export_no_reqs' => __( 'Required fields not completed.', 'give' ), 'reset_stats_warn' => __( 'Are you sure you want to reset Give? This process is not reversible and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ), diff --git a/includes/emails/functions.php b/includes/emails/functions.php index 78f93b626b..324c28f801 100644 --- a/includes/emails/functions.php +++ b/includes/emails/functions.php @@ -250,7 +250,7 @@ function give_admin_email_user_donor_disconnection( $user_id, $donor_id ) { $message .= __( 'Do you want to reconnect User and Donor profile again?', 'give' ) . "\n\n"; $message .= sprintf( '%2$s', - esc_url( admin_url() . 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor_id . '&user_id=' . $user_id . '&give-message=reconnect-user' ), + esc_url( admin_url() . 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor_id . '&user_id=' . $user_id . '&give-messages[]=reconnect-user' ), __( 'Reconnect User', 'give' ) . "\n\n" ); $message .= __( 'Thank you,', 'give' ) . "\n\n"; diff --git a/includes/emails/template.php b/includes/emails/template.php index 68e78ad995..a0b395f274 100644 --- a/includes/emails/template.php +++ b/includes/emails/template.php @@ -133,7 +133,7 @@ function give_email_preview_buttons_callback( $field ) { add_query_arg( array( 'give_action' => 'send_preview_email', 'email_type' => $field_id, - 'give-message' => 'sent-test-email', + 'give-messages[]' => 'sent-test-email', ) ), 'give-send-preview-email' ), esc_attr__( 'Send Test Email.', 'give' ), esc_html__( 'Send Test Email', 'give' ) diff --git a/includes/forms/template.php b/includes/forms/template.php index 4be467fb5d..07531c7414 100644 --- a/includes/forms/template.php +++ b/includes/forms/template.php @@ -259,21 +259,21 @@ function give_show_purchase_form( $form_id, $args ) { * * @since 1.7 */ - do_action( 'give_donation_form_before_register_login', $form_id ); + do_action( 'give_donation_form_before_register_login', $form_id, $args ); /** * Fire when register/login form fields render. * * @since 1.7 */ - do_action( 'give_donation_form_register_login_fields', $form_id ); + do_action( 'give_donation_form_register_login_fields', $form_id, $args ); /** * Fire when credit card form fields render. * * @since 1.7 */ - do_action( 'give_donation_form_before_cc_form', $form_id ); + do_action( 'give_donation_form_before_cc_form', $form_id, $args ); // Load the credit card form and allow gateways to load their own if they wish. if ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) { @@ -293,7 +293,7 @@ function give_show_purchase_form( $form_id, $args ) { * * @param int $form_id The form ID. */ - do_action( 'give_cc_form', $form_id ); + do_action( 'give_cc_form', $form_id, $args ); } /** @@ -301,7 +301,7 @@ function give_show_purchase_form( $form_id, $args ) { * * @since 1.7 */ - do_action( 'give_donation_form_after_cc_form', $form_id ); + do_action( 'give_donation_form_after_cc_form', $form_id, $args ); } else { /** @@ -318,7 +318,7 @@ function give_show_purchase_form( $form_id, $args ) { * * @since 1.7 */ - do_action( 'give_payment_fields_bottom', $form_id ); + do_action( 'give_payment_fields_bottom', $form_id, $args ); } add_action( 'give_donation_form', 'give_show_purchase_form', 10, 2 ); @@ -1663,11 +1663,12 @@ function give_checkout_final_total( $form_id ) { * * @since 1.0 * - * @param int $form_id The form ID. + * @param int $form_id The donation form ID. + * @param array $args List of arguments. * * @return void */ -function give_checkout_submit( $form_id ) { +function give_checkout_submit( $form_id, $args ) { ?>
$item ) { + if( false !== strpos( $item, 'give-display-' ) ) { + unset( $class[$index] ); + } + } + return $class; } diff --git a/includes/misc-functions.php b/includes/misc-functions.php index 58aba1acf7..acf9c14630 100644 --- a/includes/misc-functions.php +++ b/includes/misc-functions.php @@ -2069,4 +2069,47 @@ function give_goal_progress_stats( $form ) { */ return apply_filters( 'give_goal_progress_stats', $stats_array ); -} \ No newline at end of file +} + +/** + * Get the admin messages key to show the notices. + * + * @since 2.1.4 + * + * @return array $message admin message key. + */ +function give_get_admin_messages_key() { + $messages = empty( $_GET['give-messages'] ) ? array() : give_clean( $_GET['give-messages'] ); + + // backward compatibility. + if ( ! empty( $_GET['give-message'] ) ) { + $messages[] = give_clean( $_GET['give-message'] ); + } + + /** + * Filter to modify the admin messages key. + * + * @since 2.1.4 + * + * @param array $message admin message key. + * + * @return array $message admin message key. + */ + return (array) apply_filters( 'give_get_admin_messages_key', $messages ); +} + +/** + * Get User Agent String. + * + * @since 2.1.4 + * + * @return array|string + */ +function give_get_user_agent() { + + // Get User Agent. + $user_agent = ! empty( $_SERVER['HTTP_USER_AGENT'] ) ? give_clean( $_SERVER['HTTP_USER_AGENT'] ) : ''; // WPCS: input var ok. + + return $user_agent; + +} diff --git a/includes/payments/class-give-payment.php b/includes/payments/class-give-payment.php index 7ecf2bb357..41ce915f53 100644 --- a/includes/payments/class-give-payment.php +++ b/includes/payments/class-give-payment.php @@ -954,6 +954,10 @@ public function save() { wp_update_post( $args ); break; + case 'total': + $this->update_meta( '_give_payment_total', give_sanitize_amount_for_db( $this->total ) ); + break; + default: /** * Fires while saving payment. @@ -994,11 +998,8 @@ public function save() { // Verify and update form meta based on the form status. give_set_form_closed_status( $this->form_id ); - } - $this->update_meta( '_give_payment_total', give_sanitize_amount_for_db( $this->total ) ); - $this->pending = array(); $saved = true; }// End if(). @@ -1207,12 +1208,13 @@ private function decrease_subtotal( $amount = 0.00 ) { * Set or update the total for a payment. * * @since 1.5 + * @since 2.1.4 reset total in pending property * @access private * * @return void */ private function recalculate_total() { - $this->total = $this->subtotal; + $this->pending['total'] = $this->total = $this->subtotal; } /** diff --git a/includes/process-donation.php b/includes/process-donation.php index 1782d7ccf8..d748347ae3 100644 --- a/includes/process-donation.php +++ b/includes/process-donation.php @@ -465,12 +465,13 @@ function give_verify_minimum_price( $amount_range = 'minimum' ) { $post_data = give_clean( $_POST ); // WPCS: input var ok, sanitization ok, CSRF ok. $amount = ! empty( $post_data['give-amount'] ) ? give_maybe_sanitize_amount( $post_data['give-amount'] ) : 0; $form_id = ! empty( $post_data['give-form-id'] ) ? $post_data['give-form-id'] : 0; - $price_id = ! empty( $post_data['give-price-id'] ) ? $post_data['give-price-id'] : ''; + $price_id = isset( $post_data['give-price-id'] ) ? absint( $post_data['give-price-id'] ) : ''; $variable_prices = give_has_variable_prices( $form_id ); + $price_ids = array_map( 'absint', give_get_variable_price_ids( $form_id ) ); $verified_stat = false; - if ( $variable_prices && in_array( $price_id, give_get_variable_price_ids( $form_id ), true ) ) { + if ( $variable_prices && in_array( $price_id, $price_ids, true ) ) { $price_level_amount = give_get_price_option_amount( $form_id, $price_id ); @@ -1353,13 +1354,14 @@ function give_validate_donation_amount( $valid_data ) { // Sanitize donation amount. $post_data['give-amount'] = give_maybe_sanitize_amount( $post_data['give-amount'] ); $variable_price_option_amount = give_maybe_sanitize_amount( give_get_price_option_amount( $post_data['give-form-id'], $post_data['give-price-id'] ) ); + $new_price_id = ''; if ( $post_data['give-amount'] === $variable_price_option_amount ) { return true; } if ( $form->is_custom_price( $post_data['give-amount'] ) ) { - $post_data['give-price-id'] = 'custom'; + $new_price_id = 'custom'; } else { // Find correct donation level from all donation levels. @@ -1370,7 +1372,7 @@ function give_validate_donation_amount( $valid_data ) { // Set first match donation level ID. if ( $post_data['give-amount'] === $variable_price['_give_amount'] ) { - $post_data['give-price-id'] = $variable_price['_give_id']['level_id']; + $new_price_id = $variable_price['_give_id']['level_id']; break; } } @@ -1378,12 +1380,23 @@ function give_validate_donation_amount( $valid_data ) { // If donation amount is not find in donation levels then check if form has custom donation feature enable or not. // If yes then set price id to custom if amount is greater then custom minimum amount (if any). - if ( ! empty( $post_data['give-price-id'] ) ) { + if ( $post_data['give-price-id'] === $new_price_id ) { $donation_level_matched = true; } } // End if(). - return ( $donation_level_matched ? true : false ); + if ( ! $donation_level_matched ) { + give_set_error( + 'invalid_donation_amount', + sprintf( + /* translators: %s: invalid donation amount */ + __( 'Donation amount %s is invalid.', 'give' ), + give_currency_filter( + give_format_amount( $post_data['give-amount'], array( 'sanitize' => false, ) ) + ) + ) + ); + } } add_action( 'give_checkout_error_checks', 'give_validate_donation_amount', 10, 1 ); diff --git a/includes/shortcodes.php b/includes/shortcodes.php index a8958aa15a..dcea6e7be9 100644 --- a/includes/shortcodes.php +++ b/includes/shortcodes.php @@ -565,7 +565,6 @@ function give_process_profile_editor_updates( $data ) { add_action( 'give_edit_user_profile', 'give_process_profile_editor_updates' ); - /** * Give totals Shortcode. * @@ -596,6 +595,15 @@ function give_totals_shortcode( $atts ) { // Total Goal. $total_goal = give_maybe_sanitize_amount( $atts['total_goal'] ); + /** + * Give Action fire before the shortcode is rendering is started. + * + * @since 2.1.4 + * + * @param array $atts shortcode attribute. + */ + do_action( 'give_totals_goal_shortcode_before_render', $atts ); + // Build query based on cat, tag and Form ids. if ( ! empty( $atts['cats'] ) || ! empty( $atts['tags'] ) || ! empty( $atts['ids'] ) ) { @@ -604,13 +612,20 @@ function give_totals_shortcode( $atts ) { $form_ids = array_filter( array_map( 'trim', explode( ',', $atts['ids'] ) ) ); } + /** + * Filter to modify WP Query for Total Goal. + * + * @since 2.1.4 + * + * @param array WP query argument for Total Goal. + */ $form_args = array( - 'post_type' => 'give_forms', - 'post_status' => 'publish', - 'post__in' => $form_ids, - 'posts_per_page' => - 1, - 'fields' => 'ids', - 'tax_query' => array( + 'post_type' => 'give_forms', + 'post_status' => 'publish', + 'post__in' => $form_ids, + 'posts_per_page' => - 1, + 'fields' => 'ids', + 'tax_query' => array( 'relation' => 'AND', ), ); @@ -631,6 +646,17 @@ function give_totals_shortcode( $atts ) { ); } + /** + * Filter to modify WP Query for Total Goal. + * + * @since 2.1.4 + * + * @param array $form_args WP query argument for Total Goal. + * + * @return array $form_args WP query argument for Total Goal. + */ + $form_args = (array) apply_filters( 'give_totals_goal_shortcode_query_args', $form_args ); + $forms = new WP_Query( $form_args ); if ( isset( $forms->posts ) ) { @@ -644,7 +670,7 @@ function give_totals_shortcode( $atts ) { * * @since 2.1 * - * @param int $post Form ID. + * @param int $post Form ID. * @param string $form_earning Total earning of Form. */ $total += apply_filters( 'give_totals_form_earning', $form_earning, $post ); @@ -679,7 +705,7 @@ function give_totals_shortcode( $atts ) { * @since 2.1 * * @param string $message Shortcode Message. - * @param array $atts ShortCode attributes. + * @param array $atts ShortCode attributes. */ $message = apply_filters( 'give_totals_shortcode_message', $message, $atts ); @@ -699,6 +725,17 @@ function give_totals_shortcode( $atts ) { licenses page to correct this issue." msgstr "" -#: includes/class-give-license-handler.php:630 +#: includes/class-give-license-handler.php:643 msgid "Your Give add-on license expired for payment #%2$d. Click to renew an existing license or %4$s." msgstr "" -#: includes/class-give-license-handler.php:635, includes/class-give-license-handler.php:654 +#: includes/class-give-license-handler.php:648, includes/class-give-license-handler.php:667 msgid "Click here if already renewed" msgstr "" -#: includes/class-give-license-handler.php:648 +#: includes/class-give-license-handler.php:661 msgid "Your Give add-on license will expire in %1$s for payment #%3$d. Click to renew an existing license or %5$s." msgstr "" -#: includes/class-give-license-handler.php:850, includes/api/class-give-api.php:1830, includes/forms/functions.php:319, includes/gateways/manual.php:38, includes/admin/donors/donor-actions.php:436, includes/admin/tools/export/export-actions.php:26, includes/admin/tools/export/pdf-reports.php:35 +#: includes/class-give-license-handler.php:863, includes/api/class-give-api.php:1846, includes/forms/functions.php:319, includes/gateways/manual.php:38, includes/admin/donors/donor-actions.php:436, includes/admin/tools/export/export-actions.php:26, includes/admin/tools/export/pdf-reports.php:35 msgid "Nonce verification failed." msgstr "" -#: includes/class-give-license-handler.php:850, includes/class-notices.php:576, includes/formatting.php:680, includes/admin/EDD_SL_Plugin_Updater.php:396, includes/api/class-give-api.php:1830, includes/api/class-give-api.php:1836, includes/api/class-give-api.php:1851, includes/api/class-give-api.php:1856, includes/forms/functions.php:319, includes/gateways/manual.php:38, includes/admin/donors/donor-actions.php:31, includes/admin/donors/donor-actions.php:45, includes/admin/donors/donor-actions.php:144, includes/admin/donors/donor-actions.php:158, includes/admin/donors/donor-actions.php:226, includes/admin/donors/donor-actions.php:241, includes/admin/donors/donor-actions.php:325, includes/admin/donors/donor-actions.php:339, includes/admin/donors/donor-actions.php:418, includes/admin/donors/donor-actions.php:514, includes/admin/donors/donor-actions.php:561, includes/admin/donors/donor-actions.php:599, includes/admin/donors/donor-actions.php:615, includes/admin/emails/class-donation-receipt-email.php:300, includes/admin/forms/dashboard-columns.php:255, includes/admin/payments/actions.php:31, includes/admin/payments/actions.php:85, includes/admin/payments/actions.php:98, includes/admin/payments/actions.php:333, includes/admin/payments/actions.php:353, includes/admin/payments/actions.php:386, includes/admin/payments/actions.php:408, includes/admin/payments/view-payment-details.php:19, includes/admin/payments/view-payment-details.php:32, includes/admin/payments/view-payment-details.php:42, includes/admin/reports/reports.php:143, includes/admin/upgrades/upgrade-functions.php:381, includes/admin/tools/data/class-give-tools-delete-import-donors.php:268, includes/admin/tools/data/class-give-tools-delete-test-donors.php:239, includes/admin/tools/data/class-give-tools-delete-test-transactions.php:129, includes/admin/tools/data/class-give-tools-recount-all-stats.php:248, includes/admin/tools/data/class-give-tools-recount-donor-stats.php:204, includes/admin/tools/data/class-give-tools-recount-form-stats.php:204, includes/admin/tools/data/class-give-tools-recount-income.php:178, includes/admin/tools/data/class-give-tools-recount-single-donor-stats.php:160, includes/admin/tools/data/class-give-tools-reset-stats.php:198, includes/admin/tools/export/class-batch-export.php:145, includes/admin/tools/export/class-core-settings-export.php:81, includes/admin/tools/export/class-export.php:185, includes/admin/tools/export/export-actions.php:26, includes/admin/tools/export/pdf-reports.php:31, includes/admin/tools/export/pdf-reports.php:35, includes/admin/tools/export/pdf-reports.php:39, includes/admin/tools/logs/class-api-requests-logs-list-table.php:154, includes/admin/tools/logs/class-gateway-error-logs-list-table.php:136 +#: includes/class-give-license-handler.php:863, includes/class-notices.php:576, includes/formatting.php:680, includes/admin/EDD_SL_Plugin_Updater.php:396, includes/api/class-give-api.php:1846, includes/api/class-give-api.php:1852, includes/api/class-give-api.php:1867, includes/api/class-give-api.php:1872, includes/forms/functions.php:319, includes/gateways/manual.php:38, includes/admin/donors/donor-actions.php:31, includes/admin/donors/donor-actions.php:45, includes/admin/donors/donor-actions.php:144, includes/admin/donors/donor-actions.php:158, includes/admin/donors/donor-actions.php:226, includes/admin/donors/donor-actions.php:241, includes/admin/donors/donor-actions.php:325, includes/admin/donors/donor-actions.php:339, includes/admin/donors/donor-actions.php:418, includes/admin/donors/donor-actions.php:514, includes/admin/donors/donor-actions.php:561, includes/admin/donors/donor-actions.php:599, includes/admin/donors/donor-actions.php:615, includes/admin/emails/class-donation-receipt-email.php:300, includes/admin/forms/dashboard-columns.php:255, includes/admin/payments/actions.php:31, includes/admin/payments/actions.php:85, includes/admin/payments/actions.php:98, includes/admin/payments/actions.php:333, includes/admin/payments/actions.php:353, includes/admin/payments/actions.php:386, includes/admin/payments/actions.php:408, includes/admin/payments/view-payment-details.php:19, includes/admin/payments/view-payment-details.php:32, includes/admin/payments/view-payment-details.php:42, includes/admin/reports/reports.php:143, includes/admin/upgrades/upgrade-functions.php:381, includes/admin/tools/data/class-give-tools-delete-import-donors.php:268, includes/admin/tools/data/class-give-tools-delete-test-donors.php:239, includes/admin/tools/data/class-give-tools-delete-test-transactions.php:129, includes/admin/tools/data/class-give-tools-recount-all-stats.php:248, includes/admin/tools/data/class-give-tools-recount-donor-stats.php:204, includes/admin/tools/data/class-give-tools-recount-form-stats.php:204, includes/admin/tools/data/class-give-tools-recount-income.php:178, includes/admin/tools/data/class-give-tools-recount-single-donor-stats.php:160, includes/admin/tools/data/class-give-tools-reset-stats.php:198, includes/admin/tools/export/class-batch-export.php:145, includes/admin/tools/export/class-core-settings-export.php:81, includes/admin/tools/export/class-export.php:185, includes/admin/tools/export/export-actions.php:26, includes/admin/tools/export/pdf-reports.php:31, includes/admin/tools/export/pdf-reports.php:35, includes/admin/tools/export/pdf-reports.php:39, includes/admin/tools/logs/class-api-requests-logs-list-table.php:154, includes/admin/tools/logs/class-gateway-error-logs-list-table.php:136 msgid "Error" msgstr "" @@ -471,7 +475,7 @@ msgstr "" msgid "Ok" msgstr "" -#: includes/class-give-scripts.php:187, includes/forms/template.php:1355, includes/admin/donors/class-donor-table.php:469, includes/admin/donors/donors.php:460, includes/admin/donors/donors.php:684, includes/admin/donors/donors.php:1066, includes/admin/payments/view-payment-details.php:633 +#: includes/class-give-scripts.php:187, includes/forms/template.php:1355, includes/admin/donors/class-donor-table.php:469, includes/admin/donors/donors.php:460, includes/admin/donors/donors.php:684, includes/admin/donors/donors.php:1066, includes/admin/payments/view-payment-details.php:632 msgid "Cancel" msgstr "" @@ -528,214 +532,218 @@ msgid "Flush error" msgstr "" #: includes/class-give-scripts.php:201 -msgid "You must choose a method." +msgid "No form selected" msgstr "" #: includes/class-give-scripts.php:202 -msgid "Required fields not completed." +msgid "You must choose a method." msgstr "" #: includes/class-give-scripts.php:203 -msgid "Are you sure you want to reset Give? This process is not reversible and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding." +msgid "Required fields not completed." msgstr "" #: includes/class-give-scripts.php:204 -msgid "Are you sure you want to delete all the test donors? This process will also delete test donations as well." +msgid "Are you sure you want to reset Give? This process is not reversible and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding." msgstr "" #: includes/class-give-scripts.php:205 -msgid "Are you sure you want to delete all the imported donors? This process will also delete imported donations as well." +msgid "Are you sure you want to delete all the test donors? This process will also delete test donations as well." msgstr "" #: includes/class-give-scripts.php:206 +msgid "Are you sure you want to delete all the imported donors? This process will also delete imported donations as well." +msgstr "" + +#: includes/class-give-scripts.php:207 msgid "Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) ." msgstr "" -#: includes/class-give-scripts.php:208 +#: includes/class-give-scripts.php:209 msgid "Do you want to delete this item?" msgstr "" -#: includes/class-give-scripts.php:209, includes/admin/admin-actions.php:299 +#: includes/class-give-scripts.php:210, includes/admin/admin-actions.php:301 msgid "You cannot set the success and failed pages to the same page" msgstr "" -#: includes/class-give-scripts.php:210 +#: includes/class-give-scripts.php:211 msgid "Dismiss this notice." msgstr "" -#: includes/class-give-scripts.php:211 +#: includes/class-give-scripts.php:212 msgid "Type to search all forms" msgstr "" -#: includes/class-give-scripts.php:212 +#: includes/class-give-scripts.php:213 msgid "Type to search all donors" msgstr "" -#: includes/class-give-scripts.php:213 +#: includes/class-give-scripts.php:214 msgid "Type to search all countries" msgstr "" -#: includes/class-give-scripts.php:214 +#: includes/class-give-scripts.php:215 msgid "Type to search all states/provinces" msgstr "" -#: includes/class-give-scripts.php:215 +#: includes/class-give-scripts.php:216 msgid "Action forbidden" msgstr "" -#: includes/class-give-scripts.php:216 +#: includes/class-give-scripts.php:217 msgid "To edit first name and last name, please go to user profile of the donor." msgstr "" -#: includes/class-give-scripts.php:217 +#: includes/class-give-scripts.php:218 msgid "Remove from Bulk Delete" msgstr "" -#: includes/class-give-scripts.php:220 +#: includes/class-give-scripts.php:221 msgid "No donors selected" msgstr "" -#: includes/class-give-scripts.php:221 +#: includes/class-give-scripts.php:222 msgid "You must choose at least one or more donors to delete." msgstr "" -#: includes/class-give-scripts.php:224 +#: includes/class-give-scripts.php:225 msgid "No action selected" msgstr "" -#: includes/class-give-scripts.php:225 +#: includes/class-give-scripts.php:226 msgid "You must select a bulk action to proceed." msgstr "" -#: includes/class-give-scripts.php:230 +#: includes/class-give-scripts.php:231 msgid "No payments selected" msgstr "" -#: includes/class-give-scripts.php:233 +#: includes/class-give-scripts.php:234 msgid "You must choose at least one or more donations to delete." msgstr "" -#: includes/class-give-scripts.php:234 +#: includes/class-give-scripts.php:235 msgid "Are you sure you want to permanently delete this donation?" msgstr "" -#: includes/class-give-scripts.php:235 +#: includes/class-give-scripts.php:236 msgid "Are you sure you want to permanently delete the selected {payment_count} donations?" msgstr "" -#: includes/class-give-scripts.php:238 +#: includes/class-give-scripts.php:239 msgid "You must choose at least one or more recipients to resend the email receipt." msgstr "" -#: includes/class-give-scripts.php:239 +#: includes/class-give-scripts.php:240 msgid "Are you sure you want to resend the email receipt to this recipient?" msgstr "" -#: includes/class-give-scripts.php:240 +#: includes/class-give-scripts.php:241 msgid "Are you sure you want to resend the emails receipt to {payment_count} recipients?" msgstr "" -#: includes/class-give-scripts.php:243 +#: includes/class-give-scripts.php:244 msgid "You must choose at least one or more donations to set status to {status}." msgstr "" -#: includes/class-give-scripts.php:244 +#: includes/class-give-scripts.php:245 msgid "Are you sure you want to set status of this donation to {status}?" msgstr "" -#: includes/class-give-scripts.php:245 +#: includes/class-give-scripts.php:246 msgid "Are you sure you want to set status of {payment_count} donations to {status}?" msgstr "" -#: includes/class-give-scripts.php:249 +#: includes/class-give-scripts.php:250 msgid "Please reload this page and try again" msgstr "" -#: includes/class-give-scripts.php:253 +#: includes/class-give-scripts.php:254 msgid "Choose Image" msgstr "" -#: includes/class-give-scripts.php:256 +#: includes/class-give-scripts.php:257 msgid "Choose File" msgstr "" -#: includes/class-give-scripts.php:260 +#: includes/class-give-scripts.php:261 msgid "No results match {search_term}" msgstr "" -#: includes/class-give-scripts.php:261 +#: includes/class-give-scripts.php:262 msgid "Searching results for match {search_term}" msgstr "" -#: includes/class-give-scripts.php:263 +#: includes/class-give-scripts.php:264 msgid "Run Updates" msgstr "" -#: includes/class-give-scripts.php:264 +#: includes/class-give-scripts.php:265 msgid "The following process will make updates to your site's database. Please create a database backup before proceeding with updates." msgstr "" -#: includes/class-give-scripts.php:265 +#: includes/class-give-scripts.php:266 msgid "Something went wrong kindly try again!" msgstr "" -#: includes/class-give-scripts.php:268 +#: includes/class-give-scripts.php:269 msgid "Changes you made may not be saved." msgstr "" -#: includes/class-give-scripts.php:350 +#: includes/class-give-scripts.php:351 msgid "Please select a payment method." msgstr "" -#: includes/class-give-scripts.php:351 +#: includes/class-give-scripts.php:352 msgid "The minimum custom donation amount for this form is" msgstr "" -#: includes/class-give-scripts.php:352 +#: includes/class-give-scripts.php:353 msgid "The maximum custom donation amount for this form is" msgstr "" -#: includes/class-give-scripts.php:353 +#: includes/class-give-scripts.php:354 msgid "Loading..." msgstr "" -#: includes/class-give-scripts.php:354 +#: includes/class-give-scripts.php:355 msgid "Please Wait..." msgstr "" -#: includes/class-give-scripts.php:368 +#: includes/class-give-scripts.php:369 msgid "Please select payment mode." msgstr "" -#: includes/class-give-scripts.php:369, includes/process-donation.php:546, includes/shortcodes.php:449, includes/admin/admin-actions.php:782 +#: includes/class-give-scripts.php:370, includes/process-donation.php:547, includes/shortcodes.php:449, includes/admin/admin-actions.php:786 msgid "Please enter your first name." msgstr "" -#: includes/class-give-scripts.php:370, includes/process-donation.php:542 +#: includes/class-give-scripts.php:371, includes/process-donation.php:543 msgid "Please enter a valid email address." msgstr "" -#: includes/class-give-scripts.php:371, includes/user-functions.php:305 +#: includes/class-give-scripts.php:372, includes/user-functions.php:305 msgid "Invalid username. Only lowercase letters (a-z) and numbers are allowed." msgstr "" -#: includes/class-give-scripts.php:372, includes/process-donation.php:846, includes/user-functions.php:410 +#: includes/class-give-scripts.php:373, includes/process-donation.php:847, includes/user-functions.php:410 msgid "Enter a password." msgstr "" -#: includes/class-give-scripts.php:373, includes/user-functions.php:414 +#: includes/class-give-scripts.php:374, includes/user-functions.php:414 msgid "Enter the password confirmation." msgstr "" -#: includes/class-give-scripts.php:374, includes/process-donation.php:521 +#: includes/class-give-scripts.php:375, includes/process-donation.php:522 msgid "You must agree to the terms and conditions." msgstr "" -#: includes/class-give-scripts.php:381 +#: includes/class-give-scripts.php:382 msgid "Loading" msgstr "" -#: includes/class-give-scripts.php:383, includes/admin/tools/views/html-admin-page-data.php:33 +#: includes/class-give-scripts.php:384, includes/admin/tools/views/html-admin-page-data.php:33 msgid "Please select an option" msgstr "" @@ -5079,7 +5087,7 @@ msgstr "" msgid "%s million" msgstr "" -#: includes/formatting.php:679, includes/formatting.php:716, includes/process-donation.php:724 +#: includes/formatting.php:679, includes/formatting.php:716, includes/process-donation.php:725 msgid "Nonce verification has failed." msgstr "" @@ -5307,11 +5315,11 @@ msgstr "" msgid "Donation History" msgstr "" -#: includes/login-register.php:118, includes/process-donation.php:826 +#: includes/login-register.php:118, includes/process-donation.php:827 msgid "The password you entered is incorrect." msgstr "" -#: includes/login-register.php:121, includes/process-donation.php:850 +#: includes/login-register.php:121, includes/process-donation.php:851 msgid "The username you entered does not exist." msgstr "" @@ -5327,7 +5335,7 @@ msgstr "" msgid "Email address already taken." msgstr "" -#: includes/login-register.php:261, includes/process-donation.php:696, includes/process-donation.php:891, includes/user-functions.php:364, includes/admin/donors/donor-actions.php:441 +#: includes/login-register.php:261, includes/process-donation.php:697, includes/process-donation.php:892, includes/user-functions.php:364, includes/admin/donors/donor-actions.php:441 msgid "Invalid email." msgstr "" @@ -5733,51 +5741,56 @@ msgstr "" msgid "This form has a maximum donation amount of %s." msgstr "" -#: includes/process-donation.php:555 +#: includes/process-donation.php:556 msgid "Please enter your primary billing address." msgstr "" -#: includes/process-donation.php:559 +#: includes/process-donation.php:560 msgid "Please enter your zip / postal code." msgstr "" -#: includes/process-donation.php:563 +#: includes/process-donation.php:564 msgid "Please enter your billing city." msgstr "" -#: includes/process-donation.php:567 +#: includes/process-donation.php:568 msgid "Please select your billing country." msgstr "" -#: includes/process-donation.php:573 +#: includes/process-donation.php:574 msgid "Please enter billing state / province / County." msgstr "" -#: includes/process-donation.php:612 +#: includes/process-donation.php:613 msgid "Please enter Company Name." msgstr "" -#: includes/process-donation.php:701 +#: includes/process-donation.php:702 msgid "The user information is invalid." msgstr "" -#: includes/process-donation.php:799, includes/user-functions.php:319 +#: includes/process-donation.php:800, includes/user-functions.php:319 msgid "You must register or login to complete your donation." msgstr "" -#: includes/process-donation.php:828, includes/forms/template.php:1345, templates/shortcode-login.php:46 +#: includes/process-donation.php:829, includes/forms/template.php:1345, templates/shortcode-login.php:46 msgid "Reset Password" msgstr "" -#: includes/process-donation.php:907, includes/user-functions.php:354 +#: includes/process-donation.php:908, includes/user-functions.php:354 msgid "Enter an email." msgstr "" -#: includes/process-donation.php:1086 +#: includes/process-donation.php:1087 msgid "The zip / postal code you entered for your billing address is invalid." msgstr "" -#: includes/process-donation.php:1431 +#. translators: %s: invalid donation amount +#: includes/process-donation.php:1393 +msgid "Donation amount %s is invalid." +msgstr "" + +#: includes/process-donation.php:1444 msgid "The First Name and Last Name fields cannot contain an email address or numbers." msgstr "" @@ -5825,19 +5838,19 @@ msgstr "" msgid "The email you entered belongs to another donor. Please use another." msgstr "" -#: includes/shortcodes.php:583, includes/admin/shortcodes/shortcode-give-totals.php:101 +#: includes/shortcodes.php:582, includes/admin/shortcodes/shortcode-give-totals.php:104 msgid "Hey! We've raised {total} of the {total_goal} we are trying to raise for this campaign!" msgstr "" -#: includes/shortcodes.php:592, includes/forms/template.php:646, includes/forms/template.php:1710, includes/admin/forms/class-metabox-form-data.php:263, includes/admin/forms/class-metabox-form-data.php:273 +#: includes/shortcodes.php:591, includes/forms/template.php:646, includes/forms/template.php:1711, includes/admin/forms/class-metabox-form-data.php:263, includes/admin/forms/class-metabox-form-data.php:273 msgid "Donate Now" msgstr "" -#: includes/shortcodes.php:870 +#: includes/shortcodes.php:909 msgid "« Previous" msgstr "" -#: includes/shortcodes.php:871 +#: includes/shortcodes.php:910 msgid "Next »" msgstr "" @@ -5904,167 +5917,167 @@ msgid_plural "Donation statuses updated successfully." msgstr[0] "" msgstr[1] "" -#: includes/admin/admin-actions.php:213 +#: includes/admin/admin-actions.php:215 msgid "The donation has been deleted." msgstr "" -#: includes/admin/admin-actions.php:221 +#: includes/admin/admin-actions.php:223 msgid "The donation receipt has been resent." msgstr "" -#: includes/admin/admin-actions.php:229 +#: includes/admin/admin-actions.php:231 msgid "The reports cache has been cleared." msgstr "" -#: includes/admin/admin-actions.php:237 +#: includes/admin/admin-actions.php:239 msgid "The donation note has been deleted." msgstr "" -#: includes/admin/admin-actions.php:251 +#: includes/admin/admin-actions.php:253 msgid "The settings have been imported." msgstr "" -#: includes/admin/admin-actions.php:259 +#: includes/admin/admin-actions.php:261 msgid "API keys have been generated." msgstr "" -#: includes/admin/admin-actions.php:267 +#: includes/admin/admin-actions.php:269 msgid "The specified user already has API keys." msgstr "" -#: includes/admin/admin-actions.php:275 +#: includes/admin/admin-actions.php:277 msgid "API keys have been regenerated." msgstr "" -#: includes/admin/admin-actions.php:283 +#: includes/admin/admin-actions.php:285 msgid "API keys have been revoked." msgstr "" -#: includes/admin/admin-actions.php:291 +#: includes/admin/admin-actions.php:293 msgid "The test email has been sent." msgstr "" -#: includes/admin/admin-actions.php:312 +#: includes/admin/admin-actions.php:315 msgid "The donation note has been added." msgstr "" -#: includes/admin/admin-actions.php:320 +#: includes/admin/admin-actions.php:323 msgid "The donation has been updated." msgstr "" -#: includes/admin/admin-actions.php:334 +#: includes/admin/admin-actions.php:337 msgid "The selected donor(s) has been deleted." msgstr "" -#: includes/admin/admin-actions.php:343 +#: includes/admin/admin-actions.php:346 msgid "The selected donor(s) and the associated donation(s) has been deleted." msgstr "" -#: includes/admin/admin-actions.php:352 +#: includes/admin/admin-actions.php:355 msgid "You must confirm to delete the selected donor(s)." msgstr "" -#: includes/admin/admin-actions.php:361, includes/admin/donors/donor-actions.php:299, includes/admin/donors/donors.php:222, includes/admin/donors/donors.php:236 +#: includes/admin/admin-actions.php:364, includes/admin/donors/donor-actions.php:299, includes/admin/donors/donors.php:222, includes/admin/donors/donors.php:236 msgid "Invalid Donor ID." msgstr "" -#: includes/admin/admin-actions.php:370 +#: includes/admin/admin-actions.php:373 msgid "Unable to delete selected donor(s)." msgstr "" -#: includes/admin/admin-actions.php:379 +#: includes/admin/admin-actions.php:382 msgid "Donor email added." msgstr "" -#: includes/admin/admin-actions.php:388 +#: includes/admin/admin-actions.php:391 msgid "Donor email removed." msgstr "" -#: includes/admin/admin-actions.php:397 +#: includes/admin/admin-actions.php:400 msgid "Failed to remove donor email." msgstr "" -#: includes/admin/admin-actions.php:406 +#: includes/admin/admin-actions.php:409 msgid "Primary email updated for donor." msgstr "" -#: includes/admin/admin-actions.php:415 +#: includes/admin/admin-actions.php:418 msgid "Failed to set primary email." msgstr "" -#: includes/admin/admin-actions.php:424 +#: includes/admin/admin-actions.php:427 msgid "User has been successfully connected with Donor." msgstr "" -#: includes/admin/admin-actions.php:433 +#: includes/admin/admin-actions.php:436 msgid "Donor information updated successfully." msgstr "" -#: includes/admin/admin-actions.php:469 +#: includes/admin/admin-actions.php:473 msgid "Give Test Mode Active" msgstr "" -#: includes/admin/admin-actions.php:513, includes/admin/tools/views/html-admin-page-import-donations.php:25, includes/admin/tools/views/html-admin-page-imports.php:47 +#: includes/admin/admin-actions.php:517, includes/admin/tools/views/html-admin-page-import-donations.php:25, includes/admin/tools/views/html-admin-page-imports.php:47 msgid "Import Donations" msgstr "" -#: includes/admin/admin-actions.php:605 +#: includes/admin/admin-actions.php:609 msgid "All donation uploaded successfully!" msgstr "" -#: includes/admin/admin-actions.php:781 +#: includes/admin/admin-actions.php:785 msgid "ERROR" msgstr "" -#: includes/admin/admin-actions.php:809, includes/admin/donors/class-donor-table.php:65, includes/admin/emails/abstract-email-notification.php:150, includes/admin/emails/class-donation-receipt-email.php:46, includes/admin/emails/class-donor-register-email.php:41, includes/admin/emails/class-email-access-email.php:42, includes/admin/reports/class-donor-reports-table.php:66, templates/history-donations.php:69, templates/shortcode-receipt.php:39 +#: includes/admin/admin-actions.php:813, includes/admin/donors/class-donor-table.php:65, includes/admin/emails/abstract-email-notification.php:150, includes/admin/emails/class-donation-receipt-email.php:46, includes/admin/emails/class-donor-register-email.php:41, includes/admin/emails/class-email-access-email.php:42, includes/admin/reports/class-donor-reports-table.php:66, templates/history-donations.php:69, templates/shortcode-receipt.php:39 msgid "Donor" msgstr "" -#: includes/admin/admin-actions.php:812 +#: includes/admin/admin-actions.php:816 msgid "View Donor Information" msgstr "" -#: includes/admin/admin-actions.php:881 +#: includes/admin/admin-actions.php:885 msgid "Error: Security issue." msgstr "" -#: includes/admin/admin-actions.php:912 +#: includes/admin/admin-actions.php:916 msgid "Error: Unable to save the address. Please check if address already exist." msgstr "" -#: includes/admin/admin-actions.php:941 +#: includes/admin/admin-actions.php:945 msgid "Successfully added a new address to the donor." msgstr "" -#: includes/admin/admin-actions.php:956 +#: includes/admin/admin-actions.php:960 msgid "Error: Unable to delete address." msgstr "" -#: includes/admin/admin-actions.php:964 +#: includes/admin/admin-actions.php:968 msgid "Successfully removed a address of donor." msgstr "" -#: includes/admin/admin-actions.php:975 +#: includes/admin/admin-actions.php:979 msgid "Error: Unable to update address. Please check if address already exist." msgstr "" -#: includes/admin/admin-actions.php:993 +#: includes/admin/admin-actions.php:997 msgid "Successfully updated a address of donor" msgstr "" -#: includes/admin/admin-actions.php:1014, includes/admin/payments/view-payment-details.php:679 +#: includes/admin/admin-actions.php:1018, includes/admin/payments/view-payment-details.php:678 msgid "Billing Address" msgstr "" -#: includes/admin/admin-actions.php:1031 +#: includes/admin/admin-actions.php:1035 msgid "Personal Address" msgstr "" -#: includes/admin/admin-actions.php:1146 +#: includes/admin/admin-actions.php:1150 msgid "Cache flushed successfully." msgstr "" -#: includes/admin/admin-actions.php:1150 +#: includes/admin/admin-actions.php:1154 msgid "An error occured while flushing the cache." msgstr "" @@ -6167,27 +6180,27 @@ msgstr "" msgid "Your settings have been saved." msgstr "" -#: includes/admin/class-admin-settings.php:328 +#: includes/admin/class-admin-settings.php:338 msgid "Add Field" msgstr "" -#: includes/admin/class-admin-settings.php:463 +#: includes/admin/class-admin-settings.php:473 msgid "Remove setting field" msgstr "" -#: includes/admin/class-admin-settings.php:672, includes/admin/give-metabox-functions.php:775 +#: includes/admin/class-admin-settings.php:682, includes/admin/give-metabox-functions.php:775 msgid "Add or Upload %s" msgstr "" -#: includes/admin/class-admin-settings.php:672, includes/admin/give-metabox-functions.php:775 +#: includes/admin/class-admin-settings.php:682, includes/admin/give-metabox-functions.php:775 msgid "File" msgstr "" -#: includes/admin/class-admin-settings.php:672, includes/admin/give-metabox-functions.php:775 +#: includes/admin/class-admin-settings.php:682, includes/admin/give-metabox-functions.php:775 msgid "Image" msgstr "" -#: includes/admin/class-admin-settings.php:826, includes/admin/give-metabox-functions.php:867 +#: includes/admin/class-admin-settings.php:836, includes/admin/give-metabox-functions.php:867 msgid "Need Help? See docs on \"%s\"" msgstr "" @@ -7206,49 +7219,49 @@ msgstr "" #. translators: %s: form #. translators: %s: form #. translators: %s: form -#: includes/api/class-give-api.php:1034, includes/api/class-give-api.php:1262, includes/api/class-give-api.php:1390 +#: includes/api/class-give-api.php:1034, includes/api/class-give-api.php:1278, includes/api/class-give-api.php:1406 msgid "Form %s not found." msgstr "" -#: includes/api/class-give-api.php:1165, includes/api/class-give-api.php:1280 +#: includes/api/class-give-api.php:1165, includes/api/class-give-api.php:1296 msgid "The end date must be later than the start date." msgstr "" -#: includes/api/class-give-api.php:1170, includes/api/class-give-api.php:1285 +#: includes/api/class-give-api.php:1170, includes/api/class-give-api.php:1301 msgid "Invalid or no date range specified." msgstr "" -#: includes/api/class-give-api.php:1784 +#: includes/api/class-give-api.php:1800 msgid "Give API Keys" msgstr "" -#: includes/api/class-give-api.php:1793 +#: includes/api/class-give-api.php:1809 msgid "Generate API Key" msgstr "" -#: includes/api/class-give-api.php:1795 +#: includes/api/class-give-api.php:1811 msgid "Public key:" msgstr "" -#: includes/api/class-give-api.php:1799 +#: includes/api/class-give-api.php:1815 msgid "Secret key:" msgstr "" -#: includes/api/class-give-api.php:1803 +#: includes/api/class-give-api.php:1819 msgid "Token:" msgstr "" -#: includes/api/class-give-api.php:1808 +#: includes/api/class-give-api.php:1824 msgid "Revoke API Keys" msgstr "" -#: includes/api/class-give-api.php:1836 +#: includes/api/class-give-api.php:1852 msgid "User ID Required." msgstr "" #. translators: %s: process #. translators: %s: process -#: includes/api/class-give-api.php:1851, includes/api/class-give-api.php:1856 +#: includes/api/class-give-api.php:1867, includes/api/class-give-api.php:1872 msgid "You do not have permission to %s API keys for this user." msgstr "" @@ -7404,7 +7417,7 @@ msgstr "" msgid "Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:" msgstr "" -#: includes/emails/functions.php:114, includes/admin/payments/view-payment-details.php:432 +#: includes/emails/functions.php:114, includes/admin/payments/view-payment-details.php:431 msgid "Donation Date:" msgstr "" @@ -7681,15 +7694,15 @@ msgstr "" msgid "Donation Total:" msgstr "" -#: includes/forms/template.php:1944 +#: includes/forms/template.php:1945 msgid "Notice:" msgstr "" -#: includes/forms/template.php:1944 +#: includes/forms/template.php:1945 msgid "Test mode is enabled. While in test mode no live donations are processed." msgstr "" -#: includes/forms/template.php:1974 +#: includes/forms/template.php:1975 msgid "Please log in in order to complete your donation." msgstr "" @@ -8211,7 +8224,7 @@ msgstr "" msgid "Edit Donor" msgstr "" -#: includes/admin/donors/donors.php:376, includes/admin/payments/view-payment-details.php:550 +#: includes/admin/donors/donors.php:376, includes/admin/payments/view-payment-details.php:549 msgid "Donor ID:" msgstr "" @@ -8239,7 +8252,7 @@ msgstr "" msgid "View User Profile" msgstr "" -#: includes/admin/donors/donors.php:440, includes/admin/payments/view-payment-details.php:602 +#: includes/admin/donors/donors.php:440, includes/admin/payments/view-payment-details.php:601 msgid "Company Name:" msgstr "" @@ -8269,35 +8282,35 @@ msgstr "" msgid "Add Address" msgstr "" -#: includes/admin/donors/donors.php:583, includes/admin/payments/view-payment-details.php:699 +#: includes/admin/donors/donors.php:583, includes/admin/payments/view-payment-details.php:698 msgid "Country:" msgstr "" -#: includes/admin/donors/donors.php:594, includes/admin/payments/view-payment-details.php:709 +#: includes/admin/donors/donors.php:594, includes/admin/payments/view-payment-details.php:708 msgid "Select a country" msgstr "" -#: includes/admin/donors/donors.php:602, includes/admin/payments/view-payment-details.php:719 +#: includes/admin/donors/donors.php:602, includes/admin/payments/view-payment-details.php:718 msgid "Address 1:" msgstr "" -#: includes/admin/donors/donors.php:610, includes/admin/payments/view-payment-details.php:726 +#: includes/admin/donors/donors.php:610, includes/admin/payments/view-payment-details.php:725 msgid "Address 2:" msgstr "" -#: includes/admin/donors/donors.php:619, includes/admin/payments/view-payment-details.php:733 +#: includes/admin/donors/donors.php:619, includes/admin/payments/view-payment-details.php:732 msgid "City:" msgstr "" -#: includes/admin/donors/donors.php:632, includes/admin/payments/view-payment-details.php:744 +#: includes/admin/donors/donors.php:632, includes/admin/payments/view-payment-details.php:743 msgid "State / Province / County:" msgstr "" -#: includes/admin/donors/donors.php:658, includes/admin/payments/view-payment-details.php:756 +#: includes/admin/donors/donors.php:658, includes/admin/payments/view-payment-details.php:755 msgid "Select a state" msgstr "" -#: includes/admin/donors/donors.php:671, includes/admin/payments/view-payment-details.php:771 +#: includes/admin/donors/donors.php:671, includes/admin/payments/view-payment-details.php:770 msgid "Zip / Postal Code:" msgstr "" @@ -9058,7 +9071,7 @@ msgstr "" msgid "Resend Donation %s Receipt" msgstr "" -#: includes/admin/payments/class-payments-table.php:591, includes/admin/payments/view-payment-details.php:259 +#: includes/admin/payments/class-payments-table.php:591, includes/admin/payments/view-payment-details.php:258 msgid "Resend Receipt" msgstr "" @@ -9169,107 +9182,107 @@ msgstr "" msgid "Time:" msgstr "" -#: includes/admin/payments/view-payment-details.php:206, includes/admin/payments/view-payment-details.php:468 +#: includes/admin/payments/view-payment-details.php:206, includes/admin/payments/view-payment-details.php:467 msgid "Total Donation:" msgstr "" -#: includes/admin/payments/view-payment-details.php:245 +#: includes/admin/payments/view-payment-details.php:244 msgid "Save Donation" msgstr "" -#: includes/admin/payments/view-payment-details.php:285 +#: includes/admin/payments/view-payment-details.php:284 msgid "Donation Meta" msgstr "" -#: includes/admin/payments/view-payment-details.php:305 +#: includes/admin/payments/view-payment-details.php:304 msgid "Gateway:" msgstr "" -#: includes/admin/payments/view-payment-details.php:313 +#: includes/admin/payments/view-payment-details.php:312 msgid "Key:" msgstr "" -#: includes/admin/payments/view-payment-details.php:320 +#: includes/admin/payments/view-payment-details.php:319 msgid "IP:" msgstr "" -#: includes/admin/payments/view-payment-details.php:332 +#: includes/admin/payments/view-payment-details.php:331 msgid "Transaction ID:" msgstr "" -#: includes/admin/payments/view-payment-details.php:332 +#: includes/admin/payments/view-payment-details.php:331 msgid "The transaction ID within %s." msgstr "" -#: includes/admin/payments/view-payment-details.php:340 +#: includes/admin/payments/view-payment-details.php:339 msgid "View all donations for this donor »" msgstr "" -#: includes/admin/payments/view-payment-details.php:397 +#: includes/admin/payments/view-payment-details.php:396 msgid "Donation Information" msgstr "" -#: includes/admin/payments/view-payment-details.php:404 +#: includes/admin/payments/view-payment-details.php:403 msgid "Donation Form ID:" msgstr "" -#: includes/admin/payments/view-payment-details.php:416 +#: includes/admin/payments/view-payment-details.php:415 msgid "Donation Form Title:" msgstr "" -#: includes/admin/payments/view-payment-details.php:436 +#: includes/admin/payments/view-payment-details.php:435 msgid "Donation Level:" msgstr "" -#: includes/admin/payments/view-payment-details.php:541 +#: includes/admin/payments/view-payment-details.php:540 msgid "Donor Details" msgstr "" -#: includes/admin/payments/view-payment-details.php:560 +#: includes/admin/payments/view-payment-details.php:559 msgid "Create New Donor" msgstr "" -#: includes/admin/payments/view-payment-details.php:563 +#: includes/admin/payments/view-payment-details.php:562 msgid "Donor Since:" msgstr "" -#: includes/admin/payments/view-payment-details.php:569 +#: includes/admin/payments/view-payment-details.php:568 msgid "Donor Name:" msgstr "" -#: includes/admin/payments/view-payment-details.php:583 +#: includes/admin/payments/view-payment-details.php:582 msgid "Donor Email:" msgstr "" -#: includes/admin/payments/view-payment-details.php:589 +#: includes/admin/payments/view-payment-details.php:588 msgid "Change Donor:" msgstr "" -#: includes/admin/payments/view-payment-details.php:613 +#: includes/admin/payments/view-payment-details.php:612 msgid "New Donor First Name:" msgstr "" -#: includes/admin/payments/view-payment-details.php:619 +#: includes/admin/payments/view-payment-details.php:618 msgid "New Donor Last Name:" msgstr "" -#: includes/admin/payments/view-payment-details.php:625 +#: includes/admin/payments/view-payment-details.php:624 msgid "New Donor Email:" msgstr "" -#: includes/admin/payments/view-payment-details.php:635 +#: includes/admin/payments/view-payment-details.php:634 msgid "Click \"Save Donation\" to create new donor." msgstr "" -#: includes/admin/payments/view-payment-details.php:811 +#: includes/admin/payments/view-payment-details.php:810 msgid "Donation Notes" msgstr "" -#: includes/admin/payments/view-payment-details.php:828 +#: includes/admin/payments/view-payment-details.php:827 msgid "No donation notes." msgstr "" -#: includes/admin/payments/view-payment-details.php:834 +#: includes/admin/payments/view-payment-details.php:833 msgid "Add Note" msgstr "" @@ -9390,7 +9403,7 @@ msgstr "" msgid "Report Type" msgstr "" -#: includes/admin/reports/reports.php:200, includes/admin/shortcodes/shortcode-give-donation-grid.php:70, includes/admin/shortcodes/shortcode-give-donation-grid.php:80, includes/admin/shortcodes/shortcode-give-donation-grid.php:90, includes/admin/shortcodes/shortcode-give-form.php:70, includes/admin/shortcodes/shortcode-give-form.php:80, includes/admin/shortcodes/shortcode-give-goal.php:71, includes/admin/shortcodes/shortcode-give-goal.php:81, includes/admin/shortcodes/shortcode-give-receipt.php:50, includes/admin/shortcodes/shortcode-give-receipt.php:59, includes/admin/shortcodes/shortcode-give-receipt.php:68, includes/admin/shortcodes/shortcode-give-receipt.php:77, includes/admin/shortcodes/shortcode-give-receipt.php:86, includes/admin/shortcodes/shortcode-give-receipt.php:95, includes/admin/shortcodes/shortcode-give-totals.php:125 +#: includes/admin/reports/reports.php:200, includes/admin/shortcodes/shortcode-give-donation-grid.php:70, includes/admin/shortcodes/shortcode-give-donation-grid.php:80, includes/admin/shortcodes/shortcode-give-donation-grid.php:90, includes/admin/shortcodes/shortcode-give-form.php:70, includes/admin/shortcodes/shortcode-give-form.php:80, includes/admin/shortcodes/shortcode-give-goal.php:71, includes/admin/shortcodes/shortcode-give-goal.php:81, includes/admin/shortcodes/shortcode-give-receipt.php:50, includes/admin/shortcodes/shortcode-give-receipt.php:59, includes/admin/shortcodes/shortcode-give-receipt.php:68, includes/admin/shortcodes/shortcode-give-receipt.php:77, includes/admin/shortcodes/shortcode-give-receipt.php:86, includes/admin/shortcodes/shortcode-give-receipt.php:95, includes/admin/shortcodes/shortcode-give-totals.php:128 msgid "Show" msgstr "" @@ -9851,7 +9864,7 @@ msgstr "" msgid "Do you want to display the goal's progress bar?" msgstr "" -#: includes/admin/shortcodes/shortcode-give-donation-grid.php:71, includes/admin/shortcodes/shortcode-give-donation-grid.php:81, includes/admin/shortcodes/shortcode-give-donation-grid.php:91, includes/admin/shortcodes/shortcode-give-form.php:71, includes/admin/shortcodes/shortcode-give-form.php:81, includes/admin/shortcodes/shortcode-give-goal.php:72, includes/admin/shortcodes/shortcode-give-goal.php:82, includes/admin/shortcodes/shortcode-give-receipt.php:51, includes/admin/shortcodes/shortcode-give-receipt.php:60, includes/admin/shortcodes/shortcode-give-receipt.php:69, includes/admin/shortcodes/shortcode-give-receipt.php:78, includes/admin/shortcodes/shortcode-give-receipt.php:87, includes/admin/shortcodes/shortcode-give-receipt.php:96, includes/admin/shortcodes/shortcode-give-totals.php:126 +#: includes/admin/shortcodes/shortcode-give-donation-grid.php:71, includes/admin/shortcodes/shortcode-give-donation-grid.php:81, includes/admin/shortcodes/shortcode-give-donation-grid.php:91, includes/admin/shortcodes/shortcode-give-form.php:71, includes/admin/shortcodes/shortcode-give-form.php:81, includes/admin/shortcodes/shortcode-give-goal.php:72, includes/admin/shortcodes/shortcode-give-goal.php:82, includes/admin/shortcodes/shortcode-give-receipt.php:51, includes/admin/shortcodes/shortcode-give-receipt.php:60, includes/admin/shortcodes/shortcode-give-receipt.php:69, includes/admin/shortcodes/shortcode-give-receipt.php:78, includes/admin/shortcodes/shortcode-give-receipt.php:87, includes/admin/shortcodes/shortcode-give-receipt.php:96, includes/admin/shortcodes/shortcode-give-totals.php:129 msgid "Hide" msgstr "" @@ -9953,7 +9966,7 @@ msgstr "" msgid "This text displays the amount of income raised compared to the goal." msgstr "" -#: includes/admin/shortcodes/shortcode-give-goal.php:78, includes/admin/shortcodes/shortcode-give-totals.php:122 +#: includes/admin/shortcodes/shortcode-give-goal.php:78, includes/admin/shortcodes/shortcode-give-totals.php:125 msgid "Show Progress Bar:" msgstr "" @@ -10057,35 +10070,39 @@ msgstr "" msgid "Enter the total goal amount that you would like to display." msgstr "" -#: includes/admin/shortcodes/shortcode-give-totals.php:99 +#: includes/admin/shortcodes/shortcode-give-totals.php:96 +msgid "Please enter a valid total goal amount." +msgstr "" + +#: includes/admin/shortcodes/shortcode-give-totals.php:102 msgid "Message:" msgstr "" -#: includes/admin/shortcodes/shortcode-give-totals.php:100 +#: includes/admin/shortcodes/shortcode-give-totals.php:103 msgid "Enter a message to display encouraging donors to support the goal." msgstr "" -#: includes/admin/shortcodes/shortcode-give-totals.php:109 +#: includes/admin/shortcodes/shortcode-give-totals.php:112 msgid "Link:" msgstr "" -#: includes/admin/shortcodes/shortcode-give-totals.php:110 +#: includes/admin/shortcodes/shortcode-give-totals.php:113 msgid "Enter a link to the main campaign donation form." msgstr "" -#: includes/admin/shortcodes/shortcode-give-totals.php:115 +#: includes/admin/shortcodes/shortcode-give-totals.php:118 msgid "Link Text:" msgstr "" -#: includes/admin/shortcodes/shortcode-give-totals.php:116 +#: includes/admin/shortcodes/shortcode-give-totals.php:119 msgid "Enter hyperlink text for the link to the main campaign donation form." msgstr "" -#: includes/admin/shortcodes/shortcode-give-totals.php:117 +#: includes/admin/shortcodes/shortcode-give-totals.php:120 msgid "Donate!" msgstr "" -#: includes/admin/shortcodes/shortcode-give-totals.php:123 +#: includes/admin/shortcodes/shortcode-give-totals.php:126 msgid "Select whether you would like to show a goal progress bar." msgstr "" @@ -10418,19 +10435,19 @@ msgstr "" msgid "Donor's Billing Address" msgstr "" -#: includes/admin/tools/export/give-export-donations-functions.php:486 +#: includes/admin/tools/export/give-export-donations-functions.php:495 msgid "Custom Field Columns:" msgstr "" -#: includes/admin/tools/export/give-export-donations-functions.php:491 +#: includes/admin/tools/export/give-export-donations-functions.php:500 msgid "The following fields may have been created by custom code, or another plugin." msgstr "" -#: includes/admin/tools/export/give-export-donations-functions.php:511 +#: includes/admin/tools/export/give-export-donations-functions.php:520 msgid "Hidden Custom Field Columns:" msgstr "" -#: includes/admin/tools/export/give-export-donations-functions.php:516 +#: includes/admin/tools/export/give-export-donations-functions.php:525 msgid "The following hidden custom fields contain data created by Give Core, a Give Add-on, another plugin, etc.
Hidden fields are generally used for programming logic, but you may contain data you would like to export." msgstr "" diff --git a/readme.txt b/readme.txt index 3789e305e2..cb9c0c1c9a 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: donation, donations, donation plugin, wordpress donation plugin, givewp, g Requires at least: 4.8 Tested up to: 4.9 Requires PHP: 5.3 -Stable tag: 2.1.3 +Stable tag: 2.1.4 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -208,6 +208,25 @@ Use Give for donations, and let WooCommerce or WP eCommerce or the like handle y == Changelog == += 2.1.4: June 5th, 2018 = +* New: Added support for multiple messages passed to Give's internal notice API. [#1936](https://github.com/wordimpress/give/issues/1936) +* New: Added a new check for add-ons to always check the minimum Give version required prior to being able to update. This will prevent the case where an add-on is updated and requires a new version of Give Core than is currently running and deactivates itself. [#3217](https://github.com/wordimpress/give/issues/3217) +* Tweak: Improved how a donation amount is saved within the internal Give_Payment class. [#3304](https://github.com/wordimpress/give/issues/3304) +* Tweak: If a gateway is marked as disabled in the admin settings then disable the option to set it as the default gateway. [#3296](https://github.com/wordimpress/give/issues/3296) +* Fix: Improved the layout of the export donations columns so that they look good on mobile devices and more. [#3266](https://github.com/wordimpress/give/issues/3266) +* Fix: Preventing PHP notices related to AKISMET admin settings when saving. [#3260](https://github.com/wordimpress/give/issues/3260) +* Fix: Prevent the licenses tab from displaying in settings if there are no add-ons installed. [#3254](https://github.com/wordimpress/give/issues/3254) +* Fix: The Give API was not respecting date ranges for earnings and donations endpoints. [#3191](https://github.com/wordimpress/give/issues/3191) +* Fix: Plugin conflict with WPML where the plugin would display language settings within Give's admin settings incorrectly. [#3314](https://github.com/wordimpress/give/issues/3314) +* Fix: In button mode text would display incorrectly from the form if closing the modal popup. [#3301](https://github.com/wordimpress/give/issues/3301) +* Fix: Plugin conflict where WPML would cause the give_totals shortcode to output the incorrect donation amounts. [#3291](https://github.com/wordimpress/give/issues/3291) +* Fix: The Give notice dismiss button should work when rendering Give notices using JS. [#3278](https://github.com/wordimpress/give/issues/3278) +* Fix: Theme conflict with Woo's Storefron theme where Give's admin footer text would overlap some elements. [#3274](https://github.com/wordimpress/give/issues/3274) +* Fix: Ensure that Give's state field doesn't lose its style when switching countries. [#3255](https://github.com/wordimpress/give/issues/3255) +* Fix: Don't allow the set donation amount to be less than the minimum amount when saving donation forms in wp-admin. [#3249](https://github.com/wordimpress/give/issues/3249) +* Fix: The "total" attribute is now required for the give_totals shortcode so you don't have a blank goal displaying on the website. [#3060](https://github.com/wordimpress/give/issues/3060) +* Fix: Resolved a form grid shortcode issue where the Payment Method field would display incorrect when only one gateway is enabled. [#3293](https://github.com/wordimpress/give/issues/3293) + = 2.1.3: May 23rd, 2018 = * New: Better SPAM protection through the usage of improved client and server side validation to only allow alphabet characters for first and last name, validation to ensure that the gateway field is not left empty (to compbat SPAM bot scripts), and sanitize all input fields when processing the donation. [#3035](https://github.com/WordImpress/Give/issues/3035#issuecomment-391393093) * New: Added new customizable "Email Heading" fields for all Core emails (coming soon to add-ons as well). [#3110](https://github.com/WordImpress/Give/issues/3110) @@ -217,7 +236,7 @@ Use Give for donations, and let WooCommerce or WP eCommerce or the like handle y * Fix: The add-on plugin activation banner now displays properly without having to refresh the plugins screen to see it. [#3153](https://github.com/WordImpress/Give/issues/3153) * Fix: Give's shortcode picker was having an incompatibility with Elementor causing the TinyMCE to be partially blocked. [#3171](https://github.com/WordImpress/Give/issues/3171) * Fix: Give was conflicting with Beaver Builder preventing users from seeing the builder options within the WP-admin single page/post view. [#3207](https://github.com/WordImpress/Give/issues/3207) -* Fix: Give's API was not repecting the date range parameters passed to it. Now it does so you can filter the API by date ranges as expected. [#3191](https://github.com/WordImpress/Give/issues/3191) +* Fix: Give's API was not respecting the date range parameters passed to it. Now it does so you can filter the API by date ranges as expected. [#3191](https://github.com/WordImpress/Give/issues/3191) * Fix: This version contains a database cleanup routine to delete donation payment meta that is not attached to any payment. For instance, if you deleted a payment the metadata associated with it still remained prior to this version. With this upgrade the orphaned data will be removed. [#3205](https://github.com/WordImpress/Give/issues/3205) * Fix: Resolved PHP notices when exporting donor in lower PHP versions. (#3222)[https://github.com/WordImpress/Give/issues/3222], [#3218](https://github.com/WordImpress/Give/issues/3218) * Fix: We've updated the donation form's
tag ID so it's unique per form for better W3C compatibility and to ensure Stripe elements works as expected with multiple forms on a single page. [#3139](https://github.com/WordImpress/Give/issues/3139) @@ -415,4 +434,4 @@ Use Give for donations, and let WooCommerce or WP eCommerce or the like handle y This version contains a database cleanup routine to delete donation payment meta that is not attached to any payment. For instance, if you deleted a payment the metadata associated with it still remained prior to this version. With this upgrade the orphaned data will be removed. = 2.1.0 = -This new version is full of many great features and enhancements. Please ensure you have a backup in place prior to updating and be sure to update Give Core and then your Give Add-ons to the latest versions for maximum compatibility. \ No newline at end of file +This new version is full of many great features and enhancements. Please ensure you have a backup in place prior to updating and be sure to update Give Core and then your Give Add-ons to the latest versions for maximum compatibility. diff --git a/webpack.config.js b/webpack.config.js index b9e773dbfd..b1d204d659 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,6 +16,7 @@ const config = { 'admin-shortcode-button': [ './assets/src/css/admin/shortcodes.scss' ], give: [ './assets/src/js/frontend/give.js', './assets/src/css/frontend/give-frontend.scss' ], gutenberg: [ './blocks/load.js' ], + 'admin-shortcodes': './includes/admin/shortcodes/admin-shortcodes.js', }, // Tell webpack where to output.