I need to change the 'Admin URL:' link on Pro Sites success page.

I need to change the 'Finalizing your site' page 'Admin URL:' link on Pro Sites.
when a customer signs up for a new site and completes payment the Finalizing your site message is displayed. under that message there is the users information and a link to their new site.
The issue is I need to change how that link is structured. It currently displays https://usersite.mysite.com/wp-admin
there are two things I need to change here.
1) I need it to go to HTTP:// because linking to HTTPS causes the site to display an unsecured warning as my subsites don't have SSL.
2) I cannot have them going to /wp-admin as I don't allow access to that, so I just need to remove that.

so the link structure at the finalization page admin URL should display: http://usersite.mysite.com

How can I achieve this?

Thank you!
Mike

  • Ken Kimbrell

    Hello Michael-

    Could you please grant us temporary support access to your website so we can have a better look of your setup and settings? You can grant us access via WPMUDEV Dashboard plugin, there's no need to share credentials. Here's our detailed documentation page about it:
    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-4

    We'll wait for your confirmation reply here, as we don't get any notification when a member is granting us support access. We could then dig in and further investigate this!

    Take Care,

    Ken - WPMU DEV Support

  • Ken Kimbrell

    Hello Michael-

    It looks like your login, points to wp-login.php, which is the default wordpress login and has an Hyper Text Transfer Protocol Secure encryption login by default. If you were to make a custom login page where you wanted your users to go, I believe you could bypass the https warning by redirecting the user to your custom login page. Add this code to your functions.php:

    add_action('init','possibly_redirect');
    function possibly_redirect(){
     global $pagenow;
     if( 'wp-login.php' == $pagenow ) {
      wp_redirect(' /***Custom LOGIN PAGE URL Here***/ ');
      exit();
     }
    }

    Also, I recommend you look into our
    Domain Mapping plugin. This is great for what you are trying to accomplish. You would have the ability to sell to your clients the option to remove "mysite" from http://usersite.mysite.com, that way the user only has http://usersite.com :slight_smile:

    Let me know how this works for you!

    Take Care,

    Ken - WPMU DEV Support

  • Ken Kimbrell

    Hello Michael-

    Is there any reason why you blocked out your site? I would need to see how that is displayed in order to potentially give you an option that would require hardcoding the Pro Site plugin. Is it displayed mplusstudios.officetalk.io/wp-admin/?

    I have a workaround, but I will need to add a string for your domain instead of using a function like this:

    esc_url( $blog_admin_url )

    Which grabs the new blog domain and admin login.

    I could potentially try this code as a workaround:

    <a href="' . esc_url( 'http://' . $new_blog_name . '.officetalk.com' ) . '">

    I use a basic string to pull the 'http://' then I append the variable of the new domain name and append the final string which would be how your domain is displayed.

    Let me know how this works for you!

    Take Care,

    Ken - WPMU DEV Support

    • Michael

      hey Ken Kimbrell I blocked out the site because the tickets are public but if you need the exact URL for the work, it is ( https://mplusstudios.officetalk.io/wp-admin )

      I tried to implement your code myself with no luck. Where should i be placing this? I replaced
      <a href="' . esc_url( $blog_admin_url ) . '">
      In line 590 of wp-content/plugins/pro-sites/pro-sites-files/lib/ProSites/View/Front/Gateway.php
      is this the correct placement?
      Here is the new line 590 code:
      $content .= '<br />' . esc_html__( 'Admin URL: ', 'psts' ) . '<a href="' . esc_url( 'http://' . $new_blog_name . '.officetalk.io' ) . '">' . esc_html__( $new_blog_name ) . '</a></p>';
      With this change there was no change what so ever to the Admin URL on the "Finalizing site" page
      I am going to change the code back to original and grant access for you, but let me know if I placed this wrong.

      P.S. having support access granted under WPMU Dev plugin causes Pro Sites checkout to fail in Live mode using stripe, so testing on the site might not work for you.

      Mike

  • Ken Kimbrell

    Hello Mike-

    That code worked for me, I believe you put it on the wrong line. Sounds like you may be at the right file, ../wp-content/plugins/pro-sites/pro-sites-files/lib/ProSites/View/Front/Gateway.php

    Find line 701, and replace it with that code.

    In addition, you can search for this comment, as it is unique and the section you need to replace will be right after the if conditional.

    // Any passwords for existing users here will be wrong, so just don't display it.

    Make sure you're replacing this:

    $content .= '<br />' . esc_html__( 'Admin URL: ', 'psts' ) . '<a href="' . esc_url( $blog_admin_url ) . '">' . esc_html__( $blog_admin_url ) . '</a></p>';

    With this:

    $content .= '<br />' . esc_html__( 'Admin URL: ', 'psts' ) . '<a href="' . esc_url( 'http://' . $new_blog_name . '.officetalk.io' ) . '">' . esc_html__( 'http://' . $new_blog_name . '.officetalk.io' ) . '</a></p>';

    Let me know how this works for you!

    Take Care,

    Ken - WPMU DEV Support