• Resolved blurryfish

    (@photonatic)


    Hi.

    I’ve set both options “Choose to require approval for new users using URA Approval on New User Registration” and “Choose to require new users to verify email After New User Registration” to YES.

    The user (me) is able to sign up with custom fields and a verification e-mail is received. Upon clicking the verification URL the user is led to the page [domain]/ura-email-confirm with the GET-parameters action=verifye-mail, key and user_email all set in the URL. The Email Confirm page only shows the title, Email Confirm. In the User admin page the user is still in the “Pending verification” tab and the email is unverified. I have re-sent a verification e-mail several times.

    As written in the plugin FAQ I’ve changed my “Permalink Structure” to “Post Name”. I had it set to another option and there is no difference in behavior.

    I’ve tried following some of the suggestions as described by the plugin author in https://www.ads-software.com/support/topic/verifying-email-isnt-working/ such as adding a call to die() in page.php and ura-email-confirm.php, moved the call a bit around in the code. However, it seems like none of the files are ever called since I still see the website and the empty Email Confirm page.

    I have changed my theme from MagCast to Twenty Fifteen prior to adding the die() calls.

    I have RegistrationMagic and Theme My Login installed though both are disabled (with one of them, think it was TML, enabled some function call failed).

    What else to try out?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter blurryfish

    (@photonatic)

    A simple delete plugin and re-install did not solve the problem either.

    Plugin Author bnovotny

    (@bnovotny)

    Make sure your permalink is set to Post Name. And the place to really check is the /templates/ura-template-loader.php as that is where the templates are called and checked for my templates or WordPress templates. Resetting the permalink should take care of it, if not then try the function ura_template_loader in the file mentioned previously, there are a few commented out wp_dies in that function for testing or add your own. That is where my template gets called and fires and it is not firing apparently.

    Thread Starter blurryfish

    (@photonatic)

    Hi again.

    My permalink is set to Post Name.

    I’ve put some die / print / print_r here and there. With print_r on the $post object I get these values:

    WP_Post Object
    (
    [ID] => 225
    [post_author] => 1
    [post_date] => 2017-03-09 01:12:53
    [post_date_gmt] => 2017-03-08 23:12:53
    [post_content] =>
    [post_title] => Email Confirm
    [post_excerpt] =>
    [post_status] => publish
    [comment_status] => closed
    [ping_status] => closed
    [post_password] =>
    [post_name] => ura-email-confirm
    [to_ping] =>
    [pinged] =>
    [post_modified] => 2017-03-11 14:08:09
    [post_modified_gmt] => 2017-03-11 12:08:09
    [post_content_filtered] =>
    [post_parent] => 0
    [guid] => https://www.[subdomain].[domain].[topdomain]/ura-email-confirm/
    [menu_order] => 0
    [post_type] => page
    [post_mime_type] =>
    [comment_count] => 0
    [filter] => raw
    [ura_post_type] =>
    )

    It looks to me ura_post_type is empty in this case so nothing is assigned to $post_type.

    Then I added print (“URA_THEME_URL: ” . URA_THEME_URL ); a bit further down and got this back:

    URA_THEME_URL: /home/[username]/[subdomain].[domain].[topdomain]/wp-content/plugins/user-registration-aide/themes/

    Since $post_type is empty then this is never true:

    if ( $post_type == ‘ura-page’ )

    Maybe this could have picked up

    if( empty( $template ) ){

    …but I added this line after the if:

    else { print ( “empty template” ); }

    … which printed out the empty template text.

    Is this fully expected?

    Plugin Author bnovotny

    (@bnovotny)

    Well if you can you can look into the database for posts and see if it added the ura_post_type field to the table, but the if( empty( $template ) ){ was added in case it hasn’t been added.

    And are you using the latest version, as the latest version should compensate for the ura_post_type not being added with the empty $template logic. Uncomment the wp_die array key exists and see what happens. And you can try to add the ura-page to the posts table for the page in the posts db and see if that works too. Uncomment out the wp_die( ‘POST TYPE’ ) on line 47 of ura-template-loader.php and see if that does anything too. Outside of that not sure what to tell you outside of that without being able to look at it directly.

    One other thing, there is this code starting around line 46 of the ura-template-loader.php file:

    if ( $post_type == 'ura-page' ){
    		//wp_die( 'POST TYPE' );
    		$template = URA_THEME_URL.'page.php';
    		
    	}
    	if( empty( $template ) ){
    		if( array_key_exists( $post->post_name, $templates ) ){
    			//wp_die( 'ARRAY_KEY EXISTS' );
    			$template = URA_THEME_URL.'page.php';
    		}
    	}

    Change that to this:

    if( !empty( $post_type ) ){
    		if ( $post_type == 'ura-page' ){
    			//wp_die( 'POST TYPE' );
    			$template = URA_THEME_URL.'page.php';
    		}else{
    			return $template;
    		}
    	}else{
    		if( array_key_exists( $post->post_name, $templates ) ){
    			//wp_die( 'ARRAY_KEY EXISTS' );
    			$template = URA_THEME_URL.'page.php';
    		}else{
    			return $template;
    		}
    	}

    That should better cover the logic for the event that the ura-post-type is empty instead of what I had.

    Thread Starter blurryfish

    (@photonatic)

    Hi again.

    I am currently running 1.5.3.7.

    Asking me to check the database for the ura_post_type did the trick. It turned out that the column was null for all rows. So I did this:

    update wp_posts
    set ura_post_type= ‘ura-page’
    where post_name like ‘ura%’

    … and then the code fell into the right if-statement.

    I could probably also have used the logic you’ve provided but I guess it would be overwritten on the next plugin update.

    Now the Email Confirmed page seems to be messing up the page a bit but that’s another discussion. ??

    Thanks a lot for your help!

    Plugin Author bnovotny

    (@bnovotny)

    As I recall using the regular theme did create issues when I was first developing that section and I knew very little about theming at the time. The templates now use a generic theme template as I was unfamiliar with those but will look into it in the next update or see about using the current theme styling instead and see if I can get the to work properly, however it is difficult with so many theme options out there so there will always be some issues with doing it that way as well but let me check on it.

    • This reply was modified 7 years, 8 months ago by bnovotny.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘E-mail verification does not work’ is closed to new replies.