Git Product home page Git Product logo

strangerstudios / pmpro-events Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 10.0 546 KB

Offer members-only events using popular events plugins and Paid Memberships Pro.

Home Page: https://www.paidmembershipspro.com/add-ons/events-for-members-only/

PHP 100.00%
wordpress wordpress-plugin paid-memberships-pro strangerstudios-product the-events-calendar events-manager sugar-calendar all-in-one-event-calendar

pmpro-events's Introduction

WordPress Plugin Downloads License

Welcome to the Paid Memberships Pro - Events Integration GitHub Repository

This Add On offers integration for popular events plugins, including:

Events that are restricted by membership level will not allow non-members to view full event details or complete event registration. The list and single view of the event will show limited event details as defined by your Advanced Settings > "Show Excerpts to Non-Members" setting.

Additionally, you can completely hide member-restricted events to non-members via the Memberships > Advanced Settings > "Filter Searches and Archives" setting.

For more information please visit www.paidmembershipspro.com/add-ons/events-for-members-only/

Installation

For detailed installation steps, visit the our documentation page.

  1. Download the current development ZIP file directly: https://github.com/strangerstudios/pmpro-events/archive/dev.zip

Please ensure that once installing this version of the plugin to remove -dev from the plugin's folder name.

Bugs

If you find an issue/bug, let us know by creating a detailed GitHub issue.

Support

This is a developer's portal for Paid Memberships Pro - Events Integration. We do not offer support on this channel. Any support related questions should be directed to wordpress.org/support/plugin/pmpro-events/.

Contributing to Paid Memberships Pro - Events Integration

We encourage and welcome any contribution to Paid Memberships Pro - Events Integration. Please read the guidelines for contributing to this repository.

There are various ways to help development of Paid Memberships Pro - Events Integration:

  1. Report bugs/issues on GitHub.
  2. Work on any issues by submitting a Pull Request.

Here are some ways for non-developers to contribute to Paid Memberships Pro - Events Integration:

  1. Translate Paid Memberships Pro - Events Integration into your own language.
  2. Purchase a premium membership to help fund ongoing development and bug fixes.
  3. Leave an honest review for Paid Memberships Pro - Events Integration.

pmpro-events's People

Contributors

andrewlimaza avatar dparker1005 avatar femiyb avatar gausam avatar ideadude avatar kimcoleman avatar sc0ttkclark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pmpro-events's Issues

Enhancement for PM Pro and The Events Calendar

Currently you can only mark individual events from the back end as "member only". I'd love to see there be a way to mark an entire category as member only AND a way to allow front end members to mark an event as "member only". Currently, neither PMPro nor TEC community events will take responsibility to get this done so throwing it out as a suggestion.

Not compatible with Download Timely All-in-One Events Calendar v3.0+

Describe the bug
v3.0+ of Timely All-in-One Events Calendar has moved to a SaaS-like model where events are created in their service, rather than within the WordPress site.

Users can then display those events using shortcodes within the WordPress site.

Our direct integration for this plugin is no longer needed.

Users should rather leverage the content protection settings in PMPro (post, page, shortcode, or block) to offer members-only events wit Timely All-in-One Events Calendar.

Updating membership level in a recurring event does not update all events

Our site has gotten into a state where some (but not all) recurring events have the property where the older events have membership levels, and the newer events (incorrectly) do not have membership levels. Editing the series will only affect the older events; there is no way to add membership levels to the newer events.
I'm sorry I don't have exact repro steps -- I don't know how we got into this state. I can give you access to a staging site if you'd like. Or if you can point me to the code that updates all the events of a recurring event, I could look into it.
We are using The Events Calendar and The Events Calendar Pro. All plugins are updated to the latest version.

Events in site search results

Test each integration to confirm the events in general WP site search are being properly filtered according to your Advanced Settings (include/hide from searches and archives + show/hide excerpts settings).

The Events Calendar: Member events displayed in archive view to non-members

Need to filter the display of the post content for a restricted event on the "archive" page (/events) in list or calendar view.

The Single Event is properly respecting Advanced Settings (whether to show excerpts or hide).

To reproduce:

  • Install and activate The Events Calendar.
  • Install and activate Paid Memberships Pro
  • Check Memberships > Settings > Advanced tab that "Filter searches and archives" and "Show Excerpts to Non-Members" set to members only.
  • Create a membership level
  • Install and active Paid Memberships Pro - Events Add On
  • Create Event
  • Visit events pages as non-member
  • Click on "Now onwards" and select historic date
  • Members only events are now listed.

