@ 2017-04-23T15:10:55Z <?php
/* ============== ListingPro create pages ============ */
add_action('admin_init','check_pages_live');
if (!function_exists('check_pages_live')) {
function check_pages_live(){
if ( class_exists( 'Redux' ) ) {
global $listingpro_options;
global $opt_name;
$opt_name = 'listingpro_options';
$pricing_plan = $listingpro_options['pricing-plan'];
$submit_listing = $listingpro_options['submit-listing'];
$listing_author = $listingpro_options['listing-author'];
if(empty($pricing_plan) && empty($submit_listing) && empty($listing_author) && empty($payment_checkout) && empty($payment_fail)){
create_page_if_null('Dashboard', '', 'listing-author');
create_page_if_null('Submit Your Listing', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_submit title="Add your Listing" subtitle="Add details about your listing"][/vc_column][/vc_row]', 'submit-listing');
create_page_if_null('Edit Your Listing', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_edit title="Edit your Listing" subtitle="Edit details about your listing"][/vc_column][/vc_row]', 'edit-listing');
create_page_if_null('Select Your Plan', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_pricing title="Add your Listing" subtitle="Add details about your listing"][/vc_column][/vc_row]', 'pricing-plan');
create_page_if_null('Select Payment Gateway', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_p_gateways][/vc_column][/vc_row]', 'payment-gateway');
create_page_if_null('Payment Success', '', 'payment-success');
create_page_if_null('Payment Fail', '', 'payment-fail');
create_page_if_null('Payment Checkout', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_checkout title="See listings and pay" subtitle="Select your listings and payment method to proceed"][/vc_column][/vc_row]', 'payment-checkout');
}
}
}
}
add_action('admin_init','check_set_options');
if (!function_exists('check_set_options')) {
function check_set_options(){
$counter = 0;
if ( class_exists( 'Redux' ) ) {
global $listingpro_options;
global $opt_name;
$opt_name = 'listingpro_options';
$pricing_plan = $opt_name['pricing-plan'];
$submit_listing = $opt_name['submit-listing'];
$edit_listing = $opt_name['edit-listing'];
$listing_author = $opt_name['listing-author'];
$payment_checkout = $opt_name['payment-checkout'];
if(empty($listing_author)){
if( get_page_by_title('Dashboard') != NULL ) {
$page = get_page_by_title('Dashboard');
$permalink = get_permalink($page->ID);
$status = get_post_status( $page->ID );
if($status == 'publish'){
Redux::setOption( $opt_name, 'listing-author', $permalink);
}
}
}
if(empty($submit_listing)){
if( get_page_by_title('Submit Your Listing') != NULL ) {
$page = get_page_by_title('Submit Your Listing');
$permalink = get_permalink($page->ID);
$status = get_post_status( $page->ID );
if($status == 'publish'){
Redux::setOption( $opt_name, 'submit-listing', $permalink);
}
}
}
if(empty($edit_listing)){
if( get_page_by_title('Edit Your Listing') != NULL ) {
$page = get_page_by_title('Edit Your Listing');
$permalink = get_permalink($page->ID);
$status = get_post_status( $page->ID );
if($status == 'publish'){
Redux::setOption( $opt_name, 'edit-listing', $permalink);
}
}
}
if(empty($pricing_plan)){
if( get_page_by_title('Select Your Plan') != NULL ) {
$page = get_page_by_title('Select Your Plan');
$permalink = get_permalink($page->ID);
$status = get_post_status( $page->ID );
if($status == 'publish'){
Redux::setOption( $opt_name, 'pricing-plan', $permalink);
}
}
}
if(empty($payment_checkout)){
if( get_page_by_title('Payment Checkout') != NULL ) {
$page = get_page_by_title('Payment Checkout');
$permalink = $page->ID;
$status = get_post_status( $page->ID );
if($status == 'publish'){
Redux::setOption( $opt_name, 'payment-checkout', $permalink);
}
}
}
}
}
}
if (!function_exists('create_page_if_null')) {
function create_page_if_null($target,$content,$slug) {
if( get_page_by_title($target) == NULL ) {
listingpro_create_pages($target,$content,$slug);
}
}
}
if (!function_exists('listingpro_create_pages')) {
function listingpro_create_pages($pageName,$content,$slug) {
$createPage = array(
'post_title' => $pageName,
'post_content' => $content,
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'post_name' => $slug
);
if($slug == 'listing-author'){
$createPage = array(
'post_title' => $pageName,
'post_content' => $content,
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'post_name' => $slug,
'page_template' => 'template-dashboard.php'
);
}
if($slug == 'payment-success'){
$createPage = array(
'post_title' => $pageName,
'post_content' => $content,
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'post_name' => $slug,
'page_template' => 'templates/template-payment-thankyou.php'
);
}
if($slug == 'payment-fail'){
$createPage = array(
'post_title' => $pageName,
'post_content' => $content,
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'post_name' => $slug,
'page_template' => 'templates/template-payment-cancel.php'
);
}
// Insert the post into the database
wp_insert_post( $createPage );
}
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 8.3.6 0.012 0.006 18.48 8.3.5 0.015 0.006 16.61 8.3.4 0.009 0.006 18.78 8.3.3 0.011 0.004 18.72 8.3.2 0.004 0.004 20.43 8.3.1 0.000 0.007 21.72 8.3.0 0.004 0.004 18.05 8.2.18 0.000 0.015 18.54 8.2.17 0.009 0.009 22.96 8.2.16 0.014 0.007 21.05 8.2.15 0.009 0.000 24.18 8.2.14 0.008 0.000 24.66 8.2.13 0.005 0.003 22.14 8.2.12 0.003 0.006 26.35 8.2.11 0.006 0.003 20.65 8.2.10 0.000 0.011 18.03 8.2.9 0.003 0.005 17.75 8.2.8 0.000 0.008 18.77 8.2.7 0.003 0.006 17.75 8.2.6 0.010 0.003 17.47 8.2.5 0.004 0.004 18.16 8.2.4 0.006 0.003 19.35 8.2.3 0.004 0.004 19.23 8.2.2 0.003 0.005 18.15 8.2.1 0.004 0.004 18.34 8.2.0 0.005 0.002 18.28 8.1.28 0.011 0.007 25.92 8.1.27 0.004 0.004 23.91 8.1.26 0.008 0.000 26.35 8.1.25 0.008 0.000 28.09 8.1.24 0.007 0.004 18.88 8.1.23 0.004 0.008 20.84 8.1.22 0.000 0.008 18.61 8.1.21 0.004 0.004 18.77 8.1.20 0.004 0.004 17.22 8.1.19 0.006 0.003 17.35 8.1.18 0.000 0.008 18.10 8.1.17 0.000 0.008 17.62 8.1.16 0.004 0.004 18.92 8.1.15 0.006 0.003 21.82 8.1.14 0.004 0.004 19.59 8.1.13 0.000 0.007 18.95 8.1.12 0.000 0.008 17.46 8.1.11 0.003 0.006 17.32 8.1.10 0.004 0.004 17.47 8.1.9 0.004 0.004 17.46 8.1.8 0.000 0.007 17.32 8.1.7 0.003 0.003 17.47 8.1.6 0.000 0.008 17.51 8.1.5 0.008 0.000 17.53 8.1.4 0.006 0.003 17.45 8.1.3 0.000 0.008 17.73 8.1.2 0.005 0.003 17.72 8.1.1 0.004 0.004 17.61 8.1.0 0.004 0.004 17.59 8.0.30 0.000 0.007 18.77 8.0.29 0.003 0.007 16.88 8.0.28 0.004 0.004 18.54 8.0.27 0.007 0.000 16.79 8.0.26 0.004 0.004 19.10 8.0.25 0.007 0.000 16.97 8.0.24 0.007 0.000 16.93 8.0.23 0.004 0.004 17.08 8.0.22 0.004 0.004 16.97 8.0.21 0.007 0.000 17.01 8.0.20 0.004 0.004 17.08 8.0.19 0.000 0.011 17.05 8.0.18 0.004 0.004 16.91 8.0.17 0.000 0.007 16.91 8.0.16 0.005 0.002 17.00 8.0.15 0.007 0.000 16.84 8.0.14 0.000 0.007 16.95 8.0.13 0.000 0.008 13.34 8.0.12 0.000 0.007 16.87 8.0.11 0.000 0.007 16.97 8.0.10 0.008 0.000 17.05 8.0.9 0.000 0.007 16.97 8.0.8 0.009 0.013 17.00 8.0.7 0.003 0.006 17.02 8.0.6 0.004 0.004 17.05 8.0.5 0.000 0.008 16.94 8.0.3 0.014 0.006 17.15 8.0.2 0.014 0.005 17.40 8.0.1 0.004 0.004 17.07 8.0.0 0.009 0.009 16.73 7.4.33 0.000 0.005 15.55 7.4.32 0.000 0.010 16.52 7.4.30 0.004 0.004 16.55 7.4.29 0.010 0.000 16.41 7.4.28 0.005 0.003 16.57 7.4.27 0.007 0.000 16.68 7.4.26 0.006 0.006 16.62 7.4.25 0.004 0.004 16.52 7.4.24 0.004 0.004 16.54 7.4.23 0.004 0.004 16.45 7.4.22 0.017 0.009 16.67 7.4.21 0.012 0.003 16.57 7.4.20 0.004 0.004 16.65 7.4.16 0.007 0.010 16.49 7.4.15 0.007 0.010 17.40 7.4.14 0.015 0.008 17.86 7.4.13 0.012 0.008 16.53 7.4.12 0.009 0.011 16.46 7.4.11 0.007 0.014 16.74 7.4.10 0.007 0.011 16.78 7.4.9 0.010 0.010 16.51 7.4.8 0.009 0.014 19.39 7.4.7 0.009 0.009 16.61 7.4.6 0.017 0.003 16.51 7.4.5 0.000 0.016 16.57 7.4.4 0.008 0.009 16.63 7.4.3 0.013 0.003 16.53 7.4.0 0.003 0.013 14.98 7.3.33 0.000 0.005 13.18 7.3.32 0.000 0.005 13.27 7.3.31 0.005 0.002 16.36 7.3.30 0.003 0.003 16.46 7.3.29 0.008 0.006 16.35 7.3.28 0.010 0.007 16.39 7.3.27 0.007 0.010 17.40 7.3.26 0.016 0.005 16.59 7.3.25 0.011 0.010 16.44 7.3.24 0.010 0.009 16.61 7.3.23 0.007 0.013 16.73 7.3.21 0.008 0.009 16.42 7.3.20 0.007 0.010 16.41 7.3.19 0.013 0.003 16.56 7.3.18 0.004 0.012 16.50 7.3.17 0.009 0.009 16.70 7.3.16 0.016 0.007 16.43 7.3.1 0.000 0.012 16.64 7.3.0 0.007 0.007 16.59 7.2.33 0.012 0.006 16.56 7.2.32 0.003 0.019 16.66 7.2.31 0.008 0.009 16.72 7.2.30 0.012 0.004 16.56 7.2.29 0.010 0.007 16.36 7.2.13 0.010 0.007 16.81 7.2.12 0.004 0.011 16.52 7.2.11 0.004 0.007 16.92 7.2.10 0.000 0.013 16.78 7.2.9 0.000 0.015 16.73 7.2.8 0.007 0.010 16.49 7.2.7 0.007 0.010 16.41 7.2.6 0.005 0.009 16.52 7.2.5 0.010 0.003 16.56 7.2.4 0.003 0.009 16.71 7.2.3 0.006 0.006 16.88 7.2.2 0.006 0.006 16.56 7.2.1 0.006 0.009 16.69 7.2.0 0.004 0.010 18.14 7.1.25 0.007 0.007 15.75 7.1.20 0.004 0.007 15.59 7.1.7 0.000 0.010 16.98 7.1.6 0.000 0.012 17.19 7.1.5 0.015 0.010 16.57 7.1.4 0.020 0.010 34.11 7.1.3 0.013 0.017 34.16 7.1.2 0.027 0.007 34.46 7.1.1 0.003 0.010 16.18 7.1.0 0.007 0.007 16.55 7.0.20 0.010 0.007 16.51 7.0.18 0.007 0.007 15.96 7.0.17 0.003 0.010 15.98 7.0.16 0.007 0.007 15.95 7.0.15 0.003 0.010 16.05 7.0.14 0.007 0.010 16.02 7.0.13 0.003 0.007 16.29 7.0.12 0.000 0.017 16.39 7.0.11 0.000 0.013 16.03 7.0.10 0.007 0.007 15.90 7.0.9 0.000 0.013 16.21 7.0.8 0.007 0.010 15.93 7.0.7 0.007 0.007 16.03 7.0.6 0.007 0.007 16.09 7.0.5 0.003 0.010 16.32 7.0.4 0.000 0.013 16.29 7.0.3 0.003 0.007 16.20 7.0.2 0.000 0.013 16.36 7.0.1 0.010 0.003 16.24 7.0.0 0.007 0.007 16.11
preferences:dark mode live preview
63.12 ms | 401 KiB | 5 Q