Giter VIP home page Giter VIP logo

strangerstudios / pmpro-network-subsite Goto Github PK

View Code? Open in Web Editor NEW
3.0 5.0 14.0 99 KB

Manage memberships at the network’s main site (the primary domain of the network) and provide/restrict access on subsites in the network.

Home Page: https://www.paidmembershipspro.com/add-ons/pmpro-network-membership/

PHP 100.00%
wordpress-plugin wordpress strangerstudios-product paid-memberships-pro wordpress-network

pmpro-network-subsite's Issues

Correct Syntax Error

Hi there,

With assistance from @EkoJR we discoverer a syntax error on line 55 of pmpro-network-subsite.php

  • single quotes were used instead of double quotes. Before fixing the syntax, membership levels were not flowing from the main site to the subsite. But this change corrected the issue:

Change line 55 in pmpro-network-subsite.php FROM

$membership_levels = $wpdb->get_results( 'SELECT * FROM {$wpdb->pmpro_membership_levels}', OBJECT );
TO
$membership_levels = $wpdb->get_results( "SELECT * FROM {$wpdb->pmpro_membership_levels}", OBJECT );

Hope this helps! -Ryan

Front-end user menus items for subsites

Nevertheless the issue that prompted this ticket doesn’t appear to be resolved – to duplicate the front-end user menus as they’re running on the main site, I need to be able to add a unique display location for each membership level under Menu Settings in the Menu Editor on sub-sites, as I currently can on the main site.
Main Site Menus

vs
Subsite Menus

Bug: No way to configure non-member messages for current site while plugin is activated.

The non-member and logged out messages aren't being replaced with the settings from the main site and there is no way to configure the messages while the plugin is activated. We should probably default to the main site's settings (or maybe better) add these settings to the PMPro Multisite Membership Settings admin page.

Support Ticket (Moderators Only)
https://www.paidmembershipspro.com/forums/topic/multisite-login-register-wont-redirect-to-main/?skipped

Hi there

The following doesn't seem to do anything anymore:

//remove admin pages
remove_action('admin_menu', 'pmpro_add_pages');
remove_action('admin_bar_menu', 'pmpro_admin_bar_menu');

The instructions on the plugin page are fairly cryptic. Is there any further instructions?

I'm using the latest version of PMPro and WP 4.2.2

Thanks

Make sure the expiration and other crons don't run on a subsite

We can either unhook things or remove the cron jobs (unhooking might be better in case the pmpro-network-subsite plugin is deactivated later) to keep expirations and other crons from running on the subsite.

If the subsite tries to expire a member, it might do it incompletely because user meta is unavailable from the main site or other plugins are activated on the main site only that need to interact during expiration.

Error when activating on a non-network WP

If the plugin is activated on a single WP install (not a Network/Multisite) the following error is thrown:

An error of type E_ERROR was caused in line 69 of the file /home3/domain/public_html/wp-content/plugins/pmpro-network-subsite/inc/class-pmpro-manage-multisite.php. Error message: Uncaught Error: Call to undefined function get_sites() in /home3/domain/public_html/wp-content/plugins/pmpro-network-subsite/inc/class-pmpro-manage-multisite.php:69 Stack trace: #0 /home3/domain/public_html/wp-includes/class-wp-hook.php(287): PMPro_Manage_Multisite::settings_page('') #1 /home3/domain/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array) #2 /home3/domain/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #3 /home3/domain/public_html/wp-admin/admin.php(254): do_action('toplevel_page_p...') #4 {main} thrown

I have recreated this error if you install and activate the multisite membership add on on a non-network WP install. we should catch this and show a message

"This plugin will only work on a WordPress Network/Multisite environment."

what about admin bar?

The menu still shows on the admin bar of the subsites. Would be nice to get rid of it. It shows for those who don't have the capabilities to use it so they click and get "do not have permissions" page for all 10 submenu items.

Detailed information?

Hello. I cannot understand exactly what this code achieves and how. I am guessing that, once installed on a subsite of the network, it will contact the network´s main site to check if the user has privileges to access the subsite? A valid membership, etc?
Could you please explain in more detail how to setup this properly? I´ve followed the instructions over at http://www.paidmembershipspro.com/add-ons/plugins-on-github/pmpro-network-membership/ but i cannot actually see any difference after the addon is installed.
Thank you.

Hide Toolbar setting does not apply to sub sites when running multisite.

Describe the bug
When the Advanced setting to "Hide the Toolbar from all users with the Subscriber role." does not work across a mulitsites,

To Reproduce

  1. Multisite
  2. PMPro running each site
  3. Multisite Membership Add On installed
  4. check box in advance settings to hide toolbar for subscribers
  5. Hides for the main site but not subsites

Subsite fatal error if PMPro not activated on subsite before Multisite Memberships

Subsite dashboard throws a fatal error if PMPro not activated on subsite with Multisite Memberships

if you deactivate PMPro it generates this error -- (you have to delete the plugin file to regain access to dashboard)

Fatal error: Uncaught Error: Call to undefined function pmpro_get_crons()
in /home/spicypress/domains/xxx.com/public_html/wp-content/plugins/pmpro-network-subsite/pmpro-network-subsite.php on line 222

Call stack:

pmpro_multisite_remove_crons()
wp-includes/class-wp-hook.php:324
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:348
WP_Hook::do_action()
wp-includes/plugin.php:517
do_action()
wp-admin/admin.php:175
require_once()
wp-admin/plugins.php:10

Duplicating Admin Activity Emails for all Sites in the Network

We have a few reports that the admin is receiving multiple copies of the admin activity email for each site in their network.

We are investigating this further, but it appears this is an issue and should be fixed in the Add On.

  • If a user is running a multisite with 3 unrelated sites all running PMPro, you would want an admin activity emails for each separate site.
  • If a user is running a multisite with this Add On (shared DB), the user only wants the admin activity email from the main network site.

@dparker1005 suggests the following code:
function pmpro_multisite_membership_remove_cron_admin_activity_email() { remove_action( 'pmpro_cron_admin_activity_email', 'pmpro_cron_admin_activity_email' ); } add_action( 'pmpro_cron_admin_activity_email', 'pmpro_multisite_membership_remove_cron_admin_activity_email', 9 );

I am also suggesting an improvement to the core plugin so that separate admin emails from separate sites on the network are more clearly labeled. We mark the subject line with the site name BUT nothing in the email is super obvious. We should update core to add their site's name as the first thing in the email.

Hey, SITE TITLE HERE

This issue is related to #13 which addresses how crons are handled in subsites when using this Add On.

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.