CmumYghn4g
firefox_iem3fVdylO

After migrating events to The Events Calendar 6.0.1.1, no events are displayed on the front end

After migrating events to The Events Calendar 6.0.1.1, no events are displayed on the front end. This applies to events available to all users.

Query Monitor shows that seven database errors are occurring. They all say "Unknown column 'pmpro_mp.membership_id' in 'where clause'". I did more troubleshooting and found that the JOIN clause linking wp_pmpro_memberships_pages to other tables is missing from the query assembled in modules/the-events-calendar.php in pmpro_events_tribe_events_repository_handle_posts().

When I experimented in the database and added the missing JOIN clause to one of the queries that had failed, it worked. Here's the query that worked.

SELECT wp_posts.ID, CAST( wp_tec_occurrences.start_date_utc AS DATETIME ) AS event_date_utc, CAST( wp_tec_occurrences.duration AS DECIMAL ) AS event_duration
FROM wp_posts
LEFT JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id
AND wp_postmeta.meta_key = '_EventHideFromUpcoming' )
LEFT JOIN wp_tec_occurrences
ON wp_posts.ID = wp_tec_occurrences.post_id
LEFT JOIN wp_pmpro_memberships_pages AS pmpro_mp
            ON (pmpro_mp.page_id = wp_posts.ID)
WHERE 1=1
AND ( wp_postmeta.post_id IS NULL
AND CAST(wp_tec_occurrences.end_date_utc AS DATETIME) > '2021-10-06 18:40:06' )
AND wp_posts.post_type = 'tribe_events'
AND ((wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'private'))
AND (pmpro_mp.membership_id IS NULL
OR pmpro_mp.membership_id IN ( 1 ))
ORDER BY wp_tec_occurrences.start_date_utc ASC, wp_tec_occurrences.duration ASC, wp_posts.post_date ASC
LIMIT 0, 13

This site has a lot of plugins. I disabled nearly all of them and the issue persisted.

Environment/WP/Server info:

WordPress version
6.0.2

PHP version
7.4.32

PHP
max_execution_time = 120
memory_limit = 256M
upload_max_filesize = 100M
post_max_size = 100M
display_errors = 1
log_errors = 1
Server
nginx
SAPI
fpm-fcgi

