Skip to content

Commit 1329049

Browse files
committed
Add support for domain forwarding as early as possible
The code that adds support for domain forwarding needs to be executed as *early* as possible so as to set the $_SERVER['HTTPS'] env var before any other core or plugin code needs it. In order to achieve this, the installed/active plugin directory should be named a-woocommerce-dev-helper so that it's executed before all other plugins. Otherwise with EDD for instance, a bunch of external files will be loaded over HTTP and raise mixed content errors when forwarding over HTTPS
1 parent 993af05 commit 1329049

4 files changed

Lines changed: 77 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Download and install just like any other WordPress plugin. If you want to be rea
4646

4747
### 0.7.0-dev - YYYY.MM.DD
4848
* Tweak - Remove dependency on WooCommerce
49+
* Tweak - Add support for domain forwarding as early as possible
4950

5051
### 0.7.0 - 2017.04.12
5152
* Feature - Use the Bogus gateway for Subscriptions automatic renewals

i18n/languages/woocommerce-dev-helper.pot

Lines changed: 70 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,78 @@
1-
# Copyright (C) 2016 SkyVerge
1+
# Copyright (C) 2017 SkyVerge
22
# This file is distributed under the GNU General Public License v3.0.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: WooCommerce Dev Helper 0.4.2\n"
5+
"Project-Id-Version: A WooCommerce Dev Helper 0.7.0-dev\n"
66
"Report-Msgid-Bugs-To: "
77
"https://github.com/skyverge/woocommerce-dev-helper/issues\n"
88
"POT-Creation-Date: 2015-07-26 19:51:27+00:00\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=utf-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
12+
"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
1515

16+
#: includes/class-wc-dev-helper-bogus-gateway.php:42
17+
msgid "Bogus"
18+
msgstr ""
19+
20+
#: includes/class-wc-dev-helper-bogus-gateway.php:43
21+
msgid ""
22+
"A testing gateway that calls \"payment complete\" to simulate credit card "
23+
"transactions."
24+
msgstr ""
25+
26+
#: includes/class-wc-dev-helper-bogus-gateway.php:92
27+
msgid "Enable/Disable"
28+
msgstr ""
29+
30+
#: includes/class-wc-dev-helper-bogus-gateway.php:94
31+
msgid "Enable Bogus Gateway"
32+
msgstr ""
33+
34+
#: includes/class-wc-dev-helper-bogus-gateway.php:99
35+
msgid "Title"
36+
msgstr ""
37+
38+
#: includes/class-wc-dev-helper-bogus-gateway.php:101
39+
msgid ""
40+
"This controls the title for the payment method the customer sees during "
41+
"checkout."
42+
msgstr ""
43+
44+
#: includes/class-wc-dev-helper-bogus-gateway.php:102
45+
msgid "Bogus (Test)"
46+
msgstr ""
47+
48+
#: includes/class-wc-dev-helper-bogus-gateway.php:107
49+
msgid "Description"
50+
msgstr ""
51+
52+
#: includes/class-wc-dev-helper-bogus-gateway.php:109
53+
msgid "Payment method description that the customer will see on your checkout."
54+
msgstr ""
55+
56+
#: includes/class-wc-dev-helper-bogus-gateway.php:110
57+
msgid "Nothingtodohere &#128640;"
58+
msgstr ""
59+
60+
#: includes/class-wc-dev-helper-bogus-gateway.php:115
61+
msgid "Enable Subscriptions support?"
62+
msgstr ""
63+
64+
#: includes/class-wc-dev-helper-bogus-gateway.php:117
65+
msgid "Makes the gateway available for subscriptions purchases"
66+
msgstr ""
67+
68+
#: includes/class-wc-dev-helper-bogus-gateway.php:150
69+
msgid "Bogus is always approved &#128526;"
70+
msgstr ""
71+
72+
#: includes/class-wc-dev-helper-bogus-gateway.php:175
73+
msgid "Renewal order processed. Bogus is always approved &#128526;"
74+
msgstr ""
75+
1676
#: includes/class-wc-dev-helper-memberships.php:55
1777
msgid "minute(s)"
1878
msgstr ""
@@ -21,32 +81,32 @@ msgstr ""
2181
msgid "hour(s)"
2282
msgstr ""
2383

24-
#: includes/class-wc-dev-helper-subscriptions.php:97
84+
#: includes/class-wc-dev-helper-subscriptions.php:98
2585
msgid "Renew"
2686
msgstr ""
2787

28-
#: includes/class-wc-dev-helper-subscriptions.php:150
88+
#: includes/class-wc-dev-helper-subscriptions.php:151
2989
msgid "Subscription renewal processed. %sView Renewal Order%s"
3090
msgstr ""
3191

32-
#: includes/class-wc-dev-helper-subscriptions.php:173
92+
#: includes/class-wc-dev-helper-subscriptions.php:174
3393
msgid "Action Failed, Invalid Nonce"
3494
msgstr ""
3595

36-
#: includes/class-wc-dev-helper-subscriptions.php:202
96+
#: includes/class-wc-dev-helper-subscriptions.php:203
3797
msgid "Subscription Renewal Processed"
3898
msgstr ""
3999

40-
#: woocommerce-dev-helper.php:261
100+
#: woocommerce-dev-helper.php:346
41101
msgid "You cannot clone instances of WooCommerce Dev Helper."
42102
msgstr ""
43103

44-
#: woocommerce-dev-helper.php:271
104+
#: woocommerce-dev-helper.php:356
45105
msgid "You cannot unserialize instances of WooCommerce Dev Helper."
46106
msgstr ""
47107

48108
#. Plugin Name of the plugin/theme
49-
msgid "WooCommerce Dev Helper"
109+
msgid "A WooCommerce Dev Helper"
50110
msgstr ""
51111

52112
#. Plugin URI of the plugin/theme

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "woocommerce-dev-helper",
2+
"name": "a-woocommerce-dev-helper",
33
"version": "0.7.0-dev",
44
"author": "SkyVerge Team",
55
"homepage": "http://www.skyverge.com",

woocommerce-dev-helper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Plugin Name: WooCommerce Dev Helper
3+
* Plugin Name: A WooCommerce Dev Helper
44
* Plugin URI: https://github.com/skyverge/woocommerce-dev-helper/
55
* Description: A simple plugin for helping develop/debug WooCommerce & extensions
66
* Author: SkyVerge
@@ -75,6 +75,10 @@ public function __construct() {
7575

7676
// add the testing gateway
7777
add_filter( 'woocommerce_payment_gateways', array( $this, 'add_bogus_gateway' ) );
78+
79+
// use forwarded URLs: this needs to be done as early as possible in order to set the $_SERVER['HTTPS'] var
80+
require_once( $this->get_plugin_path() . '/includes/class-wc-dev-helper-use-forwarded-urls.php' );
81+
$this->use_forwarded_urls = new WC_Dev_Helper_Use_Forwarded_URLs();
7882
}
7983

8084

@@ -149,10 +153,6 @@ public function includes() {
149153
$this->gateway = new WC_Bogus_Gateway();
150154
}
151155

152-
// use forwarded URLs
153-
require_once( $this->get_plugin_path() . '/includes/class-wc-dev-helper-use-forwarded-urls.php' );
154-
$this->use_forwarded_urls = new WC_Dev_Helper_Use_Forwarded_URLs();
155-
156156
if ( $this->is_plugin_active( 'woocommerce-subscriptions.php' ) ) {
157157

158158
// Subscriptions helper

0 commit comments

Comments
 (0)