/** * Return the General Settings of Plugin, and set them to default values if they are empty * * @return array general options of plugin * @access public */ static function get_options() { // If isn't empty, return class variable if (WSW_Main::$settings) { return WSW_Main::$settings; } // default values $options = array('chk_keyword_to_titles' => '1', 'chk_nofollow_in_external' => '0', 'chk_nofollow_in_image' => '0', 'chk_use_facebook' => '0', 'chk_use_twitter' => '0', 'chk_use_richsnippets' => '1', 'chk_keyword_decorate_bold' => '0', 'chk_keyword_decorate_italic' => '0', 'chk_keyword_decorate_underline' => '0', 'opt_keyword_decorate_bold_type' => '0', 'opt_keyword_decorate_italic_type' => '0', 'opt_keyword_decorate_underline_type' => '0', 'opt_image_alternate_type' => 'empty', 'opt_image_title_type' => 'empty', 'txt_image_alternate' => '', 'txt_image_title' => '', 'lsi_bing_api_key' => '', 'chk_use_headings_h1' => '0', 'chk_use_headings_h2' => '0', 'chk_use_headings_h3' => '0', 'chk_tagging_using_google' => '0', 'txt_generic_tags' => '', 'chk_author_linking' => '0', 'wsw_initial_dt' => '', 'chk_block_login_page' => '0', 'chk_block_admin_page' => '0', 'chk_use_meta_robot' => '1', 'chk_tweak_permalink' => '0', 'chk_make_sitemap' => '0', 'wsw_set_time_check' => '0', 'anchor_text' => ''); // get saved options $saved = get_option(self::$global_option); // assign them if (!empty($saved)) { foreach ($saved as $key => $option) { $options[$key] = $option; } } else { update_option(self::$global_option, $options); } /* // update the options if necessary if ($saved != $options) {var_dump("111"); update_option(self::$global_option, $options); }*/ // Save class variable WSW_Main::$settings = $options; //return the options return $options; }
/** * Creates the markup for the Settings page */ public function markup_score_page() { echo '<div id="wrap" class="container">'; WSW_Main::markup_settings_header(); if (current_user_can(WSW_Main::REQUIRED_CAPABILITY)) { echo self::render_template('global-settings/page-score.php'); } else { wp_die('Access denied.'); } echo '</div>'; }
/** * Constructor */ protected function __construct() { self::$plugin_dir = plugin_dir_path(__FILE__); self::$plugin_url = plugins_url('', __FILE__); self::$plugin_name = plugin_basename(__FILE__); WSW_Settings::get_options(); if (WSW_Main::$settings['wsw_initial_dt'] == '') { $options = WSW_Main::$settings; $options['wsw_initial_dt'] = time(); WSW_Settings::update_options($options); } // create tables for plugin work WSW_Model_Log::create_table(); $this->register_hook_callbacks(); $this->modules = array('WSW_Dashboard' => WSW_Dashboard::get_instance(), 'WSW_Show' => WSW_Show::get_instance()); }
<li><a>People</a></li> <li><a>Product</a></li> </ul> <div> <div> <div class="form-group"> <label class="col-sm-3 control-label"><?php echo 'Rating'; ?> </label> <div class="col-sm-9"> <select class="form-control" id="wsw_review_rating" style="height: 28px;width: 50%;"> <?php $rating_values = WSW_Main::get_rating_values(); foreach ($rating_values as $rating_value) { ?> <option value="<?php echo $rating_value; ?> " <?php if ($wsw_rating_value == $rating_value) { echo ' selected="selected"'; } ?> ><?php echo $rating_value; ?> </option> <?php
/** * Creates the markup for the Dashboard page */ public function markup_dashboard_page() { WSW_Main::markup_settings_header(); if (current_user_can(WSW_Main::REQUIRED_CAPABILITY)) { $variables = array(); $variables['chk_keyword_to_titles'] = WSW_Main::$settings['chk_keyword_to_titles']; $variables['chk_tweak_permalink'] = WSW_Main::$settings['chk_tweak_permalink']; $variables['chk_nofollow_in_external'] = WSW_Main::$settings['chk_nofollow_in_external']; $variables['chk_nofollow_in_image'] = WSW_Main::$settings['chk_nofollow_in_image']; $variables['chk_use_facebook'] = WSW_Main::$settings['chk_use_facebook']; $variables['chk_use_twitter'] = WSW_Main::$settings['chk_use_twitter']; $variables['chk_use_meta_robot'] = WSW_Main::$settings['chk_use_meta_robot']; $variables['chk_use_richsnippets'] = WSW_Main::$settings['chk_use_richsnippets']; $variables['chk_keyword_decorate_bold'] = WSW_Main::$settings['chk_keyword_decorate_bold']; $variables['chk_keyword_decorate_italic'] = WSW_Main::$settings['chk_keyword_decorate_italic']; $variables['chk_keyword_decorate_underline'] = WSW_Main::$settings['chk_keyword_decorate_underline']; $variables['chk_make_sitemap'] = WSW_Main::$settings['chk_make_sitemap']; $variables['opt_keyword_decorate_bold_type'] = WSW_Main::$settings['opt_keyword_decorate_bold_type']; $variables['opt_keyword_decorate_italic_type'] = WSW_Main::$settings['opt_keyword_decorate_italic_type']; $variables['opt_keyword_decorate_underline_type'] = WSW_Main::$settings['opt_keyword_decorate_underline_type']; $variables['opt_image_alternate_type'] = WSW_Main::$settings['opt_image_alternate_type']; $variables['opt_image_title_type'] = WSW_Main::$settings['opt_image_title_type']; $variables['txt_image_alternate'] = WSW_Main::$settings['txt_image_alternate']; $variables['txt_image_title'] = WSW_Main::$settings['txt_image_title']; $variables['chk_use_headings_h1'] = WSW_Main::$settings['chk_use_headings_h1']; $variables['chk_use_headings_h2'] = WSW_Main::$settings['chk_use_headings_h2']; $variables['chk_use_headings_h3'] = WSW_Main::$settings['chk_use_headings_h3']; $variables['chk_tagging_using_google'] = WSW_Main::$settings['chk_tagging_using_google']; $variables['txt_generic_tags'] = WSW_Main::$settings['txt_generic_tags']; $variables['chk_author_linking'] = WSW_Main::$settings['chk_author_linking']; $variables['chk_block_login_page'] = WSW_Main::$settings['chk_block_login_page']; $variables['chk_block_admin_page'] = WSW_Main::$settings['chk_block_admin_page']; $variables['lsi_bing_api_key'] = WSW_Main::$settings['lsi_bing_api_key']; $variables['first_tab'] = 'tab1'; if ($_GET['action'] == 'Trash') { WSW_Model_Log::remove_record($_GET['book']); $variables['first_tab'] = 'tab4'; } else { if ($_GET['paged']) { $variables['first_tab'] = 'tab4'; } } if ($_POST['page'] == 'wsw_log_404') { if ($_POST['log404']) { foreach ($_POST['log404'] as $log404) { WSW_Model_Log::remove_record($log404); } } $variables['first_tab'] = 'tab4'; } echo self::render_template('global-settings/page-dashboard.php', $variables); } else { wp_die('Access denied.'); } }
Plugin Name: Seo Wizard Plugin URI: http://seo.uk.net/seo-wizard/ Description: SEO Wizard helps you write better content, write optimized meta titles and descriptions, integrate social media, view post/page analysis and much more! Version: 3.2.1 Author: Seo UK Team Author URI: http://seo.uk.net LICENSE Copyright Seo UK Team (email : support@seo.uk.net) (website : http://www.seo.uk.net) */ if (!defined('ABSPATH')) { die('Access denied.'); } define('WSW_NAME', 'WP SEO Wizard'); define('WSW_REQUIRED_PHP_VERSION', '5.3'); define('WSW_REQUIRED_WP_VERSION', '3.1'); // Include Files $files = array('/classes/wp-module', '/classes/wsw-main', '/classes/wsw-dashboard', '/classes/wsw-show', '/classes/wsw-setting', '/classes/wsw-calc', '/includes/admin-notice-helper/admin-notice-helper', '/lib/bootstrap', '/lib/Youtube/YoutubeInterface', '/lib/Youtube/YoutubeVideo', '/lib/LSI/lsi', '/lib/Self/keywords', '/lib/Self/html_styles', '/model/model-log', '/includes/jlfunctions/jlfunctions', '/includes/jlwp/jlwp', '/plugin/seo-functions', '/plugin/seo-update', '/modules/seo-module', '/modules/seo-importmodule'); foreach ($files as $file) { require_once plugin_dir_path(__FILE__) . $file . '.php'; } // Init Plugin if (class_exists('WSW_Main')) { $GLOBALS['wp-seo-wizard'] = WSW_Main::get_instance(); global $seo_update; $seo_update = new SEO_Update(__FILE__); register_activation_hook(__FILE__, array($GLOBALS['wp-seo-wizard'], 'activate')); register_deactivation_hook(__FILE__, array($GLOBALS['wp-seo-wizard'], 'deactivate')); }