Plugins
Query Monitor version 3.10.1 by [John Blackbourn](https://querymonitor.com/) (https://querymonitor.com/)
Native PHP Sessions for WordPress version 1.2.4 by [Pantheon](https://www.pantheon.io/) (https://www.pantheon.io/)
Advanced Custom Fields version 5.12.3 by [Delicious Brains](https://www.advancedcustomfields.com/) (https://www.advancedcustomfields.com)
bbPress Notify (No-Spam) Reply by Email version 2.6.6 by [Vinny Alves (UseStrict Consulting)](http://usestrict.net/)
bbPress Notify (No-Spam) version 2.17.6 by [Vinny Alves (UseStrict Consulting)](http://usestrict.net/)
bbPress version 2.6.9 by [The bbPress Contributors](https://bbpress.org/) (https://bbpress.org)
Code Snippets version 3.2.0 by [Code Snippets Pro](https://codesnippets.pro/) (https://codesnippets.pro)
Content Control version 1.1.9 by [Code Atlantic](https://code-atlantic.com/) (https://code-atlantic.com/)
Disable Emails version 1.8.1 by [WebAware](https://shop.webaware.com.au/) (https://shop.webaware.com.au/)
Do Not Cache version 0.3 by [Nancy Brauer](https://insidenewcity.com/) (https://insidenewcity.com)
Yoast Duplicate Post version 4.5 by [Enrico Battocchi & Team Yoast](https://yoast.com/) (https://yoast.com)
GTM4WP version 1.16.1 by [Thomas Geiger](https://gtm4wp.com/) (https://gtm4wp.com/)
Elementor version 3.7.8 by [Elementor.com](https://elementor.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash) (https://elementor.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash)
Event Tickets version 5.5.1 by [The Events Calendar](https://evnt.is/1aor) (https://evnt.is/1aor)
Force First and Last Name as Display Name version 1.2 by [Stranger Studios](https://www.strangerstudios.com/) (https://www.strangerstudios.com)
GA Google Analytics version 20221002 by [Jeff Starr](https://plugin-planet.com/) (https://plugin-planet.com/)
Import and export users and customers version 1.20.4 by [codection](https://codection.com/) (https://codection.com)
Jupiter X Core version 2.5.2 by [Artbees](https://artbees.net/) (https://artbees.net)
Login as User version 1.4.4 by [Web357](https://www.web357.com/) (https://www.web357.com/)
Login Logout Menu version 1.3.3 by [WPBrigade](https://wpbrigade.com/?utm_source=login-logout-menu) (https://WPBrigade.com/?utm_source=login-logout-menu)
Paid Memberships Pro version 2.9.5 by [Paid Memberships Pro](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com)
Paid Memberships Pro - Add Member From Admin version 0.7.1 by [Stranger Studios](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com)
Paid Memberships Pro - Add Name to Checkout Add On version 0.6.0 by [Stranger Studios](http://www.strangerstudios.com/) (http://www.strangerstudios.com)
Paid Memberships Pro - Address For Free Levels Add On version 0.5 by [Paid Memberships Pro](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com/)
Paid Memberships Pro - Advanced Levels Page Shortcode Add On version .2.4 by [Stranger Studios](http://www.strangerstudios.com/) (http://www.strangerstudios.com)
Paid Memberships Pro - Approvals Add On version 1.4.3 by [Stranger Studios](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com)
Paid Memberships Pro - bbPress Add On version 1.7.3 by [Paid Memberships Pro, Scott Sousa](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com)
Paid Memberships Pro - Events Add On version 1.3.1 by [Paid Memberships Pro](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com)
Paid Memberships Pro - Member Directory Add On version 1.2.3 by [Paid Memberships Pro](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com/)
Paid Memberships Pro - Nav Menus Add On version .3.4 by [Stranger Studios](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com)
Paid Memberships Pro - Pay by Check Add On version 0.11 by [Stranger Studios](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com)
Paid Memberships Pro - Recurring Emails Add On version .5.4 by [Stranger Studios, Thomas Sjolshagen ](http://www.strangerstudios.com/)(http://www.strangerstudios.com)
Paid Memberships Pro - Register Helper Add On version 1.8 by [Paid Memberships Pro](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com)
Paid Memberships Pro - Set Expiration Dates Add On version 0.6.1 by [Stranger Studios](http://www.strangerstudios.com/) (http://www.strangerstudios.com)
Paid Memberships Pro - State Dropdowns Add On version 0.3 by [Paid Memberships Pro](https://www.paidmembershipspro.com/) (https://www.paidmembershipspro.com)
Redirection version 5.3.4 by John Godley
Safe SVG version 2.0.3 by [10up](https://10up.com/) (https://10up.com)
The Events Calendar version 6.0.1.1 by [The Events Calendar](https://evnt.is/1x) (https://evnt.is/1x)
Yoast SEO version 19.7.2 by [Team Yoast](https://yoa.st/1uk) (https://yoa.st/1uk)
WP Job Manager version 1.38.0 by [Automattic](https://wpjobmanager.com/) (https://wpjobmanager.com/)
WP Mail SMTP Pro version 3.6.1 by [WPForms](https://wpforms.com/) (https://wpforms.com/)
WP Redis version 1.2.0 by [Pantheon, Josh Koenig, Matthew Boynes, Daniel Bachhuber, Alley Interactive](https://pantheon.io/) (https://pantheon.io/)
Sponsors version 3.5.0 by [Simple Sponsorships](http://www.wpsimplesponsorships.com/) (http://www.wpsimplesponsorships.com)
WPForms Lite version 1.7.7.1 by [WPForms](https://wpforms.com/) (https://wpforms.com)
Network Plugins
-
MU Plugins
Pantheon version 0.3 by Pantheon (https://pantheon.io/)
Theme
JupiterX Child
Multisite
-
Views V2 Status
Enabled
Custom Tables Migration Status
Completed
Settings
did_init = 1
tribeEventsTemplate =
tribeEnableViews =
Array
(
    [0] => list
    [1] => month
)
viewOption = list
schema-version = 6.0.1.1
recurring_events_are_hidden = hidden
previous_ecp_versions =
Array
(
    [0] => 0
    [1] => 5.8.1
    [2] => 5.8.2
    [3] => 5.9.0
    [4] => 5.9.1
    [5] => 5.9.2
    [6] => 5.10.0
    [7] => 5.10.1
    [8] => 5.11.0
    [9] => 5.12.0
    [10] => 5.12.2
    [11] => 5.12.3
    [12] => 5.12.4
    [13] => 5.13.0
    [14] => 5.14.0.2
    [15] => 5.14.0.4
    [16] => 5.14.1
    [17] => 5.14.2.1
    [18] => 5.16.0
    [19] => 5.16.1.1
    [20] => 5.16.2
    [21] => 5.16.2.1
    [22] => 5.16.3.1
    [23] => 5.16.4
    [24] => 6.0.0.1
    [25] => 6.0.1
)
latest_ecp_version = 6.0.1.1
views_v2_enabled = 1
postsPerPage = 12
monthEventAmount = 3
last-update-message-the-events-calendar = 6.0.1.1
ticket-enabled-post-types =
Array
(
    [0] => page
    [1] => tribe_events
)
event-tickets-schema-version = 5.5.1
previous_event_tickets_versions =
Array
(
    [0] => 0
    [1] => 5.1.7
    [2] => 5.1.8
    [3] => 5.1.9
    [4] => 5.1.9.1
    [5] => 5.1.10
    [6] => 5.2.0.1
    [7] => 5.2.1
    [8] => 5.2.2
    [9] => 5.2.3
    [10] => 5.2.4.1
    [11] => 5.3.0.1
    [12] => 5.3.1
    [13] => 5.3.2
    [14] => 5.3.3
    [15] => 5.4.0.1
    [16] => 5.4.1
    [17] => 5.4.2
    [18] => 5.4.2.1
    [19] => 5.4.3.1
    [20] => 5.4.4
    [21] => 5.5.0
)
latest_event_tickets_version = 5.5.1
tribe_tickets_migrate_offset_ = complete
last-update-message-event-tickets = 5.2.1
front_page_event_archive =
earliest_date = 2015-05-15 04:00:00
earliest_date_markers =
Array
(
    [0] => 
)
latest_date = 2022-10-12 21:00:00
latest_date_markers =
Array
(
    [0] => 
)

WP Timezone
America/New_York
WP GMT Offset
-4
Default PHP Timezone
UTC
WP Date Format
F j, Y
WP Time Format
g:i a
Week Starts On
1
Common Library Dir
/code/wp-content/plugins/event-tickets/common/src/Tribe
Common Library Version
5.0.1

BUG: Single Events page appear blank when they should show Excerpt (The Events Calendar)

Since the most recent update to 1.1 EVENTS will show up in the list or menu, but if clicked on, they take you to a blank single event page. Should show excerpt and "pmpro message".

Recreated with a clean install. Only PMPro, The Events Calendar, and Events for Members-Only Add On.
Settings in PMPro Advanced Settings to SHOW experts and not hide from search.

Single page events with a required level appeared fine at first, including excerpt and message, but when I began changing events or applying categories, the main content stopped showing title, excerpt, and message.
blank-except-in-schema

Undefined variable $event in The Events Calendar module

Notice: Undefined variable: event in /site/wp-content/plugins/pmpro-events/modules/the-events-calendar.php on line 137

Should fix this by passing $event as a second parameter into the pmpro_events_tribe_events_excerpt_filter() function here:

/**
* Adjust the filter of the the events to ensure it sticks to what we've set inside the event settings.
* @since 1.0
*/
function pmpro_events_tribe_events_excerpt_filter( $excerpt ) {
global $post;
$showexcerpts = apply_filters( 'pmpro_events_tribe_events_show_excerpts', pmpro_getOption( "showexcerpts" ), $event );
if ( pmpro_has_membership_access( $post->ID ) ) {
$excerpt = get_the_excerpt();
} elseif ( $showexcerpts && !pmpro_has_membership_access( $post->ID ) ) {
$excerpt = get_the_excerpt();
} else {
$excerpt = '';
}
return $excerpt;
}
add_filter( 'tribe_events_get_the_excerpt', 'pmpro_events_tribe_events_excerpt_filter' );

Filter code from The Events Calendar docs:

/**
 * Filter the event excerpt used in various views.
 *
 * @param string  $excerpt
 * @param WP_Post $post
 */
$excerpt = apply_filters( 'tribe_events_get_the_excerpt', wpautop( $excerpt ), $post );

https://docs.theeventscalendar.com/reference/functions/tribe_events_get_the_excerpt/

Not unique table/alias database error with The Events Calendar

Describe the bug
Visiting The Events Calendar's events page triggers the following database error WordPress database error: [Not unique table/alias: 'wp_tec_occurrences']

Related PR: #49

Not unique table/alias: 'wp_tests_tec_occurrences' for query SELECT SQL_CALC_FOUND_ROWS wp_tests_posts.ID FROM wp_tests_posts LEFT JOIN wp_tests_term_relationships ON (wp_tests_posts.ID = wp_tests_term_relationships.object_id) LEFT JOIN wp_tests_term_relationships AS tt1 ON (wp_tests_posts.ID = tt1.object_id) LEFT JOIN wp_tests_term_relationships AS tt2 ON (wp_tests_posts.ID = tt2.object_id) INNER JOIN wp_tests_tec_occurrences ON wp_tests_posts.ID = wp_tests_tec_occurrences.post_id LEFT JOIN `wp_tests_pmpro_memberships_pages` AS `pmpro_mp_5` ON `pmpro_mp_5`.`page_id` = `wp_tests_posts`.`ID` JOIN wp_tests_tec_occurrences ON wp_tests_posts.ID = wp_tests_tec_occurrences.post_id WHERE 1=1 AND wp_tests_posts.ID NOT IN (43,449,816,945,1509,43,449,816,945,1509) AND ( wp_tests_term_relationships.term_taxonomy_id IN (3) AND tt1.term_taxonomy_id IN (3) AND tt2.term_taxonomy_id IN (1,3,59,76,82,84,95) ) AND ( CAST(wp_tests_tec_occurrences.end_date AS DATETIME) < '2023-08-21 07:39:06' ) AND wp_tests_posts.post_type = 'tribe_events' AND ((wp_tests_posts.post_status = 'publish' OR wp_tests_posts.post_status = 'private')) AND (pmpro_mp_5.membership_id IS NULL OR pmpro_mp_5.membership_id IN ( 2 )) GROUP BY wp_tests_tec_occurrences.occurrence_id ORDER BY wp_tests_posts.post_date ASC LIMIT 0, 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/the-events-calendar/src/views/v2/default-template.php'), Tribe\Events\Views\V2\Template_Bootstrap->get_view_html, Tribe\Events\Views\V2\View->get_html, Tribe\Events\Views\V2\Views\List_View->setup_template_vars, Tribe\Events\Views\V2\View->setup_template_vars, Tribe\Events\Views\V2\Views\List_View->prev_url, Tribe\Events\Views\V2\Views\List_View->get_past_url, Tribe__Repository->count, WP_Query->get_posts, apply_filters_ref_array('posts_pre_query'), WP_Hook->apply_filters, TEC\Events\Custom_Tables\V1\WP_Query\Modifiers\Events_Only_Modifier->filter_posts_pre_query, TEC\Events\Custom_Tables\V1\WP_Query\Custom_Tables_Query->get_posts, WP_Query->get_posts

To Reproduce
Steps to reproduce the behavior:

  1. Activate PMPro, The Events Calendar, and the PMPro Events Add On.
  2. Visit the Events List page with debugging enabled.
  3. Check debug log, see error

Expected behavior
No errors

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

PHP 8.0.29 WordPress 6.3 PMPro 2.10.2 The Events Calendar 6.2.0.1 PMPro Events 1.4

Shows excerpt for last entered event as excerpt for all events in list of The Events Calendar

Using Event Tickets by The Events Calendar V 5.1.1, Paid Membership Pro V 2.5.7, Paid Memberships Pro - Member Directory Add On V 1.1
When PM Pro Events Add-On is activated the Events Calendar (list view) shows the same excerpt for all the events - using the excerpt from the last entered event. When deactivated shows proper excerpts for each event.
I wanted to restrict info in the event listing to not show the Events Calendar RSVP or ticket option altogether to non-members or non-logged-in-members but as a workaround I have kept the PM pro events deactivated and in Events Calendar, under the Events Settings Tickets tab I check off "Require users to log in before they RSVP" under Login Requirements. However, this option adds a "Login to RSVP" option over the RSVP box, unrelated to PM Pro. When a user clicks on that it opens a Wordpress login screen, not the stylized Membership Login screen which integrates with the site, as I would prefer. It confuses the members a bit.

Events Manager: Filter excerpt according to advanced setting.

The default events view does not include the event excerpt but it can be added using an event placeholder attribute (#_EVENTEXCERPT) in the plugin's settings.

We should try to filter this according to the membership requirements for the event and how advanced settings are configured for the site.

Feature Request: Support for Tickets

Each supported plugin has its own method for offering "Tickets". I'll include each in the comments below. We should eventually look to support tickets purchase/registration for members only and possibly free ticketing for members.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.