Skip to content

Commit

Permalink
Merge branch 'epic/event-tickets-follow-up-GIVE-371' into fix/missing…
Browse files Browse the repository at this point in the history
…-tickets-list-component-title
  • Loading branch information
kjohnson authored Dec 6, 2024
2 parents 98a37df + 5c9d557 commit 0cdd692
Show file tree
Hide file tree
Showing 204 changed files with 13,746 additions and 5,179 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,24 @@ To get started developing on the GiveWP platform you will need to perform the fo
3. Fork this repository from GitHub and then clone that into your plugins directory in a new `give` directory
4. Run `composer install` to set up dependencies
5. Run `npm install` to get the necessary npm packages
6. Activate the plugin in WordPress
7. Run `npm run watch` to start the watch process which will build the sass and script files and live reload using [Browsersync](https://www.browsersync.io/)
6. Run `npm run dev` to build the initial scripts & styles
7. Activate the plugin in WordPress


That's it. You're now ready to start development.

**Available commands**

| Command | Description |
| :------------- | :------------ |
| `npm run watch` | Live reloads JS and SASS files. Typically you'll run this command before you start development. It's necessary to build the JS/CSS however if you're working strictly within PHP it may not be necessary to run. |
| `npm run dev` | Runs a one time build for development. No production files are created. |
| `npm run production` | Builds the minified production files for release. |
| `npm run test` | Run jest tests. Make sure that your docker container is running before running this command. [Read more](https://github.com/impress-org/give/tree/master/tests/e2e) |
Note: as of GiveWP 3.0 we have two separate build processes. One for the legacy codebase that uses [Laravel Mix](https://laravel.com/docs/6.x/mix) and one for scripts introduced 3.0+ that use [@wordpress/scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/). There are commands for running both and individual processes. The commands are as follows:

| Command | Description |
|:-------------------|:----------------------------------------------------------------------------------|
| `npm run dev` | (v2 & v3) Runs a one time build for development. No production files are created. |
| `npm run dev:v3` | (v3) Runs a one time build for development. No production files are created. |
| `npm run watch` | (v2) Automatically re-builds as changes are made. |
| `npm run watch:v3` | (v3) Automatically re-builds as changes are made. |
| `npm run build` | (v2 & v3) Builds the minified production files for release. |
| `npm run build:v3` | (v3) Builds the minified production files for release. |

**Development Notes**

Expand Down
17 changes: 16 additions & 1 deletion assets/src/css/admin/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1070,10 +1070,25 @@ a.give-delete {
display: none;
}

.give-subsubsub .givewp-feature-flag-notification-counter {
translate: 0 -0.125rem;
vertical-align: middle;
}

.give-admin-beta-features-message {
background-color: #fff;
padding: 0.5rem;
padding: 1rem;
border: 1px solid #F29718;
margin-bottom: 1.5rem;

.givewp-beta-icon {
margin-right: 0.25rem;
}

p {
line-height: 1.6;
margin: 0;
}
}

.give-admin-beta-features-feedback-link {
Expand Down
2 changes: 1 addition & 1 deletion blocks/donation-form-grid/edit/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ const Inspector = ({attributes, setAttributes}) => {
</PanelBody>
</Panel>
<PanelColorSettings
title={ __( 'Color Settings' ) }
title={ __( 'Color Settings', 'give' ) }
colorSettings={ [
{
value: tagBackgroundColor
Expand Down
36 changes: 36 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
== 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!
* Enhancement: Updated the form block option to select more available forms than the original limit of 10
* Enhancement: Updated the form builder left-side menu to open automatically when entering the build screen
* Security: Added sanitizing and escaping to shortcodes
* Fix: Resolved a conflict with GiveWP and WordPress bulk actions functionality

= 3.6.2: April 5th, 2024 =
* Fix: Resolved an issue with WordPress 6.5 and the visual form builder that was making it difficult to interact with blocks

= 3.6.1: March 21st, 2024 =
* Fix: Resolved an issue with PayPal donations and currency switcher on donation forms using the visual form builder

= 3.6.0: March 13th, 2024 =
* New: Introduced a new beta feature called "Event Tickets" that is open for feedback! If enabled, you can create events and sell tickets on your donation forms.
* New: Added a new form builder layout called "Two Panel" that offers a side-by-side appearance and a multi-step donation experience.
Expand Down
6 changes: 3 additions & 3 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: GiveWP
* Author URI: https://givewp.com/
* Version: 3.6.0
* Requires at least: 6.0
* Version: 3.12.0
* Requires at least: 6.3
* Requires PHP: 7.2
* Text Domain: give
* Domain Path: /languages
Expand Down Expand Up @@ -404,7 +404,7 @@ private function setup_constants()
{
// Plugin version.
if (!defined('GIVE_VERSION')) {
define('GIVE_VERSION', '3.6.0');
define('GIVE_VERSION', '3.12.0');
}

// Plugin Root File.
Expand Down
16 changes: 14 additions & 2 deletions includes/admin/donors/donor-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
/**
* Processes a donor edit.
*
* @param array $args The $_POST array being passed.
* @since 3.7.0 Add support to the "phone" field
* @since 1.0
*
* @since 1.0
* @param array $args The $_POST array being passed.
*
* @return array|bool $output Response messages
* @throws Exception
*/
function give_edit_donor( $args ) {

Expand Down Expand Up @@ -124,6 +126,16 @@ function give_edit_donor( $args ) {
// Save company name in when admin update donor company name from dashboard.
$donor->update_meta( '_give_donor_company', sanitize_text_field( $args['give_donor_company'] ) );

/**
* Fires after using the submitted data to update the donor metadata.
*
* @param array $args The sanitized data submitted.
* @param int $donor_id The donor ID.
*
* @since 3.7.0
*/
do_action('give_admin_donor_details_updating', $args, $donor->id);

// If First name of donor is empty, then fetch the current first name of donor.
if ( empty( $donor_info['first_name'] ) ) {
$donor_info['first_name'] = $donor->get_first_name();
Expand Down
29 changes: 27 additions & 2 deletions includes/admin/donors/donors.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* @since 1.0
*/

use Give\Donors\Models\Donor;
use Give\Helpers\IntlTelInput;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand Down Expand Up @@ -298,6 +301,7 @@ function give_render_donor_view( $view, $callbacks ) {
/**
* View a donor
*
* @since 3.7.0 Add "phone" field
* @since 1.0
*
* @param Give_Donor $donor The Donor object being displayed.
Expand Down Expand Up @@ -478,10 +482,31 @@ function give_donor_view( $donor ) {
</td>
</tr>

<?php
<?php

$donor_phone_number = Donor::find($donor->id)->phone;
?>
<tr class="alternate">
<th scope="col">
<label for="tablecell"><?php
esc_html_e('Phone:', 'give'); ?></label>
</th>
<td>
<span class="donor-user-id info-item edit-item">
<?php
echo IntlTelInput::getHtmlInput($donor_phone_number, "give_donor_phone_number"); ?>
</span>

<span class="donor-user-id info-item editable">
<?php
echo $donor_phone_number; ?>
</span>
</td>
</tr>
<?php
$donor_company = $donor->get_meta( '_give_donor_company', true );
?>
<tr class="alternate">
<tr class="">
<th scope="col">
<label for="tablecell"><?php esc_html_e( 'Company Name:', 'give' ); ?></label>
</th>
Expand Down
27 changes: 26 additions & 1 deletion includes/admin/payments/view-payment-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
* @since 1.0
*/

// Exit if accessed directly.
use Give\Donations\Models\Donation;
use Give\Donations\ValueObjects\DonationMetaKeys;
use Give\Donors\Models\Donor;

// Exit if accessed directly.
if (!defined('ABSPATH')) {
exit;
}
Expand All @@ -29,6 +31,7 @@
/**
* View donation details page
*
* @since 3.9.0 Add donor phone number to the view
* @since 1.0
* @return void
*/
Expand Down Expand Up @@ -61,6 +64,8 @@
$currency_code = $payment->currency;
$payment_mode = $payment->mode;
$base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
$donation_phone_number = Donation::find($payment_id)->phone;
$donor_phone_number = Donor::find($donor_id)->phone;

?>
<div class="wrap give-wrap">
Expand Down Expand Up @@ -640,6 +645,26 @@
);
?>
</p>
<p>
<?php
if ( ! empty($donation_phone_number)) {
?>
<strong><?php
esc_html_e('Donor Phone:', 'give'); ?></strong><br>
<?php
// Show Donor donation phone first and Primary phone on parenthesis if not match both phone.
echo (empty($donor_phone_number) ||
hash_equals($donor_phone_number, $donation_phone_number))
? $donation_phone_number :
sprintf(
'%1$s (<a href="%2$s" target="_blank">%3$s</a>)',
$donation_phone_number,
esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}")),
$donor_phone_number
);
}
?>
</p>
</div>
<div class="column">
<p>
Expand Down
19 changes: 19 additions & 0 deletions includes/class-give-donate-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,10 @@ public function get_type() {
* @return string
*/
public function get_form_classes( $args ) {
/**
* @since 3.11.0 sanitize $args
*/
$args = give_clean($args);

$float_labels_option = give_is_float_labels_enabled( $args )
? 'float-labels-enabled'
Expand All @@ -834,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 @@ -850,6 +859,11 @@ public function get_form_classes( $args ) {
* @return string
*/
public function get_form_wrap_classes( $args ) {
/**
* @since 3.11.0 sanitize $args
*/
$args = give_clean($args);

$custom_class = [
'give-form-wrap',
];
Expand All @@ -876,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
11 changes: 6 additions & 5 deletions includes/class-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ public static function print_frontend_errors( $errors ) {
* Print frontend notice.
* Notice: notice type can be success/error/warning
*
* @since 3.7.0 Escape attributes
* @since 1.8.9
* @access public
*
Expand Down Expand Up @@ -691,11 +692,11 @@ public static function print_frontend_notice( $message, $echo = true, $notice_ty
</p>
%6$s
</div>',
$notice_type,
give_clean( $notice_args['dismissible'] ),
absint( $notice_args['dismiss_interval'] ),
give_clean( $notice_args['dismiss_type'] ),
$message,
esc_attr($notice_type),
esc_attr( $notice_args['dismissible'] ),
esc_attr( $notice_args['dismiss_interval'] ),
esc_attr( $notice_args['dismiss_type'] ),
esc_html($message),
$close_icon
);

Expand Down
2 changes: 2 additions & 0 deletions includes/donors/class-give-donor-wall.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function setup_actions() {
/**
* Displays donors in a grid layout.
*
* @since 3.7.0 Sanitize attributes
* @since 2.27.0 Moved AJAX nonce verification to ajax_handler method.
* @since 2.2.0
*
Expand Down Expand Up @@ -114,6 +115,7 @@ public function setup_actions() {
* @return string|bool The markup of the form grid or false.
*/
public function render_shortcode( $atts ) {
$atts = give_clean($atts);

$give_settings = give_get_settings();

Expand Down
5 changes: 5 additions & 0 deletions includes/forms/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ function give_get_donation_form( $args = [] ) {
global $post;
static $count = 1;

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

$args = wp_parse_args( $args, give_get_default_form_shortcode_args() );

// Backward compatibility for `form_id` function param.
Expand Down
4 changes: 2 additions & 2 deletions includes/login-register.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ function give_login_form( $login_redirect = '', $logout_redirect = '' ) {
give_get_template(
'shortcode-login',
array(
'give_login_redirect' => esc_url($login_redirect),
'give_logout_redirect' => esc_url($logout_redirect),
'give_login_redirect' => $login_redirect,
'give_logout_redirect' => $logout_redirect,
)
);

Expand Down
Loading

0 comments on commit 0cdd692

Please sign in to comment.