Skip Navigation

[Escalated to 2nd Tier] The restriction of the visual sites are not working

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Waqar 3 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1942939
#1943249

Hi,

Welcome to Toolset support and I'd be happy to assist.

I tried to view the page that you've mentioned, but the website is showing a "There was a critical bug on your website." error.

When an error like this is shown WordPress usually sends in some details about the error in an email to the WordPress admin. You can look for those errors or warnings or turn on WordPress debugging to investigate more into this error:
https://wordpress.org/support/article/debugging-in-wordpress/

Once the website is back online, you're welcome to share temporary admin login details in reply to this message, so that I can see why the members-only page is showing to guests (non-logged in visitors).

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1943677

That was just shortly in debug mode. now its running.

#1943765

Thank you for sharing the admin access and the post group restriction seems to be set up properly.

To investigate why this page is still showing to the guests, I'll need to perform some tests on your website's clone.

The Duplicator plugin is already installed on the website, so do I have your permission to download a clone/snapshot of the website?
( ref: https://toolset.com/faq/provide-supporters-copy-site/)

This will help in troubleshooting this without affecting the actual website.

#1943809

Yes please go for it!

#1950829

Thank you for the permission.

I've downloaded the clone and currently doing some troubleshooting on my server and will share my findings as soon as it completes.

Thank you for your patience.

#1955489

Thank you for waiting while I performed some testing and research.

During the investigation, I was able to reproduce this behavior on a test website too.

When a post/page using Enfold theme's Avia builder is restricted by Access Post Group, its regular content and not the assigned content template is shown to the users who are not allowed.

I've shared these findings with the concerned team for further review and will keep you updated through this ticket.

For now, you can use follow these steps as a workaround:

1. In your child theme's folder "enfold-child", you can add a new file named "template-login.php" with the following code:


<?php 
	/*
	Template Name: Login Form
	*/
	
	if ( !defined('ABSPATH') ){ die(); }

/*
 * A blank Template that allows you to build landing pages, coming soon pages etc
 */	
	 
 global $avia_config, $wp_query;

	/*
	 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
	 */
	get_header();

	/**
	 * @used_by				enfold\config-wpml\config.php				10
	 * @since 4.5.1
	 */
	do_action( 'ava_page_template_after_header' );

 	 if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
 	 
 	 do_action( 'ava_after_main_title' );
	 ?>

		<div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>

			<div class='container'>

				<main class='template-page content  <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>>

                    <?php
                    echo render_view_template( 1502, get_the_ID() );
                    ?>

				<!--end content-->
				</main>

				<?php

				//get the sidebar
				$avia_config['currently_viewing'] = 'page';
				get_sidebar();

				?>

			</div><!--end container-->

		</div><!-- close default .container_wrap element -->



<?php 
		get_footer();

The above page template will show the content from the content template "Login Form".

2. Please go to WP Admin -> Toolset -> Access Control -> Post Groups and for the group "Logged-in users only", select this new page template "Login Form" for the guests.
( screenshot: hidden link )

I hope this helps and please let me know if you need any further assistance around this.