示例#1
0
function weaverii_perform_check()
{
    ?>
<div style="background:#FFFF88;border:3px solid green;font-size:larger;padding:0 10px 0 10px; width:80%;margin-top:15px;margin-bottom:10px;">
	<p style="font-weight:normal;"><strong>Checking Weaver II for possible problems.</strong> This will check for some potential problems, but it is
	not a comprehensive check. Most messages are informational warnings, but things that should be fixed are marked ERROR.</p>
	<ul style="list-style-type:disc;list-style-position:inside;">
<?php 
    echo '<li>' . weaverii_check_version(true) . "</li>\n";
    // version
    global $wp_version;
    // see about file system
    if (function_exists('get_filesystem_method')) {
        // this is available to check
        $type = get_filesystem_method(array());
        // lets see if we have direct or ftpx
        if ($type == 'ftpext') {
            // supposed to be using ftp access
            ?>
	<li>Please note: your site server is configured so that WordPress requires "FTP File Access" to update themes,
	plugins, and other files. If your site host is a private server, VPS, or other system where your site is secure from other
	users, <em>this is not an issue</em>. If, on the other hand, your site is using shared hosting, then it might
	be vulnerable to attack from other users who share your server. We <strong>strongly</strong> advise that you contact
	your hosting company and see if your site can be configured more securely, and if not, change hosting companies.
	Most modern shared hosting companies can provide "suPHP", "fastCGI", or other tools that allow shared
	serving without compromising file security.
<?php 
            if (weaverii_init_base()) {
                ?>
	<br /><br />
	For Weaver II Pro, the "FTP File Access" requirement may cause issues with creating css and saved-settings files.
	You may want to add FTP credentials to your wp-config.php file.
<?php 
            }
            ?>
	</li>
<?php 
        }
    }
    if (!weaverii_init_base() && !function_exists('weaverii_extras_shortcodes_installed')) {
        echo "<li><strong>WARNING:</strong> You do not have the <em>Weaver II Theme Extras</em> plugin\n\t\tinstalled. It provides important and useful shortcodes for Weaver II. Please open the\n\t\t<strong>Shortcodes/Plugins</strong> tab for more information.</li>";
    }
    // option combinations
    if (weaverii_getopt('wii_wrap_shadow') && !weaverii_getopt('wii_page_bgcolor')) {
        // MUST have wrapper page bg set
        ?>
	<li><span style="color:red;font-weight:bold">ERROR:</span> You have specified "Wrap site with shadow" but
have not provided a backgroud color for "Wrapper Page BG". This combination may not display correctly
on IE7 and IE8. Please provide a Wrapper Page BG color.</li>
<?php 
    }
    // plugins
    weaverii_check_cache_plugins('<li>', '</li>');
    // Cache check
    weaverii_check_mobile_plugins('<li>', '</li>');
    // Check for mobile plugin themes
    $seo = '';
    if (function_exists('aioseop_get_version')) {
        $seo = 'All in One SEO Pack';
    }
    if (function_exists('su_wp_incompat_notice')) {
        $seo = 'SEO Ultimate';
    }
    if (class_exists('gregsHighPerformanceSEO')) {
        $seo = 'Greg\'s High Performance SEO';
    }
    if (class_exists('EcordiaContentOptimizer')) {
        $seo = 'Scribe SEO';
    }
    if ($seo) {
        echo '<li>You are using the SEO plugin <em>' . $seo . '</em>';
        '</em>. Be sure you have filled in the SEO plugin settings</li>';
    }
    if (function_exists('wpseo_get_value')) {
        echo '<li>NOTICE: You are using "WordPress SEO by Yoast". Weaver II automatically supports
this plugin. Be sure you have filled in the plugin settings.</li>';
        $seo = 'Yoast';
    }
    if (!$seo) {
        echo '<li>None of the most popular SEO plugins have been activated. You might want to consider using "WordPress SEO by Yoast", for example.</li>';
    }
    // widgets
    if (is_active_sidebar('header-widget-area')) {
        // have an active horizontal header area
        if (weaverii_getopt('_wii_hdr_widg_1_w_int') == '') {
            // just check the first one
            ?>
	<li><span style="color:red;font-weight:bold">ERROR:</span> You have added widgets for the <em>Header Horizontal Widget Area</em>, but have not
	properly defined widths for the widgets in that area. (Main Options:Header:Header Widget Area Widgets:Widths) </li>
<?php 
        }
    }
    if (!is_active_sidebar('primary-widget-area') && !is_active_sidebar('right-widget-area') && !is_active_sidebar('left-widget-area')) {
        echo '<li>You have not added any <em>widgets</em> to the <em>standard</em> sidebar widget areas. This check does not include any alternate
		replacement widget areas. (Dashboard:Widgets)</li>';
    }
    // misc
    $saved = get_option(apply_filters('weaver_options', 'weaverii_settings_backup'));
    if (empty($saved)) {
        echo '<li>You have not saved your settings using the <em>Save/Restore</em> tab. It is good practice to keep a saved version of your settings.</li>';
    }
    $icon = weaverii_getopt('_wii_favicon_url');
    if (!$icon) {
        echo '<li>You have not specified a <em>FavIcon</em>. It is a good idea to have a FavIcon for your site. (Advanced Options:Site Options)</li>';
    }
    // pro options
    if (weaverii_getopt_checked('_wii_inline_style')) {
        echo '<li>You have <em>Use Inline CSS</em> checked. (Weaver II Pro tab)</li>';
    }
    if (weaverii_getopt_checked('_wii_development_mode')) {
        echo '<li>You have <em>Development Mode</em> checked. It is recommended to disable it for production sites. (Weaver II Pro tab)</li>';
    }
    // MOBILE
    if (weaverii_getopt_checked('_wii_mobile_alt_theme')) {
        $temp = get_option(apply_filters('weaver_options', 'weaverii_settings_mobile'));
        if ($temp === false) {
            echo '<li><span style="color:red;font-weight:bold">ERROR:</span> You have checked <em>Use Alternate Mobile Theme</em>, but no Mobile Theme Settings have been saved. (Mobile tab) You <em>must</em> use the "Save Settings to Mobile Settings" from the Save/Restore tab first!</li>';
        }
    }
    if (weaverii_getopt_checked('_wii_sim_mobile') && weaverii_getopt_checked('_wii_sim_mobile_always')) {
        echo '<li>You have <em>Simulate Mobile Device</em> enabled for all visitors to your site. That is recommended only for demo sites. (Mobile tab)</li>';
    }
    if (strpos(weaverii_getopt('_wii_mode_mobile'), 'nostack') !== false && !is_active_sidebar('mobile-widget-area')) {
        echo '<li>You don\'t have any widgets defined for the <em>Mobile Device Widget Area</em> (Dashboard:Widgets).
		It is highly recommended to define alternate mobile widgets when you are using a "hide sidebars" mobile mode.</li>';
    }
    if (weaverii_getopt_checked('_wii_mobile_disable')) {
        echo '<li>You have <em>Disable Mobile Support</em> checked. That is not recommended unless you have an alternate mobile theme plugin. (Mobile tab)</li>';
    }
    if (weaverii_smart_mode()) {
        ?>
	<li>You are using a "smart" Mobile Support Mode. You can use the <em>Mobile Device Simulator</em> to check how your site will look on mobile devices. (Mobile tab)</li>
<?php 
    } else {
        ?>
	<li>You are using a "responsive" Mobile Support Mode. You can shrink the width of your desktop browser to see how your site will look on mobile devices.</li>
<?php 
    }
    ?>
	</ul>
	<p style="font-weight:normal;">Theme check complete.</p>

</div>
<?php 
}
示例#2
0
function weaverii_do_admin()
{
    /* theme admin page */
    /* < ?php if (weaverii_init_base()) echo " &mdash; <small style='color:red;'>Beta version expires 09/30/2013</small>"; ? > */
    /* This generates the startup script calls, etc, for the admin page */
    global $weaverii_opts_cache, $weaverii_main_options, $weaverii_main_opts_list;
    if (!current_user_can('edit_theme_options')) {
        wp_die("No permission to access that page.");
    }
    weaverii_admin_page_process_options();
    // Process non-sapi options
    if (weaverii_getopt('wii_subtheme') == 'none') {
        weaverii_activate_subtheme('antique-ivory');
    }
    // first time run, so we gotta load the theme
    echo '<div class="wrap">';
    screen_icon("themes");
    /* add a nice icon to the admin page */
    ?>
<div style="float:left;"><h2><?php 
    echo WEAVERII_THEMEVERSION;
    ?>
 Options
<?php 
    if (is_child_theme()) {
        echo " &mdash; " . wp_get_theme();
    }
    ?>
</h2>
	<a name="top_main" id="top_main"></a></div>
<?php 
    weaverii_donate_button();
    weaverii_check_theme();
    weaverii_clear_messages();
    ?>

<div style="clear:both;">

<?php 
    weaverii_check_for_old_weaver();
    weaverii_check_version();
    // check version RSS
    ?>

<div id="tabwrap">
  <div id="tab-admin" class='yetii'>
	<ul id="tab-admin-nav" class='yetii'>
	  <li><a href="#tab_themes" title="Select from pre-defined subthemes"><?php 
    echo weaverii_t_('Weaver II Subthemes');
    ?>
</a></li>
	  <li><a href="#tab_main" title="Main options for most theme elements: site appearance, layout, header, menus, content, footer, fonts, more."><?php 
    echo weaverii_t_('Main Options');
    ?>
</a></li>
	  <li><a href="#tab_mobileopts" title="Options for Mobile View display."><?php 
    echo weaverii_t_('Mobile');
    ?>
</a></li>
	  <li><a href="#tab_advanced" title="Advanced options: HTML, code, CSS insertion; page templates, background images, SEO, site options."><?php 
    echo weaverii_t_('Advanced Options');
    ?>
</a></li>
	  <li><a href="#tab_admin" title="Basic Administrative Options."><?php 
    echo weaverii_t_('Admin Options');
    ?>
</a></li>
	  <li><a href="#tab_pro" title="Settings for Weaver II Pro edition: tools, activate plugins and features."><?php 
    echo weaverii_t_('Weaver II Pro');
    ?>
</a></li>
	  <li><a href="#tab_shortcodes" title="Weaver and Weaver Pro Shortcodes."><?php 
    echo weaverii_t_('Shortcodes/Plugins');
    ?>
</a></li>
	  <li><a href="#tab_saverestore" title="Save and Restore theme settings."><?php 
    echo weaverii_t_('Save/Restore');
    ?>
</a></li>
	  <li><a href="#tab_help" title="Table of Content links to Weaver Help files"><?php 
    echo weaverii_t_('Help');
    ?>
</a></li>
	</ul>

<?php 
    //  list is order specific - above and below must match
    ?>

	  <div id="tab_themes" class="tab" >
<?php 
    weaverii_admin_subthemes();
    ?>
	  </div>
<?php 
    // ====================== Begin the big form here =====================
    weaverii_sapi_form_top('weaverii_settings_group', 'weaverii_options_form');
    ?>
	  <div id="tab_main" class="tab" >
<?php 
    weaverii_admin_mainopts();
    ?>
	  </div>

	  <div id="tab_mobileopts" class="tab" >
<?php 
    weaverii_admin_mobileopts();
    ?>
	  </div>

	  <div id="tab_advanced" class="tab" >
<?php 
    weaverii_admin_advancedopts();
    ?>
	  </div>

	  <div id="tab_admin" class="tab" >
<?php 
    weaverii_admin_admin();
    ?>
	  </div>

	  <div id="tab_pro" class="tab" >
<?php 
    weaverii_admin_pro();
    ?>
	  </div>

<?php 
    weaverii_sapi_form_bottom();
    // end of SAPI opts here. Can't cross <div>s! Non-sapi forms follow
    // ===================== end of big form  =====================
    ?>
	<div id="tab_shortcodes" class="tab" >
<?php 
    if (weaverii_init_base()) {
        ?>
<h2 style="color:blue;">Weaver II Theme Shortcodes</h2>
<br /><p><a href="<?php 
        echo site_url('/wp-admin/themes.php?page=WeaverII_Shortcodes');
        ?>
">
<span style="color:white;background:#57A;padding:4px;font-weight:bold;">Open Shortcodes Admin</span></a></p>
<br /><p>Settings and information about Weaver II  and Weaver II Pro Shortcodes are found on the
<a href="<?php 
        echo site_url('/wp-admin/themes.php?page=WeaverII_Shortcodes');
        ?>
"><em>Appearance&rarr;Shortcodes + Pro</em></a>
menu found at the left.
</p>
<?php 
    } else {
        if (function_exists('weaverii_extras_shortcodes_installed')) {
            // WEAVER II THEME EXTRAS
            do_action('weaverii_extras_info');
        } else {
            // NEED TO INSTALL EXTRAS
            ?>
<h2 style="color:blue;">Weaver II Theme Extras and Shortcodes</h2>

<h3 style="color:red;">FOR COMPLETE WEAVER II THEME FUNCTIONALITY, PLEASE INSTALL AND ACTIVATE THE <em>WEAVER II THEME EXTRAS</em> PLUGIN.</h3>

<hr />
<p style="font-weight:bold;">The <em>Weaver II Theme Extras</em> plugin provides extra theme functionality, including the capability to upload premium add-on subthemes, and the following shortcodes:</p>
<ul>
	<li><span style="color:red;font-weight:bold;">Show Posts - [weaver_show_posts]</span> - This shortcode allows you to display posts on any page or text
	area, and provides extensive fitering options. A perfect companion for the Page with Posts template.
	This shortcode is an essential part of building sites with Weaver II.</li>
	<li>Breadcrumbs - [weaver_breadcrumbs]</li>
	<li>Header Image - [weaver_header_image]</li>
	<li>HTML - [weaver_html]</li>
	<li>DIV - [div]text[/div]</li>
	<li>SPAN - [span]text[/span]</li>
	<li>iFrame - [weaver_iframe]</li>
	<li>Blog Page Navigation - [weaver_pagenav] </li>
	<li>Show If Mobile - [weaver_show_if_mobile] </li>
	<li>Hide If Mobile - [weaver_hide_if_mobile]</li>
	<li>Show If Logged In - [weaver_show_if_logged_in] </li>
	<li>Hide If Logged In - [weaver_hide_if_logged_in]</li>
	<li>Site Title - [weaver_site_title]</li>
	<li>Site Tagline - [weaver_site_desc]</li>
	<li>Vimeo - [weaver_vimeo] </li>
	<li>YouTube - [weaver_youtube] </li>
</ul>

<hr />
<h2 style="color:blue;">Weaver II Pro Shortcodes</h2>
<strong>The Weaver II Pro Version offers the following shortcodes and features as well:</strong>
<br />
<ul>
	<li>Header Gadgets - Images/Text over Header</li>
	<li>Link Buttons - shortcode & widget</li>
	<li>Social Buttons - shortcode & widget</li>
	<li>Weaver Slider Menu Shortcode</li>
	<li>Extra Menus Shortcode</li>
	<li>Widget Area Shortcode</li>
	<li>Search Form Shortcode</li>
	<li>Show Feed Shortcode</li>
	<li>Popup Link Shortcode</li>
	<li>Show/Hide Shortcode</li>
	<li>Comment Policy</li>
	<li>Shortcoder</li>
	<li>Include PHP Shortcode</li>
	<li>Total CSS</li>

</ul>
<?php 
        }
    }
    ?>
<hr/>
<h2 style="color:blue;">Recommended WordPress Plugins</h2>
<p>The following plugins are recommended to use with Weaver II. While most WordPress plugins work with Weaver, these
provide features commonly needed by Weaver users.</p>
</p>
<ul>
	<li><strong>Slide Shows and image Galleries</strong><br />
	We have developed our own Show Sliders and [gallery] slider plugin:<br />
	<ul><li><a href="http://aspenthemeworks.com/atw-show-sliders/" target="_blank">Aspen Themeworks Show Sliders</a>
	- good for header slideshows</li>
	</ul>
	</li>
	<li><strong>SEO Optimization</strong><br />
		<ul>
			<li><a href="http://wordpress.org/extend/plugins/wordpress-seo/" target="_blank">WordPress SEO by Yoast</a> -
			probably the best. Weaver II automatically supports Yoast's breadcrumbs if they are enabled.</li>
		</ul>
	</li>
	<li><strong>Server Side Caching</strong><br />
		Caching can help with site performance for busy sites on shared servers. We strongly recommend <em>Quick Cache</em>
        which is fully compatible with Weaver II. <em>These are the only 2 compatible caching plugins.</em>
		<ul>
			<li><a href="http://wordpress.org/extend/plugins/quick-cache/" target="_blank">Quick Cache</a> - Complete automatic compatibility <em>when Weaver II Theme Extras installed</em>.</li>
			<li><a href="http://wordpress.org/extend/plugins/w3-total-cache/" target="_blank">W3 Total Cache</a> - Requires custom configuration. We recommend Quick Cache over W3TC. See Help file.</li>
		</ul>
	</li><li><strong>Contact Form</strong><br />
		<ul>
			<li><a href="http://wordpress.org/extend/plugins/si-contact-form/" target="_blank">Fast Secure Contact Form</a>
			- does it all, easy to configure and style</li>
		</ul>
	</li><li><strong>Others</strong><br />
		These plugins are known to work well with Weaver II.
		<ul>

			<li><a href="http://wordpress.org/extend/plugins/ultimate-tinymce/" target="_blank">Ultimate TinyMCE</a> - extend the page/post editor</li>
					<li><a href="http://wordpress.org/extend/plugins/dynamic-widgets/" target="_blank">Dynamic Widgets</a> - an additional way to control when widgets are displayed, automatic compatibility</li>

			<li><a href="http://wordpress.org/extend/plugins/wp-pagenavi/" target="_blank">WP-PageNavi</a> - if installed, will be used instead of Weaver II's Page Navigation</li>
			<li><a href="http://wordpress.org/extend/plugins/wp-paginate/" target="_blank">WP-Paginate</a> - if installed, will be used instead of Weaver II's Page Navigation</li>
		</ul>
	</li>
</ul>
	</div>
	<div id="tab_saverestore" class="tab" >
<?php 
    weaverii_admin_saverestore();
    ?>
	</div>
	<div id="tab_help" class="tab" >
<?php 
    weaverii_admin_help();
    ?>
	</div>
   </div> <!-- #tab-saverestore -->
</div> <!-- #tabwrap -->

<?php 
    weaverii_end_of_section('Options');
    ?>

<script type="text/javascript">
		var tabberAdmin = new Yetii({
		id: 'tab-admin',
		tabclass: 'tab',
		persist: true
		});
</script>

<?php 
}