• Resolved shorif2000

    (@shorif2000)


    I have used the following to fix it. i think it works.

    --- abc-core.php	2015-01-28 15:07:44.512383618 +0000
    +++ abc-core.php.diff	2015-01-28 15:10:23.359948110 +0000
    @@ -1,277 +0,0 @@
    -<?php
    -
    -class ABC_Core {
    -
    -    static $this;
    -
    -    public function __construct()
    -    {
    -
    -        self::$this;
    -
    -        add_action('init', array($this, 'default_setting_values')); // Default settings
    -        add_action('wp_footer', array($this, 'content_wrapper')); // HTML wrapper
    -        add_action('wp_enqueue_scripts', array($this, 'scripts')); // Needed scripts
    -        add_action('wp_enqueue_scripts', array($this, 'styles')); // Needed stylesheets
    -
    -    }
    -
    -    /**
    -     * Get activ users browser details
    -     * @return array [browser details]
    -     */
    -    public function get_browser()
    -    {
    -
    -        $user_agent        = $_SERVER['HTTP_USER_AGENT'];
    -        $browser_full_name = 'Unknown';
    -        $browser_name      = 'Unknown';
    -        $platform          = 'Unknown';
    -        $version           = 'Unknown';
    -        $short_name        = 'Unknown';
    -
    -        // First get the platform
    -        if (preg_match('/android/i', $user_agent)) {
    -
    -            $platform = 'android';
    -
    -        } elseif (preg_match('/iphone/i', $user_agent) || preg_match('/ipad/i', $user_agent) || preg_match('/ipod/i', $user_agent)) {
    -
    -            $platform = 'iOS';
    -
    -        } elseif (preg_match('/linux/i', $user_agent)) {
    -
    -            $platform = 'linux';
    -
    -        } elseif (preg_match('/macintosh|mac os x/i', $user_agent)) {
    -
    -            $platform = 'mac';
    -
    -        } elseif (preg_match('/windows|win32/i', $user_agent)) {
    -
    -            $platform = 'windows';
    -
    -        }
    -
    -        // Next get the name of the useragent yes seperately and for good reason
    -        if (preg_match('/Firefox/i',$user_agent)) {
    -
    -            $browser_full_name = 'Mozilla Firefox';
    -            $browser_name      = 'Firefox';
    -            $short_name        = 'ff';
    -
    -        } elseif (preg_match('/Chrome/i',$user_agent)) {
    -
    -            $browser_full_name = 'Google Chrome';
    -            $browser_name      = 'Chrome';
    -            $short_name        = 'chrome';
    -
    -        } elseif (preg_match('/Safari/i',$user_agent)) {
    -
    -            $browser_full_name = 'Apple Safari';
    -            $browser_name      = 'Safari';
    -            $short_name        = 'safari';
    -
    -        } elseif (preg_match('/MSIE/i',$user_agent) && !preg_match('/Opera/i',$user_agent)
    -            || preg_match('/Windows NT/i',$user_agent) && !preg_match('/Opera/i',$user_agent)) {
    -
    -            $browser_full_name = 'Internet Explorer';
    -            $browser_name      = 'MSIE';
    -            $short_name        = 'ie';
    -
    -        } elseif (preg_match('/Opera/i',$user_agent)) {
    -
    -            $browser_full_name = 'Opera';
    -            $browser_name      = 'Opera';
    -            $short_name        = 'opera';
    -
    -        } elseif (preg_match('/Trident/i',$user_agent)) {
    -			$browser_full_name = 'Internet Explorer';
    -            $browser_name      = 'Trident';
    -            $short_name        = 'ie';
    -        }
    -
    -        // finally get the correct version number
    -        $known = array('Version', $browser_name, 'rv');
    -        $pattern = '#(?<browser>' . implode('|', $known) . ')[/ |:]+(?<version>[0-9.|a-zA-Z.]*)#';
    -        if (!preg_match_all($pattern, $user_agent, $matches)) {
    -            // we have no matching number just continue
    -        }
    -
    -        // see how many we have
    -        $i = count($matches['browser']);
    -
    -        if ($i != 1) {
    -
    -            //we will have two since we are not using 'other' argument yet
    -            //see if version is before or after the name
    -            if (strripos($user_agent, 'Version') < strripos($user_agent, $browser_name)){
    -
    -                $version = $matches['version'][0];
    -
    -            } else {
    -
    -                $version = $matches['version'][1];
    -
    -            }
    -
    -            if (preg_match('/Trident/i',$user_agent))
    -            	$version = "11";
    -
    -        } elseif (preg_match('/Trident/i',$user_agent)) {
    -
    -        	$version = "11";
    -
    -        } else {
    -
    -            $version = $matches['version'][0];
    -
    -        }
    -
    -        // check if we have a number
    -        if ($version == null || $version == '' || $version == 0) {$version = 'Unknown';}
    -
    -        return array(
    -            'user_agent' => $user_agent,
    -            'name'       => $browser_full_name,
    -            'short_name' => $short_name,
    -            'version'    => floor($version),
    -            'platform'   => $platform,
    -            'pattern'    => $pattern
    -        );
    -
    -    }
    -
    -    /**
    -     * The wrapper, added to the site footer, that the popup
    -     * will be placed in after the ajax load
    -     * @return html [echos out the html code needed]
    -     */
    -    function content_wrapper()
    -    {
    -
    -        echo "<div class='advanced-browser-check' style='display:none;' data-url='".json_encode(array("abc_url" => admin_url('admin-ajax.php')))."'></div>";
    -
    -    }
    -
    -    /**
    -     * Default settings and settings array used trough out
    -     * the plugin
    -     * @return array [default settings array]
    -     */
    -    public function default_setting_values()
    -    {
    -
    -        // Default settings values
    -        add_option( 'abc_title', __( 'You are using a web browser not supported by this website!', 'advanced-browser-check' ) );
    -        add_option( 'abc_message', __( 'You are using a web browser that is not supported by this website. This means that some functionality may not work as intended. This may result in strange behaviors when browsing around. Use or upgrade/install one of the following browsers to take full advantage of this website. - Thank you!', 'advanced-browser-check' ) );
    -        add_option('abc_hide', NULL);
    -        add_option('abc_show', array(
    -            'ie'        => '',
    -            'ff'        => 'https://www.mozilla.com/en-US/firefox/all.html',
    -            'safari'    => '',
    -            'opera'     => '',
    -            'chrome'    => 'https://www.google.com/chrome'
    -        ));
    -        add_option('abc_check', array(
    -            'ie'        => '9',
    -            'ff'        => '25',
    -            'safari'    => '4',
    -            'opera'     => '17',
    -            'chrome'    => '30'
    -        ));
    -        add_option('abc_debug', 'off');
    -
    -        // Run update function, this is where the plugin version number is update
    -        $this->update();
    -
    -        // Return the settings in array format
    -        return array(
    -            'title'         => get_option('abc_title'),
    -            'msg'           => get_option('abc_message'),
    -            'hide'          => get_option('abc_hide'),
    -            'show_browser'  => get_option('abc_show'),
    -            'check_browser' => get_option('abc_check'),
    -            'debug'         => get_option('abc_debug')
    -        );
    -
    -    }
    -
    -    /**
    -    * Default browsers settings. This builds the browser dropdowns on the admin page
    -    **/
    -    /**
    -     * Default browsers settings. This builds the browser
    -     * dropdowns on the admin page
    -     * @return array [versions of each browser to include]
    -     */
    -    public function default_browsers()
    -    {
    -
    -        // Included version numbers is current stable (since latest plugin update)
    -        // and 5 future versions
    -        // and 8 older versions
    -
    -        return array(
    -            'safari'    => array(0,3,4,5,6,7,8,9,10,11),
    -            'opera'     => array(0,18,19,20,21,22,23,24,25,26,27,28,29,30,31),
    -            'ff'        => array(0,26,27,28,29,30,31,32,33,34,35,36,37,36,37),
    -            'chrome'    => array(0,31,32,33,34,35,36,37,38,39,40,41,42,43,44),
    -            'ie'        => array(0,7,8,9,10,11,12,13,14,15)
    -        );
    -
    -    }
    -
    -    /**
    -    * Add scripts we need
    -    **/
    -    public function scripts() {
    -        // Load jQuery
    -        wp_enqueue_script("jquery");
    -
    -        // jQuery cookie, used to add a cookie so visitors can hide the popup
    -        wp_enqueue_script("apc_jquery_cookie", plugins_url('/js/jquery.cookie.js', __FILE__), array('jquery'));
    -
    -        // The ajax request so the plugin works with caching plugins
    -        wp_enqueue_script("abc_script", plugins_url('/js/script.js', __FILE__), array('jquery'));
    -    }
    -
    -    /**
    -    * Add styles we need
    -    **/
    -    public function styles() {
    -        // Stylesheet for the popup
    -        wp_enqueue_style("abc_style", plugins_url('/css/style.css', __FILE__));
    -    }
    -
    -    /**
    -    * Sets plugin version and there update functions will be added when larger updates is made
    -    **/
    -    private function update()
    -    {
    -
    -        // If no version number exists, we need to update the settings to v2.0.0 and above
    -        if (!get_option('abc_version')) {
    -
    -            // Get old settings array
    -            $old_settings = get_option('advanced-browser-check');
    -
    -            if ($old_settings) {
    -                // Add the old settings to the new once
    -                update_option('abc_title', $old_settings['title']);
    -                update_option('abc_message', $old_settings['msg']);
    -                update_option('abc_show', $old_settings['show_browser']);
    -                update_option('abc_check', $old_settings['check_browser']);
    -                update_option('abc_hide', $old_settings['hide']);
    -            }
    -
    -            // Delete the old settings array from the DB
    -            delete_option('advanced-browser-check');
    -
    -        }
    -
    -        update_option('abc_version', ABC_VERSION);
    -
    -    }
    -
    -}

    https://www.ads-software.com/plugins/advanced-browser-check/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter shorif2000

    (@shorif2000)

    above does nto work

    Plugin Author Mattias

    (@darkwhispering)

    What is the issue you have with IE 11?

    I have tested the plugin with multiple versions of the IE 11 user agent string without experience any issues.

    Would help if you could submit the debug from the plugin, in the browser you have problem with, plus details of what browser that is, its version and your operating system.

    Thread Starter shorif2000

    (@shorif2000)

    if its in compatibility it does not work.

    Plugin Author Mattias

    (@darkwhispering)

    My first question would be why you have IE 11 in compatibility mode?

    Second, still would be good if you could give me more info that I asked for in my previous post.

    Thread Starter shorif2000

    (@shorif2000)

    the following is a log from ie11 on win 7 , forced in compatibility mode thorugh AD

    172.16.0.85 - - [06/Feb/2015:10:49:18 +0000] "GET /wp-content/plugins/responsive-lightbox/assets/fancybox/blank.gif HTTP/1.1" 304 - "https://website-dev.uk.domain.com/" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)" 0/559
    Plugin Author Mattias

    (@darkwhispering)

    I see. Unfortunately there is nothing I can do about this.

    When IE 11 is in compatibility mode it give the user agent of IE 7, hence you get the overlay even though you are using IE 11.

    As you can see by looking at the user agent string, there is no information at all that says it is IE 11, only IE 7. And that is cuz compatibility mode renders web pages as IE 7 and not 11.

    You can add header,tell IE11 don’t use the compatibility mode.
    if you use the apache,you can use headers_module to fix it.

    <IfModule headers_module>
    Header set X-UA-Compatible: IE=edge
    </IfModule>

    But i don’t sure user agent will show ie11 or ie7, try it first.

    You would use IE11 in compatibility mode for an intranet that has a couple of sites that need compatibility mode to work. Unfortunately the way to do that is by domain name, so any sub domain gets caught under that umbrella.

    The way to tell if the browser is in compatibility mode in IE11 is through the user agent string. There is a part of the string that gives you the rendering engine. For IE11 in compatibility mode that is Trident/7.0. IE 10 uses 6.0 or 5.0. The 5.0 is also used by IE9 so that could still cause issues with IE 10.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘IE 11 not working’ is closed to new replies.