395 changes: 212 additions & 183 deletions css/admin-landing-page-list.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions landing-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Landing Pages
Plugin URI: http://www.inboundnow.com/landing-pages/
Description: The first true all-in-one Landing Page solution for WordPress, including ongoing conversion metrics, a/b split testing, unlimited design options and so much more!
Version: 1.8.6
Version: 1.8.8
Author: Inbound Now
Author URI: http://www.inboundnow.com/
Text Domain: landing-pages
Expand Down Expand Up @@ -38,7 +38,7 @@ public function __construct() {
*/
private static function load_constants() {

define('LANDINGPAGES_CURRENT_VERSION', '1.8.6' );
define('LANDINGPAGES_CURRENT_VERSION', '1.8.8' );
define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
define('LANDINGPAGES_PLUGIN_SLUG', plugin_basename( dirname(__FILE__) ) );
Expand Down
1,464 changes: 732 additions & 732 deletions modules/module.ab-testing.php

Large diffs are not rendered by default.

134 changes: 71 additions & 63 deletions modules/module.install.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,86 @@
// Added Demo Landing on Install
add_action('admin_init', 'inbound_create_default_post_type');
function inbound_create_default_post_type(){

$current_user = wp_get_current_user();


$lp_default_options = get_option( 'lp_settings_general' );

if ( isset( $lp_default_options["default_landing_page"] ) ) {
return $lp_default_options["default_landing_page"];
}

$default_lander = wp_insert_post(
array(
'post_title' => __( 'A/B Testing Landing Page Example' , 'landing-pages'),
'post_content' => __( '<p>This is the first paragraph of your landing page where you want to draw the viewers in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>' , 'landing-pages'),
'post_status' => 'publish',
'post_author' => $current_user->ID,
'post_type' => 'landing-page',
'comment_status' => 'closed'
)
);
return inbound_install_example_lander();
}

/**
* Install example landing page and return landing page id
*/
function inbound_install_example_lander() {


$landing_page_id = wp_insert_post(
array(
'post_title' => __( 'A/B Testing Landing Page Example' , 'landing-pages'),
'post_content' => __( '<p>This is the first paragraph of your landing page where you want to draw the viewers in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>' , 'post'),
'post_status' => 'publish',
'post_type' => 'landing-page',
'comment_status' => 'closed'
)
);


// Variation A
add_post_meta($default_lander, 'lp-main-headline', __( 'Main Catchy Headline (A)' , 'landing-pages') );
add_post_meta($default_lander, 'lp-selected-template', 'svtle');
add_post_meta($default_lander, 'svtle-conversion-area-content', '<h2>'.__( 'Form a' , 'landing-pages') .'</h2>[inbound_forms id="default_1" name="First, Last, Email Form"]' );
add_post_meta($default_lander, 'svtle-main-content', __( '<p>This is the first paragraph of your landing page where you want to draw the viewers in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>' , 'landing-pages') );
add_post_meta($landing_page_id, 'lp-main-headline', __( 'Main Catchy Headline (A)' , 'landing-pages') );
add_post_meta($landing_page_id, 'lp-selected-template', 'svtle');
add_post_meta($landing_page_id, 'svtle-conversion-area-content', '<h2>'.__( 'Form a' , 'landing-pages') .'</h2>[inbound_forms id="default_1" name="First, Last, Email Form"]' );
add_post_meta($landing_page_id, 'svtle-main-content', __( '<p>This is the first paragraph of your landing page where you want to draw the viewers in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>' , 'landing-pages') );

// variation B
add_post_meta($default_lander, 'lp-main-headline-1', __('Main Catchy Headline Two (B)' , 'landing-pages') );
add_post_meta($default_lander, 'lp-selected-template-1', 'svtle');
add_post_meta($default_lander, 'svtle-conversion-area-content-1', '<h2>'.__( 'Form B' , 'landing-pages') .'</h2>[inbound_forms id="default_1" name="First, Last, Email Form"]');
add_post_meta($default_lander, 'svtle-main-content-1', '<p>(Version B) This is the first paragraph of your landing page where you want to draw the viewers in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>');
add_post_meta($landing_page_id, 'lp-main-headline-1', __('Main Catchy Headline Two (B)' , 'landing-pages') );
add_post_meta($landing_page_id, 'lp-selected-template-1', 'svtle');
add_post_meta($landing_page_id, 'svtle-conversion-area-content-1', '<h2>'.__( 'Form B' , 'landing-pages') .'</h2>[inbound_forms id="default_1" name="First, Last, Email Form"]');
add_post_meta($landing_page_id, 'svtle-main-content-1', '<p>(Version B) This is the first paragraph of your landing page where you want to draw the viewers in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>');

// Add A/B Testing meta
add_post_meta($default_lander, 'lp-ab-variations', '0,1');
add_post_meta($default_lander, 'lp-ab-variation-impressions-0', 30);
add_post_meta($default_lander, 'lp-ab-variation-impressions-1', 35);
add_post_meta($default_lander, 'lp-ab-variation-conversions-0', 10);
add_post_meta($default_lander, 'lp-ab-variation-conversions-1', 15);
add_post_meta($landing_page_id, 'lp-ab-variations', '0,1');
add_post_meta($landing_page_id, 'lp-ab-variation-impressions-0', 30);
add_post_meta($landing_page_id, 'lp-ab-variation-impressions-1', 35);
add_post_meta($landing_page_id, 'lp-ab-variation-conversions-0', 10);
add_post_meta($landing_page_id, 'lp-ab-variation-conversions-1', 15);

// Add template meta A
add_post_meta($default_lander, 'svtle-submit-button-color', '5baa1e');
add_post_meta($default_lander, 'svtle-display-social', '0');
add_post_meta($default_lander, 'svtle-logo', '/wp-content/plugins/landing-pages/templates/svtle/assets/images/inbound-logo.png');
add_post_meta($default_lander, 'svtle-body-color', 'ffffff');
add_post_meta($default_lander, 'svtle-sidebar', 'left');
add_post_meta($default_lander, 'svtle-page-text-color', '4d4d4d');
add_post_meta($default_lander, 'svtle-sidebar-color', 'ffffff');
add_post_meta($default_lander, 'svtle-sidebar-text-color', '000000');
add_post_meta($default_lander, 'svtle-header-color', 'ffffff');
add_post_meta($landing_page_id, 'svtle-submit-button-color', '5baa1e');
add_post_meta($landing_page_id, 'svtle-display-social', '0');
add_post_meta($landing_page_id, 'svtle-logo', '/wp-content/plugins/landing-pages/templates/svtle/assets/images/inbound-logo.png');
add_post_meta($landing_page_id, 'svtle-body-color', 'ffffff');
add_post_meta($landing_page_id, 'svtle-sidebar', 'left');
add_post_meta($landing_page_id, 'svtle-page-text-color', '4d4d4d');
add_post_meta($landing_page_id, 'svtle-sidebar-color', 'ffffff');
add_post_meta($landing_page_id, 'svtle-sidebar-text-color', '000000');
add_post_meta($landing_page_id, 'svtle-header-color', 'ffffff');

// Add template meta B
add_post_meta($default_lander, 'svtle-submit-button-color-1', 'ff0c00');
add_post_meta($default_lander, 'svtle-display-social-1', '0');
add_post_meta($default_lander, 'svtle-logo-1', '/wp-content/plugins/landing-pages/templates/svtle/assets/images/inbound-logo.png');
add_post_meta($default_lander, 'svtle-body-color-1', '51b0ef');
add_post_meta($default_lander, 'svtle-sidebar-1', 'left');
add_post_meta($default_lander, 'svtle-page-text-color-1', '000000');
add_post_meta($default_lander, 'svtle-sidebar-color-1', '51b0ef');
add_post_meta($default_lander, 'svtle-sidebar-text-color-1', '000000');
add_post_meta($default_lander, 'svtle-header-color-1', '51b0ef');
add_post_meta($landing_page_id, 'svtle-submit-button-color-1', 'ff0c00');
add_post_meta($landing_page_id, 'svtle-display-social-1', '0');
add_post_meta($landing_page_id, 'svtle-logo-1', '/wp-content/plugins/landing-pages/templates/svtle/assets/images/inbound-logo.png');
add_post_meta($landing_page_id, 'svtle-body-color-1', '51b0ef');
add_post_meta($landing_page_id, 'svtle-sidebar-1', 'left');
add_post_meta($landing_page_id, 'svtle-page-text-color-1', '000000');
add_post_meta($landing_page_id, 'svtle-sidebar-color-1', '51b0ef');
add_post_meta($landing_page_id, 'svtle-sidebar-text-color-1', '000000');
add_post_meta($landing_page_id, 'svtle-header-color-1', '51b0ef');


// Store our page IDs
$options = array(
"default_landing_page" => $default_lander
"default_landing_page" => $landing_page_id
);

update_option( "lp_settings_general", $options );

update_option( "lp_settings_general" , $options );

return $default_lander;
return $landing_page_id;
}

/**
* Debug Activation errors */
//update_option('plugin_error', ''); //clear
Expand Down Expand Up @@ -113,28 +121,28 @@ function lp_install_register_required_plugins() {
$plugins = array(

// This is an example of how to include a plugin pre-packaged with a theme
/* array(
'name' => 'TGM Example Plugin', // The plugin name
'slug' => 'tgm-example-plugin', // The plugin slug (typically the folder name)
'source' => get_stylesheet_directory() . '/lib/plugins/tgm-example-plugin.zip', // The plugin source
'required' => true, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
), */
/* array(
'name' => 'TGM Example Plugin', // The plugin name
'slug' => 'tgm-example-plugin', // The plugin slug (typically the folder name)
'source' => get_stylesheet_directory() . '/lib/plugins/tgm-example-plugin.zip', // The plugin source
'required' => true, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
), */

// This is an example of how to include a plugin from the WordPress Plugin Repository
array(
'name' => __('WordPress Leads' , 'landing-pages') .' <span class=\'inbound-install-notice\'> - '. __('This <b>free</b> landing page addon will give you the ability to track and manage incoming web leads. Gather advanced Lead Intelligence and close more deals.' , 'landing-pages') .' <a class=\'inbound-install-notice-links\' href=\'http://wordpress.org/plugins/leads/\'> '. __('Learn more about WordPress Leads' , 'landing-pages') .'</a></span>',
'slug' => 'leads',
'required' => false,
),
array(
'name' => __('WordPress Calls to Action' , 'landing-pages') .' <span class=\'inbound-install-notice\'> - '. __('This <b>free</b> landing page addon will drive more traffic into your Landing Pages with Targeted Calls to Action in your sites sidebars & content. Create popups to capture visitor attention and convert more leads.' , 'landing-pages') . ' <a class=\'inbound-install-notice-links\' href=\'http://wordpress.org/plugins/cta/\'> ' . __('Learn more about WordPress Calls to Action' , 'landing-pages') . '</a></span>',
'slug' => 'cta',
'required' => false,
),
array(
'name' => __('WordPress Calls to Action' , 'landing-pages') .' <span class=\'inbound-install-notice\'> - '. __('This <b>free</b> landing page addon will drive more traffic into your Landing Pages with Targeted Calls to Action in your sites sidebars & content. Create popups to capture visitor attention and convert more leads.' , 'landing-pages') . ' <a class=\'inbound-install-notice-links\' href=\'http://wordpress.org/plugins/cta/\'> ' . __('Learn more about WordPress Calls to Action' , 'landing-pages') . '</a></span>',
'slug' => 'cta',
'required' => false,
),

);

Expand Down Expand Up @@ -175,7 +183,7 @@ function lp_install_register_required_plugins() {
'return' => __( 'Return to Required Plugins Installer', $theme_text_domain ),
'plugin_activated' => __( 'Plugin activated successfully.', $theme_text_domain ),
'complete' => __( 'All plugins installed and activated successfully. %s', $theme_text_domain ),
// %1$s = dashboard link
// %1$s = dashboard link
)
);

Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<phpunit bootstrap="tests/travis-ci/bootstrap.php" backupGlobals="false" colors="true">
<phpunit bootstrap="tests/phpunit/bootstrap.php" backupGlobals="false" colors="true">
<testsuites>
<!-- Default test suite to run all tests -->
<testsuite>
<directory prefix="test." suffix=".php">tests/travis-ci/</directory>
<directory prefix="test." suffix=".php">tests/phpunit/</directory>
</testsuite>
</testsuites>
</phpunit>
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
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
Requires at least: 3.8
Tested up to: 4.2
Stable Tag: 1.8.6
Stable Tag: 1.8.8

Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.

Expand Down Expand Up @@ -72,6 +72,9 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
4. Choose from a ton of pre-made templates, use your existing design, or design your own theme!

== Changelog ==
= 1.8.8 =
* Security Patch for XSS in firefox

= 1.8.6 =
* Security Patch

Expand Down
208 changes: 123 additions & 85 deletions shared/assets/css/admin/global-inbound-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,152 +3,190 @@
#wpadminbar.nojs .ab-top-menu > li.menupop.inbound-nav-marketing > .ab-item,
#wpadminbar .ab-top-menu > li.menupop.inbound-nav-marketing > .ab-item, #inboundnow-media-button {

background-image: url('../../images/global/shortcodes-blue.png');
background-image: url('../../images/global/shortcodes-blue.png');

background-repeat: no-repeat;
background-position: 0.15em 50%;
padding-left: 22px;
background-repeat: no-repeat;
background-position: 0.15em 50%;
padding-left: 22px;
}

#inboundnow-media-button {
padding-left: 5px;
padding-left: 5px;
}
.inbound-nav-marketing div:first-of-type{
color:rgba(240,245,250,1);

.inbound-nav-marketing div:first-of-type {
color: rgba(240, 245, 250, 1);
}

body #calls-to-action .toggle .switch-versions, body #landing-pages .toggle .switch-versions, body #leads .toggle .switch-versions {
display: none;
display: none;
}
.switch-versions, .switch-versions {

.switch-versions, .switch-versions {

}

#wp-admin-bar-ddw-edd-languages-de > .ab-item:before,
#wp-admin-bar-ddw-edd-translations-forum > .ab-item:before {
color: #ff9900;
content: '• ';
color: #ff9900;
content: '• ';
}

