1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129:
<?php
class Landing_Pages_Install {
public function __construct() {
self::add_hooks();
}
public static function add_hooks() {
add_action( 'admin_init', array( __CLASS__ , 'install_example_landing_page_check') );
add_action('admin_enqueue_scripts', array( __CLASS__ , 'enqueue_scripts' ) );
}
public static function enqueue_scripts() {
global $plugin_page;
if ( $plugin_page != 'install-inbound-plugins' ) {
return;
}
wp_enqueue_script('inbound-install-plugins', LANDINGPAGES_URLPATH . 'assets/js/admin/install-plugins.js' , array() , null);
wp_enqueue_style('inbound-install-plugins-css', LANDINGPAGES_URLPATH . 'assets/css/admin/install-plugins.css', array() , null);
}
public static function install_example_landing_page_check() {
$lp_default_options = get_option( 'lp_settings_general' );
if ( isset( $lp_default_options["default_landing_page"] ) ) {
return $lp_default_options["default_landing_page"];
}
return self::install_example_landing_page();
}
public static function install_example_landing_page() {
$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',
) , true
);
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') );
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_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_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_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');
$options = array(
"default_landing_page" => $landing_page_id
);
update_option( "lp_settings_general" , $options );
return $landing_page_id;
}
}
new Landing_Pages_Install;