Instapage WordPress Plugin - Version 3.2.13

Version Description

(2020-01-28) = - Added Custom experiences/dynamic text replacement alternative loading system

Download this release

Release Info

Developer marek@instapage.com
Plugin Icon 128x128 Instapage WordPress Plugin
Version 3.2.13
Comparing to
See all releases

Code changes from version 3.2.12 to 3.2.13

README.txt CHANGED
@@ -55,6 +55,9 @@ Join 250,000+ businesses who rely on Instapage.
55
  4. Instapage app's dashboard.
56
 
57
  == Changelog ==
 
 
 
58
  = 3.2.12 (2019-12-18) =
59
  - Changed naming from subaccounts to workspaces
60
  - Increased Tested up to: 5.3.1
55
  4. Instapage app's dashboard.
56
 
57
  == Changelog ==
58
+ = 3.2.13 (2020-01-28) =
59
+ - Added Custom experiences/dynamic text replacement alternative loading system
60
+
61
  = 3.2.12 (2019-12-18) =
62
  - Changed naming from subaccounts to workspaces
63
  - Increased Tested up to: 5.3.1
instapage.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Instapage Plugin
5
  Description: The best way for WordPress to seamlessly publish landing pages as a natural extension of your website.
6
- Version: 3.2.12
7
  Requires PHP: 5.2.4
8
  Plugin URI: https://instapage.com/
9
  Author: Instapage
