After activating rename wp-signup.php feature the link is wrong

Hi,

Installed in my WPMS 3.0.4 Anti-Splog.

No Buddypress is installed.

The plugin instructions states:

“Replace any hardcoded links to wp-signup.php with this function: <?php ust_wpsignup_url(); ?>”

So, I modified header.php and profile.php files on EduClean them by searching and replacing wp-signup.php for the php code stated in the plugin:

<?php ust_wpsignup_url(); ?>

Then activated Rename wp-signup.php feature, clicked Save.

After doing that the link to register is very long and has the site url added twice like this:

http://comunidadespr.com/http://comunidadespr.com/signup-fca/

How do I correct the issue?

This is the code in header.php (without editing):

<div id="main-header-inner">

<?php if( is_home() && str_replace("/","",$_SERVER) != 'wp-signup.php' && str_replace("/","",$_SERVER) != 'register' ) { ?></p>

<p><div id="main-header-inner-content">

<h4><?php echo stripslashes($tn_edus_header_text); ?></h4></p>

<p><div id="intro-log">

<div id="list-benefits">

<?php echo stripslashes($tn_edus_header_listing); ?>

</div>

<div id="intro-package">

<div id="edublog-free"><h3>Añada Su Comunidad En Segundos. Es Gratis!</h3><p>/<?php if( $bp_existed == 'true' ) { //check if bp existed ?>register/<?php } else { ?>wp-signup.php<?php } ?>" title="Get yourself a free blog">Unase Ahora!</p></div>

</div>

This is the code edited (the one that creates a long url repeating the site url):

<div id="main-header-inner">

<?php if( is_home() && str_replace("/","",$_SERVER) != '<?php ust_wpsignup_url(); ?>' && str_replace("/","",$_SERVER) != 'register' ) { ?></p>

<p><div id="main-header-inner-content">

<h4><?php echo stripslashes($tn_edus_header_text); ?></h4></p>

<p><div id="intro-log">

<div id="list-benefits">

<?php echo stripslashes($tn_edus_header_listing); ?>

</div>

<div id="intro-package">

<div id="edublog-free"><h3>Añada Su Comunidad En Segundos. Es Gratis!</h3><p>/<?php if( $bp_existed == 'true' ) { //check if bp existed ?>register/<?php } else { ?><?php ust_wpsignup_url(); ?><?php } ?>" title="Get yourself a free blog">Unase Ahora!</p></div>

</div>

Please help.

  • wlpdrpat
    • Site Builder, Child of Zeus

    Hey cbriere,

    The search and replace for the first item in your code breaks the php code. That is a string replace for your home page url that removes the end slash. However, because the register page is also an is_home it provides the exclusion for this url. What you have done will break the first part of the code. To fix this on you need to know that actual url that is generated from your new piece of code and then insert it into where ‘wp-signup.php’ occurs in the first item. From the link that was generated it would appear that this should be ‘signup-fca’

    Hope that helps.

    Pat

  • cbriere
    • Site Builder, Child of Zeus

    Hi wlpdrpat,

    Thanks for the reply.

    As per the instructions in the plugin, it states:

    “Checking this option will disable the wp-signup.php form and change the signup url automatically every 24 hours. It will look something like http://comunidadespr.com/signup-XXX/.”

    If I insert the link as you suggests, that means that after 24 hours, the link will not work since another one will be generated in the fly.

    Thanks again.

  • wlpdrpat
    • Site Builder, Child of Zeus

    Hey cbriere,

    Try the following:

    What you showed:

    <?php if( is_home() && str_replace("/","",$_SERVER) != '<?php ust_wpsignup_url(); ?>' && str_replace("/","",$_SERVER) != 'register' ) { ?>

    Try this:

    <?php if( is_home() && str_replace("/","",$_SERVER) != ust_wpsignup_url() && str_replace("/","",$_SERVER) != 'register' ) { ?>

    Or this:

    <?php $ustwpsignup = ust_wpsignup_url(); if( is_home() && str_replace("/","",$_SERVER) != $ustwpsignup && str_replace("/","",$_SERVER) != 'register' ) { ?>

    I’m not too familiar with the plugin you are using but I am pretty good with php and the way that you coded it initially you placed a php call inside of another php call, which doesn’t work well. The two options I have listed above should both work. I prefer the second one just as a matter of coding preference.

    Hope that helps.

    Pat

  • cbriere
    • Site Builder, Child of Zeus

    Hey wlpdrpat,

    Thanks again. Unfortunately that doesn’t worked. I tried both codes.

    The effect of both codes suggested, is that the generated url is displayed (out the area where it is suppossed to be) and without a link. It is displayed below the pages link and removed part of the template.

    In the Create a new account link, it still displays the long incorrect url.

    Nice try. Thanks.

  • wlpdrpat
    • Site Builder, Child of Zeus

    Hey cbriere,

    OK. I have looked at the code you provided originally to see what it purposes is (initially, I was just trying to help you write proper code). The first line of code:

    <?php if( is_home() && str_replace("/","",$_SERVER) != 'wp-signup.php' && str_replace("/","",$_SERVER) != 'register' ) { ?>

    The purpose of this is to do a string replace searching for / in the string REQUEST_URI and replacing it with nothing then comparing the result to ensure that it is not wp-signup.php or register. If it meets all these requirements then it will display what follows this php call, which is signified by the open bracket at the end of the call: “{” Using your replacement code here replacing wp-signup.php for ust_wpsignup_url() will not have much of an effect because it will be using an absolute url to compare.

    In other words placing your ust_wpsignup_url() in the first piece of code is not the problem as this is just a comparative analysis to decide whether or not to display the code that follows it.

    This is because the second part of the code is designed to generate a relative link to either register if you are using bp or wp-signup if not:

    /<?php if( $bp_existed == 'true' ) { //check if bp existed ?>register/<?php } else { ?>wp-signup.php<?php } ?>

    Notice the leading / before the php call above. This is designed to generate a relative link. Messy, messy, messy! Of course, this is because the skin is designed to work with either bp or wp. However, this is the problem. When you replace wp-signup.php with ust_wpsignup_url() in this part of the code you end up with the http://comunidadespr.com/http://comunidadespr.com/signup-b8e/ because this is designed to provide a relative link.

    Revert the first code to it’s original state:

    <?php if( is_home() && str_replace("/","",$_SERVER) != 'wp-signup.php' && str_replace("/","",$_SERVER) != 'register' ) { ?></p>

    Of course I am not sure why there is a hanging close paragraph following this code and this may be the reason you are seeing the url under your menu. However, reverting it to its original should work.

    and try this for the second code:

    <div id="intro-package">

    <div id="edublog-free"><h3>Añada Su Comunidad En Segundos. Es Gratis!</h3><p><?php if( $bp_existed == 'true' ) { //check if bp existed ?>/register/<?php } else { ?><?php ust_wpsignup_url(); ?><?php } ?>" title="Get yourself a free blog">Unase Ahora!</p></div>

    </div>

    What I have done above is moved the leading / that was before the php call creating a relative link for both register and wp-signup into the area for register only. This should do the trick for correcting your http://comunidadespr.com/http://comunidadespr.com/signup-b8e/ to http://comunidadespr.com/signup-b8e/

    Cheers,

    Pat

  • cbriere
    • Site Builder, Child of Zeus

    Hi Pat,

    Reverted to original. Then replaced code as suggested. Still dont work. The link text/contents is displayed but without the link, and the “Create a new account” link in the form still displays the long incorrect link.

    Don’t know if this is important, but here it goes: I just noticed that I’m using The Edublogs Homepage Theme ver 2.1.3 and the current one is ver 2.1.8. However, I don’t want to upgrade since I’m afraid of losing work done on it.

    I appreciate your time and effort, but it’s time someone from WPMUDEV helps us here.

  • wlpdrpat
    • Site Builder, Child of Zeus

    Hey cbriere,

    Sorry, guess I am asleep at the wheel. The code is missing the anchor. Without and anchor it won’t generate a link.

    This is what it should be:

    <div id="intro-package">

    <div id="edublog-free"><h3>Añada Su Comunidad En Segundos. Es Gratis!</h3><p>/register/<?php } else { ?><?php ust_wpsignup_url(); ?><?php } ?>" title="Get yourself a free blog">Unase Ahora!</p></div>

    </div>

    Regarding the code for the Login Block. You will have to make the same type of repair to it. If you supply the code, we can get it right.

    Pat

  • wlpdrpat
    • Site Builder, Child of Zeus

    I knew I had included the anchor in my previous post!!! for some reason the forum is stripping out my anchor from the code.

    I will try it again here but will break it into segments:

    <div id="intro-package">

    <div id="edublog-free"><h3>Añada Su Comunidad En Segundos. Es Gratis!</h3><p>

    after the above and before the below code you need an anchor < a href=” (I added a space between < and a so that it will display)

    <?php if( $bp_existed == 'true' ) { //check if bp existed ?>/register/<?php } else { ?><?php ust_wpsignup_url(); ?><?php } ?>" title="Get yourself a free blog">Unase Ahora!

    after the above code and before the below code you need to close the anchor < /a > (again I added spaces)

    </p></div>

    </div>

    I didn’t check my previous posts until just now. I added these in each post but the forum stripped them.

    Sorry about that!!

    Pat

  • cbriere
    • Site Builder, Child of Zeus

    Hey Pat,

    Your mod solved the issue of the signup link located in the box. Thanks a lot!

    Now I have to figure out how to solve the same issue in the link that says “Create a new account”. That link still points to the long/incorrect url here:

    (http://comunidadespr.com/http://comunidadespr.com/signup-c06/)

    For some reason it is calling the site url and then is also adding the full site url again with the signup link.

  • cbriere
    • Site Builder, Child of Zeus

    This is the current code of the link included in the form that is showing the long/incorrect link:

    <div id="main-header-inner">

    <?php if( is_home() && str_replace("/","",$_SERVER) != 'wp-signup.php' && str_replace("/","",$_SERVER) != 'register' ) { ?>

  • cbriere
    • Site Builder, Child of Zeus

    Well, something happens with this forum that the code is not shown correctly. The forum is removing some parts of the code.

    Again, just find this code in the profile.php file (which is part of the form):

    "<?php bloginfo('url'); ?>/<?php ust_wpsignup_url(); ?>"

    And remove the following part:

    <?php bloginfo('url'); ?>/

    That’s it.

  • Qlof
    • The Crimson Coder

    Hey renato.

    Could you print the current code? Since you’ve re-installed WP I’m guessing it could look different. It looks like you have not removed enough code when you tried to replace the signup link. If you show me the code I’ll do my best to explain.

  • renato123
    • WPMU DEV Initiate

    The intructions from the plugin are clear but DOES NOT WORK.

    It would be great to just rewrite the instruction in a way that dummies can follow.

    I tried to follow this instructions:

    Checking this option will disable the wp-signup.php form and change the signup url automatically every 24 hours. It will look something like http://drydot.com/signup-XXX/. To use this you may need to make some slight edits to your main theme’s template files. Replace any hardcoded links to wp-signup.php with this function: <?php ust_wpsignup_url(); ?> Within post or page content you can insert the [ust_wpsignup_url] shortcode, usually in the href of a link. See the install.txt file for more detailed documentation on this function

    Then I tried:

    “>Signup Now

    What I get as a result of this link is:

    http://drydot.com/%3C?php%20ust_wpsignup_url();%20?%3E

  • Qlof
    • The Crimson Coder

    This is the code I’m using:

    <a href="<?php ust_wpsignup_url(); ?>">Signup Now</a>

    It’s the exact same code. That’s strange.

    Is it possible that it’s within PHP tags? Check so that there’s a ?> before the line where you are currently having this html code. If there’s not, add it before that line and add <?php after it. If you’re not sure what that is, just post more code here so that I can see what’s before and after the piece of code that you just posted.

  • renato123
    • WPMU DEV Initiate

    I put it to work but the problem is not solved…

    I am able to use the shortcode [ust_wpsignup_url] in pages and post which works fine using the following code:

    <a href="[ust_wpsignup_url]">Signup Now</a>

    However when I try to use it in any other plugin such as slide tabs, css table pricing grid, rock tab and many others.. it does not work.

    this code <a href="[ust_wpsignup_url]">Signup Now</a>

    this code <a href="<?php ust_wpsignup_url(); ?>">Signup Now</a>

    The code I guess is right, but it would not work for instance as a link in one Slider.

    VERY ANNOYING….

    Any suggestion ???

  • metoo55
    • Flash Drive

    short code don’t work with me too. OR It about theme. I use Edu Clean Theme same renato123. And i try to use…

    1. <a href="[ust_wpsignup_url]">Signup Now</a>

    2. ust_singup_url()

    at header.php, I still don’t work.

    renato123, I found your solved problem at “Añada Su Comunidad En Segundos. Es Gratis!UNASE AHORA!” Please suggest me what code that you use in this area.

  • renato123
    • WPMU DEV Initiate

    I used the following code in the page content or into the post:

    <a href="[ust_wpsignup_url]">Signup Now</a>

    It DOES NOT WORK “inside of other plugin”

    Unfortunately there are no support for paid members, we have to rely in each other to solve these problem, what seems unfair and after pay for one year subscription I fell being riped off by these scammers…

    I am sorry if I can’t help anymore.

  • metoo55
    • Flash Drive

    Thanks renato123,

    I think, i can solved problem in Sign Up area on header.php but i still can’t solve short code in post/page, I think it have problem with Edu Clean Theme.

    Let me record, How to change header.php (of Edu Clean Them only) for Anti-Splog.

    1. Open header.php and search /wp-signup.php that you will found at line number…111, 245, 255, 257 (some time not same me don’t mine please compare with this code)

    111 <?php if (strstr($_SERVER['REQUEST_URI'], '/wp-signup.php')) { ?>
    245 <?php if( is_home() && !strstr($_SERVER['REQUEST_URI'], '/wp-signup.php') ) { ?>
    255 <?php if ( !strstr($_SERVER['REQUEST_URI'], '/wp-signup.php?action=register') ) { ?>
    257 <div id="edublog-free"><h3><?php _e("Get started in seconds for free",TEMPLATE_DOMAIN); ?></h3><p><a href="<?php echo home_url(); ?>/<?php if( $bp_existed == 'true' ) { //check if bp existed ?><?php echo bp_get_root_slug( 'register' ) . '/'; ?><?php } else { ?>wp-signup.php<?php } ?>" title="<?php _e("Get yourself a free blog",TEMPLATE_DOMAIN); ?>"><?php _e("Join Here!",TEMPLATE_DOMAIN); ?></a></p></div>

    Replace all /wp-signup.php with <?php ust_wpsignup_url(); ?>

    2. At line number 257 change it to

    257 <div id="edublog-free"><h3><?php _e("Get started in seconds for free",TEMPLATE_DOMAIN); ?></h3><p><a href="<?php echo home_url(); ?>" title="<?php _e("Get yourself a free blog",TEMPLATE_DOMAIN); ?>"><?php _e("Join Here!",TEMPLATE_DOMAIN); ?></a></p></div>

    Then everybody can click Sign Up on home page. Hope It help somebody that have same problem. :smiley:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.