| @@ -5,9 +5,9 @@ | ||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | class CoolClock { |
| 8 | 8 | |
| 9 | - static $plugin_version; | |
| 9 | + static $plugin_version = '4.0.99'; | |
| 10 | 10 | |
| 11 | 11 | static $script_version = '3.1.0'; |
| 12 | 12 | |
| 13 | 13 | private static $plugin_url; |
| @@ -21,9 +21,9 @@ | ||
| 21 | 21 | static $add_moreskins = false; |
| 22 | 22 | |
| 23 | 23 | private static $done_excanvas = false; |
| 24 | 24 | |
| 25 | - static $defaults = array( | |
| 25 | + static $defaults = array ( | |
| 26 | 26 | 'skin' => 'swissRail', |
| 27 | 27 | 'radius' => 100, |
| 28 | 28 | 'noseconds' => false, // Hide seconds |
| 29 | 29 | 'gmtoffset' => '', // GMT offset |
| @@ -31,9 +31,9 @@ | ||
| 31 | 31 | 'scale' => 'linear', // Define type of clock linear/logarithmic/log reversed |
| 32 | 32 | 'digitalcolor' => '#333' |
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | - static $showdigital_options = array( | |
| 35 | + static $showdigital_options = array ( | |
| 36 | 36 | '' => '', |
| 37 | 37 | 'digital12' => 'showDigital' |
| 38 | 38 | ); |
| 39 | 39 | |
| @@ -38,22 +38,22 @@ | ||
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | 40 | static $advanced = false; |
| 41 | 41 | |
| 42 | - static $advanced_defaults = array( | |
| 42 | + static $advanced_defaults = array ( | |
| 43 | 43 | 'subtext' => '', |
| 44 | 44 | 'align' => 'center' |
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | - static $default_skins = array('swissRail','chunkySwiss','chunkySwissOnBlack'); | |
| 47 | + static $default_skins = ['swissRail','chunkySwiss','chunkySwissOnBlack']; | |
| 48 | 48 | |
| 49 | - static $more_skins = array('fancy','machine','simonbaird_com','classic','modern','simple','securephp','Tes2','Lev','Sand','Sun','Tor','Cold','Babosa','Tumb','Stone','Disc','watermelon','mister'); | |
| 49 | + static $more_skins = ['fancy','machine','simonbaird_com','classic','modern','simple','securephp','Tes2','Lev','Sand','Sun','Tor','Cold','Babosa','Tumb','Stone','Disc','watermelon','mister']; | |
| 50 | 50 | |
| 51 | - static $advanced_skins = array(); | |
| 51 | + static $advanced_skins = []; | |
| 52 | 52 | |
| 53 | - static $advanced_skins_config = array(); | |
| 53 | + static $advanced_skins_config = []; | |
| 54 | 54 | |
| 55 | - static $clock_types = array( | |
| 55 | + static $clock_types = array ( | |
| 56 | 56 | 'linear' => '', |
| 57 | 57 | 'logClock' => 'logClock', |
| 58 | 58 | 'logClockRev' => 'logClockRev' |
| 59 | 59 | ); |
| @@ -147,69 +147,19 @@ | ||
| 147 | 147 | public static function register_widget() { |
| 148 | 148 | register_widget("CoolClock_Widget"); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - // add links to plugin's description | |
| 152 | - public static function plugin_meta_links($links, $file) { | |
| 153 | - $support_link = '<a target="_blank" href="https://wordpress.org/support/plugin/coolclock/">' . __('Support','coolclock') . '</a>'; | |
| 154 | - $rate_link = '<a target="_blank" href="https://wordpress.org/support/plugin/coolclock/reviews/?filter=5#new-post">' . __('Rate ★★★★★','coolclock') . '</a>'; | |
| 155 | - | |
| 156 | - if ( $file == self::$plugin_basename ) { | |
| 157 | - $links[] = $support_link; | |
| 158 | - $links[] = $rate_link; | |
| 159 | - } | |
| 160 | - | |
| 161 | - return $links; | |
| 162 | - } | |
| 163 | - | |
| 164 | - public static function colorval( $color ) | |
| 165 | - { | |
| 166 | - $color = strip_tags( $color ); | |
| 167 | - $color = trim( $color ); | |
| 168 | - | |
| 169 | - if (substr($color, 0, 1) == '#') { | |
| 170 | - if ( ctype_xdigit(substr($color, 1)) ) | |
| 171 | - return $color; | |
| 172 | - | |
| 173 | - return substr($color, 1); | |
| 174 | - } | |
| 175 | - | |
| 176 | - return ctype_xdigit($color) ? '#'.$color : $color; | |
| 177 | - } | |
| 178 | - | |
| 179 | 151 | /** |
| 180 | 152 | * INIT |
| 181 | 153 | */ |
| 182 | 154 | |
| 183 | - public function __construct( $plugin_file, $plugin_version ) { | |
| 155 | + public function __construct( $file ) { | |
| 184 | 156 | // VARS |
| 185 | - self::$plugin_url = plugins_url( '/', $plugin_file ); | |
| 186 | - self::$plugin_basename = plugin_basename( $plugin_file ); | |
| 187 | - self::$plugin_version = $plugin_version; | |
| 157 | + self::$plugin_url = plugins_url( '/', $file ); | |
| 158 | + self::$plugin_basename = plugin_basename( $file ); | |
| 188 | 159 | |
| 189 | 160 | if ( defined('WP_DEBUG') && WP_DEBUG ) { |
| 190 | 161 | self::$min = ''; |
| 191 | 162 | } |
| 192 | - | |
| 193 | - // text domain | |
| 194 | - add_action( 'plugins_loaded', array( __CLASS__, 'textdomain' ) ); | |
| 195 | - | |
| 196 | - // widgets | |
| 197 | - add_action( 'widgets_init', array( __CLASS__, 'register_widget' ) ); | |
| 198 | - | |
| 199 | - // enqueue scripts but only if shortcode or widget has been used | |
| 200 | - // so it has to be done as late as the wp_footer action | |
| 201 | - add_action( 'wp_footer', array( __CLASS__, 'enqueue_scripts' ), 1 ); | |
| 202 | - | |
| 203 | - add_filter( 'plugin_row_meta', array( __CLASS__, 'plugin_meta_links' ), 10, 2); | |
| 204 | - | |
| 205 | - /************** | |
| 206 | - * SHORTCODE | |
| 207 | - **************/ | |
| 208 | - | |
| 209 | - add_shortcode( 'coolclock', array( 'CoolClock_Shortcode', 'handle_shortcode' ) ); | |
| 210 | - | |
| 211 | - // prevent texturizing shortcode content | |
| 212 | - add_filter( 'no_texturize_shortcodes', array( 'CoolClock_Shortcode', 'no_wptexturize') ); | |
| 213 | 163 | } |
| 214 | 164 | |
| 215 | 165 | } |