Making WordPress.org


Ignore:
Timestamp:
09/21/2017 06:53:00 PM (7 years ago)
Author:
coffee2code
Message:

Browse Happy API: Switch to CDN URLs for browser logo images.

Also introduces cache buster string.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/browsers.php

    r5936 r5947  
    4545function browsehappy_api_get_browser_data( $browser = false ) {
    4646
    47     $http = 'http://s.wordpress.org/images/browsers/';
    48     $https = 'https://wordpress.org/images/browsers/';
     47    $http  = 'http://s.w.org/images/browsers/';
     48    $https = 'https://s.w.org/images/browsers/';
     49
     50    // Cache buster; increment whenever a browser logo image is updated.
     51    $cache_buster = 1;
    4952
    5053    $data = array(
     
    5457            'normalized'  => 1, // just first number
    5558            'url'         => 'https://support.microsoft.com/en-us/help/17621/internet-explorer-downloads',
    56             'img_src'     => $http . 'ie.png',
    57             'img_src_ssl' => $https . 'ie.png',
     59            'img_src'     => $http  . 'ie.png' . "?{$cache_buster}",
     60            'img_src_ssl' => $https . 'ie.png' . "?{$cache_buster}",
    5861        ),
    5962        'Firefox' => (object) array(
     
    6265            'normalized'  => 1.5, // include second number if non-zero
    6366            'url'         => 'https://www.firefox.com/',
    64             'img_src'     => $http . 'firefox.png',
    65             'img_src_ssl' => $https . 'firefox.png',
     67            'img_src'     => $http  . 'firefox.png' . "?{$cache_buster}",
     68            'img_src_ssl' => $https . 'firefox.png' . "?{$cache_buster}",
    6669        ),
    6770        'Safari' => (object) array(
     
    7073            'normalized'  => 1.5, // include second number if non-zero
    7174            'url'         => 'https://www.apple.com/safari/',
    72             'img_src'     => $http . 'safari.png',
    73             'img_src_ssl' => $https . 'safari.png',
     75            'img_src'     => $http  . 'safari.png' . "?{$cache_buster}",
     76            'img_src_ssl' => $https . 'safari.png' . "?{$cache_buster}",
    7477        ),
    7578        'Opera' => (object) array(
     
    7881            'normalized'  => 2, // include second number
    7982            'url'         => 'https://www.opera.com/',
    80             'img_src'     => $http . 'opera.png',
    81             'img_src_ssl' => $https . 'opera.png',
     83            'img_src'     => $http  . 'opera.png' . "?{$cache_buster}",
     84            'img_src_ssl' => $https . 'opera.png' . "?{$cache_buster}",
    8285        ),
    8386        'Chrome' => (object) array(
     
    8689            'normalized'  => 1, // just first number
    8790            'url'         => 'https://www.google.com/chrome',
    88             'img_src'     => $http . 'chrome.png',
    89             'img_src_ssl' => $https . 'chrome.png',
     91            'img_src'     => $http  . 'chrome.png' . "?{$cache_buster}",
     92            'img_src_ssl' => $https . 'chrome.png' . "?{$cache_buster}",
    9093        ),
    9194    );
Note: See TracChangeset for help on using the changeset viewer.