WordPress.org

Plugin Directory

Changeset 627154


Ignore:
Timestamp:
11/19/12 17:33:34 (17 months ago)
Author:
andy
Message:

Jetpack Stats errors: do not show scary debug info on first instance of error. should reduce user panic on simple timeouts so they just try again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/modules/stats.php

    r624727 r627154  
    948948 
    949949function stats_print_wp_remote_error( $get, $url ) { 
     950    $state_name = 'stats_remote_error_' . substr( md5( $url ), 0, 8 ); 
     951    $previous_error = Jetpack::state( $state_name ); 
     952    $error = md5( serialize( compact( 'get', 'url' ) ) ); 
     953    Jetpack::state( $state_name, $error ); 
     954    if ( $error !== $previous_error ) { 
     955?> 
     956    <div class="wrap"> 
     957    <p><?php _e( 'We were unable to get your stats just now. Please reload this page to try again.', 'jetpack' ); ?></p> 
     958    </div> 
     959<?php 
     960        return; 
     961    } 
    950962?> 
    951963    <div class="wrap"> 
Note: See TracChangeset for help on using the changeset viewer.