function content_layout() { global $wpdb; $has_layout = false; if ($current = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `{$wpdb->prefix}optimizepress_post_layouts` WHERE `type`='body' AND `post_id`=%d", OP_PAGEBUILDER_ID))) { if ($current > 0) { $has_layout = true; } } $results = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}optimizepress_predefined_layouts` ORDER BY id DESC"); $data = array('has_layout' => $has_layout); $previews = array(); if ($results) { $count = 0; foreach ($results as $result) { $li_class = $input_attr = ''; $selected = false; $previews[] = array('image' => OP_IMG . 'content_layouts/' . $result->id . '.' . $result->preview_ext, 'width' => 212, 'height' => 156, 'preview_content' => $result->name, 'input' => '<input type="radio" id="op_content_layout_' . $result->id . '" name="op[content_layout]" value="' . $result->id . '"' . $input_attr . ' />', 'li_class' => $li_class); $count++; } } $data['previews'] = $previews; /* global $wpdb; $results = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}optimizepress_predefined_layouts` ORDER BY id DESC"); $data = array(); if($results){ $html = ''; foreach($results as $result){ $id = 'op_content_layout_layouts_option_'.$result->id; $html .= '<li><input type="radio" name="op[content_layout][option]" id="'.$id.'" value="'.$result->id.'" /><label for="'.$id.'">'.$result->name.'</label><p class="preview-layout"><a href="'.OP_IMG.'content_layouts/'.$result->id.'.'.$result->preview_ext.'" target="_blank">'.__('Preview').'</a></p></li>'; } $data['layout_list'] = $html; }*/ echo op_load_section('content_layout/layouts', $data, 'page'); }
function analytics_and_tracking() { echo op_load_section('analytics_and_tracking', array(), 'analytics_and_tracking'); }
function size_color() { echo op_load_section('layout/size_color', 'page'); }
function social_integration() { echo op_load_section('social_integration', array(), 'blog/general'); }
function typography() { echo op_load_section('typography'); }
function landing_bg() { echo op_load_section('layout/landing_bg', 'page'); }
function compatibility_check() { global $wpdb; global $wp_version; $data = array(); // PHP if (version_compare(PHP_VERSION, '5.3', '<')) { $data['php'] = array('status' => 'warning', 'message' => sprintf(__('Your PHP version (%s) is lower than recommended (%s).', OP_SN), PHP_VERSION, '5.3')); } else { $data['php'] = array('status' => 'ok', 'message' => sprintf(__('Your PHP version (%s) meets requirements (%s).', OP_SN), PHP_VERSION, '5.3')); } // MySQL if (version_compare($wpdb->db_version(), '5.0', '<')) { $data['mysql'] = array('status' => 'error', 'message' => sprintf(__('Your MySQL version (%s) is lower than required (%s).', OP_SN), $wpdb->db_version(), '5.0')); } else { $data['mysql'] = array('status' => 'ok', 'message' => sprintf(__('Your MySQL version (%s) meets requirements (%s).', OP_SN), $wpdb->db_version(), '5.0')); } // WP if (version_compare($wp_version, '3.5', '<')) { $data['wordpress'] = array('status' => 'warning', 'message' => sprintf(__('Your WordPress version (%s) is lower than recommended (%s).', OP_SN), $wp_version, '3.5')); } else { $data['wordpress'] = array('status' => 'ok', 'message' => sprintf(__('Your WordPress version (%s) meets requirements (%s).', OP_SN), $wp_version, '3.5')); } // Transfer protocols (curl, streams) $http = new Wp_Http(); if (false === $http->_get_first_available_transport(array())) { $data['transfer'] = array('status' => 'error', 'message' => __('There are no transport protocols (curl, streams) that are capable of handling the requests.', OP_SN)); } else { $data['transfer'] = array('status' => 'ok', 'message' => __('Transfer protocols (curl, streams) are in order.', OP_SN)); } // OP SL if (true !== op_sl_ping()) { $data['op_sl'] = array('status' => 'error', 'message' => __('Unable to connect to OptimizePress Security & Licensing service.', OP_SN)); } else { $data['op_sl'] = array('status' => 'ok', 'message' => __('Connection with OptimizePress Security & Licensing service is in order.', OP_SN)); } // OP Eligibility if (true !== op_sl_eligible()) { $data['op_sl'] = array('status' => 'warning', 'message' => sprintf(__('You are not eligible for new updates. You can prolong your subscription <a href="%s" target="_blank">here</a>.', OP_SN), 'http://optimizepress.com')); } // Permalink structure if ('' === ($permalink_structure = get_option('permalink_structure', ''))) { $data['permalink'] = array('status' => 'error', 'message' => sprintf(__('Permalink structure must not be set to "default" for OptimizePress to work correctly. Please change the <a href="%s">setting</a>.', OP_SN), admin_url('options-permalink.php'))); } else { $data['permalink'] = array('status' => 'ok', 'message' => sprintf(__('Permalink structure is in order (%s).', OP_SN), trim($permalink_structure, '/'))); } // Memory limit $memory_limit = wp_convert_hr_to_bytes(ini_get('memory_limit')) / 1024 / 1024; if ($memory_limit < 64) { $data['memory'] = array('status' => 'warning', 'message' => sprintf(__('Your memory limit (%sMB) is lower than recommended (%sMB)', OP_SN), $memory_limit, 64)); } else { $data['memory'] = array('status' => 'ok', 'message' => sprintf(__('Your memory limit (%sMB) meets recommendation (%sMB)', OP_SN), $memory_limit, 64)); } // Upload limit $upload_limit = wp_max_upload_size() / 1024 / 1024; if ($upload_limit < 32) { $data['upload'] = array('status' => 'warning', 'message' => sprintf(__('Your upload limit (%sMB) is lower than recommended (%sMB).', OP_SN), $upload_limit, 32)); } else { $data['upload'] = array('status' => 'ok', 'message' => sprintf(__('Your upload limit (%sMB) meets recommendation (%sMB).', OP_SN), $upload_limit, 32)); } // Max input vars $input_vars_limit = ini_get('max_input_vars'); if ($input_vars_limit < 3000) { $data['input_vars'] = array('status' => 'info', 'message' => sprintf(__('Your "max_input_vars" setting is set to %s. If you plan to have pages with a large number of elements on it, you should raise this setting to at least %s.', OP_SN), $input_vars_limit ? $input_vars_limit : 1000, 3000)); } else { $data['input_vars'] = array('status' => 'ok', 'message' => sprintf(__('Your "max_input_vars" (%s) meets recommendation (%s).', OP_SN), $input_vars_limit, 3000)); } // Max execution time $execution_time = ini_get('max_execution_time'); if ($execution_time < 60) { $data['execution_time'] = array('status' => 'info', 'message' => sprintf(__('Your "max_execution_time" setting (%s) is lower than recommended (%s).', OP_SN), $execution_time ? $execution_time : 30, 60)); } else { $data['execution_time'] = array('status' => 'ok', 'message' => sprintf(__('Your "max_execution_time" (%s) meets recommendation (%s).', OP_SN), $execution_time, 60)); } echo op_load_section('compatibility_check', array('compat' => $data), 'global_settings'); }
/** * Load theme section template * @return void */ public function loadTheme() { echo op_load_section('theme', array('theme' => wp_get_theme()), 'disable_styles_scripts'); }
/** * Load section template * @return void */ public function loadElementCache() { echo op_load_section('clear_localstorage', array(), 'cache'); }
function footer_prefs() { echo op_load_section('footer_prefs', array('footer_prefs' => $this->_footer_prefs())); }
function ontraport() { echo op_load_section('ontraport', array(), 'email_marketing_services'); }
echo $name; ?> " id="advanced_colors_<?php echo $name; ?> "> <div class="op-bsw-grey-panel-header cf"> <h3><a href="#"><?php echo $options['title']; ?> </a></h3> <?php $help_vid = op_help_vid(array('page', 'color_schemes', 'advanced', $name), true); ?> <div class="op-bsw-panel-controls<?php echo $help_vid == '' ? '' : ' op-bsw-panel-controls-help'; ?> cf"> <div class="show-hide-panel"><a href="#"></a></div> </div> </div> <div class="op-bsw-grey-panel-content op-bsw-grey-panel-no-sidebar"> <?php echo op_load_section('color_options', array('elements' => $options['elements'], 'opt_array' => array('color_scheme_advanced', $name), 'fieldname' => 'op[color_scheme_advanced][' . $name . ']', 'fieldid' => 'op_color_scheme_advanced_' . $name . '_'), 'page'); ?> </div> </div> <?php } ?> </div>
function officeautopilot() { echo op_load_section('officeautopilot', array(), 'email_marketing_services'); }
/** * Render MailPoet settings sections. * * @return void */ public function mailpoet() { echo op_load_section('mailpoet', array(), 'email_marketing_services'); }
/** * Output theme data * @return void */ public function loadTheme() { echo op_load_section('items', array('items' => $this->getThemeRows(), 'open' => false, 'section' => 'theme', 'label' => __('Theme', 'optimizepress')), 'system_status'); }
function advanced() { echo op_load_section('color_schemes/advanced', array('color_options' => $this->_advanced_sections()), 'page'); }
function typography() { echo op_load_section('typography', array(), 'global_settings'); }