WordPress.org

Plugin Directory

Changeset 698473


Ignore:
Timestamp:
04/16/13 11:37:01 (12 months ago)
Author:
donncha
Message:

Added debug logs to mobile detection code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-super-cache/trunk/wp-cache-phase1.php

    r698463 r698473  
    402402        return $cache_key; 
    403403 
     404    if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_check_mobile: $cache_key" ); 
     405 
    404406    // allow plugins to short circuit mobile check. Cookie, extra UA checks? 
    405407    switch( do_cacheaction( 'wp_cache_check_mobile', $cache_key ) ) { 
    406408    case "normal": 
     409        if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_check_mobile: desktop user agent detected by wp_cache_check_mobile action" ); 
    407410        return $cache_key; 
    408411        break; 
    409412    case "mobile": 
     413        if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_check_mobile: mobile user agent detected by wp_cache_check_mobile action" ); 
    410414        return $cache_key . "-mobile"; 
    411415        break; 
     
    416420    } 
    417421 
    418     if ( do_cacheaction( 'disable_mobile_check', false ) ) 
     422    if ( do_cacheaction( 'disable_mobile_check', false ) ) { 
     423        if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_check_mobile: disable_mobile_check disabled mobile check" ); 
    419424        return $cache_key; 
     425    } 
    420426 
    421427    $browsers = explode( ',', $wp_cache_mobile_browsers ); 
     
    646652        foreach( $cookie_keys as $key ) { 
    647653            if ( strpos( $cookie, $key ) !== FALSE ) { 
    648                 if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Removing auth from $_COOKIE to allow caching for logged user (' . $cookie . ')', 5 ); 
     654                if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Removing auth from $_COOKIE to allow caching for logged in user (' . $cookie . ')', 5 ); 
    649655                unset( $_COOKIE[ $cookie ] ); 
    650656            } 
Note: See TracChangeset for help on using the changeset viewer.