#wpadminbar .inbound-search-input {
width: 140px;
width: 140px;
}

#wp-admin-bar-ddw-edd-inboundsupportsections .ab-item,
#wp-admin-bar-ddw-edd-inbounddocsquick .ab-item,
#wp-admin-bar-ddw-edd-inbounddocssections .ab-item,
#wpadminbar .inbound-search-input,
#wpadminbar .inbound-search-go {
color: #21759b !important;
text-shadow: none;
color: #21759b !important;
text-shadow: none;
}

#wpadminbar .inbound-search-input,
#wpadminbar .inbound-search-go {
background-color: #fff;
height: 18px;
line-height: 18px;
padding: 1px 4px;
background-color: #fff;
height: 18px;
line-height: 18px;
padding: 1px 4px;
}

#wpadminbar .inbound-search-go {
-webkit-border-radius: 11px;
-moz-border-radius: 11px;
border-radius: 11px;
font-size: 0.67em;
margin: 0 0 0 2px;
-webkit-border-radius: 11px;
-moz-border-radius: 11px;
border-radius: 11px;
font-size: 0.67em;
margin: 0 0 0 2px;
}

@font-face {
font-family: 'FontAwesome';
src: url('../../fonts/fontawesome/fontawesome-webfont.eot');
src: url('../../fonts/fontawesome/fontawesome-webfont.eot') format('embedded-opentype'),
url('../../fonts/fontawesome/fontawesome-webfont.woff?v=3.0.2') format('woff'),
url('../../fonts/fontawesome/fontawesome-webfont.ttf?v=3.0.2') format('truetype');
font-weight: normal;
font-style: normal;
font-family: 'FontAwesome';
src: url('../../fonts/fontawesome/fontawesome-webfont.eot');
src: url('../../fonts/fontawesome/fontawesome-webfont.eot') format('embedded-opentype'),
url('../../fonts/fontawesome/fontawesome-webfont.woff?v=3.0.2') format('woff'),
url('../../fonts/fontawesome/fontawesome-webfont.ttf?v=3.0.2') format('truetype');
font-weight: normal;
font-style: normal;
}

