Skip to content

Commit

Permalink
Merge pull request #193 from mediasanctuary/update-plugins
Browse files Browse the repository at this point in the history
upgrade plugins
  • Loading branch information
dphiffer authored Nov 27, 2024
2 parents 06e90a3 + 616db9e commit c66068f
Show file tree
Hide file tree
Showing 35 changed files with 517 additions and 192 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'the-events-calendar/tribe-common',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '63dd7e9664696331ab95215b8c6d5bf0b39b77d0',
'pretty_version' => '6.3.2',
'version' => '6.3.2.0',
'reference' => 'f37e825d0d7d07207fba1eae8ab8c4a47ec4ea78',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -154,9 +154,9 @@
'dev_requirement' => false,
),
'the-events-calendar/tribe-common' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '63dd7e9664696331ab95215b8c6d5bf0b39b77d0',
'pretty_version' => '6.3.2',
'version' => '6.3.2.0',
'reference' => 'f37e825d0d7d07207fba1eae8ab8c4a47ec4ea78',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 8 additions & 10 deletions wp-content/plugins/the-events-calendar/readme.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
=== The Events Calendar ===

Contributors: theeventscalendar, borkweb, bordoni, brianjessee, aguseo, camwynsp, GeoffBel, jentheo, leahkoerper, lucatume, neillmcshea, vicskf, zbtirrell, juanfra
Contributors: theeventscalendar, stellarwp, borkweb, bordoni, brianjessee, aguseo, camwynsp, jentheo, leahkoerper, lucatume, neillmcshea, vicskf, zbtirrell
Tags: events, calendar, event, schedule, organizer
Donate link: https://evnt.is/29
Stable tag: 6.8.2
Stable tag: 6.8.2.1
Requires at least: 6.3
Tested up to: 6.7
Tested up to: 6.7.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -90,14 +90,10 @@ Our Premium Plugins and Services:
⚡ [Events Calendar PRO](https://evnt.is/18wi)
↪️ [Event Aggregator](https://evnt.is/197u) (service)
🎟️ [Event Tickets Plus](https://evnt.is/18wk)
📱 [Event Tickets Wallet Plus](https://evnt.is/etwp)
✉️ [Promoter](https://evnt.is/1ajt)
👥 [Community Events](https://evnt.is/2g)
🎟️ [Community Tickets](https://evnt.is/18wl)
✏️ [Filter Bar](https://evnt.is/fa)
🗓️ [Eventbrite Tickets](https://evnt.is/2e)
📡 [Virtual Events](https://evnt.is/1aky)
🔄 [Event Automator](https://evnt.is/1bdk)

== Help ==

Expand Down Expand Up @@ -178,13 +174,10 @@ The following add-ons are available for The Events Calendar:

* [Events Calendar Pro](https://evnt.is/18wi), for adding premium calendar features like recurring events, advanced views, cool widgets, [shortcodes](https://evnt.is/1ajw), additional fields, and more!
* [Event Aggregator](https://evnt.is/197u), a service that effortlessly fills your calendar with events from Meetup, Google Calendar, iCalendar, Eventbrite, CSV, and ICS.
* [Virtual Events](https://evnt.is/1aky), which optimizes your calendar for virtual events including Zoom integration, video and livestream embeds, SEO optimization for online events and more.
* [Event Tickets](https://wordpress.org/plugins/event-tickets/) (free), which allows you to sell tickets and collect RSVPs to events. It can run alongside The Events Calendar or as a standalone plugin that adds ticket and RSVP functionality to WordPress posts and pages.
* [Event Tickets Plus](https://evnt.is/18wk), which allows you to sell tickets for your events using your favorite e-commerce platform.
* [Event Tickets Wallet Plus](https://evnt.is/etwp), for adding digital tickets like Apple Wallet passes and PDF tickets.
* [Promoter](https://evnt.is/1ajt), automated email communication made just for The Events Calendar and Event Tickets. Stay in touch with your attendees every step of the way.
* [Community Events](https://evnt.is/2g), for allowing frontend event submission from your readers.
* [Community Tickets](https://evnt.is/18wl), which allows event organizers to sell tickets to the events they submit via Community Events.
* [Filter Bar](https://evnt.is/fa), for adding advanced frontend filtering capabilities to your events calendar.
* [Eventbrite Tickets](https://evnt.is/2e), for selling tickets to your event directly through Eventbrite.

Expand Down Expand Up @@ -239,6 +232,11 @@ Remember to always make a backup of your database and files before updating!

== Changelog ==

= [6.8.2.1] 2024-11-21 =

* Tweak - Introduced filter `tec_events_rest_api_password_protected_fields` which can be used to control which event fields should be hidden in the REST API for password protected events. [SVUL-8]
* Security - Hide content fields from the archive REST endpoint for password protected events. [SVUL-8]

= [6.8.2] 2024-11-19 =

* Feature - Introduced Help Hub, a centralized support and resource interface for enhanced user guidance and plugin assistance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function instance() {
* Constructor!
*/
public function __construct( Tribe__Events__Aggregator__API__Requests $requests ) {
$this->register_messages();
add_action( 'after_setup_theme', [ $this, 'register_messages' ] );
$this->requests = $requests;
}

Expand Down Expand Up @@ -759,7 +759,7 @@ public function get_limit_remaining( $ignore_cache = false ) {
* These messages are delivered by the EA service and don't need to be registered. They just need to exist
* here so that they can be translated.
*/
protected function register_messages() {
public function register_messages() {
$ical_uid_specification_link = sprintf(
'<a target="_blank" href="https://tools.ietf.org/html/rfc5545#section-3.8.4.7">%s</a>',
esc_html__( 'the UID part of the iCalendar Specification', 'the-events-calendar' )
Expand Down
2 changes: 1 addition & 1 deletion wp-content/plugins/the-events-calendar/src/Tribe/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Tribe__Events__Main {
const POSTTYPE = 'tribe_events';
const VENUE_POST_TYPE = 'tribe_venue';
const ORGANIZER_POST_TYPE = 'tribe_organizer';
const VERSION = '6.8.2';
const VERSION = '6.8.2.1';

/**
* Min Pro Addon.
Expand Down
39 changes: 39 additions & 0 deletions wp-content/plugins/the-events-calendar/src/Tribe/REST/V1/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,45 @@ public function hook() {

add_action( 'rest_api_init', [ $this, 'register_endpoints' ] );
add_filter( 'tribe_events_register_event_cat_type_args', [ $this, 'filter_taxonomy_args' ] );
add_filter( 'tribe_rest_events_archive_data', [ $this, 'filter_out_password_protected_events' ], 100, 2 );
}

/**
* Filters out content from password protected events from the REST API response.
*
* @since 6.8.2.1
*
* @param array $data The events to be filtered.
* @param WP_REST_Request $request The request object.
*
* @return array The filtered events.
*/
public function filter_out_password_protected_events( array $data, WP_REST_Request $request ): array {
foreach( $data['events'] as &$event ) {
if ( ! post_password_required( $event['id'] ) ) {
// No password required or password has been provided or requirement has been removed through filters.
continue;
}

$event_post = get_post( $event['id'] );

if ( ! ( $event_post instanceof WP_Post && $event_post->ID ) ) {
// No post object, weird but let's skip it.
continue;
}

$validator = tribe( 'tec.rest-v1.validator' );

if ( $validator->can_access_password_content( $event_post, $request ) ) {
// User has provided password and can see password protected content.
continue;
}

// User should not be able to see password protected content.
$event = $validator->remove_password_protected_content( $event );
}

return $data;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,46 @@ class Tribe__Events__REST__V1__Validator__Base
extends Tribe__Events__Validator__Base
implements Tribe__Events__REST__V1__Validator__Interface {

/**
* The event fields that are password protected when a password is required.
*
* @since 6.8.2.1
*
* @var array
*/
protected const PASSWORD_PROTECTED_FIELDS = [
'description' => '',
'excerpt' => '',
'image' => false,
'all_day' => 'null',
'cost' => '',
'cost_details' => [
'currency_symbol' => '',
'currency_position' => '',
'currency_code' => '',
'values' => [],
],
'website' => '',
'show_map' => 'null',
'show_map_link' => 'null',
'hide_from_listings' => 'null',
'sticky' => 'null',
'featured' => 'null',
'categories' => [],
'tags' => [],
'venue' => [],
'organizer' => [],
'ticketed' => 'null',
'is_virtual' => 'null',
'virtual_url' => '',
'virtual_video_source' => '',
'attendance' => [
'total_attendees' => 'null',
'checked_in' => 'null',
'not_checked_in' => 'null',
],
];

/**
* Determine if a value is a Venue ID, entry, or empty.
*
Expand Down Expand Up @@ -167,4 +207,35 @@ public function can_access_password_content( WP_Post $post, WP_REST_Request $req
// Double-check the request password.
return hash_equals( $post->post_password, $request['password'] );
}

/**
* Removes password-protected content from the response.
*
* @since 6.8.2.1
*
* @return array
*/
public function remove_password_protected_content( array $data ): array {
/**
* Filters the password-protected fields that should be removed from the response.
*
* @since 6.8.2.1
*
* @param array $password_protected_fields The password-protected fields to remove.
*/
$password_protected_fields = (array) apply_filters( 'tec_events_rest_api_password_protected_fields', self::PASSWORD_PROTECTED_FIELDS );

foreach ( $data as $key => $value ) {
if ( isset( $password_protected_fields[ $key ] ) ) {
$data[ $key ] = 'null' === $password_protected_fields[ $key ] ? null : $password_protected_fields[ $key ];
continue;
}

if ( is_array( $value ) || is_object( $value ) ) {
$data[ $key ] = $this->remove_password_protected_content( (array) $value );
}
}

return $data;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,21 @@ class Google_Calendar extends Link_Abstract {
* {@inheritDoc}
*/
public function register() {
$this->label = __( 'Google Calendar', 'the-events-calendar' );
$this->single_label = __( 'Add to Google Calendar', 'the-events-calendar' );
// intentionally left blank.
}

/**
* {@inheritDoc}
*/
protected function label(): string {
return __( 'Google Calendar', 'the-events-calendar' );
}

/**
* {@inheritDoc}
*/
protected function single_label(): string {
return __( 'Add to Google Calendar', 'the-events-calendar' );
}

/**
Expand Down
Loading

0 comments on commit c66068f

Please sign in to comment.