WordPress Landing Pages - Version 2.4.2

Version Description

  • Updating shared directory, minor code structure improvements.
Download this release

Release Info

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

Code changes from version 2.3.8 to 2.4.2

assets/css/admin-ab-testing.css CHANGED
@@ -44,21 +44,21 @@
44
font-size: 17px;
45
line-height: 24px;
46
}
47
- .variation-off .bab-stat-control-pause, .variation-on .bab-stat-control-play, .variation-off .pause-sep,.variation-on .play-sep, .variation-on .is-paused{
48
display: none;
49
}
50
- .bab-stat-control-container {
51
52
bottom: 0px;
53
left: 0px;
54
}
55
- .bab-stat-control-container:hover {
56
57
bottom: 0px;
58
left: 0px;
59
display: block;
60
}
61
- .bab-variation-row {
62
position: relative;
63
//margin-bottom: -27px;
64
//-moz-transition: all .4s ease-in-out;
@@ -67,10 +67,10 @@
67
//transition: all .4s ease-in-out;
68
}
69
70
- .bab-variation-row:last-child {
71
margin-bottom: 0px;
72
}
73
- .bab-variation-row:hover {
74
margin-bottom: 0px;
75
//-moz-transition: all .4s ease-in-out;
76
//-webkit-transition: all .4s ease-in-out;
@@ -78,20 +78,20 @@
78
//transition: all .4s ease-in-out;
79
80
}
81
- .bab-stat-control-container span {
82
vertical-align: bottom;
83
display: inline-block;
84
}
85
- .bab-stat-seperator {
86
padding-left: 3px;
87
padding-right: 3px;
88
font-size: 0px;
89
}
90
- .variation-on .bab-stat-control-pause a {
91
color: red;
92
font-weight: bold;
93
}
94
- .variation-off .bab-number-box {
95
color: rgb(117, 117, 117);
96
}
97
.is-paused { font-size: 10px;
@@ -100,11 +100,11 @@
100
opacity: .8;
101
padding-left: 10px;
102
}
103
- .variation-off .bab-stat-control-play a {
104
color: green;
105
font-weight: bold;
106
}
107
- .variation-off .bab-varation-header {
108
font-weight: normal;
109
}
110
.lp-tab-display
@@ -132,14 +132,14 @@
132
133
/* Begin with quick stats! */
134
135
- .bab-stat-letter {
136
border-radius: 3px;
137
border-style:solid;
138
border-width:1px;
139
padding:2px;
140
}
141
142
- .bab-stat-container-conversions, .bab-stat-container-impressions, .bab-stat-container-conversion_rate {
143
display:inline;
144
}
145
@@ -251,13 +251,13 @@
251
.settings_list_li a:hover{
252
color: #000
253
}
254
- #wpbody .bab-varation-header{
255
font-size: 14px;
256
font-weight: normal;
257
color: #000;
258
padding-left: 18px !important;
259
}
260
- .bab-stat-letter {
261
border-radius: 0px;
262
border-style: solid;
263
border-width: 0px;
@@ -265,7 +265,7 @@
265
background: none !important;
266
font-weight: bold;
267
}
268
- .bab-stat-control-pause a:before{
269
background: url(../images/ab-retina-icons.png) no-repeat;
270
width: 15px;
271
position: absolute;
@@ -281,7 +281,7 @@
281
margin-top: 0px;
282
}
283
284
- .bab-stat-control-play a:before{
285
background: url(../images/ab-retina-icons.png) no-repeat;
286
width: 15px;
287
position: absolute;
@@ -298,9 +298,9 @@
298
.variation-off{
299
300
}
301
- .bab-stat-control-play a:before{
302
}
303
- #wpbody .bab-varation-header {
304
line-height: 1;
305
background-color: #ededed;
306
border-color: #dddddd;
44
font-size: 17px;
45
line-height: 24px;
46
}
47
+ .variation-off .stat-control-pause, .variation-on .stat-control-play, .variation-off .pause-sep,.variation-on .play-sep, .variation-on .is-paused{
48
display: none;
49
}
50
+ .stat-control-container {
51
52
bottom: 0px;
53
left: 0px;
54
}
55
+ .stat-control-container:hover {
56
57
bottom: 0px;
58
left: 0px;
59
display: block;
60
}
61
+ .variation-row {
62
position: relative;
63
//margin-bottom: -27px;
64
//-moz-transition: all .4s ease-in-out;
67
//transition: all .4s ease-in-out;
68
}
69
70
+ .variation-row:last-child {
71
margin-bottom: 0px;
72
}
73
+ .variation-row:hover {
74
margin-bottom: 0px;
75
//-moz-transition: all .4s ease-in-out;
76
//-webkit-transition: all .4s ease-in-out;
78
//transition: all .4s ease-in-out;
79
80
}
81
+ .stat-control-container span {
82
vertical-align: bottom;
83
display: inline-block;
84
}
85
+ .stat-seperator {
86
padding-left: 3px;
87
padding-right: 3px;
88
font-size: 0px;
89
}
90
+ .variation-on .stat-control-pause a {
91
color: red;
92
font-weight: bold;
93
}
94
+ .variation-off .number-box {
95
color: rgb(117, 117, 117);
96
}
97
.is-paused { font-size: 10px;
100
opacity: .8;
101
padding-left: 10px;
102
}
103
+ .variation-off .stat-control-play a {
104
color: green;
105
font-weight: bold;
106
}
107
+ .variation-off .varation-header {
108
font-weight: normal;
109
}
110
.lp-tab-display
132
133
/* Begin with quick stats! */
134
135
+ .stat-letter {
136
border-radius: 3px;
137
border-style:solid;
138
border-width:1px;
139
padding:2px;
140
}
141
142
+ .stat-container-conversions, .stat-container-impressions, .stat-container-conversion_rate {
143
display:inline;
144
}
145
251
.settings_list_li a:hover{
252
color: #000
253
}
254
+ #wpbody .varation-header{
255
font-size: 14px;
256
font-weight: normal;
257
color: #000;
258
padding-left: 18px !important;
259
}
260
+ .stat-letter {
261
border-radius: 0px;
262
border-style: solid;
263
border-width: 0px;
265
background: none !important;
266
font-weight: bold;
267
}
268
+ .stat-control-pause a:before{
269
background: url(../images/ab-retina-icons.png) no-repeat;
270
width: 15px;
271
position: absolute;
281
margin-top: 0px;
282
}
283
284
+ .stat-control-play a:before{
285
background: url(../images/ab-retina-icons.png) no-repeat;
286
width: 15px;
287
position: absolute;
298
.variation-off{
299
300
}
301
+ .stat-control-play a:before{
302
}
303
+ #wpbody .varation-header {
304
line-height: 1;
305
background-color: #ededed;
306
border-color: #dddddd;
assets/css/admin/content-stats.css CHANGED
@@ -1,4 +1,4 @@
1
- #bab-stat-box
2
{
3
font-size: 12px;
4
margin-bottom: 10px;
@@ -14,17 +14,17 @@
14
z-index: 200;
15
width: 100%;
16
}
17
- #bab-stat-box:last-child {
18
margin-bottom: 0px;
19
}
20
- .bab-number-box
21
{
22
background: transparent;
23
display: inline-block;
24
width: 31%;
25
padding-top: 15px
26
}
27
- .bab-number-box span
28
{
29
text-align: center;
30
padding: 20px;
@@ -35,7 +35,7 @@
35
padding-top: 6px;
36
}
37
38
- .bab-varation-header
39
{
40
font-size: 19px;
41
font-weight: bold;
@@ -46,32 +46,32 @@
46
border-top: 1px solid #CECDCA;
47
}
48
49
- .bab-stat-control-container
50
{
51
text-align: center;
52
padding: 5px;
53
}
54
55
- .bab-variation-row
56
{
57
display: block;
58
}
59
60
- .bab-stat-letter
61
{
62
background: #fff;
63
padding-top: 0px;
64
padding-bottom: 0px;
65
}
66
67
- .bab-notes
68
{
69
float: right;
70
font-size: 12px;
71
font-weight: normal;
72
}
73
74
- .bab-number-box span.bab-stat-id{
75
line-height: 1;
76
font-size: 9px;
77
font-weight: normal;
@@ -81,7 +81,7 @@
81
color: #333333
82
}
83
84
- .bab-rate
85
{
86
font-size: 9px !important;
87
}
1
+ #stat-box
2
{
3
font-size: 12px;
4
margin-bottom: 10px;
14
z-index: 200;
15
width: 100%;
16
}
17
+ #stat-box:last-child {
18
margin-bottom: 0px;
19
}
20
+ .number-box
21
{
22
background: transparent;
23
display: inline-block;
24
width: 31%;
25
padding-top: 15px
26
}
27
+ .number-box span
28
{
29
text-align: center;
30
padding: 20px;
35
padding-top: 6px;
36
}
37
38
+ .varation-header
39
{
40
font-size: 19px;
41
font-weight: bold;
46
border-top: 1px solid #CECDCA;
47
}
48
49
+ .stat-control-container
50
{
51
text-align: center;
52
padding: 5px;
53
}
54
55
+ .variation-row
56
{
57
display: block;
58
}
59
60
+ .stat-letter
61
{
62
background: #fff;
63
padding-top: 0px;
64
padding-bottom: 0px;
65
}
66
67
+ .notes
68
{
69
float: right;
70
font-size: 12px;
71
font-weight: normal;
72
}
73
74
+ .number-box span.stat-id{
75
line-height: 1;
76
font-size: 9px;
77
font-weight: normal;
81
color: #333333
82
}
83
84
+ .rate
85
{
86
font-size: 9px !important;
87
}
assets/js/ajax.clearstats.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function ($) {
2
jQuery('.clear_stats').on('click', function () {
3
// define the bulk edit row
4
var post_id = this.id.replace('lp_clear_', '');
5
var status = 0;
6
if (confirm('Are you sure you want to delete the ALL of stats for this landing page? (There is no undo) Alternatively you can clear stats per version.')) {
7
jQuery.ajax({
8
type: 'POST',
9
url: ajaxurl,
10
context: this,
11
data: {
12
action: 'lp_clear_stats_action',
13
j_rules: status,
14
page_id: post_id
15
},
16
success: function (data) {
17
var self = this;
18
//alert(data);
19
// jQuery('.lp-form').unbind('submit').submit();
20
jQuery(self).hide();
21
jQuery(self).parent().parent().parent().parent().find(".lp-impress-num, .lp-con-num").text("0");
22
jQuery(self).parent().parent().parent().parent().find(".cr-number").addClass("cr-empty-0").text("0%");
23
//alert("Changes Saved! Refresh the page to see your changes");
24
},
25
error: function (MLHttpRequest, textStatus, errorThrown) {
26
alert("Ajax not enabled");
27
}
28
});
29
return false;
30
}
31
});
32
jQuery('body').on('click', '.lp-delete-var-stats', function () {
33
var post_id = jQuery(this).attr("rel");
34
var variation_id = jQuery(this).attr('data-vid');
35
var variation_letter = jQuery(this).attr('data-letter');
36
var selector = 'li[data-postid=' + post_id + '][data-letter=' + variation_letter + ']';
37
//console.log(selector);
38
if (confirm('Are you sure you want to delete stats for variation ' + variation_letter + "?")) {
39
jQuery.ajax({
40
type: 'POST',
41
url: ajaxurl,
42
context: this,
43
data: {
44
action: 'lp_clear_stats_single',
45
variation: variation_id,
46
page_id: post_id
47
},
48
success: function (data) {
49
var self = this;
50
jQuery(self).text("Stats Removed!").css("color", "green").removeClass("lp-delete-var-stats").addClass('lp-clear-success');
51
jQuery(selector).find(".lp-impress-num, .lp-con-num").text("0");
52
jQuery(selector).find(".cr-number").addClass("cr-empty-0").text("0%");
53
jQuery(self).parent().parent().find('.bab-stat-span-impressions, .bab-stat-span-conversions').text("0");
54
jQuery(self).parent().parent().find('.bab-stat-span-conversion_rate').text("0%");
55
},
56
error: function (MLHttpRequest, textStatus, errorThrown) {
57
alert("Ajax not enabled");
58
}
59
});
60
return false;
61
}
62
});
63
jQuery('.clear_stats').on('click', function () {
64
// define the bulk edit row
65
var post_id = this.id.replace('lp_clear_', '');
66
var status = 0;
67
if (confirm('Are you sure you want to delete the ALL of stats for this landing page? (There is no undo) Alternatively you can clear stats per version.')) {
68
jQuery.ajax({
69
type: 'POST',
70
url: ajaxurl,
71
context: this,
72
data: {
73
action: 'lp_clear_stats_action',
74
j_rules: status,
75
page_id: post_id
76
},
77
success: function (data) {
78
var self = this;
79
//alert(data);
80
// jQuery('.lp-form').unbind('submit').submit();
81
jQuery(self).hide();
82
jQuery(self).parent().parent().parent().parent().find(".lp-impress-num, .lp-con-num").text("0");
83
jQuery(self).parent().parent().parent().parent().find(".cr-number").addClass("cr-empty-0").text("0%");
84
//alert("Changes Saved! Refresh the page to see your changes");
85
},
86
error: function (MLHttpRequest, textStatus, errorThrown) {
87
alert("Ajax not enabled");
88
}
89
});
90
return false;
91
}
92
});
93
jQuery('body').on('click', '.lp-delete-var-stats', function () {
94
var post_id = jQuery(this).attr("rel");
95
var variation_id = jQuery(this).attr('data-vid');
96
var variation_letter = jQuery(this).attr('data-letter');
97
var selector = '#lp-variation-' + variation_letter;
98
//console.log(selector);
99
if (confirm('Are you sure you want to delete stats for variation ' + variation_letter + "?")) {
100
jQuery.ajax({
101
type: 'POST',
102
url: ajaxurl,
103
context: this,
104
data: {
105
action: 'lp_clear_stats_single',
106
variation: variation_id,
107
page_id: post_id
108
},
109
success: function (data) {
110
var self = this;
111
jQuery(self).text("Stats Removed!").css("color", "green").removeClass("lp-delete-var-stats").addClass('lp-clear-success');
112
jQuery(selector).find(".stat-span-impressions, .stat-span-conversions").text("0");
113
jQuery(selector).find(".stat-span-conversion_rate").addClass("cr-empty-0").text("0%");
114
},
115
error: function (MLHttpRequest, textStatus, errorThrown) {
116
alert("Ajax not enabled");
117
}
118
});
119
return false;
120
}
121
});
1
jQuery('.clear_stats').on('click', function () {
2
// define the bulk edit row
3
var post_id = this.id.replace('lp_clear_', '');
4
var status = 0;
5
if (confirm('Are you sure you want to delete the ALL of stats for this landing page? (There is no undo) Alternatively you can clear stats per version.')) {
6
jQuery.ajax({
7
type: 'POST',
8
url: ajaxurl,
9
context: this,
10
data: {
11
action: 'lp_clear_stats_action',
12
j_rules: status,
13
page_id: post_id
14
},
15
success: function (data) {
16
var self = this;
17
//alert(data);
18
// jQuery('.lp-form').unbind('submit').submit();
19
jQuery(self).hide();
20
jQuery(self).parent().parent().parent().parent().find(".lp-impress-num, .lp-con-num").text("0");
21
jQuery(self).parent().parent().parent().parent().find(".cr-number").addClass("cr-empty-0").text("0%");
22
//alert("Changes Saved! Refresh the page to see your changes");
23
},
24
error: function (MLHttpRequest, textStatus, errorThrown) {
25
alert("Ajax not enabled");
26
}
27
});
28
return false;
29
}
30
});
31
jQuery('body').on('click', '.lp-delete-var-stats', function () {
32
var post_id = jQuery(this).attr("rel");
33
var variation_id = jQuery(this).attr('data-vid');
34
var variation_letter = jQuery(this).attr('data-letter');
35
var selector = 'li[data-postid=' + post_id + '][data-letter=' + variation_letter + ']';
36
//console.log(selector);
37
if (confirm('Are you sure you want to delete stats for variation ' + variation_letter + "?")) {
38
jQuery.ajax({
39
type: 'POST',
40
url: ajaxurl,
41
context: this,
42
data: {
43
action: 'lp_clear_stats_single',
44
variation: variation_id,
45
page_id: post_id
46
},
47
success: function (data) {
48
var self = this;
49
jQuery(self).text("Stats Removed!").css("color", "green").removeClass("lp-delete-var-stats").addClass('lp-clear-success');
50
jQuery(selector).find(".lp-impress-num, .lp-con-num").text("0");
51
jQuery(selector).find(".cr-number").addClass("cr-empty-0").text("0%");
52
jQuery(self).parent().parent().find('.bab-stat-span-impressions, .bab-stat-span-conversions').text("0");
53
jQuery(self).parent().parent().find('.bab-stat-span-conversion_rate').text("0%");
54
},
55
error: function (MLHttpRequest, textStatus, errorThrown) {
56
alert("Ajax not enabled");
57
}
58
});
59
return false;
60
}
61
});
62
+ jQuery(document).ready(function ($) {
63
jQuery('.clear_stats').on('click', function () {
64
// define the bulk edit row
65
var post_id = this.id.replace('lp_clear_', '');
66
var status = 0;
67
if (confirm('Are you sure you want to delete the ALL of stats for this landing page? (There is no undo) Alternatively you can clear stats per version.')) {
68
jQuery.ajax({
69
type: 'POST',
70
url: ajaxurl,
71
context: this,
72
data: {
73
action: 'lp_clear_stats_action',
74
j_rules: status,
75
page_id: post_id
76
},
77
success: function (data) {
78
var self = this;
79
//alert(data);
80
// jQuery('.lp-form').unbind('submit').submit();
81
jQuery(self).hide();
82
jQuery(self).parent().parent().parent().parent().find(".lp-impress-num, .lp-con-num").text("0");
83
jQuery(self).parent().parent().parent().parent().find(".cr-number").addClass("cr-empty-0").text("0%");
84
//alert("Changes Saved! Refresh the page to see your changes");
85
},
86
error: function (MLHttpRequest, textStatus, errorThrown) {
87
alert("Ajax not enabled");
88
}
89
});
90
return false;
91
}
92
});
93
jQuery('body').on('click', '.lp-delete-var-stats', function () {
94
var post_id = jQuery(this).attr("rel");
95
var variation_id = jQuery(this).attr('data-vid');
96
var variation_letter = jQuery(this).attr('data-letter');
97
var selector = '#lp-variation-' + variation_letter;
98
//console.log(selector);
99
if (confirm('Are you sure you want to delete stats for variation ' + variation_letter + "?")) {
100
jQuery.ajax({
101
type: 'POST',
102
url: ajaxurl,
103
context: this,
104
data: {
105
action: 'lp_clear_stats_single',
106
variation: variation_id,
107
page_id: post_id
108
},
109
success: function (data) {
110
var self = this;
111
jQuery(self).text("Stats Removed!").css("color", "green").removeClass("lp-delete-var-stats").addClass('lp-clear-success');
112
jQuery(selector).find(".stat-span-impressions, .stat-span-conversions").text("0");
113
jQuery(selector).find(".stat-span-conversion_rate").addClass("cr-empty-0").text("0%");
114
},
115
error: function (MLHttpRequest, textStatus, errorThrown) {
116
alert("Ajax not enabled");
117
}
118
});
119
return false;
120
}
121
});
assets/tests/codeception/acceptance/StatisticsCept.php CHANGED
@@ -31,25 +31,25 @@ $I->see( 'Landing Pages');
31
$I->wantTo('Open example landing page');
32
$I->click( [ 'link' => 'A/B Testing Landing Page Example']);
33
$I->wantTo('check if impressions are correct for variation a');
34
- $imp = $I->grabTextFrom('#lp-variation-A .bab-stat-span-impressions');
35
$I->assertContains( '30' , $imp );
36
37
$I->wantTo('check check impressions for variation b');
38
- $imp = $I->grabTextFrom('#lp-variation-B .bab-stat-span-impressions');
39
$I->assertContains( '35' , $imp , '' );
40
41
$I->wantTo('check conversions for variation a');
42
- $con = $I->grabTextFrom('#lp-variation-A .bab-stat-span-conversions');
43
$I->assertContains( '10' , $con , '' );
44
45
$I->wantTo('check conversions for variation b');
46
- $con = $I->grabTextFrom('#lp-variation-B .bab-stat-span-conversions');
47
$I->assertContains( '15' , $con );
48
49
$I->wantTo('check the conversion rate of variation a');
50
- $per = $I->grabTextFrom('#lp-variation-A .bab-stat-span-conversion_rate');
51
$I->assertContains( '33' , $per );
52
53
$I->wantTo('check the conversion rate of variation b');
54
- $per = $I->grabTextFrom('#lp-variation-B .bab-stat-span-conversion_rate');
55
$I->assertContains( '42.86' , $per );
31
$I->wantTo('Open example landing page');
32
$I->click( [ 'link' => 'A/B Testing Landing Page Example']);
33
$I->wantTo('check if impressions are correct for variation a');
34
+ $imp = $I->grabTextFrom('#lp-variation-A .stat-span-impressions');
35
$I->assertContains( '30' , $imp );
36
37
$I->wantTo('check check impressions for variation b');
38
+ $imp = $I->grabTextFrom('#lp-variation-B .stat-span-impressions');
39
$I->assertContains( '35' , $imp , '' );
40
41
$I->wantTo('check conversions for variation a');
42
+ $con = $I->grabTextFrom('#lp-variation-A .stat-span-conversions');
43
$I->assertContains( '10' , $con , '' );
44
45
$I->wantTo('check conversions for variation b');
46
+ $con = $I->grabTextFrom('#lp-variation-B .stat-span-conversions');
47
$I->assertContains( '15' , $con );
48
49
$I->wantTo('check the conversion rate of variation a');
50
+ $per = $I->grabTextFrom('#lp-variation-A .stat-span-conversion_rate');
51
$I->assertContains( '33' , $per );
52
53
$I->wantTo('check the conversion rate of variation b');
54
+ $per = $I->grabTextFrom('#lp-variation-B .stat-span-conversion_rate');
55
$I->assertContains( '42.86' , $per );
classes/class.activation.php CHANGED
@@ -110,7 +110,7 @@ class Landing_Pages_Activation {
110
/* Listen for a manual upgrade call */
111
if (isset($_GET['plugin_action']) && $_GET['plugin_action'] == 'upgrade_routines' && $_GET['plugin'] =='landing-pages' ) {
112
self::run_updates();
113
- wp_redirect(admin_url('edit.php?post_type=landing-page'));
114
exit;
115
}
116
110
/* Listen for a manual upgrade call */
111
if (isset($_GET['plugin_action']) && $_GET['plugin_action'] == 'upgrade_routines' && $_GET['plugin'] =='landing-pages' ) {
112
self::run_updates();
113
+ wp_redirect(wp_get_referer());
114
exit;
115
}
116
classes/class.activation.upgrade-routines.php CHANGED
@@ -287,7 +287,6 @@ if ( !class_exists('Landing_Pages_Activation_Update_Routines') ) {
287
}
288
}
289
290
-
291
}
292
293
}
287
}
288
}
289
290
}
291
292
}
classes/class.admin-notices.php CHANGED
@@ -123,7 +123,7 @@ class Landing_Pages_Admin_Notices {
123
return;
124
}
125
126
- $extension_data = lp_get_extension_data();
127
$current_template = Landing_Pages_Variations::get_current_template($post->ID);
128
129
if ( !isset($extension_data[$current_template]['info']['data_type']) || $extension_data[$current_template]['info']['data_type'] != 'acf4' ) {
@@ -176,7 +176,7 @@ class Landing_Pages_Admin_Notices {
176
return;
177
}
178
179
- $extension_data = lp_get_extension_data();
180
$current_template = Landing_Pages_Variations::get_current_template($post->ID);
181
182
if ( defined('ACF_PRO') || !isset($extension_data[$current_template]['info']['data_type']) || $extension_data[$current_template]['info']['data_type'] != 'acf5' ) {
@@ -253,6 +253,11 @@ class Landing_Pages_Admin_Notices {
253
public static function download_legacy_templates() {
254
global $pagenow;
255
256
$message_id = 'download-legacy-landing-page-templates';
257
258
/* check if user viewed message already */
123
return;
124
}
125
126
+ $extension_data = Landing_Pages_Load_Extensions::get_extended_data();;
127
$current_template = Landing_Pages_Variations::get_current_template($post->ID);
128
129
if ( !isset($extension_data[$current_template]['info']['data_type']) || $extension_data[$current_template]['info']['data_type'] != 'acf4' ) {
176
return;
177
}
178
179
+ $extension_data = Landing_Pages_Load_Extensions::get_extended_data();;
180
$current_template = Landing_Pages_Variations::get_current_template($post->ID);
181
182
if ( defined('ACF_PRO') || !isset($extension_data[$current_template]['info']['data_type']) || $extension_data[$current_template]['info']['data_type'] != 'acf5' ) {
253
public static function download_legacy_templates() {
254
global $pagenow;
255
256
+ /* ignore for pro users */
257
+ if (class_exists('Inbound_Pro_Plugin')) {
258
+ return;
259
+ }
260
+
261
$message_id = 'download-legacy-landing-page-templates';
262
263
/* check if user viewed message already */
classes/{class.load-extensions.php → class.load-templates.php} RENAMED
@@ -16,9 +16,9 @@ class Landing_Pages_Load_Extensions {
16
public static function load_hooks() {
17
18
/*load core & uploaded templates */
19
- add_action('init',array(__CLASS__,'load_core_template_configurations') , 5 );
20
- add_action('init',array(__CLASS__,'load_uploaded_template_configurations') , 5 );
21
- add_action('init',array(__CLASS__,'load_theme_privided_template_configurations') , 5 );
22
23
/* Adds core metabox settings to extension data array */
24
add_filter('lp_extension_data', array(__CLASS__, 'add_core_setting_data'), 1, 1);
@@ -33,10 +33,6 @@ class Landing_Pages_Load_Extensions {
33
*/
34
public static function add_core_setting_data($data) {
35
36
- if (!is_admin()) {
37
- return;
38
- }
39
-
40
$data['lp']['settings'] = array(array('id' => 'selected-template', 'label' => __('Select Template', 'landing-pages'), 'description' => __("This option provides a placeholder for the selected template data.", 'landing-pages'), 'type' => 'radio', /* this is not honored. Template selection setting is handled uniquely by core. */
41
'default' => 'default', 'options' => null /* this is not honored. Template selection setting is handled uniquely by core. */), array('id' => 'main-headline', 'label' => __('Set Main Headline', 'landing-pages'), 'description' => __("Set Main Headline", 'landing-pages'), 'type' => 'text', /* this is not honored. Main Headline Input setting is handled uniquely by core. */
42
'default' => '', 'options' => null),);
@@ -48,9 +44,6 @@ class Landing_Pages_Load_Extensions {
48
* Looks for occurances of 'options' in template & extension data arrays and replaces key with 'settings'
49
*/
50
public static function add_legacy_data_support($data) {
51
- if (!is_admin()) {
52
- return;
53
- }
54
55
foreach ($data as $parent_key => $subarray) {
56
if (is_array($subarray)) {
@@ -78,10 +71,7 @@ class Landing_Pages_Load_Extensions {
78
* @returns ARRAY contains template setting data
79
*/
80
public static function load_core_template_configurations() {
81
-
82
- if (!is_admin()) {
83
- return;
84
- }
85
86
$template_ids = self::get_core_template_ids();
87
@@ -94,11 +84,6 @@ class Landing_Pages_Load_Extensions {
94
}
95
}
96
97
-
98
- /* Store all template config files in global */
99
- $GLOBALS['lp_data'] = $lp_data;
100
-
101
- return $lp_data;
102
}
103
104
/**
@@ -123,9 +108,6 @@ class Landing_Pages_Load_Extensions {
123
}
124
}
125
126
-
127
- return $lp_data;
128
-
129
}
130
131
/**
@@ -144,9 +126,6 @@ class Landing_Pages_Load_Extensions {
144
}
145
}
146
147
-
148
- return $lp_data;
149
-
150
}
151
152
/**
@@ -290,9 +269,5 @@ class Landing_Pages_Load_Extensions {
290
}
291
292
/* Initialize Landing_Pages_Load_Extensions */
293
- $GLOBALS['Landing_Pages_Load_Extensions'] = new Landing_Pages_Load_Extensions;
294
295
- /* Get data array of template settings */
296
- function lp_get_extension_data() {
297
- return Landing_Pages_Load_Extensions::get_extended_data();
298
- }
16
public static function load_hooks() {
17
18
/*load core & uploaded templates */
19
+ add_action('admin_init',array(__CLASS__,'load_core_template_configurations') , 5 );
20
+ add_action('admin_init',array(__CLASS__,'load_uploaded_template_configurations') , 5 );
21
+ add_action('admin_init',array(__CLASS__,'load_theme_privided_template_configurations') , 5 );
22
23
/* Adds core metabox settings to extension data array */
24
add_filter('lp_extension_data', array(__CLASS__, 'add_core_setting_data'), 1, 1);
33
*/
34
public static function add_core_setting_data($data) {
35
36
$data['lp']['settings'] = array(array('id' => 'selected-template', 'label' => __('Select Template', 'landing-pages'), 'description' => __("This option provides a placeholder for the selected template data.", 'landing-pages'), 'type' => 'radio', /* this is not honored. Template selection setting is handled uniquely by core. */
37
'default' => 'default', 'options' => null /* this is not honored. Template selection setting is handled uniquely by core. */), array('id' => 'main-headline', 'label' => __('Set Main Headline', 'landing-pages'), 'description' => __("Set Main Headline", 'landing-pages'), 'type' => 'text', /* this is not honored. Main Headline Input setting is handled uniquely by core. */
38
'default' => '', 'options' => null),);
44
* Looks for occurances of 'options' in template & extension data arrays and replaces key with 'settings'
45
*/
46
public static function add_legacy_data_support($data) {
47
48
foreach ($data as $parent_key => $subarray) {
49
if (is_array($subarray)) {
71
* @returns ARRAY contains template setting data
72
*/
73
public static function load_core_template_configurations() {
74
+ global $lp_data;
75
76
$template_ids = self::get_core_template_ids();
77
84
}
85
}
86
87
}
88
89
/**
108
}
109
}
110
111
}
112
113
/**
126
}
127
}
128
129
}
130
131
/**
269
}
270
271
/* Initialize Landing_Pages_Load_Extensions */
272
+ new Landing_Pages_Load_Extensions;
273
classes/class.metaboxes.php CHANGED
@@ -77,7 +77,7 @@ class Landing_Pages_Metaboxes {
77
);
78
79
/* Load Template Settings */
80
- $extension_data = lp_get_extension_data();
81
$current_template = Landing_Pages_Variations::get_current_template($post->ID);
82
foreach ($extension_data as $key => $data) {
83
@@ -264,7 +264,7 @@ class Landing_Pages_Metaboxes {
264
wp_localize_script( 'jpicker', 'jpicker', array( 'thispath' => LANDINGPAGES_URLPATH.'assets/libraries/jpicker/images/' ));
265
wp_enqueue_style('jpicker-css', LANDINGPAGES_URLPATH . 'assets/libraries/jpicker/css/jPicker-1.1.6.min.css');
266
267
- $template_data = lp_get_extension_data();
268
$template_data_json = json_encode($template_data);
269
$template = Landing_Pages_Variations::get_current_template( $post->ID );
270
$params = array('selected_template'=>$template, 'templates'=>$template_data_json);
@@ -482,7 +482,7 @@ class Landing_Pages_Metaboxes {
482
</style>
483
<div class="inside" id="a-b-testing">
484
485
- <div id="bab-stat-box">
486
<?php
487
488
if (isset($_GET['new_meta_key']) && is_numeric($_GET['new_meta_key']) ) {
@@ -531,10 +531,10 @@ class Landing_Pages_Metaboxes {
531
?>
532
533
<div id="lp-variation-<?php echo Landing_Pages_Variations::vid_to_letter( $post->ID , $key); ?>"
534
- class="bab-variation-row <?php echo $variation_status_class; ?>">
535
- <div class='bab-varation-header'>
536
- <span class='bab-variation-name'><?php _e('Variation', 'landing-pages'); ?> <span
537
- class='bab-stat-letter'><?php echo Landing_Pages_Variations::vid_to_letter( $post->ID , $key); ?></span>
538
<?php
539
if ($variation_status != 1) {
540
?>
@@ -549,28 +549,28 @@ class Landing_Pages_Metaboxes {
549
<span class="settings_wrapper_heading">Variation Settings</span>
550
<ul class="settings_list_li">
551
<li class="settings_edit">
552
- <span class='bab-stat-menu-edit'>
553
<a title="<?php _e('Edit this variation', 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo $vid; ?>'>
554
<?php _e('Edit', 'landing-pages'); ?>
555
</a>
556
</span>
557
</li>
558
<li class="settings_preview">
559
- <span class='bab-stat-menu-preview'>
560
<a title="<?php _e('Preview this variation', 'landing-pages'); ?>" class='thickbox' href='<?php echo $permalink; ?>&iframe_window=on&post_id=<?php echo $post->ID; ?>&TB_iframe=true&width=1503&height=467' target='_blank'>
561
<?php _e('Preview', 'landing-pages'); ?>
562
</a>
563
</span>
564
</li>
565
<li class="settings_clone">
566
- <span class='bab-stat-menu-clone'>
567
<a title="<?php _e('Clone this variation', 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&new-variation=1&clone=<?php echo $vid; ?>&new_meta_key=<?php echo $howmany; ?>'>
568
<?php _e('Clone', 'landing-pages'); ?>
569
</a>
570
</span>
571
</li>
572
<li class="settings_delete">
573
- <span class='bab-stat-control-delete'>
574
<a title="<?php _e('Delete this variation', 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo $vid; ?>&ab-action=delete-variation'>
575
<?php _e('Delete', 'landing-pages'); ?>
576
</a>
@@ -588,13 +588,13 @@ class Landing_Pages_Metaboxes {
588
589
590
<!-- PAUSE START -->
591
- <span class='bab-stat-control-pause'><a title="<?php _e('Pause this variation', 'landing-pages'); ?>"
592
href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo $vid; ?>&ab-action=pause-variation'> </a></span>
593
<!-- PAUSE END -->
594
595
<!-- PLAY START -->
596
- <span class='bab-stat-seperator pause-sep'>|</span>
597
- <span class='bab-stat-control-play'><a
598
title="<?php _e('Turn this variation on', 'landing-pages'); ?>"
599
href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo $vid; ?>&ab-action=play-variation'> </a></span>
600
<!-- PLAY END -->
@@ -602,26 +602,26 @@ href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo
602
603
604
</div>
605
- <div class="bab-stat-row">
606
- <div class='bab-stat-stats' colspan='2'>
607
- <div class='bab-stat-container-impressions bab-number-box'>
608
- <span class="bab-stat-id"><?php _e('Views', 'landing-pages'); ?> </span>
609
- <span class='bab-stat-span-impressions'><?php echo $impressions; ?></span>
610
</div>
611
- <div class='bab-stat-container-conversions bab-number-box'>
612
- <span class="bab-stat-id"><?php _e('Conversions', 'landing-pages'); ?></span> <span class='bab-stat-span-conversions'><?php echo $conversions; ?></span>
613
</span>
614
</div>
615
- <div class='bab-stat-container-conversion_rate bab-number-box'>
616
- <span class="bab-stat-id bab-rate"><?php _e('Conversion Rate', 'landing-pages'); ?></span>
617
- <span class='bab-stat-span-conversion_rate'><?php echo $conversion_rate; ?></span>
618
</div>
619
620
</div>
621
</div>
622
- <div class="bab-stat-row">
623
624
- <div class='bab-stat-menu-container'>
625
626
<?php do_action('lp_ab_testing_stats_menu_post'); ?>
627
@@ -763,7 +763,7 @@ href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo
763
764
$toggle = ($screen->parent_file != 'edit.php?post_type=landing-page' || $screen->action != 'add') ? "display:none" : "";
765
766
- $extension_data = lp_get_extension_data();
767
$extension_data_cats = Landing_Pages_Load_Extensions::get_template_categories();
768
769
unset($extension_data['lp']);
@@ -938,7 +938,7 @@ href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo
938
*/
939
public static function display_extended_metabox( $post , $args) {
940
941
- $extension_data = lp_get_extension_data();
942
943
$key = $args['args']['key'];
944
77
);
78
79
/* Load Template Settings */
80
+ $extension_data = Landing_Pages_Load_Extensions::get_extended_data();;
81
$current_template = Landing_Pages_Variations::get_current_template($post->ID);
82
foreach ($extension_data as $key => $data) {
83
264
wp_localize_script( 'jpicker', 'jpicker', array( 'thispath' => LANDINGPAGES_URLPATH.'assets/libraries/jpicker/images/' ));
265
wp_enqueue_style('jpicker-css', LANDINGPAGES_URLPATH . 'assets/libraries/jpicker/css/jPicker-1.1.6.min.css');
266
267
+ $template_data = Landing_Pages_Load_Extensions::get_extended_data();;
268
$template_data_json = json_encode($template_data);
269
$template = Landing_Pages_Variations::get_current_template( $post->ID );
270
$params = array('selected_template'=>$template, 'templates'=>$template_data_json);
482
</style>
483
<div class="inside" id="a-b-testing">
484
485
+ <div id="stat-box">
486
<?php
487
488
if (isset($_GET['new_meta_key']) && is_numeric($_GET['new_meta_key']) ) {
531
?>
532
533
<div id="lp-variation-<?php echo Landing_Pages_Variations::vid_to_letter( $post->ID , $key); ?>"
534
+ class="variation-row <?php echo $variation_status_class; ?>">
535
+ <div class='varation-header'>
536
+ <span class='variation-name'><?php _e('Variation', 'landing-pages'); ?> <span
537
+ class='stat-letter'><?php echo Landing_Pages_Variations::vid_to_letter( $post->ID , $key); ?></span>
538
<?php
539
if ($variation_status != 1) {
540
?>
549
<span class="settings_wrapper_heading">Variation Settings</span>
550
<ul class="settings_list_li">
551
<li class="settings_edit">
552
+ <span class='stat-menu-edit'>
553
<a title="<?php _e('Edit this variation', 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo $vid; ?>'>
554
<?php _e('Edit', 'landing-pages'); ?>
555
</a>
556
</span>
557
</li>
558
<li class="settings_preview">
559
+ <span class='stat-menu-preview'>
560
<a title="<?php _e('Preview this variation', 'landing-pages'); ?>" class='thickbox' href='<?php echo $permalink; ?>&iframe_window=on&post_id=<?php echo $post->ID; ?>&TB_iframe=true&width=1503&height=467' target='_blank'>
561
<?php _e('Preview', 'landing-pages'); ?>
562
</a>
563
</span>
564
</li>
565
<li class="settings_clone">
566
+ <span class='stat-menu-clone'>
567
<a title="<?php _e('Clone this variation', 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&new-variation=1&clone=<?php echo $vid; ?>&new_meta_key=<?php echo $howmany; ?>'>
568
<?php _e('Clone', 'landing-pages'); ?>
569
</a>
570
</span>
571
</li>
572
<li class="settings_delete">
573
+ <span class='stat-control-delete'>
574
<a title="<?php _e('Delete this variation', 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo $vid; ?>&ab-action=delete-variation'>
575
<?php _e('Delete', 'landing-pages'); ?>
576
</a>
588
589
590
<!-- PAUSE START -->
591
+ <span class='stat-control-pause'><a title="<?php _e('Pause this variation', 'landing-pages'); ?>"
592
href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo $vid; ?>&ab-action=pause-variation'> </a></span>
593
<!-- PAUSE END -->
594
595
<!-- PLAY START -->
596
+ <span class='stat-seperator pause-sep'>|</span>
597
+ <span class='stat-control-play'><a
598
title="<?php _e('Turn this variation on', 'landing-pages'); ?>"
599
href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo $vid; ?>&ab-action=play-variation'> </a></span>
600
<!-- PLAY END -->
602
603
604
</div>
605
+ <div class="stat-row">
606
+ <div class='stat-stats' colspan='2'>
607
+ <div class='stat-container-impressions number-box'>
608
+ <span class="stat-id"><?php _e('Views', 'landing-pages'); ?> </span>
609
+ <span class='stat-span-impressions'><?php echo $impressions; ?></span>
610
</div>
611
+ <div class='stat-container-conversions number-box'>
612
+ <span class="stat-id"><?php _e('Conversions', 'landing-pages'); ?></span> <span class='stat-span-conversions'><?php echo $conversions; ?></span>
613
</span>
614
</div>
615
+ <div class='stat-container-conversion_rate number-box'>
616
+ <span class="stat-id rate"><?php _e('Conversion Rate', 'landing-pages'); ?></span>
617
+ <span class='stat-span-conversion_rate'><?php echo $conversion_rate; ?></span>
618
</div>
619
620
</div>
621
</div>
622
+ <div class="stat-row">
623
624
+ <div class='stat-menu-container'>
625
626
<?php do_action('lp_ab_testing_stats_menu_post'); ?>
627
763
764
$toggle = ($screen->parent_file != 'edit.php?post_type=landing-page' || $screen->action != 'add') ? "display:none" : "";
765
766
+ $extension_data = Landing_Pages_Load_Extensions::get_extended_data();;
767
$extension_data_cats = Landing_Pages_Load_Extensions::get_template_categories();
768
769
unset($extension_data['lp']);
938
*/
939
public static function display_extended_metabox( $post , $args) {
940
941
+ $extension_data = Landing_Pages_Load_Extensions::get_extended_data();;
942
943
$key = $args['args']['key'];
944
classes/class.post-type.landing-page.php CHANGED
@@ -46,7 +46,7 @@ if ( !class_exists('Landing_Pages_Post_Type') ) {
46
if (isset($_GET['dont_save'])
47
|| isset($_GET['iframe_window'])
48
|| isset($_GET['inbound-preview']) ) {
49
- add_action('wp_enqueue_scripts', array(__CLASS__, 'stop_stat_tracking'));
50
}
51
52
/* load iframed preview page when preview is clicked from AB stats box */
@@ -122,6 +122,7 @@ if ( !class_exists('Landing_Pages_Post_Type') ) {
122
$role->add_cap( 'edit_others_landing_pages' );
123
$role->add_cap( 'edit_published_landing_pages' );
124
$role->add_cap( 'publish_landing_pages' );
125
$role->add_cap( 'delete_others_landing_pages' );
126
$role->add_cap( 'delete_private_landing_pages' );
127
$role->add_cap( 'delete_published_landing_pages' );
@@ -582,7 +583,7 @@ if ( !class_exists('Landing_Pages_Post_Type') ) {
582
*/
583
public static function stop_stat_tracking() {
584
show_admin_bar(false);
585
- wp_enqueue_script('stop-inbound-stats-js', LANDINGPAGES_URLPATH . 'assets/js/stop_page_stats.js');
586
wp_enqueue_style('inbound-preview-window-css', LANDINGPAGES_URLPATH . 'assets/css/iframe-preview.css');
587
}
588
46
if (isset($_GET['dont_save'])
47
|| isset($_GET['iframe_window'])
48
|| isset($_GET['inbound-preview']) ) {
49
+ add_action('wp_enqueue_scripts', array(__CLASS__, 'stop_stat_tracking') , 20);
50
}
51
52
/* load iframed preview page when preview is clicked from AB stats box */
122
$role->add_cap( 'edit_others_landing_pages' );
123
$role->add_cap( 'edit_published_landing_pages' );
124
$role->add_cap( 'publish_landing_pages' );
125
+ $role->add_cap( 'delete_landing_pages' );
126
$role->add_cap( 'delete_others_landing_pages' );
127
$role->add_cap( 'delete_private_landing_pages' );
128
$role->add_cap( 'delete_published_landing_pages' );
583
*/
584
public static function stop_stat_tracking() {
585
show_admin_bar(false);
586
+ wp_enqueue_script('stop-inbound-stats-js', LANDINGPAGES_URLPATH . 'assets/js/stop_page_stats.js' , array('inbound-analytics'));
587
wp_enqueue_style('inbound-preview-window-css', LANDINGPAGES_URLPATH . 'assets/css/iframe-preview.css');
588
}
589
classes/class.settings.php CHANGED
@@ -460,7 +460,16 @@ class Landing_Pages_Settings {
460
Registered Post Stati: <?php echo implode(', ', get_post_stati()) . "\n\n"; ?>
461
462
PHP Version: <?php echo PHP_VERSION . "\n"; ?>
463
- MySQL Version: <?php echo mysql_get_server_info($wpdb->dbh) . "\n"; ?>
464
Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?>
465
466
PHP Safe Mode: <?php echo ini_get('safe_mode') ? "Yes" : "No\n"; ?>
460
Registered Post Stati: <?php echo implode(', ', get_post_stati()) . "\n\n"; ?>
461
462
PHP Version: <?php echo PHP_VERSION . "\n"; ?>
463
+ MySQL Version: <?php
464
+ $con=mysqli_connect("localhost","my_user","my_password","my_db");
465
+
466
+ if (mysqli_connect_errno()) {
467
+ echo "Failed to connect to MySQL: " . mysqli_connect_error(). "\n";
468
+ }
469
+
470
+ echo mysqli_get_server_info($con). "\n";
471
+
472
+ ?>
473
Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?>
474
475
PHP Safe Mode: <?php echo ini_get('safe_mode') ? "Yes" : "No\n"; ?>
classes/class.statistics.php CHANGED
@@ -86,12 +86,12 @@ if (!class_exists('Landing_Pages_Stats')) {
86
return $data;
87
}
88
89
/* increment conversions for landing pages */
90
if( isset($data['post_type']) && $data['post_type'] === 'landing-page' ) {
91
$conversions = Landing_Pages_Variations::get_conversions( $data['page_id'] , $data['variation'] );
92
$conversions++;
93
Landing_Pages_Variations::set_conversions_count( $data['page_id'] , $data['variation'] , $conversions );
94
-
95
}
96
/* increment conversions for non landing pages */
97
else {
86
return $data;
87
}
88
89
+
90
/* increment conversions for landing pages */
91
if( isset($data['post_type']) && $data['post_type'] === 'landing-page' ) {
92
$conversions = Landing_Pages_Variations::get_conversions( $data['page_id'] , $data['variation'] );
93
$conversions++;
94
Landing_Pages_Variations::set_conversions_count( $data['page_id'] , $data['variation'] , $conversions );
95
}
96
/* increment conversions for non landing pages */
97
else {
classes/class.widgets.php CHANGED
@@ -10,14 +10,11 @@ function lp_load_widgets() {
10
11
class LP_Widget_Conversion_Area extends WP_Widget {
12
13
- /**
14
- * Constructor. Sets up widget options.
15
- */
16
17
- function LP_Widget_Conversion_Area() {
18
19
/* Widget settings. */
20
- $widget_ops = array('classname' => 'class_LP_Widget_Conversion_Area', 'description' => __('Use this widget on your landing page sidebar. This sidebar replaces the normal sidebar while using your default theme as a template, or other inactive themes as landing page templates.', 'landing-pages'));
21
22
/* Widget control settings. */
23
$control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'id_lp_conversion_area_widget');
10
11
class LP_Widget_Conversion_Area extends WP_Widget {
12
13
14
+ function __construct() {
15
16
/* Widget settings. */
17
+ $widget_ops = array('classname' => 'class_LP_Widget_Conversion_Area', 'description' => __('Use this widget on your landing page sidebar. This sidebar replaces the normal sidebar while using your default theme as a template, or other inactive themes as landing page templates.', 'inbound-pro'));
18
19
/* Widget control settings. */
20
$control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'id_lp_conversion_area_widget');
classes/class.wp-list-table.templates.php CHANGED
@@ -14,7 +14,7 @@ class Landing_Pages_Templates_List_Table extends WP_List_Table {
14
15
function __construct() {
16
17
- $lp_data = lp_get_extension_data();
18
$final_data = array();
19
20
foreach ($lp_data as $key => $data) {
14
15
function __construct() {
16
17
+ $lp_data = Landing_Pages_Load_Extensions::get_extended_data();;
18
$final_data = array();
19
20
foreach ($lp_data as $key => $data) {
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.8
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.8' );
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' );
@@ -74,7 +74,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
74
include_once( LANDINGPAGES_PATH . 'classes/class.welcome.php');
75
include_once( LANDINGPAGES_PATH . 'classes/class.install.php');
76
include_once( LANDINGPAGES_PATH . 'classes/class.landing-pages.php');
77
- include_once( LANDINGPAGES_PATH . 'classes/class.load-extensions.php');
78
include_once( LANDINGPAGES_PATH . 'classes/class.post-type.landing-page.php');
79
include_once( LANDINGPAGES_PATH . 'modules/module.utils.php');
80
include_once( LANDINGPAGES_PATH . 'classes/class.sidebars.php');
@@ -99,8 +99,6 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
99
include_once( LANDINGPAGES_PATH . 'classes/class.sidebars.php');
100
include_once( LANDINGPAGES_PATH . 'classes/class.widgets.php');
101
include_once( LANDINGPAGES_PATH . 'classes/class.landing-pages.php');
102
- include_once( LANDINGPAGES_PATH . 'classes/class.load-extensions.php');
103
-
104
105
BREAK;
106
endswitch;
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.4.2
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.4.2' );
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' );
74
include_once( LANDINGPAGES_PATH . 'classes/class.welcome.php');
75
include_once( LANDINGPAGES_PATH . 'classes/class.install.php');
76
include_once( LANDINGPAGES_PATH . 'classes/class.landing-pages.php');
77
+ include_once( LANDINGPAGES_PATH . 'classes/class.load-templates.php');
78
include_once( LANDINGPAGES_PATH . 'classes/class.post-type.landing-page.php');
79
include_once( LANDINGPAGES_PATH . 'modules/module.utils.php');
80
include_once( LANDINGPAGES_PATH . 'classes/class.sidebars.php');
99
include_once( LANDINGPAGES_PATH . 'classes/class.sidebars.php');
100
include_once( LANDINGPAGES_PATH . 'classes/class.widgets.php');
101
include_once( LANDINGPAGES_PATH . 'classes/class.landing-pages.php');
102
103
BREAK;
104
endswitch;
readme.txt CHANGED
@@ -6,8 +6,8 @@ License: GPLv2 or later
6
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.1
10
- Stable Tag: 2.3.8
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
@@ -49,7 +49,7 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
49
50
[Follow Development on GitHub ](https://github.com/inboundnow/landing-pages "Follow & Contribute to core development on GitHub")
51
|
52
- [Follow Development on Twitter ](https://twitter.com/gitlandingpages "See our latest development commits on Twitter")
53
54
55
== Installation ==
@@ -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.8 =
74
* Improving events storage and events reporting.
75
6
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.7.1
10
+ Stable Tag: 2.4.2
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
49
50
[Follow Development on GitHub ](https://github.com/inboundnow/landing-pages "Follow & Contribute to core development on GitHub")
51
|
52
+ [Follow Inbound Now on Twitter ](https://twitter.com/inboundnow "Stay notified with updates.")
53
54
55
== Installation ==
70
71
== Changelog ==
72
73
+ = 2.4.2 =
74
+ * Updating shared directory, minor code structure improvements.
75
+
76
= 2.3.8 =
77
* Improving events storage and events reporting.
78
shared/classes/class.ajax.php CHANGED
@@ -38,12 +38,17 @@ if (!class_exists('Inbound_Ajax')) {
38
}
39
40
/**
41
- *
42
*/
43
public static function track_lead() {
44
45
global $wpdb;
46
47
$lead_data['lead_id'] = (isset($_POST['wp_lead_id'])) ? $_POST['wp_lead_id'] : '';
48
$lead_data['nature'] = (isset($_POST['nature'])) ? $_POST['nature'] : 'non-conversion'; /* what is nature? */
49
$lead_data['json'] = (isset($_POST['json'])) ? addslashes($_POST['json']) : 0;
@@ -68,8 +73,7 @@ if (!class_exists('Inbound_Ajax')) {
68
$_SESSION['inbound_page_views'] = $page_views;
69
}
70
71
- /* update lead data */
72
-
73
if ($lead_data['lead_id']) {
74
self::update_page_view_obj($lead_data);
75
self::set_current_lists($lead_data['lead_id']);
38
}
39
40
/**
41
+ * Listen for page view event
42
*/
43
public static function track_lead() {
44
45
global $wpdb;
46
47
+ /* check for known bots and ignore */
48
+ if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/bot|crawl|slurp|spider/i', $_SERVER['HTTP_USER_AGENT'])) {
49
+ return;
50
+ }
51
+
52
$lead_data['lead_id'] = (isset($_POST['wp_lead_id'])) ? $_POST['wp_lead_id'] : '';
53
$lead_data['nature'] = (isset($_POST['nature'])) ? $_POST['nature'] : 'non-conversion'; /* what is nature? */
54
$lead_data['json'] = (isset($_POST['json'])) ? addslashes($_POST['json']) : 0;
73
$_SESSION['inbound_page_views'] = $page_views;
74
}
75
76
+ /* update lead data and set lead lists into cookies */
77
if ($lead_data['lead_id']) {
78
self::update_page_view_obj($lead_data);
79
self::set_current_lists($lead_data['lead_id']);
shared/classes/class.confirm-double-optin.php ADDED
@@ -0,0 +1,217 @@
1
+ <?php
2
+ if(!class_exists('Inbound_Confirm_Double_Optin')){
3
+
4
+ class Inbound_Confirm_Double_Optin{
5
+
6
+ /**
7
+ * Initialize class
8
+ */
9
+ function __construct(){
10
+ self::add_hooks();
11
+ }
12
+
13
+ /**
14
+ * Load Hooks and Filters
15
+ */
16
+ public static function add_hooks(){
17
+
18
+ /* Shortcode for displaying list double opt in confirmation form */
19
+ add_action( 'init' , array( __CLASS__, 'process_confrimation' ), 20 );
20
+
21
+ /* Process shortcode to produce the confirmation link,
22
+ * the name is different from the one the user uses to prevent early rendering */
23
+ add_shortcode( 'list-double-optin-link', array( __CLASS__, 'render_confirm_link' ) );
24
+
25
+ }
26
+
27
+
28
+ /**
29
+ * @param $atts
30
+ * @return string
31
+ */
32
+ public static function process_confrimation(){
33
+ global $inbound_settings;
34
+
35
+ if (!isset($_REQUEST['inbound-action']) || $_REQUEST['inbound-action'] != 'confirm' ) {
36
+ return;
37
+ }
38
+
39
+ /* get all lead lists */
40
+ $lead_lists = Inbound_Leads::get_lead_lists_as_array();
41
+
42
+ /* decode token */
43
+ $params = self::decode_confirm_token( sanitize_text_field($_GET['token']) );
44
+
45
+
46
+ if ( !isset( $params['lead_id'] ) ) {
47
+ return;
48
+ }
49
+
50
+ self::confirm_being_added_to_lists($params, $all);
51
+ }
52
+
53
+
54
+ /**
55
+ * Creates the double optin confirmation link
56
+ * The shorcode used by the user is: inbound-list-double-optin-link.
57
+ * But Inbound_List_Double_Optin::add_confirm_link_shortcode_params trims the name to: list-double-optin-link.
58
+ * Then it gets rendered.
59
+ * The reason for this is so the shorcode isn't rendered until the atts have been added to it.
60
+ */
61
+ public static function render_confirm_link( $params ) {
62
+
63
+ $params = shortcode_atts( array(
64
+ 'lead_id' => '',
65
+ 'list_ids' => '-1',
66
+ 'email_id' => '-1'
67
+ ), $params, 'list-double-optin-link');
68
+ /* check to see if lead id is set as a REQUEST */
69
+ if ( isset($params['lead_id']) ) {
70
+ $params['lead_id'] = intval($params['lead_id']);
71
+ } else if ( isset($_REQUEST['lead_id']) ) {
72
+ $params['lead_id'] = intval($_REQUEST['lead_id']);
73
+ } else if ( isset($_COOKIE['wp_lead_id']) ) {
74
+ $params['lead_id'] = intval($_COOKIE['wp_lead_id']);
75
+ }
76
+ /* Add variation id to confirm link */
77
+ $params['variation_id'] = ( isset($_REQUEST['inbvid']) ) ? intval($_REQUEST['inbvid']) : intval(0);
78
+
79
+ /* generate confirm link */
80
+ $confirm_link = self::generate_confirm_link( $params );
81
+ return $confirm_link;
82
+ }
83
+
84
+
85
+
86
+ /**
87
+ * Generates confirm url given lead id and lists
88
+ * @param ARRAY $params contains: lead_id (INT ), list_ids (MIXED), email_id (INT)
89
+ * @return STRING $confirm_url
90
+ */
91
+ public static function generate_confirm_link( $params ) {
92
+ if (!isset($params['lead_id']) || !$params['lead_id']) {
93
+ return __( '#confirm-not-available-in-online-mode' , 'inbound-pro' );
94
+ }
95
+ if (isset($_GET['lead_lists']) && !is_array($_GET['lead_lists'])){
96
+ $params['list_ids'] = explode( ',' , $_GET['lead_lists']);
97
+ } else if (isset($params['list_ids']) && !is_array($params['list_ids'])) {
98
+ $params['list_ids'] = explode( ',' , $params['list_ids']);
99
+ }
100
+ $args = array_merge( $params , $_GET );
101
+ $token = self::encode_confirm_token( $args );
102
+
103
+ if(!defined('INBOUND_PRO_CURRENT_VERSION')){
104
+ $double_optin_page_id = get_option('list-double-optin-page-id', '');
105
+ }else{
106
+ $settings = Inbound_Options_API::get_option('inbound-pro', 'settings', array());
107
+ $double_optin_page_id = $settings['leads']['list-double-optin-page-id'];
108
+ }
109
+
110
+ if ( empty($double_optin_page_id) ) {
111
+ $post = get_page_by_title( __( 'Confirm Subscription' , 'inbound-pro' ) );
112
+ $double_optin_page_id = $post->ID;
113
+ }
114
+
115
+ $base_url = get_permalink( $double_optin_page_id );
116
+
117
+ return add_query_arg( array( 'token'=>$token , 'inbound-action' => 'confirm' ) , $base_url );
118
+ }
119
+
120
+
121
+ /**
122
+ * Encodes data into a confirm token
123
+ * @param ARRAY $params contains: lead_id (INT ), list_ids (MIXED), email_id (INT)
124
+ * @return INT $token
125
+ */
126
+ public static function encode_confirm_token( $params ) {
127
+ unset($params['doing_wp_cron']);
128
+ $json = json_encode($params);
129
+ $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
130
+ $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
131
+ $encrypted_string =
132
+ base64_encode(
133
+ trim(
134
+ mcrypt_encrypt(
135
+ MCRYPT_RIJNDAEL_256, substr( SECURE_AUTH_KEY , 0 , 16 ) , $json, MCRYPT_MODE_ECB, $iv
136
+ )
137
+ )
138
+ );
139
+ $decode_test = self::decode_confirm_token($encrypted_string);
140
+ return str_replace(array('+', '/', '='), array('-', '_', '^'), $encrypted_string);
141
+ }
142
+
143
+
144
+ /**
145
+ * Decodes confirm token into an array of parameters
146
+ * @param STRING $reader_id Encoded lead id.
147
+ * @return ARRAY $confirm array of confirmation data
148
+ */
149
+ public static function decode_confirm_token( $token ) {
150
+ $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
151
+ $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
152
+ $decrypted_string =
153
+ trim(
154
+ mcrypt_decrypt(
155
+ MCRYPT_RIJNDAEL_256 , substr( SECURE_AUTH_KEY , 0 , 16 ) , base64_decode( str_replace(array('-', '_', '^'), array('+', '/', '='), $token ) ) , MCRYPT_MODE_ECB, $iv
156
+ )
157
+ );
158
+ return json_decode($decrypted_string , true);
159
+ }
160
+
161
+ /**
162
+ * Adds the lead to lists he selected when filling out the confirmation form.
163
+ * If all_lists was selected, all lists currently waiting for confirmation will be selected and the lead will be added to those.
164
+ */
165
+ public static function confirm_being_added_to_lists($params, $all = false){
166
+
167
+ /*get the double optin waiting list id*/
168
+ if(!defined('INBOUND_PRO_CURRENT_VERSION')){
169
+ $double_optin_list_id = get_option('list-double-optin-list-id', '');
170
+ }else{
171
+ $settings = Inbound_Options_API::get_option('inbound-pro', 'settings', array());
172
+ $double_optin_list_id = $settings['leads']['list-double-optin-list-id'];
173
+ }
174
+
175
+
176
+ /*get the lists waiting to be opted into*/
177
+ $stored_double_optin_lists = get_post_meta($params['lead_id'], 'double_optin_lists', true);
178
+
179
+ /*if there aren't any lists, exit*/
180
+ if(empty($stored_double_optin_lists)){
181
+ return;
182
+ }
183
+
184
+ /*if opt into all lists has been selected, set list ids to all stored list ids*/
185
+ if($all){
186
+ $params['list_ids'] = $stored_double_optin_lists;
187
+ }
188
+
189
+ /**for each supplied list, add the lead to the list.
190
+ * And remove the list id from the array of lists needing to be opted into**/
191
+ foreach($params['list_ids'] as $list_id){
192
+ Inbound_Leads::add_lead_to_list($params['lead_id'], $list_id);
193
+
194
+ if(in_array($list_id, $stored_double_optin_lists)){
195
+ $index = array_search($list_id, $stored_double_optin_lists);
196
+ unset($stored_double_optin_lists[$index]);
197
+ }
198
+ }
199
+
200
+ /**if there are still lists awaiting double optin confirmation after the "waiting" meta listing has been updated**/
201
+ if(!empty($stored_double_optin_lists)){
202
+ /*update the "waiting" meta listing with the remaining lists*/
203
+ update_post_meta($params['lead_id'], 'double_optin_lists', array_values($stored_double_optin_lists));
204
+ }else{
205
+ /**if there are no lists awaiting double optin confirmation**/
206
+ /*remove the meta listing for double optin*/
207
+ delete_post_meta($params['lead_id'], 'double_optin_lists');
208
+ /*remove this lead from the double optin list*/
209
+ wp_remove_object_terms($params['lead_id'], $double_optin_list_id, 'wplead_list_category');
210
+ /*update the lead status*/
211
+ update_post_meta( $params['lead_id'], 'wp_lead_status', 'active');
212
+ }
213
+ }
214
+ }
215
+ new Inbound_Confirm_Double_Optin;
216
+
217
+ }
shared/classes/class.database-routines.php ADDED
@@ -0,0 +1,143 @@
1
+ <?php
2
+
3
+ /* Public methods in this class will be run at least once during plugin activation script. */
4
+ /* Updater methods fired are stored in transient to prevent repeat processing */
5
+
6
+ if ( !class_exists('Inbound_Upgrade_Routines') ) {
7
+
8
+ class Inbound_Upgrade_Routines {
9
+ static $routines;
10
+ static $past_version;
11
+ static $current_version;
12
+
13
+ /**
14
+ * Run Generic Upgrade Routines
15
+ */
16
+ public static function load() {
17
+ self::define_routines();
18
+ self::load_routines();
19
+ }
20
+
21
+ /**
22
+ *
23
+ */
24
+ public static function define_routines() {
25
+
26
+ /* alter page view table */
27
+ self::$routines['page-views-table-1'] = array(
28
+ 'id' => 'page-views-table-1',
29
+ 'scope' => 'shared',
30
+ 'introduced' => '1.0.1',
31
+ 'callback' => array( __CLASS__ , 'alter_page_views_table_1')
32
+ );
33
+
34
+ /* alter page view table */
35
+ self::$routines['events-table-1'] = array(
36
+ 'id' => 'events-table-1',
37
+ 'scope' => 'shared',
38
+ 'introduced' => '1.0.1',
39
+ 'callback' => array( __CLASS__ , 'alter_events_table_1')
40
+ );
41
+ }
42
+
43
+ /**
44
+ *
45
+ */
46
+ public static function load_routines() {
47
+
48
+ self::$routines = apply_filters( 'inbound-pro/upgrade-routines' , self::$routines);
49
+
50
+ foreach (self::$routines as $routine) {
51
+ /* set versions int static vars */
52
+ self::set_versions($routine);
53
+
54
+ /* compare versions and see last installed version is beneath the introduced version */
55
+ if ( !self::$past_version || !version_compare( (int) self::$past_version , (int) $routine['introduced'] , '<') ) {
56
+ continue;
57
+ }
58
+
59
+ /* run the routine */
60
+ call_user_func(array($routine['callback'][0] , $routine['callback'][1]) );
61
+ }
62
+
63
+ /* set shared version transient */
64
+ set_transient('inbound_shared_version' , INBOUNDNOW_SHARED_DBRV);
65
+ }
66
+
67
+
68
+ /**
69
+ * @param $routine
70
+ */
71
+ public static function set_versions( $routine ) {
72
+ switch($routine['scope']) {
73
+ case 'shared':
74
+ self::$past_version = get_transient('inbound_shared_version');
75
+ self::$current_version = INBOUNDNOW_SHARED_DBRV;
76
+ break;
77
+ case 'leads':
78
+ self::$past_version = get_transient('leads_shared_version');
79
+ self::$current_version = WPL_CURRENT_VERSION;
80
+ break;
81
+ case 'landing-pages':
82
+ self::$past_version = get_transient('lp_current_version');
83
+ self::$current_version = LANDINGPAGES_CURRENT_VERSION;
84
+ break;
85
+ case 'cta':
86
+ self::$past_version = get_transient('cta_current_version');
87
+ self::$current_version = WP_CTA_CURRENT_VERSION;
88
+ break;
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Alter pageview table from INT to VARCHARR
94
+ * @param $routines
95
+ */
96
+ public static function alter_page_views_table_1() {
97
+ global $wpdb;
98
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
99
+
100
+ $table_name = $wpdb->prefix . "inbound_page_views";
101
+
102
+ /* add ip field if does not exist */
103
+ $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{$table_name}' AND column_name = 'ip'" );
104
+ if(empty($row)){
105
+ $wpdb->get_results( "ALTER TABLE {$table_name} ADD `ip` VARCHAR(45) NOT NULL" );
106
+ }
107
+
108
+ /* alter ip field to fix bad field types */
109
+ $wpdb->get_results( "ALTER TABLE {$table_name} MODIFY COLUMN `ip` VARCHAR(45)" );
110
+
111
+ }
112
+
113
+ /**
114
+ * @migration-type: alter inbound_events table
115
+ * @mirgration: adds columns list_id funnel, and source to events table
116
+ */
117
+ public static function alter_events_table_1() {
118
+
119
+ global $wpdb;
120
+
121
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
122
+ $table_name = $wpdb->prefix . "inbound_events";
123
+
124
+ /* add columns funnel and source to legacy table */
125
+ $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{$table_name}' AND column_name = 'source'" );
126
+ if(empty($row)){
127
+ // do your stuff
128
+ $wpdb->get_results( "ALTER TABLE {$table_name} ADD `funnel` text NOT NULL" );
129
+ $wpdb->get_results( "ALTER TABLE {$table_name} ADD `source` text NOT NULL" );
130
+ }
131
+
132
+ /* add columns list_id inbound events table */
133
+ $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{$table_name}' AND column_name = 'list_id'" );
134
+ if(empty($row)){
135
+ $wpdb->get_results( "ALTER TABLE {$table_name} ADD `list_id` varchar(255) NOT NULL" );
136
+ }
137
+ }
138
+ }
139
+
140
+ /* hook upgrade routines into activation script */
141
+ add_action('inbound_shared_activate' , array( 'Inbound_Upgrade_Routines' , 'load') );
142
+
143
+ }
shared/classes/class.events.php CHANGED
@@ -43,10 +43,6 @@ class Inbound_Events {
43
/* Saves all all incoming POST data as meta pairs */
44
add_action('before_delete_post', array(__CLASS__, 'delete_related_events'));
45
46
- /* listen for Inbound Mailer send event and record to events table
47
- * I think we can pull this infromation directly from Mandril
48
- add_action('inbound_mandrill_send_event' , array( __CLASS__ , 'store_email_send'), 10 , 2);
49
- */
50
}
51
52
/**
@@ -117,6 +113,7 @@ class Inbound_Events {
117
`session_id` varchar(255) NOT NULL,
118
`source` text NOT NULL,
119
`datetime` datetime NOT NULL,
120
121
UNIQUE KEY id (id)
122
) $charset_collate;";
@@ -203,25 +200,6 @@ class Inbound_Events {
203
self::store_event($args);
204
}
205
206
- /**
207
- * Stores email send event into events table
208
- * @param $args
209
- */
210
- public static function store_email_send( $message , $send_at ) {
211
-
212
- $args = array(
213
- 'event_name' => 'inbound_email_send',
214
- 'email_id' => $message['metadata']['email_id'],
215
- 'variation_id' => $message['metadata']['variation_id'],
216
- 'lead_id' => $args['urlparams']['lead_id'],
217
- 'lead_uid' => ( isset($_COOKIE['wp_lead_uid']) ? $_COOKIE['wp_lead_uid'] : '' ),
218
- 'event_details' => json_encode($args['urlparams']),
219
- 'datetime' => $args['datetime'],
220
- 'form_id' => ''
221
- );
222
-
223
- self::store_event($args);
224
- }
225
226
/**
227
* Stores inbound email click event into events table
@@ -393,8 +371,7 @@ class Inbound_Events {
393
global $wpdb;
394
395
$table_name = $wpdb->prefix . "inbound_page_views";
396
- $timezone_format = 'Y-m-d G:i:s T';
397
- $wordpress_date_time = date_i18n($timezone_format);
398
399
$defaults = array(
400
'page_id' => '',
@@ -403,12 +380,17 @@ class Inbound_Events {
403
'lead_uid' => ( isset($_COOKIE['wp_lead_uid']) ? $_COOKIE['wp_lead_uid'] : '' ),
404
'session_id' => ( isset($_COOKIE['PHPSESSID']) ? $_COOKIE['PHPSESSID'] : session_id() ),
405
'datetime' => $wordpress_date_time,
406
- 'source' => ( isset($_COOKIE['inbound_referral_site']) ? $_COOKIE['inbound_referral_site'] : '' )
407
);
408
409
$args = array_merge( $defaults , $args );
410
411
412
/* unset non db ready keys */
413
foreach ($args as $key => $value) {
414
if (!isset($defaults[$key])) {
@@ -416,17 +398,12 @@ class Inbound_Events {
416
}
417
}
418
419
- /* add event to event table */
420
$wpdb->insert(
421
$table_name,
422
$args
423
);
424
425
- /* check error messages for broken tables */
426
- if (isset($wpdb->last_error)) {
427
- self::create_page_views_table();
428
- }
429
-
430
}
431
432
public static function delete_related_events( $post_id , $vid = 'all' ) {
@@ -532,6 +509,52 @@ class Inbound_Events {
532
return $results;
533
}
534
535
/**
536
* Get form submission events given conditions
537
*
@@ -563,7 +586,7 @@ class Inbound_Events {
563
$query .= 'AND variation_id = "'.$params['variation_id'].'" ';
564
}
565
566
- $query .= 'AND `event_name` LIKE "%form_submission" ORDER BY `datetime` DESC';
567
568
$results = $wpdb->get_results( $query , ARRAY_A );
569
@@ -573,12 +596,20 @@ class Inbound_Events {
573
/**
574
* Get page view events related to lead ID
575
*/
576
- public static function get_page_views( $lead_id ){
577
global $wpdb;
578
579
$table_name = $wpdb->prefix . "inbound_page_views";
580
581
- $query = 'SELECT * FROM '.$table_name.' WHERE `lead_id` = "'.$lead_id.'" ORDER BY `datetime` DESC';
582
$results = $wpdb->get_results( $query , ARRAY_A );
583
584
return $results;
@@ -593,20 +624,84 @@ class Inbound_Events {
593
594
$table_name = $wpdb->prefix . "inbound_page_views";
595
$query = 'SELECT * FROM '.$table_name.' WHERE ';
596
switch ($nature) {
597
case 'lead_id':
598
- $query .='`lead_id` = "'.$params['lead_id'].'"';
599
break;
600
case 'page_id':
601
- $query .='`page_id` = "'.$params['page_id'].'"';
602
break;
603
}
604
605
if (isset($params['start_date'])) {
606
- $query .= 'AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
607
- $query .= 'ORDER BY `datetime` DESC';
608
}
609
610
$results = $wpdb->get_results( $query , ARRAY_A );
611
612
return $results;
@@ -623,6 +718,8 @@ class Inbound_Events {
623
624
$query = 'SELECT count(*) FROM '.$table_name.' WHERE `lead_id` = "'.$lead_id.'"';
625
626
$count = $wpdb->get_var( $query , 0, 0 );
627
628
/* return null if nothing there */
@@ -665,7 +762,6 @@ class Inbound_Events {
665
666
$query .='GROUP BY lead_uid';
667
668
-
669
$results = $wpdb->get_results( $query , ARRAY_A );
670
671
/* return null if nothing there */
@@ -674,16 +770,207 @@ class Inbound_Events {
674
}
675
676
677
678
/**
679
- * Get all cta click events related to lead ID
680
*/
681
- public static function get_events(){
682
global $wpdb;
683
684
$table_name = $wpdb->prefix . "inbound_events";
685
686
- $query = 'SELECT DISTINCT(event_name) FROM '.$table_name.' ORDER BY `event_name` DESC';
687
$results = $wpdb->get_results( $query , ARRAY_A );
688
689
return $results;
@@ -706,6 +993,47 @@ class Inbound_Events {
706
707
}
708
709
/**
710
* Get all cta click events related to lead ID
711
*/
@@ -994,7 +1322,7 @@ class Inbound_Events {
994
* @param datetime $start_date
995
* @param datetime $end_date
996
*/
997
- public static function get_page_actions($page_id , $activity = 'any' , $start_date = null, $end_date = null ){
998
global $wpdb;
999
1000
$table_name = $wpdb->prefix . "inbound_events";
43
/* Saves all all incoming POST data as meta pairs */
44
add_action('before_delete_post', array(__CLASS__, 'delete_related_events'));
45
46
}
47
48
/**
113
`session_id` varchar(255) NOT NULL,
114
`source` text NOT NULL,
115
`datetime` datetime NOT NULL,
116
+ `ip` varchar(45) NOT NULL,
117
118
UNIQUE KEY id (id)
119
) $charset_collate;";
200
self::store_event($args);
201
}
202
203
204
/**
205
* Stores inbound email click event into events table
371
global $wpdb;
372
373
$table_name = $wpdb->prefix . "inbound_page_views";
374
+ $wordpress_date_time = date_i18n('Y-m-d G:i:s T');
375
376
$defaults = array(
377
'page_id' => '',
380
'lead_uid' => ( isset($_COOKIE['wp_lead_uid']) ? $_COOKIE['wp_lead_uid'] : '' ),
381
'session_id' => ( isset($_COOKIE['PHPSESSID']) ? $_COOKIE['PHPSESSID'] : session_id() ),
382
'datetime' => $wordpress_date_time,
383
+ 'source' => ( isset($_COOKIE['inbound_referral_site']) ? $_COOKIE['inbound_referral_site'] : '' ),
384
+ 'ip' => LeadStorage::lookup_ip_address()
385
);
386
387
$args = array_merge( $defaults , $args );
388
389
390
+ if (!$args['page_id']) {
391
+ return;
392
+ }
393
+
394
/* unset non db ready keys */
395
foreach ($args as $key => $value) {
396
if (!isset($defaults[$key])) {
398
}
399
}
400
401
+ /* add page view to inbound_page_views table */
402
$wpdb->insert(
403
$table_name,
404
$args
405
);
406
407
}
408
409
public static function delete_related_events( $post_id , $vid = 'all' ) {
509
return $results;
510
}
511
512
+ /**
513
+ * Determine information about point of event capture
514
+ * @param $event
515
+ * @return mixed
516
+ */
517
+ public static function get_event_capture_data( $event ) {
518
+ switch( $event['event_name'] ) {
519
+ case 'inbound_cta_click':
520
+ $link = admin_url('post.php?post='.$event['cta_id'].'&action=edit');
521
+ $title = get_the_title($event['cta_id']);
522
+ $capture_id = $event['cta_id'];
523
+ break;
524
+ case 'inbound_form_submission':
525
+ $link = admin_url('post.php?post='.$event['form_id'].'&action=edit');
526
+ $title = get_the_title($event['form_id']);
527
+ $capture_id = $event['form_id'];
528
+ break;
529
+ case 'cf7_form_submission':
530
+ $link = admin_url('post.php?page=wpcf7&post='.$event['form_id'].'&action=edit');
531
+ $title = get_the_title($event['form_id']);
532
+ $capture_id = $event['form_id'];
533
+ break;
534
+ case 'ninja_form_submission':
535
+ $link = admin_url('post.php?page=ninja-forms&form_id='.$event['form_id'].'&action=edit');
536
+ $title = get_the_title($event['form_id']);
537
+ $capture_id = $event['form_id'];
538
+ break;
539
+ case 'inbound_list_add':
540
+ $link = "";
541
+ $title = "";
542
+ $capture_id = "";
543
+ break;
544
+ case 'sparkpost_delivery':
545
+ $link = "";
546
+ $title = "";
547
+ $capture_id = "";
548
+ break;
549
+ }
550
+
551
+ $array['link'] = ($link) ? $link : '#';
552
+ $array['title'] = ($title) ? $title : __('n/a','inbound-pro');
553
+ $array['capture_id'] = ($capture_id) ? $capture_id : 0;
554
+
555
+ return apply_filters('inbound-events/capture-data' , $array , $event);
556
+ }
557
+
558
/**
559
* Get form submission events given conditions
560
*
586
$query .= 'AND variation_id = "'.$params['variation_id'].'" ';
587
}
588
589
+ $query .= 'AND `event_name` = "inbound_form_submission" ORDER BY `datetime` DESC';
590
591
$results = $wpdb->get_results( $query , ARRAY_A );
592
596
/**
597
* Get page view events related to lead ID
598
*/
599
+ public static function get_page_views( $lead_id , $lead_uid = 0 , $page_id = 0 ){
600
global $wpdb;
601
602
$table_name = $wpdb->prefix . "inbound_page_views";
603
604
+ $query = 'SELECT * FROM '.$table_name.' WHERE `lead_id` = "'.$lead_id.'"';
605
+
606
+ $query .=' AND `page_id` != "0"';
607
+
608
+ if ($page_id) {
609
+ $query .=' AND page_views_id` = "'.$page_id.'"';
610
+ }
611
+
612
+ $query .='ORDER BY `datetime` DESC';
613
$results = $wpdb->get_results( $query , ARRAY_A );
614
615
return $results;
624
625
$table_name = $wpdb->prefix . "inbound_page_views";
626
$query = 'SELECT * FROM '.$table_name.' WHERE ';
627
+
628
+
629
switch ($nature) {
630
case 'lead_id':
631
+ $query .=' `lead_id` = "'.$params['lead_id'].'" ';
632
+ break;
633
+ case 'lead_uid':
634
+ $query .=' `lead_uid` = "'.$params['lead_uid'].'" ';
635
break;
636
case 'page_id':
637
+ $query .=' `page_id` = "'.$params['page_id'].'" ';
638
+ break;
639
+ case 'mixed':
640
+ if (isset($params['lead_id']) && $params['lead_id'] ) {
641
+ $queries[] = ' `lead_id` = "'.$params['lead_id'].'" ';
642
+ }
643
+ if (isset($params['lead_uid']) && $params['lead_uid']) {
644
+ $queries[] = ' `lead_uid` = "'.$params['lead_uid'].'" ';
645
+ }
646
+ if (isset($params['page_id']) && $params['page_id']) {
647
+ $queries[] = ' `page_id` = "'.$params['page_id'].'" ';
648
+ }
649
+
650
+ /* combine queries into a usable string */
651
+ foreach ($queries as $i => $q) {
652
+ $query .= $q . ( isset($queries[$i+1]) ? ' AND ' : '' );
653
+ }
654
+
655
break;
656
}
657
658
+
659
+ $query .=' AND `page_id` != "0" ';
660
+
661
if (isset($params['start_date'])) {
662
+ $query .= ' AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
663
+ }
664
+
665
+ if (isset($params['group_by'])) {
666
+ $query .= ' GROUP BY `'.$params['group_by'].'` ';
667
}
668
669
+ $query .= ' ORDER BY `datetime` DESC';
670
+ //print_r($query);exit;
671
+ $results = $wpdb->get_results( $query , ARRAY_A );
672
+
673
+ return $results;
674
+ }
675
+
676
+
677
+
678
+ /**
679
+ * Get page view events given conditions
680
+ *
681
+ */
682
+ public static function get_page_views_by_dates( $params ){
683
+ global $wpdb;
684
+
685
+ $params['group_by'] = (isset($params['group_by'])) ? $params['group_by'] : 'lead_uid';
686
+ $params['order_by'] = (isset($params['order_by'])) ? $params['order_by'] : 'datetime DESC';
687
+
688
+ $table_name = $wpdb->prefix . "inbound_page_views";
689
+
690
+ $query = 'SELECT *, count(*) as impressions, count(date(datetime)) as impressions_per_day, date(datetime) as date FROM '.$table_name.' WHERE `page_id` = "'.$params['page_id'].'"';
691
+
692
+
693
+ if (isset($params['source']) && $params['source'] ) {
694
+ $query .= ' AND source = "'.$params['source'].'" ';
695
+ }
696
+
697
+ $query .=' AND `page_id` != "0" ';
698
+
699
+ if (isset($params['start_date'])) {
700
+ $query .= ' AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
701
+ }
702
+
703
+ $query .= 'GROUP BY DATE(datetime)';
704
+
705
$results = $wpdb->get_results( $query , ARRAY_A );
706
707
return $results;
718
719
$query = 'SELECT count(*) FROM '.$table_name.' WHERE `lead_id` = "'.$lead_id.'"';
720
721
+ $query .=' AND `page_id` != "0" ';
722
+
723
$count = $wpdb->get_var( $query , 0, 0 );
724
725
/* return null if nothing there */
762
763
$query .='GROUP BY lead_uid';
764
765
$results = $wpdb->get_results( $query , ARRAY_A );
766
767
/* return null if nothing there */
770
}
771
772
773
+ /**
774
+ * Get page view events given conditions
775
+ *
776
+ */
777
+ public static function get_visitors( $params ){
778
+ global $wpdb;
779
+
780
+ $params['group_by'] = (isset($params['group_by'])) ? $params['group_by'] : 'lead_uid';
781
+ $params['order_by'] = (isset($params['order_by'])) ? $params['order_by'] : 'datetime DESC';
782
+
783
+ $table_name = $wpdb->prefix . "inbound_page_views";
784
+ $query = 'SELECT *, count('.$params['group_by'].') as count FROM '.$table_name.' WHERE `page_id` = "'.$params['page_id'].'"';
785
+
786
+ if (isset($params['source']) && $params['source'] ) {
787
+ $query .= ' AND source = "'.$params['source'].'" ';
788
+ }
789
+
790
+ if (isset($params['start_date'])) {
791
+ $query .= ' AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
792
+ }
793
+
794
+ $query .= ' GROUP BY `'.$params['group_by'].'` ';
795
+
796
+ if (isset($params['order_by'])) {
797
+ $query .= ' ORDER BY '.$params['order_by'].' ';
798
+ }
799
+
800
+ if (isset($params['limit'])) {
801
+ $query .= ' LIMIT '.$params['limit'];;
802
+ }
803
+
804
+ $results = $wpdb->get_results( $query , ARRAY_A );
805
+
806
+ return $results;
807
+ }
808
809
/**
810
+ * Get page view events given conditions
811
+ *
812
+ */
813
+ public static function get_visitors_by_dates( $params ){
814
+ global $wpdb;
815
+
816
+ $params['group_by'] = (isset($params['group_by'])) ? $params['group_by'] : 'lead_uid';
817
+ $params['order_by'] = (isset($params['order_by'])) ? $params['order_by'] : 'datetime DESC';
818
+
819
+ $table_name = $wpdb->prefix . "inbound_page_views";
820
+ $query = 'SELECT count(date(datetime)) as visits_per_day, date(datetime) as date , sum(visits) as visitors FROM ( ';
821
+
822
+ $query .= ' SELECT *, count('.$params['group_by'].') as visits FROM '.$table_name.' WHERE `page_id` = "'.$params['page_id'].'"';
823
+
824
+
825
+ if (isset($params['source']) && $params['source'] ) {
826
+ $query .= ' AND source = "'.$params['source'].'" ';
827
+ }
828
+
829
+ if (isset($params['start_date'])) {
830
+ $query .= ' AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
831
+ }
832
+
833
+ $query .= ' GROUP BY '.$params['group_by'].' ';
834
+
835
+
836
+ $query .= ') AS concat_date GROUP BY DATE(datetime)';
837
+
838
+ $results = $wpdb->get_results( $query , ARRAY_A );
839
+
840
+ return $results;
841
+ }
842
+
843
+ /**
844
+ * Get page view events given conditions
845
+ *
846
*/
847
+ public static function get_visitors_group_by_source( $params ){
848
global $wpdb;
849
850
+ $table_name = $wpdb->prefix . "inbound_page_views";
851
+ $query = 'SELECT * , count(source) as visitors, sum(page_views) as page_views_total FROM ( ';
852
+
853
+ $query .= ' SELECT *, count(lead_uid) as page_views FROM '.$table_name.' WHERE `page_id` = "'.$params['page_id'].'"';
854
+
855
+ if (isset($params['source']) && $params['source'] ) {
856
+ $query .= ' AND source = "'.$params['source'].'" ';
857
+ }
858
+
859
+ if (isset($params['start_date'])) {
860
+ $query .= ' AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
861
+ }
862
+
863
+ $query .= ' GROUP BY lead_uid ';
864
+
865
+ $query .= ') AS s1 GROUP BY source';
866
+
867
+ $query .= ' ORDER BY visitors DESC, page_views DESC ';
868
+
869
+ if (isset($params['limit'])) {
870
+ $query .= ' LIMIT '.$params['limit'];;
871
+ }
872
+
873
+ $results = $wpdb->get_results( $query , ARRAY_A );
874
+
875
+ return $results;
876
+ }
877
+
878
+
879
+ /**
880
+ * Get events given parameters
881
+ *
882
+ */
883
+ public static function get_events( $params ){
884
+ global $wpdb;
885
+
886
+ $params['order_by'] = (isset($params['order_by'])) ? $params['order_by'] : 'datetime DESC';
887
+
888
$table_name = $wpdb->prefix . "inbound_events";
889
+ $query = 'SELECT *';
890
+
891
+ if (isset($params['group_by']) && $params['group_by'] ) {
892
+ $query .=' , count('.$params['group_by'].') as count ';
893
+ }
894
+
895
+ $query .=' FROM '.$table_name.' WHERE 1=1 ';
896
+
897
+ if (isset($params['page_id']) && $params['page_id'] ) {
898
+ $query .= ' AND page_id = "'.$params['page_id'].'" ';
899
+ }
900
+
901
+ if (isset($params['event_name']) && $params['event_name'] ) {
902
+ $query .= ' AND event_name = "'.$params['event_name'].'" ';
903
+ }
904
+
905
+ if (isset($params['source']) && $params['source'] ) {
906
+ $query .= ' AND source = "'.$params['source'].'" ';
907
+ }
908
+
909
+ if (isset($params['lead_id']) && $params['lead_id'] ) {
910
+ $query .= ' AND lead_id = "'.$params['lead_id'].'" ';
911
+ }
912
+
913
+ if (isset($params['start_date']) && $params['start_date']) {
914
+ $query .= ' AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
915
+ }
916
+
917
+ if (isset($params['group_by']) && $params['group_by']) {
918
+ $query .= ' GROUP BY `' . $params['group_by'] . '` ';
919
+ }
920
921
+ if (isset($params['order_by']) && $params['order_by']) {
922
+ $query .= ' ORDER BY '.$params['order_by'].' ';
923
+ }
924
+
925
+ if (isset($params['limit'])) {
926
+ $query .= ' LIMIT '.$params['limit'];;
927
+ }
928
+
929
+ $results = $wpdb->get_results( $query , ARRAY_A );
930
+
931
+ return $results;
932
+ }
933
+
934
+ /**
935
+ * Returns a label for an event given an event_name
936
+ */
937
+ public static function get_event_label( $event_name , $plural = true) {
938
+ switch($event_name) {
939
+ case 'inbound_form_submission':
940
+ return ($plural) ? __('Inbound Form Submissions' , 'inbound-pro') : __('Inbound Form Submission' , 'inbound-pro');
941
+ break;
942
+ case 'inbound_cta_click':
943
+ return ($plural) ? __('CTA Clicks' , 'inbound-pro') : __('CTA Click' , 'inbound-pro');
944
+ break;
945
+ case 'inbound_direct_messege':
946
+ return ($plural) ? __('Direct Messages' , 'inbound-pro') : __('Direct Message' , 'inbound-pro');
947
+ break;
948
+ case 'inbound_list_add':
949
+ return ($plural) ? __('Lead Added to Lists' , 'inbound-pro') : __('Lead Added to List' , 'inbound-pro');
950
+ break;
951
+ case 'sparkpost_delivery':
952
+ return ($plural) ? __('SparkPost Deliveries' , 'inbound-pro') : __('SparkPost Delivery' , 'inbound-pro');
953
+ break;
954
+ }
955
+
956
+ return apply_filters('inbound-events/event-label' , $event_name , $plural );
957
+ }
958
+
959
+ /**
960
+ * Get all possible event names
961
+ */
962
+ public static function get_event_names( $params = array() ){
963
+ global $wpdb;
964
+
965
+ $table_name = $wpdb->prefix . "inbound_events";
966
+
967
+ $query = 'SELECT DISTINCT(event_name) FROM '.$table_name;
968
+
969
+ if (isset($params['page_id']) && $params['page_id']) {
970
+ $query .= ' WHERE `page_id` = "'.$params['page_id'].'" ';
971
+ }
972
+
973
+ $query .= ' ORDER BY `event_name` DESC ';
974
$results = $wpdb->get_results( $query , ARRAY_A );
975
976
return $results;
993
994
}
995
996
+ /**
997
+ * Get page view events given conditions
998
+ *
999
+ */
1000
+ public static function get_events_by_dates( $params ){
1001
+ global $wpdb;
1002
+
1003
+ $params['group_by'] = (isset($params['group_by'])) ? $params['group_by'] : 'event_name';
1004
+ $params['order_by'] = (isset($params['order_by'])) ? $params['order_by'] : 'datetime DESC';
1005
+
1006
+ $table_name = $wpdb->prefix . "inbound_events";
1007
+ $query = 'SELECT date(datetime) as date , sum(events) as events_count FROM ( ';
1008
+
1009
+ $query .= ' SELECT *, count('.$params['group_by'].') as events FROM '.$table_name.' WHERE `page_id` = "'.$params['page_id'].'"';
1010
+
1011
+ if (isset($params['event_name']) && $params['event_name'] ) {
1012
+ $query .= ' AND event_name = "'.$params['event_name'].'" ';
1013
+ }
1014
+
1015
+ if (isset($params['source']) && $params['source'] ) {
1016
+ $query .= ' AND source = "'.$params['source'].'" ';
1017
+ }
1018
+
1019
+ if (isset($params['lead_id']) && $params['lead_id'] ) {
1020
+ $query .= ' AND lead_id = "'.$params['lead_id'].'" ';
1021
+ }
1022
+
1023
+ if (isset($params['start_date'])) {
1024
+ $query .= ' AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
1025
+ }
1026
+
1027
+ $query .= ' GROUP BY '.$params['group_by'].' ';
1028
+
1029
+
1030
+ $query .= ') AS concat_date GROUP BY DATE(datetime)';
1031
+
1032
+ $results = $wpdb->get_results( $query , ARRAY_A );
1033
+
1034
+ return $results;
1035
+ }
1036
+
1037
/**
1038
* Get all cta click events related to lead ID
1039
*/
1322
* @param datetime $start_date
1323
* @param datetime $end_date
1324
*/
1325
+ public static function get_page_actions_count($page_id , $activity = 'any' , $start_date = null, $end_date = null ){
1326
global $wpdb;
1327
1328
$table_name = $wpdb->prefix . "inbound_events";
shared/classes/class.form.php CHANGED
@@ -551,7 +551,7 @@ if (!class_exists('Inbound_Forms')) {
551
/* TODO remove this */
552
?>
553
<script type="text/javascript">
554
- _inbound.add_action( 'form_before_submission', inbound_additional_checks, 10);
555
556
function inbound_additional_checks( data ) {
557
/* make sure event is defined */
@@ -560,14 +560,17 @@ if (!class_exists('Inbound_Forms')) {
560
event.target = data.event;
561
}
562
563
- /* added below condition for check any of checkbox checked or not by kirit dholakiya */
564
- if( jQuery('.checkbox-required')[0] && jQuery('.checkbox-required input[type=checkbox]:checked').length==0) {
565
- jQuery('.checkbox-required input[type=checkbox]:first').focus();
566
alert("<?php _e('Oops! Looks like you have not filled out all of the required fields!', 'inbound-pro') ; ?> ");
567
- throw new Error('<?php _e('Oops! Looks like you have not filled out all of the required fields!', 'inbound-pro') ; ?>');
568
}
569
570
- jQuery(this).find("input").each(function(){
571
if(!jQuery(this).prop("required")){
572
} else if (!jQuery(this).val()) {
573
alert("<?php _e('Oops! Looks like you have not filled out all of the required fields!', 'inbound-pro'); ?>");
@@ -795,6 +798,13 @@ if (!class_exists('Inbound_Forms')) {
795
*/
796
public static function send_conversion_admin_notification($form_post_data, $form_meta_data) {
797
798
if ($template = self::get_new_lead_email_template()) {
799
800
add_filter('wp_mail_content_type', 'inbound_set_html_content_type');
@@ -909,25 +919,7 @@ if (!class_exists('Inbound_Forms')) {
909
}
910
911
/* Get Lead Email Address */
912
- $lead_email = false;
913
- foreach ($form_post_data as $key => $value) {
914
- if (preg_match('/email|e-mail/i', $key)) {
915
- $lead_email = $form_post_data[$key];
916
- }
917
- }
918
-
919
- /* Redundancy */
920
- if (!$lead_email) {
921
- if (isset($form_post_data['email'])) {
922
- $lead_email = $form_post_data['email'];
923
- } else if (isset($form_post_data['e-mail'])) {
924
- $lead_email = $form_post_data['e-mail'];
925
- } else if (isset($form_post_data['wpleads_email_address'])) {
926
- $lead_email = $form_post_data['wpleads_email_address'];
927
- } else {
928
- $lead_email = 'null map email field';
929
- }
930
- }
931
932
if (!$lead_email) {
933
return;
@@ -977,8 +969,37 @@ if (!class_exists('Inbound_Forms')) {
977
978
}
979
980
/**
981
* Get Email Template for New Lead Notification
982
*/
983
static function get_new_lead_email_template() {
984
@@ -1098,7 +1119,7 @@ if (!class_exists('Inbound_Forms')) {
1098
<w:anchorlock/>
1099
<center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">' . __('View Lead', 'inbound-pro') . '</center>
1100
</v:roundrect>
1101
- <![endif]--><a href="{{admin-url}}edit.php?post_type=wp-lead&s={{lead-email-address}}"
1102
style="background-color:#3A9FD1;border:1px solid #7490af;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:250px;-webkit-text-size-adjust:none;mso-hide:all;" title="' . __('View the full Lead details in WordPress', 'inbound-pro') . '">' . __('View Full Lead Details', 'inbound-pro') . '</a>
1103
</div>
1104