Version Description
Download this release
Release Info
Developer | unbouncewordpress |
Plugin | Unbounce Landing Pages |
Version | 0.1.22 |
Comparing to | |
See all releases |
Code changes from version 0.1.21 to 0.1.22
- UBConfig.php +8 -3
- UBPageTable.php +46 -0
- UBUtil.php +47 -0
- Unbounce-Page.php +77 -42
- css/unbounce-pages.css +61 -0
- img/unbounce-logo-blue.png +0 -0
- readme.txt +22 -7
UBConfig.php
CHANGED
@@ -10,9 +10,10 @@ class UBConfig {
|
|
10 |
const UB_API_URL_KEY = 'ub-api-url';
|
11 |
const UB_API_CLIENT_ID_KEY = 'ub-api-client-id';
|
12 |
const UB_AUTHORIZED_DOMAINS_KEY = 'ub-authorized-domains';
|
|
|
13 |
const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
|
14 |
-
const UB_USER_AGENT = 'Unbounce WP Plugin 0.1.
|
15 |
-
const UB_VERSION = '0.1.
|
16 |
|
17 |
public static function default_page_server_domain() {
|
18 |
$domain = getenv('UB_PAGE_SERVER_DOMAIN');
|
@@ -62,6 +63,10 @@ class UBConfig {
|
|
62 |
return get_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY, UBConfig::default_authorized_domains());
|
63 |
}
|
64 |
|
|
|
|
|
|
|
|
|
65 |
public static function debug_loggging_enabled() {
|
66 |
return WP_DEBUG || WP_DEBUG_LOG || UBConfig::remote_debug_logging_enabled();
|
67 |
}
|
@@ -153,7 +158,7 @@ class UBConfig {
|
|
153 |
$use_internal_errors = libxml_use_internal_errors(true);
|
154 |
$sitemap = simplexml_load_string($string);
|
155 |
|
156 |
-
if($sitemap) {
|
157 |
libxml_use_internal_errors($use_internal_errors);
|
158 |
$urls = array();
|
159 |
|
10 |
const UB_API_URL_KEY = 'ub-api-url';
|
11 |
const UB_API_CLIENT_ID_KEY = 'ub-api-client-id';
|
12 |
const UB_AUTHORIZED_DOMAINS_KEY = 'ub-authorized-domains';
|
13 |
+
const UB_HAS_AUTHORIZED_KEY = 'ub-has-authorized';
|
14 |
const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
|
15 |
+
const UB_USER_AGENT = 'Unbounce WP Plugin 0.1.22';
|
16 |
+
const UB_VERSION = '0.1.22';
|
17 |
|
18 |
public static function default_page_server_domain() {
|
19 |
$domain = getenv('UB_PAGE_SERVER_DOMAIN');
|
63 |
return get_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY, UBConfig::default_authorized_domains());
|
64 |
}
|
65 |
|
66 |
+
public static function has_authorized() {
|
67 |
+
return (bool) get_option(UBConfig::UB_HAS_AUTHORIZED_KEY);
|
68 |
+
}
|
69 |
+
|
70 |
public static function debug_loggging_enabled() {
|
71 |
return WP_DEBUG || WP_DEBUG_LOG || UBConfig::remote_debug_logging_enabled();
|
72 |
}
|
158 |
$use_internal_errors = libxml_use_internal_errors(true);
|
159 |
$sitemap = simplexml_load_string($string);
|
160 |
|
161 |
+
if($sitemap !== false) {
|
162 |
libxml_use_internal_errors($use_internal_errors);
|
163 |
$urls = array();
|
164 |
|
UBPageTable.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if( ! class_exists( 'WP_List_Table' ) ) {
|
4 |
+
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
5 |
+
}
|
6 |
+
|
7 |
+
class UBPageTable extends WP_List_Table {
|
8 |
+
|
9 |
+
private $item_scroll_threshold = 10;
|
10 |
+
|
11 |
+
function __construct($page_urls) {
|
12 |
+
parent::__construct();
|
13 |
+
|
14 |
+
$this->items = array_map(function($url) {
|
15 |
+
return array('url' => $url);
|
16 |
+
}, $page_urls);
|
17 |
+
|
18 |
+
$this->_column_headers = array(array('url' => 'Url'), array(), array());
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function column_default($item, $column_name) {
|
22 |
+
switch($column_name) {
|
23 |
+
case 'url':
|
24 |
+
return "<a href=\"//${item[$column_name]}\" target=\"_blank\">${item[$column_name]}</a>";
|
25 |
+
break;
|
26 |
+
default:
|
27 |
+
return $item[$column_name];
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
protected function display_tablenav($which) {
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function get_table_classes() {
|
35 |
+
$super = parent::get_table_classes();
|
36 |
+
|
37 |
+
if(count($this->items) > $this->item_scroll_threshold) {
|
38 |
+
$super[] = 'ub-table-scroll';
|
39 |
+
}
|
40 |
+
|
41 |
+
return $super;
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
?>
|
UBUtil.php
CHANGED
@@ -10,5 +10,52 @@ class UBUtil {
|
|
10 |
return isset($array[$index]) ? $array[$index] : $default;
|
11 |
}
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
?>
|
10 |
return isset($array[$index]) ? $array[$index] : $default;
|
11 |
}
|
12 |
|
13 |
+
public static function time_ago($timestamp) {
|
14 |
+
$now = new DateTime('now');
|
15 |
+
$from = new DateTime();
|
16 |
+
$from->setTimestamp($timestamp);
|
17 |
+
$diff = date_diff($now, $from);
|
18 |
+
|
19 |
+
if($diff->y > 0) {
|
20 |
+
$message = $diff->y . ' year'. ($diff->y > 1 ? 's' : '');
|
21 |
+
}
|
22 |
+
else if($diff->m > 0) {
|
23 |
+
$message = $diff->m . ' month'. ($diff->m > 1 ? 's' : '');
|
24 |
+
}
|
25 |
+
else if($diff->d > 0) {
|
26 |
+
$message = $diff->d . ' day' . ($diff->d > 1 ? 's' : '');
|
27 |
+
}
|
28 |
+
else if($diff->h > 0) {
|
29 |
+
$message = $diff->h . ' hour' . ($diff->h > 1 ? 's' : '');
|
30 |
+
}
|
31 |
+
else if($diff->i > 0) {
|
32 |
+
$message = $diff->i . ' minute' . ($diff->i > 1 ? 's' : '');
|
33 |
+
}
|
34 |
+
else if($diff->s > 0) {
|
35 |
+
$message = $diff->s . ' second' . ($diff->s > 1? 's' : '');
|
36 |
+
}
|
37 |
+
else {
|
38 |
+
$message = 'a moment';
|
39 |
+
}
|
40 |
+
|
41 |
+
return $message . ' ago';
|
42 |
+
}
|
43 |
+
|
44 |
+
public static function clear_flash() {
|
45 |
+
foreach($_COOKIE as $cookie_name => $value) {
|
46 |
+
if(strpos($cookie_name, 'ub-flash-') === 0) {
|
47 |
+
setcookie($cookie_name, '', time() - 60);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
public static function get_flash($cookie_name, $default = null) {
|
53 |
+
return UBUtil::array_fetch($_COOKIE, "ub-flash-${cookie_name}", $default);
|
54 |
+
}
|
55 |
+
|
56 |
+
public static function set_flash($cookie_name, $value) {
|
57 |
+
setcookie("ub-flash-${cookie_name}", $value, time() + 60);
|
58 |
+
}
|
59 |
+
|
60 |
}
|
61 |
?>
|
Unbounce-Page.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Unbounce
|
4 |
Plugin URI: http://unbounce.com
|
5 |
Description: Publish Unbounce Landing Pages to your Wordpress Domain.
|
6 |
-
Version: 0.1.
|
7 |
Author: Unbounce
|
8 |
Author URI: http://unbounce.com
|
9 |
License: GPLv2
|
@@ -15,6 +15,7 @@ require_once dirname(__FILE__) . '/UBConfig.php';
|
|
15 |
require_once dirname(__FILE__) . '/UBLogger.php';
|
16 |
require_once dirname(__FILE__) . '/UBHTTP.php';
|
17 |
require_once dirname(__FILE__) . '/UBIcon.php';
|
|
|
18 |
|
19 |
register_activation_hook(__FILE__, function() {
|
20 |
add_option(UBConfig::UB_ROUTES_CACHE_KEY, array());
|
@@ -29,6 +30,7 @@ register_activation_hook(__FILE__, function() {
|
|
29 |
UBConfig::default_api_client_id());
|
30 |
add_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY,
|
31 |
UBConfig::default_authorized_domains());
|
|
|
32 |
});
|
33 |
|
34 |
register_deactivation_hook(__FILE__, function() {
|
@@ -39,12 +41,13 @@ register_deactivation_hook(__FILE__, function() {
|
|
39 |
delete_option(UBConfig::UB_API_URL_KEY);
|
40 |
delete_option(UBConfig::UB_API_CLIENT_ID_KEY);
|
41 |
delete_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY);
|
|
|
42 |
});
|
43 |
|
44 |
add_action('init', function() {
|
45 |
UBLogger::setup_logger();
|
46 |
|
47 |
-
$domain =
|
48 |
|
49 |
if(!UBConfig::is_authorized_domain($domain)) {
|
50 |
UBLogger::info("Domain: $domain has not been authorized");
|
@@ -139,6 +142,8 @@ add_action('init', function() {
|
|
139 |
});
|
140 |
|
141 |
add_action('admin_init', function() {
|
|
|
|
|
142 |
# disable incompatible scripts
|
143 |
|
144 |
# WPML
|
@@ -150,69 +155,96 @@ add_action('admin_init', function() {
|
|
150 |
wp_enqueue_script('set-unbounce-domains-js',
|
151 |
plugins_url('js/set-unbounce-domains.js', __FILE__),
|
152 |
array('jquery', 'ub-rx'));
|
153 |
-
|
154 |
# re-enable incompatible scripts
|
155 |
|
156 |
# WPML
|
157 |
wp_enqueue_script('installer-admin');
|
|
|
|
|
|
|
158 |
}, 0);
|
159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
function render_unbounce_pages($domain_info, $domain) {
|
161 |
-
|
|
|
|
|
162 |
|
163 |
if(UBConfig::is_authorized_domain($domain)) {
|
164 |
$proxyable_url_set = UBUtil::array_fetch($domain_info, 'proxyable_url_set');
|
165 |
-
if(empty($proxyable_url_set)) {
|
166 |
-
echo '<p class="warning">No URLs have been registered from Unbounce</p>';
|
167 |
-
|
168 |
-
} else {
|
169 |
-
$proxyable_url_set_fetched_at = UBUtil::array_fetch($domain_info, 'proxyable_url_set_fetched_at');
|
170 |
-
|
171 |
-
$list_items = array_map(function($url) { return '<li><a href="//'. $url .'">' . $url . '</a></li>'; },
|
172 |
-
$proxyable_url_set);
|
173 |
|
174 |
-
|
175 |
-
echo '<ul>' . join($list_items, "\n") . '</ul>';
|
176 |
-
echo '<p>Last refresh date: <span id="last-cache-fetch" style="font-weight: bold;">' . date('r', $proxyable_url_set_fetched_at) . '</span></p>';
|
177 |
-
echo '</div>';
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
$flush_pages_url = admin_url('admin-post.php');
|
182 |
-
echo "<form method='get' action='$flush_pages_url'>";
|
183 |
echo '<input type="hidden" name="action" value="flush_unbounce_pages" />';
|
184 |
-
echo get_submit_button('
|
|
|
|
|
|
|
|
|
185 |
echo '</form>';
|
186 |
|
187 |
-
echo '<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
} else {
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
}
|
191 |
|
192 |
-
$
|
193 |
-
echo "<form method='post' action='$set_domains_url'>";
|
194 |
-
echo "<input type='hidden' name='domains' />";
|
195 |
-
echo get_submit_button('Authorize With Unbounce',
|
196 |
-
'primary',
|
197 |
-
'set-unbounce-domains',
|
198 |
-
true,
|
199 |
-
array('data-set-domains-url' => $set_domains_url,
|
200 |
-
'data-redirect-uri' => admin_url('admin.php?page=unbounce-pages'),
|
201 |
-
'data-api-url' => UBConfig::api_url(),
|
202 |
-
'data-api-client-id' => UBConfig::api_client_id()));
|
203 |
-
echo '</form>';
|
204 |
-
|
205 |
-
$authorization = UBUtil::array_fetch($_GET, 'authorization');
|
206 |
if($authorization === 'success') {
|
207 |
-
echo '<div class="updated">Successfully authorized with Unbounce.</div>';
|
208 |
} elseif($authorization === 'failure') {
|
209 |
-
echo '<div class="error">Sorry, there was an error authorizing with Unbounce. Please try again.</div>';
|
210 |
}
|
211 |
}
|
212 |
|
213 |
add_action('admin_menu', function() {
|
214 |
$print_admin_panel = function() {
|
215 |
-
$domain =
|
216 |
$domain_info = UBConfig::read_unbounce_domain_info($domain, false);
|
217 |
|
218 |
render_unbounce_pages($domain_info, $domain);
|
@@ -232,18 +264,21 @@ add_action('admin_post_set_unbounce_domains', function() {
|
|
232 |
|
233 |
if($domains_json && is_array($domains)) {
|
234 |
update_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY, $domains);
|
|
|
235 |
$authorization = 'success';
|
236 |
} else {
|
237 |
$authorization = 'failure';
|
238 |
}
|
239 |
|
|
|
|
|
240 |
status_header(301);
|
241 |
-
$location = admin_url(
|
242 |
header("Location: $location");
|
243 |
});
|
244 |
|
245 |
add_action('admin_post_flush_unbounce_pages', function() {
|
246 |
-
$domain =
|
247 |
// Expire cache and redirect
|
248 |
$_domain_info = UBConfig::read_unbounce_domain_info($domain, true);
|
249 |
status_header(301);
|
3 |
Plugin Name: Unbounce
|
4 |
Plugin URI: http://unbounce.com
|
5 |
Description: Publish Unbounce Landing Pages to your Wordpress Domain.
|
6 |
+
Version: 0.1.22
|
7 |
Author: Unbounce
|
8 |
Author URI: http://unbounce.com
|
9 |
License: GPLv2
|
15 |
require_once dirname(__FILE__) . '/UBLogger.php';
|
16 |
require_once dirname(__FILE__) . '/UBHTTP.php';
|
17 |
require_once dirname(__FILE__) . '/UBIcon.php';
|
18 |
+
require_once dirname(__FILE__) . '/UBPageTable.php';
|
19 |
|
20 |
register_activation_hook(__FILE__, function() {
|
21 |
add_option(UBConfig::UB_ROUTES_CACHE_KEY, array());
|
30 |
UBConfig::default_api_client_id());
|
31 |
add_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY,
|
32 |
UBConfig::default_authorized_domains());
|
33 |
+
add_option(UBConfig::UB_HAS_AUTHORIZED_KEY);
|
34 |
});
|
35 |
|
36 |
register_deactivation_hook(__FILE__, function() {
|
41 |
delete_option(UBConfig::UB_API_URL_KEY);
|
42 |
delete_option(UBConfig::UB_API_CLIENT_ID_KEY);
|
43 |
delete_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY);
|
44 |
+
delete_option(UBConfig::UB_HAS_AUTHORIZED_KEY);
|
45 |
});
|
46 |
|
47 |
add_action('init', function() {
|
48 |
UBLogger::setup_logger();
|
49 |
|
50 |
+
$domain = parse_url(get_site_url(), PHP_URL_HOST);
|
51 |
|
52 |
if(!UBConfig::is_authorized_domain($domain)) {
|
53 |
UBLogger::info("Domain: $domain has not been authorized");
|
142 |
});
|
143 |
|
144 |
add_action('admin_init', function() {
|
145 |
+
UBUtil::clear_flash();
|
146 |
+
|
147 |
# disable incompatible scripts
|
148 |
|
149 |
# WPML
|
155 |
wp_enqueue_script('set-unbounce-domains-js',
|
156 |
plugins_url('js/set-unbounce-domains.js', __FILE__),
|
157 |
array('jquery', 'ub-rx'));
|
|
|
158 |
# re-enable incompatible scripts
|
159 |
|
160 |
# WPML
|
161 |
wp_enqueue_script('installer-admin');
|
162 |
+
|
163 |
+
wp_enqueue_style('unbounce-pages-css',
|
164 |
+
plugins_url('css/unbounce-pages.css', __FILE__));
|
165 |
}, 0);
|
166 |
|
167 |
+
function authorization_button($text, $wrap_in_p = false) {
|
168 |
+
$set_domains_url = admin_url('admin-post.php?action=set_unbounce_domains');
|
169 |
+
echo "<form method='post' action='$set_domains_url'>";
|
170 |
+
echo "<input type='hidden' name='domains' />";
|
171 |
+
echo get_submit_button($text,
|
172 |
+
'primary',
|
173 |
+
'set-unbounce-domains',
|
174 |
+
$wrap_in_p,
|
175 |
+
array('data-set-domains-url' => $set_domains_url,
|
176 |
+
'data-redirect-uri' => admin_url('admin.php?page=unbounce-pages'),
|
177 |
+
'data-api-url' => UBConfig::api_url(),
|
178 |
+
'data-api-client-id' => UBConfig::api_client_id()));
|
179 |
+
echo '</form>';
|
180 |
+
}
|
181 |
function render_unbounce_pages($domain_info, $domain) {
|
182 |
+
$img_url = plugins_url('img/unbounce-logo-blue.png', __FILE__);
|
183 |
+
echo "<img class=\"ub-logo\" src=\"${img_url}\" />";
|
184 |
+
echo "<h1 class=\"ub-unbounce-pages-heading\">Unbounce Pages</h1>";
|
185 |
|
186 |
if(UBConfig::is_authorized_domain($domain)) {
|
187 |
$proxyable_url_set = UBUtil::array_fetch($domain_info, 'proxyable_url_set');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
|
189 |
+
echo '<h2 class="ub-published-pages-heading">Published Pages</h2>';
|
|
|
|
|
|
|
190 |
|
191 |
+
echo '<form method="get" action="https://app.unbounce.com" target="_blank">';
|
|
|
|
|
|
|
192 |
echo '<input type="hidden" name="action" value="flush_unbounce_pages" />';
|
193 |
+
echo get_submit_button('Manage In Unbounce',
|
194 |
+
'secondary',
|
195 |
+
'flush-unbounce-pages',
|
196 |
+
false,
|
197 |
+
array('style' => 'margin-top: 10px'));
|
198 |
echo '</form>';
|
199 |
|
200 |
+
echo '<div class="ub-page-list">';
|
201 |
+
$table = new UBPageTable($proxyable_url_set);
|
202 |
+
echo $table->display();
|
203 |
+
|
204 |
+
$proxyable_url_set_fetched_at = UBUtil::array_fetch($domain_info, 'proxyable_url_set_fetched_at');
|
205 |
+
echo '<p>Last refreshed ' . UBUtil::time_ago($proxyable_url_set_fetched_at) . '.</p>';
|
206 |
+
authorization_button('Re-authorize With Unbounce');
|
207 |
+
echo '</p>';
|
208 |
+
echo '</div>';
|
209 |
+
|
210 |
+
add_action('in_admin_footer', function() {
|
211 |
+
echo '<h2 class="ub-need-help-header">Need Help?</h2>';
|
212 |
+
|
213 |
+
$flush_pages_url = admin_url('admin-post.php');
|
214 |
+
echo "<form method='get' action='$flush_pages_url'>";
|
215 |
+
echo '<input type="hidden" name="action" value="flush_unbounce_pages" />';
|
216 |
+
echo '<p>If your pages are not showing up, first try ';
|
217 |
+
echo get_submit_button('refreshing the Published Pages list', 'secondary', 'flush-unbounce-pages', false);
|
218 |
+
echo '. If they are still not appearing, double check that your Unbounce pages are using a Wordpress domain.</p>';
|
219 |
+
echo '</form>';
|
220 |
+
echo '<a href="http://documentation.unbounce.com/hc/en-us/articles/205069824-Integrating-with-WordPress" target="_blank">Check out our knowledge base.</a>';
|
221 |
+
echo '<p class="ub-version">Unbounce Version 0.1.22</p>';
|
222 |
+
});
|
223 |
} else {
|
224 |
+
if (UBConfig::has_authorized()) {
|
225 |
+
// They've attempted to authorize, but this domain isn't in the list
|
226 |
+
echo '<div class="error"><p>This domain has not been authorized with Unbounce.</p></div>';
|
227 |
+
authorization_button('Try Authorizing With Unbounce Again', true);
|
228 |
+
echo '<h2>Still not working?</h2>';
|
229 |
+
echo '<p>Double check that the domain you added in Unbounce matches the WordPress Address ';
|
230 |
+
echo '(URL) in your WordPress account\'s General Settings.</p>';
|
231 |
+
} else {
|
232 |
+
// They haven't yet tried to authorize
|
233 |
+
authorization_button('Authorize With Unbounce', true);
|
234 |
+
}
|
235 |
}
|
236 |
|
237 |
+
$authorization = UBUtil::get_flash('authorization');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
if($authorization === 'success') {
|
239 |
+
echo '<div class="updated"><p>Successfully authorized with Unbounce.</p></div>';
|
240 |
} elseif($authorization === 'failure') {
|
241 |
+
echo '<div class="error"><p>Sorry, there was an error authorizing with Unbounce. Please try again.</p></div>';
|
242 |
}
|
243 |
}
|
244 |
|
245 |
add_action('admin_menu', function() {
|
246 |
$print_admin_panel = function() {
|
247 |
+
$domain = parse_url(get_site_url(), PHP_URL_HOST);
|
248 |
$domain_info = UBConfig::read_unbounce_domain_info($domain, false);
|
249 |
|
250 |
render_unbounce_pages($domain_info, $domain);
|
264 |
|
265 |
if($domains_json && is_array($domains)) {
|
266 |
update_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY, $domains);
|
267 |
+
update_option(UBConfig::UB_HAS_AUTHORIZED_KEY, true);
|
268 |
$authorization = 'success';
|
269 |
} else {
|
270 |
$authorization = 'failure';
|
271 |
}
|
272 |
|
273 |
+
UBUtil::set_flash('authorization', $authorization);
|
274 |
+
|
275 |
status_header(301);
|
276 |
+
$location = admin_url('admin.php?page=unbounce-pages');
|
277 |
header("Location: $location");
|
278 |
});
|
279 |
|
280 |
add_action('admin_post_flush_unbounce_pages', function() {
|
281 |
+
$domain = parse_url(get_site_url(), PHP_URL_HOST);
|
282 |
// Expire cache and redirect
|
283 |
$_domain_info = UBConfig::read_unbounce_domain_info($domain, true);
|
284 |
status_header(301);
|
css/unbounce-pages.css
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ub-logo {
|
2 |
+
width: 40px;
|
3 |
+
height: 40px;
|
4 |
+
float: left;
|
5 |
+
margin: 20px 10px 0 0;
|
6 |
+
}
|
7 |
+
|
8 |
+
.ub-unbounce-pages-heading {
|
9 |
+
margin-top: 30px;
|
10 |
+
}
|
11 |
+
|
12 |
+
.ub-published-pages-heading {
|
13 |
+
float: left;
|
14 |
+
margin-right: 10px;
|
15 |
+
}
|
16 |
+
|
17 |
+
.ub-need-help-header {
|
18 |
+
margin-bottom: 7px;
|
19 |
+
}
|
20 |
+
|
21 |
+
.ub-version {
|
22 |
+
text-align: right;
|
23 |
+
}
|
24 |
+
|
25 |
+
.ub-page-list {
|
26 |
+
margin: 0;
|
27 |
+
padding: 0 20px 0 0;
|
28 |
+
}
|
29 |
+
|
30 |
+
.ub-table-scroll table {
|
31 |
+
width: 100%;
|
32 |
+
border-collapse: collapse;
|
33 |
+
border-spacing: 0;
|
34 |
+
}
|
35 |
+
|
36 |
+
.ub-table-scroll thead,
|
37 |
+
.ub-table-scroll tbody,
|
38 |
+
.ub-table-scroll tr,
|
39 |
+
.ub-table-scroll td,
|
40 |
+
.ub-table-scroll th {
|
41 |
+
box-sizing: border-box;
|
42 |
+
display: block;
|
43 |
+
}
|
44 |
+
|
45 |
+
.ub-table-scroll tr:after {
|
46 |
+
content: ' ';
|
47 |
+
display: block;
|
48 |
+
visibility: hidden;
|
49 |
+
clear: both;
|
50 |
+
}
|
51 |
+
|
52 |
+
.ub-table-scroll tbody {
|
53 |
+
height: 350px;
|
54 |
+
overflow-y: auto;
|
55 |
+
width: 100%;
|
56 |
+
}
|
57 |
+
|
58 |
+
.ub-table-scroll tbody td, .ub-table-scroll thead th {
|
59 |
+
width: 100%;
|
60 |
+
float: left;
|
61 |
+
}
|
img/unbounce-logo-blue.png
ADDED
Binary file
|
readme.txt
CHANGED
@@ -1,20 +1,35 @@
|
|
1 |
=== Plugin Name ===
|
2 |
Contributors: unbouncewordpress
|
3 |
-
Tags:
|
4 |
Requires at least: 4.1.5
|
5 |
Tested up to: 4.2.2
|
6 |
-
Stable tag: 0.1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
-
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
== Installation ==
|
20 |
|
1 |
=== Plugin Name ===
|
2 |
Contributors: unbouncewordpress
|
3 |
+
Tags: Unbounce, AB testing, A/B testing, split testing, CRO, conversion optimization, wordpress landing page, wp landing pages, splash pages, landing pages, squeeze pages, lead gen, lead generation, email list, responsive landing pages, templates, inbound marketing, ppc, analytics
|
4 |
Requires at least: 4.1.5
|
5 |
Tested up to: 4.2.2
|
6 |
+
Stable tag: 0.1.22
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
+
This Unbounce Plug-In is in Beta Testing, if you are interested in trying it out please contact our support team at: wpbeta@unbounce.com.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
Unbounce is the most powerful standalone landing page builder
|
15 |
+
available. With Unbounce, marketers can create fully customized landing pages
|
16 |
+
for their campaigns and publish them to their existing WordPress sites.
|
17 |
+
|
18 |
+
Choose from one of Unbounce’s 80+ landing page templates, add copy, then apply
|
19 |
+
your website’s fonts, colors and images. Unbounce allows you to customize your
|
20 |
+
landing pages to match your brand perfectly. With the Unbounce WordPress Landing
|
21 |
+
Page Plugin, you can launch your landing page on your own domain without ever
|
22 |
+
talking to I.T. Try it for a month for free!
|
23 |
+
|
24 |
+
More than 9,000 digital marketers use Unbounce. Some of the features they love the most include:
|
25 |
+
|
26 |
+
- A team of Customer Success coaches that are easy to reach when you need help
|
27 |
+
- 80+ free templates (plus more on ThemeForest)
|
28 |
+
- Complete customizability of the desktop and mobile layouts
|
29 |
+
- Built in A/B testing features
|
30 |
+
- Easy Google Analytics tagging & event tracking
|
31 |
+
- Integrations with the tools marketers use - MailChimp, SalesForce, Hubspot & more
|
32 |
+
- Plus much more
|
33 |
|
34 |
== Installation ==
|
35 |
|