Exemplo n.º 1
0
function weaverii_check_cache_plugins($before = '<p style="border:1px solid black;padding:2px 2px 2px 6px;background:#faa">', $after = '</p>')
{
    if (!weaverii_smart_mode()) {
        return;
    }
    // cache irrelevant if not smart mode
    $bad_cache = '';
    if (function_exists('wpsupercache_site_admin')) {
        $bad_cache = "the WP Super Cache Plugin";
    }
    if (function_exists('wpgc_handle_user_interactions')) {
        $bad_cache = "WP Green Cache";
    }
    if (function_exists('hyper_activate')) {
        $bad_cache = "Hyper Cache";
    }
    if ($bad_cache != '') {
        echo $before;
        ?>
<strong style="color:red;">WARNING!</strong> You are using
<strong><?php 
        echo $bad_cache;
        ?>
</strong>.
Currently, <strong>Weaver II in Smart Mode mobile support is not compatible with that cache plugin</strong>.
Visitors using a Mobile Device to view your site will not get the correct content when using this cache plugin.
Most cache plugins will not work with Weaver II using Smart Mode mobile support. However,
<strong>Quick Cache</strong> and <strong>W3 Total Cache</strong> do work with Weaver II when properly set up.
Please see the Weaver II help file for instructions on using compatible cache.
<em>You can also switch to one of Weaver II's Responsive Mode mobile support models for full cache compatibility.</em>
Click here &rarr; <?php 
        weaverii_help_link('help.html#quickcache', 'Cache Settings for Weaver II');
        echo $after;
    }
    if (function_exists('ws_plugin__qcache_configure_options_and_their_defaults')) {
        echo $before;
        echo '<strong style="color:red;">WARNING!</strong> You are using an old version of <strong>Quick Cache</strong>. Please update!';
        echo $after;
    }
    if (isset($GLOBALS['quick_cache__advanced_cache']) && !defined('WEAVER_II_EXTRAS_VERSION')) {
        echo $before;
        echo 'NOTICE! You are using <strong>Quick Cache</strong>. You MUST install the  <em>Weaver II Theme Extras</em>
        installed for full automatic compatibility with Quick Cache.';
        echo $after;
    }
    $good_cache = '';
    if (function_exists('w3_load_plugins')) {
        $good_cache = "the W3 Total Cache Plugin";
    }
    if ($good_cache) {
        echo $before;
        ?>
	<strong>NOTICE!</strong> You are using
<strong><?php 
        echo $good_cache;
        ?>
</strong>.
Currently, <strong>Weaver II in Smart Mode mobile support requires custom settings</strong>
to work properly with that cache plugin. If you have
not yet configured <em><?php 
        echo $good_cache;
        ?>
</em>, please see the Weaver II help file for instructions on
using that plugin. Click here &rarr; <?php 
        weaverii_help_link('help.html#quickcache', 'Cache Settings for Weaver II');
        ?>
 <br />
Any of the Weaver II Responsive Mode mobile support options are compatible with any cache plugin <em>without</em> additional settings.
</p>
<?php 
        echo $after;
    }
}
Exemplo n.º 2
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 
}
Exemplo n.º 3
0
function weaverii_mobile_output_style($sout)
{
    weaverii_f_write($sout, "/* Weaver II Mobile Device Options */\n");
    if (weaverii_smart_mode()) {
        // settable options
        if ($opt = weaverii_getopt('wii_mobile_title_color')) {
            weaverii_f_write($sout, sprintf(".weaver-mobile #site-title a {color:{$opt};}\n"), $opt);
        }
        if (!weaverii_getopt_checked('wii_mobile_nounderline')) {
            $dev = '.weaver-mobile ';
            if (!weaverii_getopt_checked('wii_mobile_tablet_nounderline')) {
                $dev = '.weaver-any-mobile ';
            }
            weaverii_f_write($sout, sprintf("{$dev} #main a, {$dev} #mobile-widget-area a, {$dev} .sidebar_top a, {$dev} .sidebar_bottom a, {$dev} .sidebar_extra a {text-decoration: underline !important;}\n", $dev, $dev, $dev, $dev, $dev));
        }
    }
    if (weaverii_getopt('wii_mobile_hide_menu_extras')) {
        weaverii_f_write($sout, ".menu-vertical .menu-add{display:none !important;}\n");
    }
    if (weaverii_getopt('wii_mobile_slide_threshold') >= 5000) {
        /* reduces flash of standard menu */
        weaverii_f_write($sout, "#nav-bottom-menu,#nav-top-menu {display:none;}\n#mobile-bottom-nav,#mobile-top-nav {display:block;}\n");
    }
    // ------ Tablet -----------
    if (!weaverii_getopt_checked('wii_mobile_keep_site_margins')) {
        weaverii_f_write($sout, "@media only screen and (max-width:768px) and (orientation:portrait) {body {padding: 0px !important;}}\n");
    }
    // ----- Mobile - Small Tablets + Phones
    weaverii_f_write($sout, "@media only screen and (max-width:640px) {\n");
    // @media
    if (weaverii_getopt_checked('wii_mobile_hide_header_image')) {
        weaverii_f_write($sout, "#header_image {display:none;}\n");
    }
    if (weaverii_getopt_checked('_wii_hdr_widg_hide_mobile')) {
        weaverii_f_write($sout, "#sidebar_header {display:none;}\n");
    }
    weaverii_css_style_val($sout, 'body', '{font-size:%dpx !important;}', 'wii_site_fontsize_mobile_int');
    if (!weaverii_getopt_checked('wii_mobile_nounderline')) {
        weaverii_f_write($sout, "#main a, #mobile-widget-area a, .sidebar_top a, .sidebar_bottom a, .sidebar_extra a{text-decoration: underline !important;}\n");
    }
    if ($opt = weaverii_getopt('wii_mobile_title_color')) {
        weaverii_f_write($sout, sprintf("#site-title a {color:{$opt};}\n"), $opt);
    }
    if (weaverii_getopt_checked('wii_mobile_show_footerwidgets')) {
        weaverii_f_write($sout, ".weaver-mobile-smart-nostack #sidebar_wrap_footer,.weaver-mobile-resp-nostack #sidebar_wrap_footer {display:block !important;}\n");
    }
    if (weaverii_getopt_checked('wii_mobile_hide_topbottom_widgets')) {
        weaverii_f_write($sout, ".sidebar_top, .sidebar_bottom {display:none;}\n");
    }
    weaverii_f_write($sout, "}\n");
    // end @media
    // ----- Phones
    weaverii_f_write($sout, "@media only screen and (max-width: 580px) {\n");
    if (weaverii_getopt_checked('wii_desc_show_mobile')) {
        weaverii_f_write($sout, "#site-description {display:block;}\n");
    }
    weaverii_f_write($sout, "}\n");
}
Exemplo n.º 4
0
function weaverii_sc_hide_if_mobile($args = '', $text)
{
    extract(shortcode_atts(array('type' => 'mobile'), $args));
    if (weaverii_smart_mode()) {
        if (!weaverii_use_mobile($type)) {
            return do_shortcode($text);
        } else {
            return '';
        }
    } else {
        if ($type == 'touch') {
            $type = 'mobile';
        }
        return '<span class="wvr-hide-mobile-' . $type . '">' . do_shortcode($text) . '</span>';
    }
    return '';
}