Plugin Directory

Changeset 2382492


Ignore:
Timestamp:
09/15/2020 11:04:26 PM (6 years ago)
Author:
chrisb10
Message:

Outdated browser feature

Location:
browserly/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • browserly/trunk/browserly.php

    r2381564 r2382492  
    88  * Description: Easily customise the users browser, including setting the theme colour, and disabling overscroll or pull-to-refresh features.
    99  * Author: Browserly
    10   * Version: 1.1.0
     10  * Version: 1.2.0
    1111  */
    1212
  • browserly/trunk/inc/customizer.php

    r2381564 r2382492  
    1717  ) );
    1818
    19     // add theme section
     19  // add theme section
    2020    $wp_customize->add_section( 'browserly_theme', array(
    2121        'title' => __( 'Theme Colour', 'browserly' ),
    22         'description' => __( 'Allow your branding to flow throughout the users browser on mobile devices, by adjusting the theme colour of the address and notifications bar.' ),
     22        'description' => __( 'Allow your branding to flow throughout the users browser on mobile devices, by adjusting the theme colour of the address and notifications bar. <br><br>This applies to Chrome, Firefox, Opera, and Windows mobile devices. ' ),
    2323        'priority' => 10,
    2424    'panel' => 'browserly',
     
    3333  ) );
    3434
    35     // primary color control
     35  // primary color control
    3636    $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'browserly_primary_color', array(
    37         'label' => 'Address & Notification Bar Colour',
    38     'description' => __( 'This applies to Chrome, Firefox, Opera, and Windows mobile devices.', 'browserly' ),
    3937        'section' => 'browserly_theme',
    4038        'settings' => 'browserly_primary_color',
     
    111109  ) );
    112110
     111  // add outdated browser section
     112  $wp_customize->add_section( 'browserly_outdatedbrowser', array(
     113    'title' => __( 'Outdated Browser', 'browserly' ),
     114    'description' => __( 'Don\'t let visitors using outdated browsers miss out! Enable this option to display a message to visitors using an out-of-date browser version, recommending they upgrade. <br><br>Further details on this can be found here: https://browser-update.org/' ),
     115    'priority' => 30,
     116    'panel' => 'browserly',
     117  ) );
     118
     119  // outdated browser setting
     120  $wp_customize->add_setting( 'browserly_outdatedbrowser' , array(
     121    'type' => 'option',
     122    'capability' => 'manage_options',
     123    'sanitize_callback' => 'browserly_sanitize_checkbox'
     124  ) );
     125
     126  // outdated browser control
     127  $wp_customize->add_control( 'browserly_outdatedbrowser', array(
     128    'label' => 'Enable out-of-date browser message', 'browserly',
     129    'type' => 'checkbox',
     130    'default'    => '0',
     131    'section' => 'browserly_outdatedbrowser',
     132  ) );
     133
    113134function browserly_sanitize_checkbox( $checked ) {
    114135  // Boolean check.
  • browserly/trunk/inc/get-options.php

    r2381564 r2382492  
    7070
    7171add_action( 'wp_head', 'browserly_overscroll_styles' );
     72
     73
     74// Out-of-date browser message
     75function browserly_outdatedbrowser() {
     76
     77$browserly_outdatedbrowser = get_option( 'browserly_outdatedbrowser', __('0') );
     78if ( $browserly_outdatedbrowser != '0' ) :
     79?>
     80  <script>
     81    var $buoop = {required:{e:-4,f:-3,o:-3,s:-1,c:-3},insecure:true,unsupported:true,mobile:false,api:2020.09 };
     82    function $buo_f(){
     83    var e = document.createElement("script");
     84    e.src = "//browser-update.org/update.min.js";
     85    document.body.appendChild(e);
     86    };
     87    try {document.addEventListener("DOMContentLoaded", $buo_f,false)}
     88    catch(e){window.attachEvent("onload", $buo_f)}
     89  </script>
     90<?php
     91endif;
     92
     93}
     94
     95add_action( 'wp_footer', 'browserly_outdatedbrowser' );
  • browserly/trunk/readme.txt

    r2381564 r2382492  
    11=== Browserly ===
    2 Tags: Chrome,Theme Color, meta name, Color,Theme,Overscroll,Pull to refresh, Browser,Safari,Firefox
     2Contributors: chrisb10
     3Tags: theme color, meta name, pull to refresh, overscroll, out of date, outdated browser, color, theme, browser, chrome, safari, firefox
    34Requires at least: 4.0
    45Tested up to: 5.5
     
    3435== Installation ==
    3536
    36 1. Upload the plugin files to the `/wp-content/plugins/browserly` directory, or install the plugin through the WordPress plugins screen directly
     371. Upload the plugin to the `/wp-content/plugins` directory, or install the plugin through the WordPress plugins screen directly
    37382. Activate the plugin through the 'Plugins' screen in WordPress
    38393. The plugin options can be found within the WordPress Customizer > Browserly
     
    4445The options are available within the WordPress Customizer > Browserly.
    4546
    46 = Does your plugin cleanup data upon uninstall? =
     47= Does Browserly cleanup its data upon uninstall? =
    4748
    48 Yes, when you uninstall Browserly, we remove any saved data. It will be like it was never installed. :)
     49Yes, when you uninstall Browserly, any saved data is automatically removed. It will be like it was never installed. :)
     50
     51= How can I get support? =
     52
     53The support forum is best! We'll follow with any questions/issues there - https://wordpress.org/support/plugin/browserly/
    4954
    5055== Changelog ==
    51561.0.0
     5710th September 2020
    5258Initial release
    53591.1.0
     6014th September 2020
    5461Feature: Safari Specific Styling
     621.2.0
     6315th September 2020
     64Feature: Outdated browser message
  • browserly/trunk/uninstall.php

    r2381564 r2382492  
    1717$wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'browserly_overscroll'" );
    1818$wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'browserly_safari_notification'" );
     19$wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'browserly_outdatedbrowser'" );
Note: See TracChangeset for help on using the changeset viewer.