Is there a list built into pro sites that can list current pro site paid members and a link too ?

I want to showcase the member sites that are using the paid pro site levels on my multisite network. Is there a built in way to display this list of paid members? currently, I am just adding pro members on a page on my site manually with a link to their site but it will get tricky to manage when more members upgrade and then later if members downgrade or stop membership. Is there an automatic way that the plugin can list the paid members and then take any members off the list when their subscription expires and is not renewed.

Additionally, what happens when a subscription is not renewed? I have set it up that level 1 membership has my ads disabled automatically and then they are able also to gain access to their appearance settings and change the appearance, add a logo and alter the widget area. If their membership does not renew, I expect they will lose access to their advanced dashboard and ads will appear again automatically (I am also using easy blogs where free members only have access to the easy dashboard with no ability to access the appearance settings.) However, will the changes they have already made stay put or will they too disappear? For example, they may have changed colors and added a logo picture. Those things will still stay put but they won't have access to the dashboard to alter them again. Does that sound right? Now, about my second level of pro site ability. This level includes a plugin package. Will the plugins be disabled when the membership expires or will the plugins simply not be accessible to the user anymore but still work? Thanks

  • Ash

    Hello @Leslie

    I hope you are well today and thanks for asking the question.

    Is there a built in way to display this list of paid members?

    Please use the following code:

    function show_pro_sites_func( $atts ) {
        global $psts;
        $sites = wp_get_sites( array( 'limit' => 5000 ) );
    
        $html .= '<table width="100%" cellspacing="0" cellpadding="0">';
        $html .= '<tr>';
    	$html .= '<th>Site Name</th>';
    	$html .= '<th>Admin</th>';
    	$html .= '<th>Pro Level</th>';
        $html .= '</tr>';
    
        foreach( $sites as $site ) {
        	if( $site['blog_id'] == 1 ) continue;
    	switch_to_blog( $site['blog_id'] );
    	$html .= '<tr>';
    	$html .= '<td><a href="' . site_url() . '" target="_blank">' . get_bloginfo( 'name' ) . '</a></td>';
    	$user = get_user_by( 'email', get_bloginfo( 'admin_email' ) );
    	$html .= '<td>' . $user->display_name . '</td>';
    	$html .= '<td>' . $psts->get_level_setting( $psts->get_level( $site['blog_id'] ), 'name' ) . '</td>';
    	$html .= '</tr>';
    	restore_current_blog();
        }
        $html .= '</table>';
        return $html;
    
    }
    add_shortcode( 'show_pro_sites', 'show_pro_sites_func' );

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Then use the shortcode:

    [show_pro_sites]

    However, will the changes they have already made stay put or will they too disappear?

    If this is appearances settings, then yes, the changes will be active even when the Pro status is expired.

    Will the plugins be disabled when the membership expires or will the plugins simply not be accessible to the user anymore but still work?

    Yes, the plugins will be disabled automatically when the pro status will be expired. So, anything related to those plugins won't be functional.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

  • Leslie

    We modified the code a bit as shown below because the short code was showing all members rather than just the pro members. Thanks.
    function show_pro_sites_table( $atts ) {
    global $psts;
    $sites = wp_get_sites( array( 'limit' => 5000 ) );

    $html .= '<table width="100%" cellspacing="0" cellpadding="0">';
    $html .= '<tr>';
    $html .= '<th>Site Name</th>';
    $html .= '<th>Admin</th>';
    $html .= '<th>Pro Level</th>';
    $html .= '</tr>';

    foreach( $sites as $site ) {
    $level = $psts->get_level_setting( $psts->get_level( $site['blog_id'] ), 'name' );
    if( $site['blog_id'] == 1 || !strpos($level,"Pro",0) ) continue;
    switch_to_blog( $site['blog_id'] );
    $html .= '<tr>';
    $html .= '<td>' . get_bloginfo( 'name' ) . '</td>';
    $user = get_user_by( 'email', get_bloginfo( 'admin_email' ) );
    $html .= '<td>' . $user->display_name . '</td>';
    $html .= '<td>' . $psts->get_level_setting( $psts->get_level( $site['blog_id'] ), 'name' ) . '</td>';
    $html .= '</tr>';
    restore_current_blog();
    }
    $html .= '</table>';
    return $html;

    }
    add_shortcode( 'show_pro_sites_table', 'show_pro_sites_table' );