Support

Home Forums Event Espresso Premium Staging site – email links pointing to main site

Staging site – email links pointing to main site

Posted: January 23, 2019 at 5:47 pm

Viewing 9 reply threads


Porter

January 23, 2019 at 5:47 pm

I’ve just realised that all the links in the EE messages are linking to our live site and not our staging site. We have not yet set up EE on our live site and are only testing EE on our staging site. Is there a way we can change the default domain to our staging domain so we can make sure it is linking correctly?


Tony

  • Support Staff

January 24, 2019 at 4:25 am

Hi there,

That’s odd, did you initially install EE on live and then import it over to stanging?

The functions used to generate the links all use WP core functions such as get_permalink() or site_url() which should parse to the current site.

The exception being that when EE generates its internal config it caches it, but you can force EE to regenerate the config by navigating to Event Espresso -> General Settings, make a single change (change site name for example), save and will rebuild the config, you can then reverse that change again should you wish and save again.

If you do that now and retest do the links still show as the live site?

Is there an event I can register onto to view this?


Porter

January 24, 2019 at 12:31 pm

This reply has been marked as private.


Tony

  • Support Staff

January 25, 2019 at 2:40 am

Yeah that’s the problem, if site_url is using the ‘live’ site that’s what will be used to generate the links.

I’ve not heard of the site url using the the live url on staging tbh, that means that pretty much any plugin that generates links would use the live site in that setup.

Which host are you using?


Porter

January 25, 2019 at 3:40 am

This reply has been marked as private.


Tony

  • Support Staff

January 25, 2019 at 6:45 am

Ok, so this is a limitation with your staging environment rather than Event Espresso.

EE can only generate the links based on the values given to it from your site, so as that’s the live URL that is what you get.

You can either open the link and change the domain to your staging URL to test that way, or you could try adding:

define('WP_HOME','{staging_domain}');
define('WP_SITEURL','{staging_domain}');

To your wp-config.php file on staging, for example:

define('WP_HOME','http://ee4dev.local');
define('WP_SITEURL','http://ee4dev.local');

Is on one of my local test sites.

That overrides the values set in your database (it does not save the values unless you click save in Dashboard->General so don’t do that with the above active).

However, and this is important, firstly, I don’t know if this will work on that environment (I don’t use SiteGround) so you’ll need to test this yourself and second you MUST remove that from wp-config.php BEFORE you push staging to live, if you don’t you’ve just broken your live site as it’ll now point to staging (should be an easy fix though).

So add the above, regenerate some messages and check if the links work then, do your testing and confirm the functionality you want to, then remove the above again.

Cloning the site is another option, it will no longer be ‘connected’ to your live site in the way staging is so you can change whatever you like. For example, clone the site, change the settings, test the functionality and then destroy the site. It’s the next ‘closest’ option to live and is how its done without ‘staging’ systems.

(Full disclaimer – Because I don’t use the above I accept no responsibility for any issues from the above, it’s a couple of options for you to try with your hosting environment, you may want to run them by SiteGround first. Cloning the site is probably the ‘safest’ although all of the above I would consider safe really)


Porter

January 25, 2019 at 6:57 am

THanks for your detailed response – i really appreciate it! We were just discussing the same thing as a new cloned site so we can test this properly!


Porter

January 26, 2019 at 10:39 am

This reply has been marked as private.


Tony

  • Support Staff

January 26, 2019 at 1:28 pm

How exactly did you clone the site? Please post all of the steps taken.

The error you’ve posted is half of the error, the beginning is missing.

The error you’ve posted looks like there’s an issue pulling in the EE settings from your wp options, which likely means the site was not cloned correctly.


Porter

January 26, 2019 at 2:10 pm

This reply has been marked as private.
Viewing 9 reply threads

The support post ‘Staging site – email links pointing to main site’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso