function weaverii_admin_mobileopts()
{
    $opts = array(array('name' => '#070Mobile Support Mode', 'id' => '_wii_mode_mobile', 'type' => 'select_id', 'info' => 'Select how Weaver II generates mobile views. (Default: Smart, hide sidebars) Important: see the help file!. &diams;', 'value' => array(array('val' => 'weaver-mobile-smart-nostack', 'desc' => 'Smart, hide sidebars'), array('val' => 'weaver-mobile-smart-stacked', 'desc' => 'Smart, stacked sidebars'), array('val' => 'weaver-mobile-resp-nostack', 'desc' => 'Responsive, hide sidebars'), array('val' => 'weaver-mobile-responsive', 'desc' => 'Responsive, stacked sidebars'))), array('name' => '#070<small>Disable Mobile Support</small>', 'id' => '_wii_mobile_disable', 'type' => '=checkbox', 'info' => 'Disable support for mobile devices. Your site will shrink the sizes of the sidebars and content
areas, but will otherwise not be responsive or stack sidebars. &diams;'), array('name' => '<small>Alternative Mobile Plugins:</small>', 'type' => '=note', 'info' => 'If you need to use an alternative Mobile Theme plugin, you <strong>must</strong> set one of the
responsive <em>Mobile Support Modes</em> above, in which case your site will continue to display responsively on desktop browsers and unrecognized mobile devices, while using the alternative plugin for recognized mobile devices.
You can also <em>Disable Mobile Support</em>, in which case you will not get fully responsive desktop support.'), array('name' => 'Mobile Simulator Options', 'type' => 'subheader', 'info' => 'Settings for the Mobile simulator. Available only when using "Smart" Mobile Modes.'), array('name' => '#070Simulate Mobile Device', 'id' => '_wii_sim_mobile', 'type' => 'select_id', 'info' => 'Simulate Mobile Device (&#9688;Smart Modes Only): Select type to see what your site will look like on mobile devices. The simulator works only when using a "Smart" mobile support mode. Otherwise, just shrink your browser for the Responsive modes (IE7/IE8 don\'t work to shrink). &diams;', 'value' => array(array('val' => 'none', 'desc' => 'Simulation Off'), array('val' => 'WeaverMobile', 'desc' => 'Smart Phone'), array('val' => 'WeaverMobileSmallTablet', 'desc' => 'Small Tablet (Fire)'), array('val' => 'WeaverMobileTablet', 'desc' => 'Large Tablet (iPad)'))), array('name' => '#070<small>... even if not admin</small>', 'id' => '_wii_sim_mobile_always', 'type' => '=checkbox', 'info' => 'Normally, the mobile simulation will be displayed only for admins. Checking this allows visitors to view the simulated mobile view. IMPORTANT! Be careful using this option - it is intended for development and demos only and normally should be disabled for productions sites. &diams;'), array('name' => 'Small Screen Devices', 'type' => '=subheader', 'info' => 'Settings for smartphones, other small screen devices, and small tablets.'), array('name' => '#070Show Full Blog Posts', 'id' => 'wii_mobile_full_posts', 'type' => '+checkbox', 'info' => 'Show full post text on blog pages - posts are excerpted by default on mobile devices (&#9688;Smart Modes only). (&#9679;Pro)'), array('name' => '#070Show Footer Widgets', 'id' => 'wii_mobile_show_footerwidgets', 'type' => '+checkbox', 'info' => 'Will show footer widget area on non-stacked Mobile Modes for mobile devices. (Footer widget is always displayed on stacked Mobile Modes.) (&#9679;Pro)'), array('name' => '#070Hide Top/Bottom Widget Areas', 'id' => 'wii_mobile_hide_topbottom_widgets', 'type' => '+checkbox', 'info' => 'Hide Top and Bottom Widget Areas in addition to Sidebars. (&#9679;Pro)'), array('name' => '#070No Auto-Underline Links', 'id' => 'wii_mobile_nounderline', 'type' => '+checkbox', 'info' => 'Underlined links are easier to use on most mobile devices. This will disable auto-underlined links. (&#9679;Pro)'), array('name' => '#070View Toggle', 'id' => 'wii_layout_view_toggle', 'type' => '+select_id', 'info' => 'How to display the Full View/Mobile View toggle button on mobile devices (&#9688;Smart Modes only). (&#9679;Pro)', 'value' => array(array('val' => 'both', 'desc' => 'Both top &amp; bottom'), array('val' => 'top', 'desc' => 'Top only'), array('val' => 'bottom', 'desc' => 'Bottom only'), array('val' => 'hide', 'desc' => 'Hide view toggle'))), array('name' => '#070<small>Alternate Full View HTML</small>', 'id' => '_wvr_mobile_fullmsg', 'type' => '+textarea', 'info' => 'HTML to replace standard Full View icon (include style if needed). (&#9679;Pro) &diams;'), array('name' => '#070<small>Alternate Mobile View HTML</small>', 'id' => '_wvr_mobile_mobilemsg', 'type' => '+textarea', 'info' => 'HTML to replace standard Mobile View icon. (&#9679;Pro) &diams;'), array('name' => '#070Mobile Home Page', 'id' => 'wii_mobile_home_int', 'type' => '+text', 'info' => 'Specify page ID for alternate Home page when site viewed from mobile device (&#9688;Smart Modes only). Recommended: check "Hide Page on the default Primary Menu" Per Page option for the page. (&#9679;Pro)'), array('name' => '#070Mobile Site Title', 'id' => '_wii_mobile_site_title', 'type' => '+textarea', 'info' => 'Specify alternate Site Title if needed (&#9688;Smart Modes only) (Use &amp;nbsp; to hide Site Title on mobile). (&#9679;Pro) &diams;'), array('name' => '#070<small>Mobile Site Title Color</small>', 'id' => 'wii_mobile_title_color', 'type' => '+color', 'info' => 'Alternate Color for Mobile Site Title (includes Responsive Modes). (&#9679;Pro)'), array('name' => '#070Mobile Header Image', 'id' => '_wii_mobile_header_url', 'type' => '+textmedia', 'info' => 'Specify alternate header image for phone/small tablet mobile view (&#9688;Smart Modes only). (&#9679;Pro) &diams;'), array('name' => '#070<small>Mobile Header Image - Tablet</small>', 'id' => '_wii_mobile_tablet_header_url', 'type' => '+textmedia', 'info' => 'Specify alternate header image for tablet mobile view (will usually not be necessary, &#9688;Smart Modes only). (&#9679;Pro) &diams;'), array('name' => '#070Custom CSS', 'id' => '_wii_mobile_css', 'type' => '+textarea', 'info' => 'Custom site wide CSS included only when viewed on Mobile Device. Note that ".weaver-mobile" wrapping class can also be used for this purpose in the &lt;HEAD&gt; Section Custom CSS option (&#9688;Smart Modes only). (&#9679;Pro) &diams;'), array('name' => '<span style="color:green;">More Mobile Options:</span>', 'type' => 'note', 'info' => 'More mobile options are available for specific areas: Header, Menus, Post Specifics, Shortcodes.'), array('type' => 'submit'), array('name' => 'Tablets', 'type' => '=subheader', 'info' => 'Settings for iPad and other tablets'), array('name' => '#070Keep Site Margins', 'id' => 'wii_mobile_keep_site_margins', 'type' => '+checkbox', 'info' => 'Retain standard site margins on tablets (&#9688;Smart Modes only) - will normally reduce outer margins by default. (&#9679;Pro)'), array('name' => '#070No Auto-Underline Links', 'id' => 'wii_mobile_tablet_nounderline', 'type' => '+checkbox', 'info' => 'Underlined links are easier to use on most tablet devices. This will disable auto-underlined links. (&#9688;Smart Modes only - Responsive Modes never auto-underline links on tablets.) (&#9679;Pro)'), array('name' => 'Alternate Mobile Theme', 'type' => '=subheader', 'info' => 'Use Alternate Mobile Theme when site viewed by Mobile Device.'), array('name' => '#070Use Alternate Mobile Theme', 'id' => '_wii_mobile_alt_theme', 'type' => '+checkbox', 'info' => 'Mobile Devices will use the Mobile Theme Settings saved in the "Save Settings to Mobile Settings"
option on the "Save/Restore" tab (&#9688;Smart Modes only). (The Alternate Mobile Theme can not be displayed with the Mobile Simulator.) (&#9679;Pro) &diams;'));
    ?>
<h3>Mobile Device Options <?php 
    weaverii_help_link('help.html#MobileHelp', 'Help for Mobile Options');
    ?>
</h3>
<p style="font-size:small">
	These are the main options that control how Weaver II displays your site on Mobile devices. Please note that there are
	other options that affect the mobile view located on other tabs (e.g., the Main Options : Header tab). Options that affect
	the mobile view are displayed with a <span style="color:#080;font-weight:bold;">Green Label</span>.
</p>
<?php 
    weaverii_sapi_submit();
    weaverii_check_cache_plugins();
    weaverii_form_show_options($opts);
    if (weaverii_getopt_checked('_wii_mobile_alt_theme')) {
        $temp = get_option(apply_filters('weaver_options', 'weaverii_settings_mobile'));
        if ($temp === false) {
            echo '<strong style="color:red;">Warning: No Mobile Theme Settings have been saved. You <strong>must</strong> use the "Save Settings to Mobile Settings" from the Save/Restore tab first!</strong><br />';
        }
    }
    ?>
<br />
<?php 
    if (!weaverii_hide_advanced_optval('_wii_apple_touch_icon_url')) {
        ?>
   <span style="color:blue;"><b>Apple Touch Icon for iOS</b></span><br />
	<p>When this site is viewed on an Apple iOS device such as an iPhone or iPad (&#9688;Smart Modes only), Apple iOS recognizes a special icon
	that can be displayed on the device's home screen. The recommend size for this icon is a <code>.png</code> file 57x57 px for basic display,
	or 114x114 px for enhanced display. &diams;</p>
	<p>
<?php 
        $icon = weaverii_getopt('_wii_apple_touch_icon_url');
        if ($icon != '') {
            echo '<img src="' . $icon . '" alt="apple touch" />&nbsp;';
        }
        ?>
<strong style="color:#070">Apple Touch Icon URL: </strong>
	<textarea name="<?php 
        weaverii_sapi_main_name('_wii_apple_touch_icon_url');
        ?>
" id="_wii_apple_touch_icon_url" rows=1 style="width: 350px"><?php 
        echo esc_textarea(weaverii_getopt('_wii_apple_touch_icon_url'));
        ?>
</textarea><?php 
        weaverii_media_lib_button('_wii_apple_touch_icon_url');
        ?>
&nbsp;&nbsp;Full path to Apple Touch Icon</p>
	<br />
<?php 
    }
    ?>

   <span style="color:blue;"><b>Caching Plugins for Weaver II</b></span><br />
	<p>Because of the advanced Smart Mobile View capabilities provided by Weaver II, many existing WordPress Caching plugins
	will <strong>not</strong> work correctly with Weaver II <em>when it is displayed in Smart Mobile Device mode</em>.
	(Using one of the Responsive mobile display modes will allow Weaver II to work correctly with any cache plugin.)
	For using the &#9688;Smart Modes mobile support, we have found that the <strong>Quick Cache</strong> and
	<strong>W3 Total Cache</strong> plugins do work with Weaver Smart Mobile mode when
	properly configured. Please see the Weaver II help file for instructions on
	using compatible cache plugin &rarr;. <?php 
    weaverii_help_link('help.html#quickcache', 'Cache Setting for Weaver II');
    ?>
	<p>

<?php 
    weaverii_sapi_submit();
}
Esempio 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 
}