#adminmenu .menu-icon-wp-lead div.wp-menu-image:before {
font-family: "FontAwesome" !important;
content: "\f0c0";
font-family: "FontAwesome" !important;
content: "\f0c0";

}

.branch-3-7 #adminmenu .menu-icon-wp-lead div.wp-menu-image:before {
display: none;
display: none;
}
#adminmenu .menu-icon-wp-lead div.wp-menu-image img{
display: none;

#adminmenu .menu-icon-wp-lead div.wp-menu-image img {
display: none;
}

.branch-3-7 #adminmenu .menu-icon-wp-lead div.wp-menu-image img {
display: block;
display: block;
}

#wp-admin-bar-inbound-cta a:first-child, #wp-admin-bar-inbound-templates .ab-item.ab-empty-item, #wp-admin-bar-inbound-settings .ab-item.ab-empty-item, #wp-admin-bar-inbound-analytics a:first-child {
padding-left: 30px !important;
padding-left: 30px !important;
}

#wp-admin-bar-inbound-templates .ab-item.ab-empty-item:hover, #wp-admin-bar-inbound-settings .ab-item.ab-empty-item:hover {
color: #2ea2cc;
color: #2ea2cc;
}

#wp-admin-bar-inbound-leads a:first-child, #wp-admin-bar-inbound-seo a:first-child, #wp-admin-bar-inbound-landingpages a:first-child, #wp-admin-bar-inbound-forms a:first-child {
padding-left: 31px !important;
padding-left: 31px !important;
}

