Skip to content

Commit

Permalink
Merge branch 'develop' into fix/sidebar-panel-overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaHungDinh authored Jun 25, 2024
2 parents 9742998 + 52434ca commit 7b0ce1c
Show file tree
Hide file tree
Showing 43 changed files with 1,491 additions and 338 deletions.
11 changes: 2 additions & 9 deletions assets/src/css/admin/sale-banners.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
display: block;
width: 100%;
position: relative;
padding: 1.75rem 0 1.5rem 2.75rem;
box-shadow: 0 0.0625em 0.25em rgba(0, 0, 0, 0.25);
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
Expand Down Expand Up @@ -49,18 +47,13 @@
}
}

/* Reports page */
.give_forms_page_give-reports {
.givewp-sale-banners-container {
margin: .5rem 0 0 0;
}
}

.givewp-sale-banner {
&__content {
width: 70%;
line-height: normal;
font-style: normal;
padding: 1.75rem 0 1.5rem 2.75rem;
box-shadow: 0 0.0625em 0.25em rgba(0, 0, 0, 0.25);

& h2 {
font-size: 2rem;
Expand Down
4 changes: 3 additions & 1 deletion assets/src/css/plugins/modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@
}

&__description {
margin: 0 0 1.5rem;
margin: 0 0 1rem;
padding: 0;
font-size: 16px;
font-weight: 500;
}

.give-spinner-wrap{
Expand Down
342 changes: 183 additions & 159 deletions assets/src/js/admin/paypal-commerce/index.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion assets/src/js/admin/reports/widget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ import RESTChart from '../components/rest-chart';
import RESTMiniChart from '../components/rest-mini-chart';
import LoadingNotice from '../components/loading-notice';
import MiniPeriodSelector from '../components/mini-period-selector';
import useBannerVisibility from '../../../../../../src/Promotions/ReportsWidgetBanner/hooks/useBannerVisibility.ts';
import WidgetBanner from '../../../../../../src/Promotions/ReportsWidgetBanner/components/WidgetBanner';

const Widget = () => {
const [{giveStatus, pageLoaded}] = useStoreValue();
const [{giveStatus, pageLoaded, widgetBanner}] = useStoreValue();
const {hideWidgetBanner, isVisible} = useBannerVisibility();

return (
<div className="givewp-reports-widget-container">
{isVisible && <WidgetBanner hideWidgetBanner={hideWidgetBanner} />}
{giveStatus === 'no_donations_found' && <RecurringAddonOverlay />}
{pageLoaded === false && <LoadingNotice />}
<Grid gap="12px" visible={pageLoaded}>
Expand Down
4 changes: 2 additions & 2 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: GiveWP
* Author URI: https://givewp.com/
* Version: 3.12.0
* Version: 3.12.3
* Requires at least: 6.3
* Requires PHP: 7.2
* Text Domain: give
Expand Down Expand Up @@ -404,7 +404,7 @@ private function setup_constants()
{
// Plugin version.
if (!defined('GIVE_VERSION')) {
define('GIVE_VERSION', '3.12.0');
define('GIVE_VERSION', '3.12.3');
}

// Plugin Root File.
Expand Down
4 changes: 3 additions & 1 deletion includes/admin/tools/export/export-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function give_do_ajax_export() {
* Note: This function is for internal purposes only.
* Use filter "give_export_donors_get_default_columns" instead.
*
* @since 3.12.1 add donor_phone_number column.
* @since 2.2.6
*
* @return array
Expand All @@ -154,7 +155,8 @@ function give_export_donors_get_default_columns() {
'address' => __( 'Address', 'give' ),
'userid' => __( 'User ID', 'give' ),
'donor_created_date' => __( 'Donor Created Date', 'give' ),
'donations' => __( 'Number of donations', 'give' ),
'donor_phone_number' => __( 'Donor Phone Number', 'give' ),
'donations' => __( 'Number of donations', 'give' ),
'donation_sum' => __( 'Total Donated', 'give' ),
];

Expand Down
11 changes: 11 additions & 0 deletions includes/admin/tools/export/give-export-donations-exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public function csv_cols() {
/**
* CSV file columns.
*
* @since 3.12.1 add phone column.
* @since 2.1
*
* @param array $columns
Expand Down Expand Up @@ -199,6 +200,9 @@ private function get_cols( $columns ) {
$cols['address_zip'] = __( 'Zip', 'give' );
$cols['address_country'] = __( 'Country', 'give' );
break;
case 'phone':
$cols['phone'] = __( 'Donor Phone Number', 'give' );
break;
case 'comment':
$cols['comment'] = __( 'Donor Comment', 'give' );
break;
Expand Down Expand Up @@ -314,6 +318,7 @@ public function get_donation_argument( $args = array() ) {
*
* @access public
*
* @since 3.12.1 add donor phone.
* @since 2.1
*
* @global object $wpdb Used to query the database using the WordPress database API.
Expand Down Expand Up @@ -374,6 +379,10 @@ public function get_data() {
$data[ $i ]['address_country'] = isset( $address['country'] ) ? $address['country'] : '';
}

if ( ! empty( $columns['phone'] ) ) {
$data[ $i ]['phone'] = $payment_meta['_give_payment_donor_phone'];
}

if ( ! empty( $columns['comment'] ) ) {
$comment = give_get_donor_donation_comment( $payment->ID, $payment->donor_id );
$data[ $i ]['comment'] = ! empty( $comment ) ? $comment->comment_content : '';
Expand Down Expand Up @@ -674,13 +683,15 @@ public function print_csv_rows() {
* Escapes CSV cell data to protect against CSV injection.
* @link https://owasp.org/www-community/attacks/CSV_Injection
*
* @since 3.12.1 sanitize + prefix
* @since 2.25.2
*
* @param mixed|string $cellData
*
* @return mixed|string
*/
protected function escape_csv_cell_data($cellData) {
$cellData = str_replace('+', '', $cellData);
$firstCharacter = substr($cellData, 0, 1);
if( in_array($firstCharacter, array('=', '+', '-', '@')) ) {
$cellData = "'" . $cellData;
Expand Down
31 changes: 20 additions & 11 deletions includes/admin/tools/export/give-export-donations-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ function give_export_donations_get_custom_fields() {
$donation_list = implode( ',', (array) give_get_payments( $args ) );

$query_and = sprintf(
"AND $wpdb->posts.ID IN (%s)
AND $wpdb->donationmeta.meta_key != ''
"AND $wpdb->posts.ID IN (%s)
AND $wpdb->donationmeta.meta_key != ''
AND $wpdb->donationmeta.meta_key NOT RegExp '(^[_0-9].+$)'",
$donation_list
);

$query = "
SELECT DISTINCT($wpdb->donationmeta.meta_key)
FROM $wpdb->posts
LEFT JOIN $wpdb->donationmeta
SELECT DISTINCT($wpdb->donationmeta.meta_key)
FROM $wpdb->posts
LEFT JOIN $wpdb->donationmeta
ON $wpdb->posts.ID = {$wpdb->donationmeta}.{$donationmeta_table_key}
WHERE $wpdb->posts.post_type = '%s'
" . $query_and;
Expand All @@ -56,17 +56,17 @@ function give_export_donations_get_custom_fields() {
}

$query_and = sprintf(
"AND $wpdb->posts.ID IN (%s)
AND $wpdb->donationmeta.meta_key != ''
"AND $wpdb->posts.ID IN (%s)
AND $wpdb->donationmeta.meta_key != ''
AND $wpdb->donationmeta.meta_key NOT RegExp '^[^_]'",
$donation_list
);

$query = "
SELECT DISTINCT($wpdb->donationmeta.meta_key)
FROM $wpdb->posts
LEFT JOIN $wpdb->donationmeta
ON $wpdb->posts.ID = {$wpdb->donationmeta}.{$donationmeta_table_key}
SELECT DISTINCT($wpdb->donationmeta.meta_key)
FROM $wpdb->posts
LEFT JOIN $wpdb->donationmeta
ON $wpdb->posts.ID = {$wpdb->donationmeta}.{$donationmeta_table_key}
WHERE $wpdb->posts.post_type = '%s'
" . $query_and;

Expand Down Expand Up @@ -229,6 +229,7 @@ function give_export_donation_form_search_args( $args ) {
/**
* Add Donation standard fields in export donation page
*
* @since 3.12.1 add Donor Phone Number to donor fields.
* @since 2.1
*/
function give_export_donation_standard_fields() {
Expand Down Expand Up @@ -472,6 +473,14 @@ function give_export_donation_standard_fields() {
</label>
</li>

<li>
<label for="give-export-phone">
<input type="checkbox" checked
name="give_give_donations_export_option[phone]"
id="give-export-address"><?php _e( 'Donor\'s Phone Number', 'give' ); ?>
</label>
</li>

<li>
<label for="give-export-comment">
<input type="checkbox" checked
Expand Down
15 changes: 14 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding
Requires at least: 6.3
Tested up to: 6.5
Requires PHP: 7.2
Stable tag: 3.12.0
Stable tag: 3.12.3
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -262,6 +262,19 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri
10. Use almost any payment gateway integration with GiveWP through our add-ons or by creating your own add-on.

== Changelog ==
= 3.12.3: June 19th, 2024 =
* Fix: Resolved an issue where PayPal was not processing donations due to missing billing address fields

= 3.12.2: June 11th, 2024 =
* Fix: Resolved an issue where only the donation amount was sent to PayPal, ignoring event ticket values for one-time donations.
* Fix: Resolved an issue where donations were processed on PayPal but not recorded in GiveWP due to missing city, state, and zip fields.

= 3.12.1: June 5th, 2024 =
* Fix: Resolved an issue where the Donor Phone field was not included in the donor export
* Fix: Resolved an issue where the Billing Address field was not saved in Stripe
* Security: Added additional escaping to Stripe onboarding
* Dev: Added a new filter `givewp_log_source_view` to allow customization of the log source column

= 3.12.0: May 15th, 2024 =
* New: Updated the donation amount block with options for donation amount level description in the visual form builder
* New: Updated form goal settings with options for start and end dates in the visual form builder
Expand Down
5 changes: 4 additions & 1 deletion src/API/Endpoints/Logs/GetLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ public function getSchema()
}

/**
* @since 3.12.1 Add 'givewp_log_source_view' filter
*
* @param WP_REST_Request $request
*
* @return WP_REST_Response
Expand All @@ -157,7 +159,8 @@ public function handleRequest(WP_REST_Request $request)
'id' => $log->getId(),
'log_type' => $log->getType(),
'category' => $log->getCategory(),
'source' => $log->getSource(),
'source' => apply_filters('givewp_log_source_view', $log->getSource(), $log->getContext(),
$log->getId()),
'message' => $log->getMessage(),
'context' => $log->getContext(),
'date' => $log->getDate(),
Expand Down
2 changes: 1 addition & 1 deletion src/DonationForms/Repositories/DonationFormRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private function validateProperties(DonationForm $donationForm)
}

/**
* @unreleased Prevent returning forms without the "formBuilderSettings" and "formBuilderFields" meta keys
* @since 3.12.1 Prevent returning forms without the "formBuilderSettings" and "formBuilderFields" meta keys
* @since 3.0.0
*
* @return ModelQueryBuilder<DonationForm>
Expand Down
1 change: 1 addition & 0 deletions src/DonationForms/resources/styles/_base-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ input[type="email"],
textarea {
&:focus {
border-color: transparent;
--box-shadow: 0 0 0 var(--outline-width) var(--form-element-focus-color);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
namespace Give\EventTickets\Actions;

use Give\Donations\Models\Donation;
use Give\EventTickets\DataTransferObjects\TicketPurchaseData;
use Give\EventTickets\DataTransferObjects\EventTicketTypeData;
use Give\EventTickets\DataTransferObjects\TicketPurchaseData;
use Give\EventTickets\Fields\EventTickets;
use Give\EventTickets\Models\EventTicket;
use Give\EventTickets\Models\EventTicketType;
use Give\EventTickets\Repositories\EventRepository;
use Give\Framework\Blocks\BlockModel;
use Give\Framework\FieldsAPI\Exceptions\EmptyNameException;
Expand All @@ -16,13 +14,14 @@
class ConvertEventTicketsBlockToFieldsApi
{
/**
* @since 3.12.2 Remove event ID from field name
* @since 3.6.0
*
* @throws EmptyNameException
*/
public function __invoke(BlockModel $block, int $formId)
{
return EventTickets::make($block->getShortName() . '-' . $block->getAttribute('eventId'))
return EventTickets::make($block->getShortName())
->tap(function (EventTickets $eventTicketsField) use ($block, $formId) {
$eventId = $block->getAttribute('eventId');
$event = give(EventRepository::class)->getById($eventId);
Expand Down
4 changes: 4 additions & 0 deletions src/Exports/DonorsExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function set_properties($request)
}

/**
* @since 3.12.1 Include donor phone.
* @since 2.29.0 Include donor created date
* @since 2.21.2
* @since 3.3.0 Filter donors by form ID
Expand All @@ -67,6 +68,7 @@ public function get_data(): array
['donors.email', 'email'],
['donors.user_id', 'userid'],
['donors.date_created', 'donor_created_date'],
['donors.phone', 'donor_phone_number'],
['donors.purchase_count', 'donations'],
['donors.purchase_value', 'donation_sum']
);
Expand Down Expand Up @@ -155,6 +157,7 @@ protected function filterExportData(array $exportData): array
}

/**
* @since 3.12.1 Include donor_phone_number col.
* @since 2.29.0 Include donor created col
* @since 2.21.2
*/
Expand All @@ -174,6 +177,7 @@ public function csv_cols(): array
],
'userid' => __('User ID', 'give'),
'donor_created_date' => __('Donor Created', 'give'),
'donor_phone_number' => __('Donor Phone Number', 'give'),
'donations' => __('Number of donations', 'give'),
'donation_sum' => __('Total Donated', 'give'),
], $this->postedData['give_export_columns'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ export default function Edit({
}}
>
{__(' Go to the settings to change the ')}
<a href="/wp-admin/edit.php?post_type=give_forms&page=give-settings&tab=display&section=display-settings">
{__('global Title Prefixes options.')}
<a
href="/wp-admin/edit.php?post_type=give_forms&page=give-settings&tab=display&section=display-settings"
target="_blank"
rel="noopener noreferrer"
>
{__('Global Title Prefixes options.')}
</a>
</p>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export default function GlobalSettingsLink({href}: GlobalSettingsLinkProps) {
}}
>
{__(' Go to the settings to change the ')}
<a href={href}>{__('global Label and Text options.')}</a>
<a href={href} target="_blank" rel="noopener noreferrer">
{__('Global Label and Text options.')}
</a>
</p>
);
}
Loading

0 comments on commit 7b0ce1c

Please sign in to comment.