WordPress Landing Pages - Version 2.3.6

Version Description

  • [fix] Fixing Inbound Forms error when Leads is not activated
Download this release

Release Info

Developer adbox
Plugin Icon 128x128 WordPress Landing Pages
Version 2.3.6
Comparing to
See all releases

Code changes from version 2.3.5 to 2.3.6

landing-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
- Version: 2.3.5
7
  Author: Inbound Now
8
  Author URI: http://www.inboundnow.com/
9
 
@@ -37,7 +37,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
37
  */
38
  private static function load_constants() {
39
 
40
- define('LANDINGPAGES_CURRENT_VERSION', '2.3.5' );
41
  define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
42
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
43
  define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
+ Version: 2.3.6
7
  Author: Inbound Now
8
  Author URI: http://www.inboundnow.com/
9
 
37
  */
38
  private static function load_constants() {
39
 
40
+ define('LANDINGPAGES_CURRENT_VERSION', '2.3.6' );
41
  define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
42
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
43
  define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
readme.txt CHANGED
@@ -7,7 +7,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
  Requires at least: 3.8
9
  Tested up to: 4.6.0
10
- Stable Tag: 2.3.5
11
 
12
  Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
13
 
@@ -70,6 +70,9 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
70
 
71
  == Changelog ==
72
 
 
 
 
73
  = 2.3.4 =
74
  * [fix] fixing broken include file for Inbound Forms when wp-config.php is outside of it's normal location.
75
 
7
  Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
  Requires at least: 3.8
9
  Tested up to: 4.6.0
10
+ Stable Tag: 2.3.6
11
 
12
  Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
13
 
70
 
71
  == Changelog ==
72
 
73
+ = 2.3.6 =
74
+ * [fix] Fixing Inbound Forms error when Leads is not activated
75
+
76
  = 2.3.4 =
77
  * [fix] fixing broken include file for Inbound Forms when wp-config.php is outside of it's normal location.
78
 
shared/assets/assets.loader.class.php CHANGED
@@ -8,10 +8,10 @@ if (!class_exists('Inbound_Asset_Loader')) {
8
  static $load_assets;
9
 
10
  static function load_inbound_assets() {
11
- self::$load_assets = true;
12
- add_action('admin_enqueue_scripts', array(__CLASS__, 'load_admin_scripts'), 101);
13
- add_action('wp_enqueue_scripts', array(__CLASS__, 'register_scripts_and_styles'), 101);
14
- add_action('admin_enqueue_scripts', array(__CLASS__, 'register_scripts_and_styles'), 101);
15
  }
16
 
17
  static function load_admin_scripts(){
@@ -52,10 +52,10 @@ if (!class_exists('Inbound_Asset_Loader')) {
52
  $store = false;
53
 
54
  if ( !empty( $wp_scripts->queue ) ) {
55
- $store = $wp_scripts->queue; /* store the scripts */
56
- foreach ( $wp_scripts->queue as $handle ) {
57
- wp_dequeue_script( $handle );
58
- }
59
  }
60
 
61
  /* unminified source available */
@@ -128,8 +128,8 @@ if (!class_exists('Inbound_Asset_Loader')) {
128
  $id_check = ($post_id != null) ? true : false;
129
 
130
  if (!is_archive() && !$id_check){
131
- $post_id = (isset($post)) ? $post->ID : false;
132
- $id_check = ($post_id != null) ? true : false;
133
  }
134
  if (!$id_check) {
135
  $post_id = wpl_url_to_postid($current_page);
@@ -141,9 +141,9 @@ if (!class_exists('Inbound_Asset_Loader')) {
141
  }
142
 
143
  /* If page tracking on */
144
- $lead_page_view_tracking = get_option( 'wpl-main-page-view-tracking', 1);
145
- $lead_search_tracking = get_option( 'wpl-main-search-tracking', 1);
146
- $lead_comment_tracking = get_option( 'wpl-main-comment-tracking', 1);
147
  if (!$lead_search_tracking) {
148
  $search_tracking = 'off';
149
  }
@@ -161,15 +161,15 @@ if (!class_exists('Inbound_Asset_Loader')) {
161
  $lead_data_array['lead_uid'] = ($lead_uid) ? $lead_uid : null;
162
  $time = current_time( 'timestamp', 0 ); /* Current wordpress time from settings */
163
  $wordpress_date_time = date("Y/m/d G:i:s", $time);
164
- $inbound_track_include = get_option( 'wpl-main-tracking-ids');
165
- $inbound_track_exclude = get_option( 'wpl-main-exclude-tracking-ids');
166
 
167
  /* get variation id */
168
  if (class_exists('Landing_Pages_Variations')) {
169
  $variation = Landing_Pages_Variations::get_current_variation_id();
170
  } else if( function_exists('lp_ab_testing_get_current_variation_id') ) {
171
- $variation = lp_ab_testing_get_current_variation_id();
172
- }
173
 
174
  $variation = (isset($variation)) ? $variation : 0;
175
 
@@ -193,6 +193,27 @@ if (!class_exists('Inbound_Asset_Loader')) {
193
  return apply_filters( 'inbound_analytics_localized_data' , $inbound_localized_data);
194
  } /* end localize lead data */
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  } /* end class */
197
  }
198
 
8
  static $load_assets;
9
 
10
  static function load_inbound_assets() {
11
+ self::$load_assets = true;
12
+ add_action('admin_enqueue_scripts', array(__CLASS__, 'load_admin_scripts'), 101);
13
+ add_action('wp_enqueue_scripts', array(__CLASS__, 'register_scripts_and_styles'), 101);
14
+ add_action('admin_enqueue_scripts', array(__CLASS__, 'register_scripts_and_styles'), 101);
15
  }
16
 
17
  static function load_admin_scripts(){
52
  $store = false;
53
 
54
  if ( !empty( $wp_scripts->queue ) ) {
55
+ $store = $wp_scripts->queue; /* store the scripts */
56
+ foreach ( $wp_scripts->queue as $handle ) {
57
+ wp_dequeue_script( $handle );
58
+ }
59
  }
60
 
61
  /* unminified source available */
128
  $id_check = ($post_id != null) ? true : false;
129
 
130
  if (!is_archive() && !$id_check){
131
+ $post_id = (isset($post)) ? $post->ID : false;
132
+ $id_check = ($post_id != null) ? true : false;
133
  }
134
  if (!$id_check) {
135
  $post_id = wpl_url_to_postid($current_page);
141
  }
142
 
143
  /* If page tracking on */
144
+ $lead_page_view_tracking = self::get_lead_setting( 'wpl-main-page-view-tracking', 1);
145
+ $lead_search_tracking = self::get_lead_setting( 'wpl-main-search-tracking', 1);
146
+ $lead_comment_tracking = self::get_lead_setting( 'wpl-main-comment-tracking', 1);
147
  if (!$lead_search_tracking) {
148
  $search_tracking = 'off';
149
  }
161
  $lead_data_array['lead_uid'] = ($lead_uid) ? $lead_uid : null;
162
  $time = current_time( 'timestamp', 0 ); /* Current wordpress time from settings */
163
  $wordpress_date_time = date("Y/m/d G:i:s", $time);
164
+ $inbound_track_include = self::get_lead_setting( 'wpl-main-tracking-ids' , '');
165
+ $inbound_track_exclude = self::get_lead_setting( 'wpl-main-exclude-tracking-ids' , '');
166
 
167
  /* get variation id */
168
  if (class_exists('Landing_Pages_Variations')) {
169
  $variation = Landing_Pages_Variations::get_current_variation_id();
170
  } else if( function_exists('lp_ab_testing_get_current_variation_id') ) {
171
+ $variation = lp_ab_testing_get_current_variation_id();
172
+ }
173
 
174
  $variation = (isset($variation)) ? $variation : 0;
175
 
193
  return apply_filters( 'inbound_analytics_localized_data' , $inbound_localized_data);
194
  } /* end localize lead data */
195
 
196
+ /**
197
+ * Get setting value from DB. Handles stand alone leads plugin differently from Inbound Pro included leads plugin
198
+ * this function is redundant, but neccecary to prevent fatals when Leads is not activated
199
+ * @param $field_id
200
+ * @param $default
201
+ * @return mixed
202
+ */
203
+ public static function get_lead_setting( $field_id , $default ) {
204
+ global $inbound_settings;
205
+ $value = $default;
206
+
207
+ if (defined('INBOUND_PRO_CURRENT_VERSION')) {
208
+ $field_id = str_replace('wpl-main-' , '', $field_id );
209
+ $value = (isset($inbound_settings['leads'][$field_id])) ? $inbound_settings['leads'][$field_id] : $default;
210
+ } else {
211
+ $value = get_option( $field_id, $default );
212
+ }
213
+
214
+ return $value;
215
+ }
216
+
217
  } /* end class */
218
  }
219
 
shared/classes/class.inbound-forms.akismet.php DELETED
@@ -1,169 +0,0 @@
1
- <?php
2
-
3
-
4
- if ( !class_exists('Inbound_Akismet') ) {
5
-
6
- class Inbound_Akismet {
7
-
8
- function __construct() {
9
- self::load_hooks();
10
- }
11
-
12
- private function load_hooks() {
13
- /* Load hooks if akismet filtering is enabled */
14
- if (get_option('inbound_forms_enable_akismet', '1' )) {
15
- add_action( 'inbound_check_if_spam', array(__CLASS__, 'check_is_spam' ), 10, 2 );
16
- } else {
17
-
18
- }
19
- }
20
-
21
- /* Checks if post content contains spam material
22
- *
23
- * @param lead_data ARRAY
24
- *
25
- * @return BOOL true for spam and false for spam
26
- *
27
- */
28
- public static function check_is_spam( $is_spam = false, $lead_data ) {
29
- $api_key = Inbound_Akismet::get_api_key();
30
-
31
- /* return false if akismet is not setup */
32
- if (!$api_key) {
33
- return false;
34
- }
35
-
36
- $params = Inbound_Akismet::prepare_params( $lead_data );
37
- $is_spam = Inbound_Akismet::api_check( $params );
38
-
39
- /* if not spam return false */
40
- if (!$is_spam) {
41
- return false;
42
- }
43
- /* else return true for spam */
44
- else {
45
- return true;
46
- }
47
- }
48
-
49
- /* This function polls Akismet to see if submitted content contains spam */
50
- public static function api_check( $params ) {
51
- global $akismet_api_host, $akismet_api_port;
52
-
53
- /* bail if no content to check against akismet */
54
- if (!isset($params['comment_content'])) {
55
- return;
56
- }
57
-
58
- $spam = false;
59
- $query_string = '';
60
-
61
- foreach ( $params as $key => $data ) {
62
- $query_string .= $key . '=' . urlencode( wp_unslash( (string) $data ) ) . '&';
63
- }
64
-
65
- if ( is_callable( array( 'Akismet', 'http_post' ) ) ) { /* Akismet v3.0+ */
66
- $response = Akismet::http_post( $query_string, 'comment-check' );
67
- } else {
68
- $response = akismet_http_post( $query_string, $akismet_api_host,
69
- '/1.1/comment-check', $akismet_api_port );
70
- }
71
-
72
- /* returns true if spam else return false */
73
- if ( 'true' == $response[1] ) {
74
- return true;
75
- }
76
-
77
- return false;
78
- }
79
-
80
- /* Get Akismet API key */
81
- public static function get_api_key() {
82
-
83
- if ( is_callable( array( 'Akismet', 'get_api_key' ) ) ) { /* Akismet v3.0+ */
84
- return (bool) Akismet::get_api_key();
85
- }
86
-
87
- if ( function_exists( 'akismet_get_key' ) ) {
88
- return (bool) akismet_get_key();
89
- }
90
-
91
- return false;
92
- }
93
-
94
- /* Extract lead data and prepare params for akismet filtering */
95
- public static function prepare_params( $lead_data ) {
96
-
97
- $first_name = (isset($lead_data['wpleads_first_name'])) ? $lead_data['wpleads_first_name'] : '';
98
- $last_name = (isset($lead_data['wpleads_last_name'])) ? $lead_data['wpleads_last_name'] : '';
99
- $email_address = (isset($lead_data['wpleads_email_address'])) ? $lead_data['wpleads_email_address'] : '';
100
-
101
- $content = Inbound_Akismet::detect_content( $lead_data );
102
-
103
-
104
- $params = array(
105
- 'comment_author' => $first_name . ' ' . $last_name,
106
- /*'comment_author' => 'spamcheck-test-123', */
107
- 'comment_author_email' => $email_address,
108
- 'comment_content' => $content
109
- );
110
-
111
- $params['blog'] = get_option( 'home' );
112
- $params['blog_lang'] = get_locale();
113
- $params['blog_charset'] = get_option( 'blog_charset' );
114
- $params['user_ip'] = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] );
115
- $params['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
116
- $params['referrer'] = $_SERVER['HTTP_REFERER'];
117
- $params['permalink'] = $_SERVER['HTTP_REFERER'];
118
- $params['comment_type'] = 'contact-form';
119
-
120
- return $params;
121
- }
122
-
123
- public static function detect_content( $lead_data ) {
124
-
125
- /* Look for the form_input_values key in lead data array first */
126
- if (isset($lead_data['form_input_values'])) {
127
- $form_submit_values = json_decode( stripslashes($lead_data['form_input_values']), true );
128
-
129
- if (!is_array($form_submit_values)) {
130
- $form_submit_values = array();
131
- }
132
-
133
- /* If notes is mapped to the form then use the 'wpleads_notes' map key */
134
- if (isset($form_submit_values['wpleads_notes'])) {
135
- return $form_submit_values['wpleads_notes'];
136
- }
137
-
138
- /* detect multi-line content in form submission */
139
- foreach ( $form_submit_values as $key => $value ) {
140
- if ( !is_array( $value ) && substr_count( $value, "\n" ) > 1 ) {
141
- return $value;
142
- }
143
- }
144
- }
145
-
146
-
147
- /* Next look to see if our data is available in the main array */
148
- if (isset($lead_data['wpleads_notes'])) {
149
- return $lead_data['wpleads_notes'];
150
- }
151
-
152
- /* detect multi-line content in form submission */
153
- foreach ( $lead_data as $key => $value ) {
154
- if ( !is_array( $value ) && substr_count( $value, "\n" ) > 1 ) {
155
- return $value;
156
- }
157
- }
158
-
159
- return '';
160
- }
161
-
162
- }
163
-
164
- /**
165
- * Load Inbound Akismet
166
- */
167
- $GLOBALS['Inbound_Akismet'] = new Inbound_Akismet();
168
-
169
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
shared/classes/class.load-shared.php CHANGED
@@ -59,7 +59,6 @@ if (!class_exists('Inbound_Load_Shared')) {
59
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.shortcodes.email-template.php');
60
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.shortcodes.cookie-values.php');
61
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.lead-fields.php');
62
- include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.inbound-forms.akismet.php');
63
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.options-api.php');
64
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.events.php');
65
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.lead-storage.php');
59
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.shortcodes.email-template.php');
60
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.shortcodes.cookie-values.php');
61
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.lead-fields.php');
 
62
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.options-api.php');
63
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.events.php');
64
  include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.lead-storage.php');