#search-inbound-menu {
max-height: 22px !important;
padding: 0px !important;
min-height: 23px !important;
padding-left: 3px !important;
margin-bottom: 1px !important;
}
#wp-admin-bar-inbound-docs-searchform, #wp-admin-bar-inbound-leads-search{
margin-bottom: 10px !important;
}
#wp-admin-bar-inbound-cta .ab-submenu a, #wp-admin-bar-inbound-leads .ab-submenu a, #wp-admin-bar-inbound-landingpages .ab-submenu a , #wp-admin-bar-inbound-forms .ab-submenu a, #wp-admin-bar-inbound-templates .ab-submenu a, #wp-admin-bar-inbound-analytics .ab-submenu a, #wp-admin-bar-inbound-seo .ab-submenu a{
padding-left: 10px !important;
}
#wp-admin-bar-inbound-cta:before, #wp-admin-bar-inbound-leads:before, #wp-admin-bar-inbound-landingpages:before, #wp-admin-bar-inbound-forms:before, #wp-admin-bar-inbound-templates:before, #wp-admin-bar-inbound-settings:before, #wp-admin-bar-inbound-analytics:before, #wp-admin-bar-inbound-seo:before {
font-family: "FontAwesome" !important;
content: "\f05b" !important;
font: 100 19px/1 "FontAwesome" !important;
padding-top: 4px;
width: 30px;
display: inline-block;
height: 30px;
position: absolute;
left: 6px;
max-height: 22px !important;
padding: 0px !important;
min-height: 23px !important;
padding-left: 3px !important;
margin-bottom: 1px !important;
}

#wp-admin-bar-inbound-docs-searchform, #wp-admin-bar-inbound-leads-search {
margin-bottom: 10px !important;
}

#wp-admin-bar-inbound-cta .ab-submenu a, #wp-admin-bar-inbound-leads .ab-submenu a, #wp-admin-bar-inbound-landingpages .ab-submenu a, #wp-admin-bar-inbound-forms .ab-submenu a, #wp-admin-bar-inbound-templates .ab-submenu a, #wp-admin-bar-inbound-analytics .ab-submenu a, #wp-admin-bar-inbound-seo .ab-submenu a {
padding-left: 10px !important;
}

#wp-admin-bar-inbound-cta:before, #wp-admin-bar-inbound-leads:before, #wp-admin-bar-inbound-landingpages:before, #wp-admin-bar-inbound-forms:before, #wp-admin-bar-inbound-templates:before, #wp-admin-bar-inbound-settings:before, #wp-admin-bar-inbound-analytics:before, #wp-admin-bar-inbound-seo:before {
font-family: "FontAwesome" !important;
content: "\f05b" !important;
font: 100 19px/1 "FontAwesome" !important;
padding-top: 4px;
width: 30px;
display: inline-block;
height: 30px;
position: absolute;
left: 6px;
}

#wp-admin-bar-inbound-leads:before {
content: "\f0c0" !important;
font: 100 17px/1 "FontAwesome" !important;
content: "\f0c0" !important;
font: 100 17px/1 "FontAwesome" !important;
}

#wp-admin-bar-inbound-landingpages:before {
content: "\f15c" !important;
left: 7px;
font-size: 21px !important;
}
content: "\f15c" !important;
left: 7px;
font-size: 21px !important;
}

#wp-admin-bar-inbound-forms:before {
font: 400 18px/1 dashicons!important;
font: 400 18px/1 dashicons !important;
content: "\f163" !important;
}
}

#wp-admin-bar-inbound-templates:before {
content: "\f0c5" !important;
font-size: 18px !important;
}
}

#wp-admin-bar-inbound-settings:before {
content: "\f013" !important;
left: 7px !important;
content: "\f013" !important;
left: 7px !important;
}

#wp-admin-bar-inbound-analytics:before {
content: "\f012" !important;
font-size: 17px !important;
content: "\f012" !important;
font-size: 17px !important;
}

#wp-admin-bar-inbound-seo:before {
content: "\f002" !important;
font-size: 17px !important;
content: "\f002" !important;
font-size: 17px !important;
}

#wp-admin-bar-inbound-cta a {
vertical-align: top;
vertical-align: top;
}

#adminmenu .menu-icon-wp-call-to-action div.wp-menu-image:before {
font-family: "FontAwesome" !important;
content: "\f05b";
font: 400 24px/1 "FontAwesome" !important;
padding-top: 6px;
font-family: "FontAwesome" !important;
content: "\f05b";
font: 400 24px/1 "FontAwesome" !important;
padding-top: 6px;

}

.short-list-inbound .mceIcon {
position: absolute;
top: 0;
left: 0;
width: 22px;
position: absolute;
top: 0;
left: 0;
width: 22px;
}