3
  /*
4
  Plugin Name: Instapage Plugin
5
  Description: The best way for WordPress to seamlessly publish landing pages as a natural extension of your website.
6
+ Version: 3.2.13
7
  Requires PHP: 5.2.4
8
  Plugin URI: https://instapage.com/
9
  Author: Instapage
knockout/view_models/InstapageCmsPluginSettingsModel.js CHANGED
@@ -15,6 +15,7 @@ var InstapageCmsPluginSettingsModel = function InstapageCmsPluginSettingsModel(d
15
  self.hideConnectedTokens = instapageKO.observable(true);
16
  self.metadata = (data && data.metadata) ? JSON.parse(data.metadata) : {};
17
  self.supportLegacy = (typeof self.metadata.supportLegacy !== 'undefined') ? instapageKO.observable(self.metadata.supportLegacy) : instapageKO.observable(true);
 
18
 
19
  self.loginUser = function loginUser() {
20
  var post = {action: 'loginUser', data: {email: encodeURIComponent(self.email()), password: encodeURIComponent(self.password())}};
@@ -319,6 +320,13 @@ var InstapageCmsPluginSettingsModel = function InstapageCmsPluginSettingsModel(d
319
 
320
  return true;
321
  };
 
 
 
 
 
 
 
322
  };
323
 
324
  var PluginConfig = function PluginConfig(data) {
15
  self.hideConnectedTokens = instapageKO.observable(true);
16
  self.metadata = (data && data.metadata) ? JSON.parse(data.metadata) : {};
17
  self.supportLegacy = (typeof self.metadata.supportLegacy !== 'undefined') ? instapageKO.observable(self.metadata.supportLegacy) : instapageKO.observable(true);
18
+ self.lpAjaxLoader = (typeof self.metadata.lpAjaxLoader !== 'undefined') ? instapageKO.observable(self.metadata.lpAjaxLoader) : instapageKO.observable(false);
19
 
20
  self.loginUser = function loginUser() {
21
  var post = {action: 'loginUser', data: {email: encodeURIComponent(self.email()), password: encodeURIComponent(self.password())}};
320
 
321
  return true;
322
  };
323
+
324
+ self.saveLpAjaxLoaderSetting = function saveLpAjaxLoaderSetting() {
325
+ self.metadata.lpAjaxLoader = self.lpAjaxLoader();
326
+ self.saveConfig(false);
327
+
328
+ return true;
329
+ }
330
  };
331
 
332
  var PluginConfig = function PluginConfig(data) {
modules/lpAjaxLoader/InstapageCmsPluginLPAjaxLoaderController.php CHANGED
@@ -14,6 +14,7 @@ class InstapageCmsPluginLPAjaxLoaderController
14
  /**
15
  * Check if it is pantheon hosting platform and check if utm_ variables are replaced
16
  * Also Check if it is WP Engine hosting and if it is not already request from Ajax Loader JS
 
17
  *
18
  * @param string $url URL of landing page that plugin tries to load
19
  * @return bool
@@ -23,6 +24,8 @@ class InstapageCmsPluginLPAjaxLoaderController
23
  return (isset($_ENV['PANTHEON_ENVIRONMENT'])
24
  && strpos($url, self::PANTHEON_STRIPPED) !== false)
25
  || (isset($_ENV['WPENGINE_ACCOUNT'])
 
 
26
  && strpos($url, self::AJAX_REQUEST_FLAG_NAME) === false);
27
  }
28
 
@@ -35,7 +38,9 @@ class InstapageCmsPluginLPAjaxLoaderController
35
  public function shouldDecodeQuery()
36
  {
37
  return
38
- (isset($_ENV['PANTHEON_ENVIRONMENT']) || isset($_ENV['WPENGINE_ACCOUNT']))
 
 
39
  && isset($_GET['b64']);
40
  }
41
 
14
  /**
15
  * Check if it is pantheon hosting platform and check if utm_ variables are replaced
16
  * Also Check if it is WP Engine hosting and if it is not already request from Ajax Loader JS
17
+ * Also Check if client manually enabled LP Ajax Loader
18
  *
19
  * @param string $url URL of landing page that plugin tries to load
20
  * @return bool
24
  return (isset($_ENV['PANTHEON_ENVIRONMENT'])
25
  && strpos($url, self::PANTHEON_STRIPPED) !== false)
26
  || (isset($_ENV['WPENGINE_ACCOUNT'])
27
+ && strpos($url, self::AJAX_REQUEST_FLAG_NAME) === false)
28
+ || (InstapageCmsPluginHelper::getMetadata('lpAjaxLoader', false)
29
  && strpos($url, self::AJAX_REQUEST_FLAG_NAME) === false);
30
  }
31
 
38
  public function shouldDecodeQuery()
39
  {
40
  return
41
+ (isset($_ENV['PANTHEON_ENVIRONMENT'])
42
+ || isset($_ENV['WPENGINE_ACCOUNT'])
43
+ || InstapageCmsPluginHelper::getMetadata('lpAjaxLoader', false))
44
  && isset($_GET['b64']);
45
  }
46
 
views/settings.php CHANGED
@@ -161,7 +161,20 @@
161
  <span class="c-button__text"><?php echo InstapageCmsPluginConnector::lang('Migrate'); ?></span>
162
  </button>
163
  </div>
164
- <?php echo InstapageCmsPluginConnector::getSettingsModule(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  </form>
166
  </div>
167
 
161
  <span class="c-button__text"><?php echo InstapageCmsPluginConnector::lang('Migrate'); ?></span>
162
  </button>
163
  </div>
164
+
165
+ <div class="custom-params-form ui-section">
166
+ <h3 class="ui-subtitle"><?php echo InstapageCmsPluginConnector::lang('Custom experiences/dynamic text replacement alternative loading system'); ?></h3>
167
+ <p class="l-space-bottom-primary"><?php echo InstapageCmsPluginConnector::lang('If you experience issues with displaying custom experiences '
168
+ . 'or dynamic text replacement and you use external hosting with a custom cache system for your site (like Pantheon, or WP Engine), '
169
+ . 'turning this option on may be helpful. It should be done only if other fixing methods didn\'t succeed.'); ?></p>
170
+ <label class="c-mark">
171
+ <input class="c-mark__input" data-bind="checked: lpAjaxLoader, click: saveLpAjaxLoaderSetting" type="checkbox" >
172
+ <i class="c-mark__icon c-mark__icon--checkbox material-icons">check</i>
173
+ <span class="c-mark__label"><?php echo InstapageCmsPluginConnector::lang('Turn alternative loading system on'); ?></span>
174
+ </label>
175
+ </div>
176
+
177
+ <?php echo InstapageCmsPluginConnector::getSettingsModule(); ?>
178
  </form>
179
  </div>
180