Skip to content

Commit

Permalink
Merge branch 'develop' into add/implement-strauss-installar
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwaldstein authored Jun 26, 2024
2 parents ac15bf9 + 52434ca commit 413119c
Show file tree
Hide file tree
Showing 106 changed files with 3,594 additions and 1,039 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
22 changes: 22 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
== Changelog ==
= 3.11.0: May 7th, 2024 =
* New: Added pre-requisite form builder compatibility for upcoming ConvertKit add-on release
* New: Added ability to customize alt tags for header images in the visual form builder
* Security: Added additional escaping to the give_form shortcode
* Security: Added additional sanitization to the custom css field in the form builder

= 3.10.0: April 30th, 2024 =
* New: Added pre-requisite form builder compatibility for upcoming ActiveCampaign add-on release
* Enhancement: Updated PayPal support phone number
* Enhancement: Updated various strings to be translatable (open-source contribution by @DAnn2012)
* Security: sanitize additional give_form shortcode args
* Fix: Resolved styling issues with recurring labels in the form builder

= 3.9.0: April 24th, 2024 =
* New: Added a donor phone number block to the form builder to collect donor phone numbers on donation forms
* Enhancement: Updated form field inputs to have a single border color when selected

= 3.8.0: April 17th, 2024 =
* New: Added pre-requisite form builder compatibility for upcoming double the donation add-on release
* Enhancement: Updated the form builder tour to highlight where to find the guided tour again
* Dev: Added BlockType api for easier block to field conversion

= 3.7.0: April 10th, 2024 =
* New: Added pre-requisite form builder compatibility for upcoming constant contact add-on release
* New: Added phone number field to the donor details page, more updates for this field will come in future releases!
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.10.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.10.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
14 changes: 12 additions & 2 deletions includes/class-give-donate-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ public function get_type() {
*/
public function get_form_classes( $args ) {
/**
* @unreleased sanitize $args
* @since 3.11.0 sanitize $args
*/
$args = give_clean($args);

Expand All @@ -838,6 +838,11 @@ public function get_form_classes( $args ) {
// Remove empty class names.
$form_classes_array = array_filter( $form_classes_array );

/**
* @since 3.11.0 sanitize attributes
*/
$form_classes_array = array_map('esc_attr', $form_classes_array);

return implode( ' ', $form_classes_array );

}
Expand All @@ -855,7 +860,7 @@ public function get_form_classes( $args ) {
*/
public function get_form_wrap_classes( $args ) {
/**
* @unreleased sanitize $args
* @since 3.11.0 sanitize $args
*/
$args = give_clean($args);

Expand Down Expand Up @@ -885,6 +890,11 @@ public function get_form_wrap_classes( $args ) {
*/
$form_wrap_classes_array = (array) apply_filters( 'give_form_wrap_classes', $custom_class, $this->ID, $args );

/**
* @since 3.11.0 sanitize attributes
*/
$form_wrap_classes_array = array_map('esc_attr', $form_wrap_classes_array);

return implode( ' ', $form_wrap_classes_array );

}
Expand Down
2 changes: 1 addition & 1 deletion includes/forms/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function give_get_donation_form( $args = [] ) {
static $count = 1;

/**
* @unreleased sanitize $args
* @since 3.11.0 sanitize $args
*/
$args = give_clean($args);

Expand Down
5 changes: 4 additions & 1 deletion includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ function give_form_shortcode( $atts ) {
*
* Show the Give donation form goals.
*
* @since 3.12.0 add start_date and end_date attributes
* @since 3.7.0 Sanitize attributes
* @since 3.4.0 Add additional validations to check if the form is valid and has the 'published' status.
* @since 1.0
Expand All @@ -228,7 +229,9 @@ function give_goal_shortcode( $atts ) {
'id' => '',
'show_text' => true,
'show_bar' => true,
'color' => '',
'color' => '#66BB6A',
'start_date' => '',
'end_date' => '',
],
$atts,
'give_goal'
Expand Down
Loading

0 comments on commit 413119c

Please sign in to comment.