.inbound-form-shortcode input {
overflow:hidden;
}
.inbound-form-shortcode {
overflow:hidden;
}
18 changes: 16 additions & 2 deletions shared/shortcodes/inbound-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static function loads($hook) {

if (isset($post)&&post_type_supports($post->post_type,'editor')||isset($post)&&'wp-call-to-action' === $post->post_type) {
wp_enqueue_script('inbound-shortcodes', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/shortcodes.js', array( 'jquery', 'jquery-cookie' ));
$form_id = (isset($_GET['post'])) ? $_GET['post'] : '';
$form_id = (isset($_GET['post']) && is_int( $_GET['post'] )) ? $_GET['post'] : '';
wp_localize_script( 'inbound-shortcodes', 'inbound_shortcodes', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) , 'adminurl' => admin_url(), 'inbound_shortcode_nonce' => wp_create_nonce('inbound-shortcode-nonce') , 'form_id' => $form_id ) );
wp_enqueue_script('selectjs', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/select2.min.js');
wp_enqueue_style('selectjs', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/css/select2.css');
Expand Down Expand Up @@ -657,6 +657,20 @@ static function inbound_forms_header_area()
</ol>
</div>
<div id="inbound-email-response">
<?php

if (defined('INBOUND_PRO_PATH')) {
?>
<h3><?php _e( 'Inbound Pro Users' , INBOUNDNOW_TEXT_DOMAIN ); ?></h3>
<div class='' style='padding-left:20px;'>

<?php echo sprintf( __( ' Membership holders should ignore the setup area below and referrer to %s this document %s for instructions on setting up a followup email. We are leaveing this section in up for non members and for members that are leveraging it. We may remove it remove it entirely from the Inbound Pro plugin. ' , INBOUNDNOW_TEXT_DOMAIN ) , '<a href="http://docs.inboundnow.com/guide/creating-a-follow-up-email-using-inbound-now-as-an-autoresponder-marketing-automation/">', '</a>') ; ?>
</div>
<br>
<?php
}
?>

<h2><?php _e( 'Set Email Response to Send to the person filling out the form' , INBOUNDNOW_TEXT_DOMAIN ); ?></h2>
<?php
$values = get_post_custom( $post->ID );
Expand Down Expand Up @@ -758,7 +772,7 @@ static function inbound_forms_header_area()
<?php if( $shortcode->no_preview ) : ?>
<div id="inbound-shortcodes-nopreview"><?php _e('Shortcode has no preview', 'leads'); ?></div>
<?php else :
if ( isset($_REQUEST['post']) ) {
if ( isset($_REQUEST['post']) && is_int($_REQUEST['post']) ) {
$post_id = html_entity_decode( $_REQUEST['post'] );
} else {
$post_id = 0;
Expand Down
2 changes: 1 addition & 1 deletion templates/simple-two-column/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ color: white;
display: inline;
color:red;
}
input[type="text"], input[type="email"], #inbound-form-wrapper input[type=text], #inbound-form-wrapper input[type=url], #inbound-form-wrapper input[type=email], #inbound-form-wrapper input[type=tel], #inbound-form-wrapper input[type=number], #inbound-form-wrapper input[type=password] {
input[type="text"], input[type="email"], #inbound-form-wrapper input[type=text], #inbound-form-wrapper input[type=url], #inbound-form-wrapper input[type=email], #inbound-form-wrapper input[type=tel], #inbound-form-wrapper input[type=number], #inbound-form-wrapper input[type=password] , #inbound-form-wrapper select {
width: 94%;
padding: 8px 4px 8px 10px;
margin-bottom: 15px;
Expand Down
4 changes: 4 additions & 0 deletions tests/build/php.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php5
AddType application/x-httpd-php-source .phps
</IfModule>
1 change: 1 addition & 0 deletions tests/build/php.load
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
1 change: 1 addition & 0 deletions tests/build/scratchpad.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
phantomjs --webdriver=4444
23 changes: 23 additions & 0 deletions tests/build/travis-ci-apache
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<VirtualHost *:80>
ServerAdmin tests@inboundnow.com
DocumentRoot /var/www/inboundtesting.dev/
ServerName inboundtesting.dev
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# Wire up Apache to use Travis CI's php-fpm.
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
</IfModule>

<Directory "/var/www/inboundtesting.dev/">
Options FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
</VirtualHost>

9 changes: 9 additions & 0 deletions tests/codeception/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

/* load wp */
require '../../../wp-load.php';
require '../../../wp-admin/includes/plugin.php';

/* load required landing pages files */
include_once LANDINGPAGES_PATH . 'modules/module.install.php';
include_once LANDINGPAGES_PATH . 'classes/class.statistics.php';
1 change: 1 addition & 0 deletions tests/codeception/_data/dump.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Replace this file with actual dump of your database */
10 changes: 10 additions & 0 deletions tests/codeception/_support/AcceptanceHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
namespace Codeception\Module;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

class AcceptanceHelper extends \Codeception\Module
{

}
10 changes: 10 additions & 0 deletions tests/codeception/_support/FunctionalHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
namespace Codeception\Module;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

class FunctionalHelper extends \Codeception\Module
{

}
10 changes: 10 additions & 0 deletions tests/codeception/_support/UnitHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
namespace Codeception\Module;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

class UnitHelper extends \Codeception\Module
{

}
20 changes: 20 additions & 0 deletions tests/codeception/acceptance.suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Codeception Test Suite Configuration

# suite for acceptance tests.
# perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.

class_name: AcceptanceTester
modules:
enabled:
- WebDriver
- AcceptanceHelper
- Asserts
config:
WebDriver:
url: 'http://local.wordpress.dev/'
browser: firefox
clear_cookies: false
window_size: 1024x768
PhpBrowser:
url: 'http://inboundsoon.dev'
1,918 changes: 1,918 additions & 0 deletions tests/codeception/acceptance/AcceptanceTester.php

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions tests/codeception/acceptance/LoginCept.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('login to wp-admin');
$I->amOnPage( site_url().'/wp-login.php' );
$I->fillField('Username', 'admin');
$I->fillField('Password','admin');
$I->click('Log In');
$I->see('Dashboard');
55 changes: 55 additions & 0 deletions tests/codeception/acceptance/StatisticsCept.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

/**
* This test is desnged to test the impressions/conversions systems of landing pages.
* Systems tested:
* - Dmummy landing page creation
* - Impression/Conversion UI display on landing page edit screen
* - Cear individual landing page stats buttons.
* - Manually setting impressions/conversions
* - Makes sure landing page does not 404
* - Frontend impression ajax systems
* - Variation rotation systems
* - Conversion tracking system for inbount form
* - Conversion tracking system for tracked link
*/

/* create test landing page */
$lp_id = inbound_install_example_lander();
shell_exec('here');
shell_exec($lp_id);
$permalink = get_post_permalink( $lp_id , false );
shell_exec($permalink);
$I = new AcceptanceTester($scenario);


$I->wantTo('check example landing page is editable');
$I->amOnPage( admin_url( 'post.php?post='. $lp_id .'&action=edit&frontend=false') );
$I->seeInField( '#title','A/B Testing Landing Page Example');

$I->wantTo('check if impressions are correct for variation a');
$imp = $I->grabTextFrom('#lp-variation-A .bab-stat-span-impressions');
$I->assertContains( '30' , $imp );

$I->wantTo('check check impressions for variation b');
$imp = $I->grabTextFrom('#lp-variation-B .bab-stat-span-impressions');
$I->assertContains( '35' , $imp , '' );

$I->wantTo('check conversions for variation a');
$con = $I->grabTextFrom('#lp-variation-A .bab-stat-span-conversions');
$I->assertContains( '10' , $con , '' );

$I->wantTo('check conversions for variation b');
$con = $I->grabTextFrom('#lp-variation-B .bab-stat-span-conversions');
$I->assertContains( '15' , $con );

$I->wantTo('check the conversion rate of variation a');
$per = $I->grabTextFrom('#lp-variation-A .bab-stat-span-conversion_rate');
$I->assertContains( '33' , $per );

$I->wantTo('check the conversion rate of variation b');
$per = $I->grabTextFrom('#lp-variation-B .bab-stat-span-conversion_rate');
$I->assertContains( '43' , $per );



7 changes: 7 additions & 0 deletions tests/codeception/acceptance/WelcomeCept.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('Make sure the default WordPress homepage loads.');
$I->amOnPage( site_url() );
$I->see('Hello world!');

2 changes: 2 additions & 0 deletions tests/codeception/acceptance/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Here you can initialize variables that will be available to your tests
9 changes: 9 additions & 0 deletions tests/codeception/functional.suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Codeception Test Suite Configuration

# suite for functional (integration) tests.
# emulate web requests and make application process them.
# Include one of framework modules (Symfony2, Yii2, Laravel4) to use it.

class_name: FunctionalTester
modules:
enabled: [Filesystem, FunctionalHelper]
360 changes: 360 additions & 0 deletions tests/codeception/functional/FunctionalTester.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,360 @@
<?php //[STAMP] fa259e6277a310881c0cdeb89563ce4c

// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build
// @codingStandardsIgnoreFile


use Codeception\Module\Filesystem;
use Codeception\Module\FunctionalHelper;

/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void haveFriend($name, $actorClass = null)
*
* @SuppressWarnings(PHPMD)
*/
class FunctionalTester extends \Codeception\Actor
{

/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Enters a directory In local filesystem.
* Project root directory is used by default
*
* @param $path
* @see \Codeception\Module\Filesystem::amInPath()
*/
public function amInPath($path) {
return $this->scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Opens a file and stores it's content.
*
* Usage:
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->seeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $filename
* @see \Codeception\Module\Filesystem::openFile()
*/
public function openFile($filename) {
return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Deletes a file
*
* ``` php
* <?php
* $I->deleteFile('composer.lock');
* ?>
* ```
*
* @param $filename
* @see \Codeception\Module\Filesystem::deleteFile()
*/
public function deleteFile($filename) {
return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Deletes directory with all subdirectories
*
* ``` php
* <?php
* $I->deleteDir('vendor');
* ?>
* ```
*
* @param $dirname
* @see \Codeception\Module\Filesystem::deleteDir()
*/
public function deleteDir($dirname) {
return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Copies directory with all contents
*
* ``` php
* <?php
* $I->copyDir('vendor','old_vendor');
* ?>
* ```
*
* @param $src
* @param $dst
* @see \Codeception\Module\Filesystem::copyDir()
*/
public function copyDir($src, $dst) {
return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks If opened file has `text` in it.
*
* Usage:
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->seeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $text
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::seeInThisFile()
*/
public function canSeeInThisFile($text) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks If opened file has `text` in it.
*
* Usage:
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->seeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $text
* @see \Codeception\Module\Filesystem::seeInThisFile()
*/
public function seeInThisFile($text) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks the strict matching of file contents.
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
* Better to use with HEREDOC strings.
* Matching is done after removing "\r" chars from file content.
*
* ``` php
* <?php
* $I->openFile('process.pid');
* $I->seeFileContentsEqual('3192');
* ?>
* ```
*
* @param $text
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
*/
public function canSeeFileContentsEqual($text) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks the strict matching of file contents.
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
* Better to use with HEREDOC strings.
* Matching is done after removing "\r" chars from file content.
*
* ``` php
* <?php
* $I->openFile('process.pid');
* $I->seeFileContentsEqual('3192');
* ?>
* ```
*
* @param $text
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
*/
public function seeFileContentsEqual($text) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks If opened file doesn't contain `text` in it
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->dontSeeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $text
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
*/
public function cantSeeInThisFile($text) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks If opened file doesn't contain `text` in it
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->dontSeeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $text
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
*/
public function dontSeeInThisFile($text) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Deletes a file
* @see \Codeception\Module\Filesystem::deleteThisFile()
*/
public function deleteThisFile() {
return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if file exists in path.
* Opens a file when it's exists
*
* ``` php
* <?php
* $I->seeFileFound('UserModel.php','app/models');
* ?>
* ```
*
* @param $filename
* @param string $path
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::seeFileFound()
*/
public function canSeeFileFound($filename, $path = null) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if file exists in path.
* Opens a file when it's exists
*
* ``` php
* <?php
* $I->seeFileFound('UserModel.php','app/models');
* ?>
* ```
*
* @param $filename
* @param string $path
* @see \Codeception\Module\Filesystem::seeFileFound()
*/
public function seeFileFound($filename, $path = null) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if file does not exists in path
*
* @param $filename
* @param string $path
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
*/
public function cantSeeFileFound($filename, $path = null) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if file does not exists in path
*
* @param $filename
* @param string $path
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
*/
public function dontSeeFileFound($filename, $path = null) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Erases directory contents
*
* ``` php
* <?php
* $I->cleanDir('logs');
* ?>
* ```
*
* @param $dirname
* @see \Codeception\Module\Filesystem::cleanDir()
*/
public function cleanDir($dirname) {
return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Saves contents to file
*
* @param $filename
* @param $contents
* @see \Codeception\Module\Filesystem::writeToFile()
*/
public function writeToFile($filename, $contents) {
return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args()));
}
}
2 changes: 2 additions & 0 deletions tests/codeception/functional/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Here you can initialize variables that will be available to your tests
6 changes: 6 additions & 0 deletions tests/codeception/unit.suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Codeception Test Suite Configuration

# suite for unit (internal) tests.
class_name: UnitTester
modules:
enabled: [Asserts, UnitHelper]
300 changes: 300 additions & 0 deletions tests/codeception/unit/UnitTester.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
<?php //[STAMP] c8568e8eab4a240544c36ae031f88bd8

// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build
// @codingStandardsIgnoreFile


use Codeception\Module\Asserts;
use Codeception\Module\UnitHelper;

/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void haveFriend($name, $actorClass = null)
*
* @SuppressWarnings(PHPMD)
*/
class UnitTester extends \Codeception\Actor
{

/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that two variables are equal.
*
* @param $expected
* @param $actual
* @param string $message
*
* @return mixed
* @see \Codeception\Module\Asserts::assertEquals()
*/
public function assertEquals($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertEquals', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that two variables are not equal
*
* @param $expected
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertNotEquals()
*/
public function assertNotEquals($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that two variables are same
*
* @param $expected
* @param $actual
* @param string $message
*
* @return mixed
* @see \Codeception\Module\Asserts::assertSame()
*/
public function assertSame($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertSame', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that two variables are not same
*
* @param $expected
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertNotSame()
*/
public function assertNotSame($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that expected is greater than actual
*
* @param $expected
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertGreaterThan()
*/
public function assertGreaterThan($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* @deprecated
* @see \Codeception\Module\Asserts::assertGreaterThen()
*/
public function assertGreaterThen($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThen', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that expected is greater or equal than actual
*
* @param $expected
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertGreaterThanOrEqual()
*/
public function assertGreaterThanOrEqual($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* @deprecated
* @see \Codeception\Module\Asserts::assertGreaterThenOrEqual()
*/
public function assertGreaterThenOrEqual($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThenOrEqual', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that expected is less than actual
*
* @param $expected
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertLessThan()
*/
public function assertLessThan($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that expected is less or equal than actual
*
* @param $expected
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertLessThanOrEqual()
*/
public function assertLessThanOrEqual($expected, $actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that haystack contains needle
*
* @param $needle
* @param $haystack
* @param string $message
* @see \Codeception\Module\Asserts::assertContains()
*/
public function assertContains($needle, $haystack, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertContains', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that haystack doesn't contain needle.
*
* @param $needle
* @param $haystack
* @param string $message
* @see \Codeception\Module\Asserts::assertNotContains()
*/
public function assertNotContains($needle, $haystack, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that variable is empty.
*
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertEmpty()
*/
public function assertEmpty($actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that variable is not empty.
*
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertNotEmpty()
*/
public function assertNotEmpty($actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that variable is NULL
*
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertNull()
*/
public function assertNull($actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertNull', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that variable is not NULL
*
* @param $actual
* @param string $message
* @see \Codeception\Module\Asserts::assertNotNull()
*/
public function assertNotNull($actual, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that condition is positive.
*
* @param $condition
* @param string $message
* @see \Codeception\Module\Asserts::assertTrue()
*/
public function assertTrue($condition, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertTrue', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that condition is negative.
*
* @param $condition
* @param string $message
* @see \Codeception\Module\Asserts::assertFalse()
*/
public function assertFalse($condition, $message = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('assertFalse', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Fails the test with message.
*
* @param $message
* @see \Codeception\Module\Asserts::fail()
*/
public function fail($message) {
return $this->scenario->runStep(new \Codeception\Step\Action('fail', func_get_args()));
}
}
2 changes: 2 additions & 0 deletions tests/codeception/unit/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Here you can initialize variables that will be available to your tests
82 changes: 82 additions & 0 deletions tests/phantomjs/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**
* PhantomJs server for calling webpages & processing JS
* returns page content
*/

var args = require('system').args;
var address = args[1];
var page = new WebPage();

var renderPage = function(){

page = require('webpage').create();
var myArgs = Array.prototype.slice.call(arguments),
url_str = myArgs[0];

console.log('accessing:'+url_str);

page.onError = function(msg){console.log('js error');}

/**
* From PhantomJS documentation:
* This callback is invoked when there is a JavaScript console. The callback may accept up to three arguments:
* the string for the message, the line number, and the source identifier.
*/
page.onConsoleMessage = function (msg, line, source) {
console.log('console> ' + msg);
};

/**
* From PhantomJS documentation:
* This callback is invoked when there is a JavaScript alert. The only argument passed to the callback is the string for the message.
*/
page.onAlert = function (msg) {
console.log('alert!!> ' + msg);
};

/**
* Handle Redirection
*/
page.onNavigationRequested = function(url_sub_str, type, willNavigate, main) {
if (main && url_sub_str != url_str) {
url_str = url_sub_str;
console.log("redirect caught");
page.close();
setTimeout(function() {
renderPage(url_str)
},1);
}
};

page.onResourceReceived = function (response) {
//console.log('Receive ' + JSON.stringify(response, undefined, 4));
};

//page.onLoadFinished = function() { console.log(&quot;onLoadFinished FIRED&quot;); }

/**
* Open the web page and run RRunner
*/
page.open(url_str, function(status) {
console.log('here');
if (status === 'success') {
console.log(page.content);
page.close();
setTimeout( function() {

phantom.exit();
} , 5000);
} else {
console.log('failed');
phantom.exit();
}
});
};


address = 'http://local.wordpress.dev/test.php';
//address = 'http://local.wordpress.dev/';
//address = 'http://www.simpleweb.org/';
renderPage(address);


10 changes: 10 additions & 0 deletions tests/phantomjs/server.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
//echo shell_exec( '/usr/bin/phantomjs /vagrant/www/wordpress-default/wp-content/plugins/landing-pages/tests/phantomjs/server.js' );
//sleep(10);

//$output = shell_exec('/usr/bin/phantomjs server.js');
//echo "<pre>$output</pre>";
error_reporting(E_ALL);
session_write_close();
$result = shell_exec('phantomjs --web-security=false --ssl-protocol=any server.js ' . $_GET['url'] );
echo $result;
3 changes: 3 additions & 0 deletions tests/phantomjs/server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
export DISPLAY=:0
phantomjs --ignore-ssl-errors=true server.js 2>&1
30 changes: 30 additions & 0 deletions tests/phpunit/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Bootstrap the plugin unit testing environment.
*
* @package wordpress-plugin-tests
*/

/* load wp environemnt */
require '../../../wp-load.php';

/* load plugins */
require '../../../wp-admin/includes/plugin.php';

/**
* Replacement for wp_remote_get
* processes javascript through PhantomJs
*/
function inbound_remote_get( $url ) {
$response = wp_remote_get(
add_query_arg(
array( 'url' => urlencode( $url ) ) ,
LANDINGPAGES_URLPATH . 'tests/phantomjs/server.php'
)
);

return $response;
}



50 changes: 50 additions & 0 deletions tests/phpunit/test.activations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

/**
* Tests to test that that testing framework is testing tests. Meta, huh?
*
* @package wordpress-plugins-tests
*/
class Tests_Activation extends PHPUnit_Framework_TestCase {

/**
* Run a simple test to ensure that the tests are running
*/
function test_tests() {
$this->assertTrue( true );
}

/**
* Ensure landing pages is active
*/
function test_lading_pages_activated() {
$this->assertTrue( is_plugin_active( 'landing-pages/landing-pages.php' ) );
}

/**
* Ensure that the Leads has been installed and activated.
*/
function test_leads_activated() {
$this->assertTrue( is_plugin_active( 'leads/leads.php' ) );
}

/**
* Ensure that the Calls to Action has been installed and activated.
*/
function test_cta_activated() {
$this->assertTrue( is_plugin_active( 'cta/calls-to-action.php' ) );
}

/**
* Run upgrade routines and check option to see if complete
*/
function test_run_upgrade_routines() {
include_once LANDINGPAGES_PATH . 'classes/class.activation.php';
include_once LANDINGPAGES_PATH . 'classes/class.activation.upgrade-routines.php';
Landing_Pages_Activation::run_updates();
$this->assertTrue( true );
}

}

?>
96 changes: 96 additions & 0 deletions tests/phpunit/test.statistics.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php

/**
* Test design to juse phantomjs to interact with front end. This test is disabled in favor for codeception tests
*
* @package wordpress-plugins-tests
*/
class Tests_Statistics extends PHPUnit_Framework_TestCase {

var $lp_id;
var $variations;

/**
* setup
*/
function setUp() {
return;
/* includes */
include_once LANDINGPAGES_PATH . 'modules/module.install.php';
include_once LANDINGPAGES_PATH . 'classes/class.statistics.php';

$this->lp_id = inbound_install_example_lander();
/* clear the stats */
$this->variations = Landing_Pages_Statistics::get_variations($this->lp_id );
foreach ($this->variations as $vid) {
Landing_Pages_Statistics::set_impression_count( $this->lp_id , $vid, 0 );
Landing_Pages_Statistics::set_conversion_count( $this->lp_id , $vid, 0 );
}
}

/**
* Tear down
*/
function tearDown() {
return;
//delete_option('lp_settings_general');
//wp_delete_post( $this->lp_id , false );
}


/**
* Test is Landing_Pages_Statistics::read_statistics works
*/
function test_read_statistics() {
return;

/* includes */
include_once LANDINGPAGES_PATH . 'classes/class.statistics.php';

$stats = Landing_Pages_Statistics::read_statistics( $this->lp_id );

$this->assertEquals( count($stats) , 3 );
$this->assertEquals( $stats['impressions'][0] , 0 );
$this->assertEquals( $stats['conversions'][0] , 0 );
$this->assertEquals( $stats['impressions'][1] , 0 );
$this->assertEquals( $stats['conversions'][1] , 0 );
}

/**
* launch a landing page
*/
function test_landing_page_read() {
return;

/* includes */
include_once LANDINGPAGES_PATH . 'classes/class.statistics.php';

$permalink = get_post_permalink( $this->lp_id , false );
echo $permalink."\r\n";
$permalink = 'http://local.wordpress.dev/go/ab-testing-landing-page-example-104/?lp-variation-id=1';
$permalink = 'http://local.wordpress.dev/';
print_r(inbound_remote_get( $permalink ));
/*
sleep(5);
$response = inbound_remote_get( $permalink );
sleep(5);
$response = inbound_remote_get( $permalink );
sleep(5);
$response = inbound_remote_get( $permalink );
sleep(5);
$response = inbound_remote_get( add_query_arg( array('lp-variation-id'=> 0 ) , $permalink ) );
sleep(5);
$response = inbound_remote_get( add_query_arg( array('lp-variation-id'=> 1 ) , $permalink ) );
sleep(5);
*/
$stats = Landing_Pages_Statistics::read_statistics( $this->lp_id );
print_r($stats);

$this->assertEquals( $stats['impressions'][0] , 3 );
$this->assertEquals( $stats['conversions'][0] , 0 );
$this->assertEquals( $stats['impressions'][1] , 3 );
$this->assertEquals( $stats['conversions'][1] , 0 );
}
}