Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Woocommerce theme messed up on TOR #52

Open
NicolasDorier opened this issue May 7, 2019 · 1 comment
Open

Woocommerce theme messed up on TOR #52

NicolasDorier opened this issue May 7, 2019 · 1 comment

Comments

@NicolasDorier
Copy link
Member

NicolasDorier commented May 7, 2019

If you first use woocommerce on clearnet and then attempt to use TOR, then the layout is messed up because woocommerce saved options home and siteurl in database during the install.

This website shows manual steps to edit this those values.

A better idea, is to modify wp-config.php and add:

define('WP_SITEURL', $_SERVER["REQUEST_SCHEME"].'://'.$_SERVER["SERVER_NAME"]);
define('WP_HOME', $_SERVER["REQUEST_SCHEME"]'.'://'.'$_SERVER["SERVER_NAME"]);

We should check $_SERVER['HTTP_X_FORWARDED_PROTO'] instead of REQUEST_SCHEME though.

This has the advantage to make woocommerce works at same time on clearnet and Tor.
We should probably do this automatically in the docker-entrypoint.sh.

@ndeet
Copy link

ndeet commented Oct 1, 2022

@dennisreimann to make this work with Tor adding above config will make the theme work again but the problem is with wordpress unlike most other CMSs it hardcodes the whole URL to images and links. So the full URL is hardcoded in the db linking to images and internal links. So it would still be broken if site get's setup over clearnet but also available over Tor (or the other way around). If you start with Tor and go Tor only you can rewrite all urls with wp cli, wp search-replace 'https://clearnet-domain.tld' 'http://tor-domain.onion'.

If we want a hybrid mode that both work there is more work involved see this tutorial linked on an issue for the plugin itself:
https://tech.michaelaltfield.net/2021/02/12/wordpress-multisite-tor-alias/

Maybe we should do a separate plugin for this or try to do it as an option in the BTCPay for WooCommerce plugin.

@dennisreimann dennisreimann transferred this issue from btcpayserver/docker-woocommerce Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants