PluginProbe
CoolClock / 4.1
CoolClock v4.1
4.3.9 4.3.8 trunk 0.1 2.0 2.9.8 3.0 3.1 3.2 3.3 4.0 4.1 4.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7
← All changes | includes/class-coolclock-widget.php +130 -157 4.3.64.1 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 /**
3 4 * CoolClock Widget Class
4 5 */
5 6
@@ -5,40 +6,29 @@
5 6
6 7 class CoolClock_Widget extends WP_Widget {
7 8
8 9 /** PHP5+ constructor */
9 - public function __construct()
10 - {
10 + public function __construct() {
11 11 parent::__construct(
12 - 'coolclock-widget',
13 - __('Analog Clock', 'coolclock'),
14 - array(
15 - 'classname' => 'coolclock',
16 - 'description' => __('Add an analog clock to your sidebar.', 'coolclock')
17 - ),
18 - array(
19 - 'width' => 300,
20 - 'id_base' => 'coolclock-widget'
21 - )
22 - );
12 + 'coolclock-widget',
13 + __('Analog Clock', 'coolclock'),
14 + array(
15 + 'classname' => 'coolclock',
16 + 'description' => __('Add an analog clock to your sidebar.', 'coolclock')
17 + ),
18 + array(
19 + 'width' => 300,
20 + 'id_base' => 'coolclock-widget'
21 + )
22 + );
23 23 }
24 24
25 25 /** @see WP_Widget::widget -- do not rename this */
26 - public function widget( $args, $instance )
27 - {
26 + public function widget( $args, $instance ) {
28 27 extract( $args );
29 -
30 - $defaults = array_merge( array('title'=>'','custom_skin'=>''), CoolClock::$defaults, CoolClock::$advanced_defaults );
31 -
32 - // backward compat
33 - if ( isset($instance['digitalcolor']) && !isset($instance['fontcolor']) ) $instance['fontcolor'] = $instance['digitalcolor'];
34 -
35 28 $title = !empty($instance['title']) ? apply_filters( 'widget_title', $instance['title'] ) : '';
36 - //$number = $this->number;
29 + $number = $this->number;
37 30
38 - // set footer script flags
39 - CoolClock::$add_script = true;
40 -
41 31 // Print output
42 32 echo $before_widget;
43 33
44 34 if ( $title )
@@ -44,76 +34,64 @@
44 34 if ( $title )
45 35 echo $before_title . $title . $after_title;
46 36
47 37 // set skin
48 - $instance['skin'] = CoolClock::parse_skin(
49 - ! empty( $instance['skin'] ) ? $instance['skin'] : $defaults['skin'],
50 - ! empty( $instance['custom_skin'] ) ? $instance['custom_skin'] : ''
51 - );
38 + $skin = ( isset( $instance['skin'] ) )
39 + ? $instance['skin'] : CoolClock::$defaults['skin'];
52 40
53 - // radius, used in wrapper style and coolclock fields
54 - $instance['radius'] = !empty( $instance['radius'] ) && is_numeric( $instance['radius'] ) ? (int) $instance['radius'] : $defaults['radius'];
55 - if ( 10 > $instance['radius'] ) $instance['radius'] = 10; // absolute minimum size 20x20
41 + // add custom skin parameters to the plugin skins array
42 + if ( 'custom_'.$number == $skin )
43 + CoolClock::$advanced_skins_config[$skin] = wp_strip_all_tags( $instance['custom_skin'], true );
56 44
57 - $align = !empty( $instance['align'] ) ? $instance['align'] : $defaults['align'];
58 - $styles = array(
59 - 'width' => 2 * $instance['radius'] . 'px',
60 - 'height' => 'auto',
61 - );
62 - if ( in_array( $align, array('left','center') ) ) {
63 - $styles['margin-right'] = 'auto';
64 - if ( 'left' == $align ) $styles['margin-left'] = '0';
65 - }
66 - if ( in_array( $align, array('right','center') ) ) {
67 - $styles['margin-left'] = 'auto';
68 - if ( 'right' == $align ) $styles['margin-right'] = '0';
69 - }
70 - $styles = apply_filters( 'coolclock_container_styles', $styles, $instance, $defaults );
45 + // set footer script flags
46 + CoolClock::$add_script = true;
71 47
72 - // Build output
73 - // begin wrapper
74 - $output = '<div class="coolclock-container"' . CoolClock::inline_style( $styles ) . '>';
75 - // add canvas
76 - $output .= CoolClock::canvas( $instance );
77 - // end wrapper
78 - $output .= '</div>';
48 + if ( in_array( $skin, CoolClock::$more_skins ) )
49 + CoolClock::$add_moreskins = true;
79 50
80 - // Print filtered output
81 - echo apply_filters( 'coolclock_widget', $output, $args, $instance );
51 + $output = CoolClock::canvas( array(
52 + 'skin' => $skin,
53 + 'radius' => !empty($instance['radius']) && is_numeric($instance['radius']) ? (int) $instance['radius'] : 100,
54 + 'noseconds' => !empty($instance['radius']) ? $instance['noseconds'] : '',
55 + 'gmtoffset' => !empty($instance['gmtoffset']) ? $instance['gmtoffset'] : '',
56 + 'showdigital' => !empty($instance['showdigital']) ? $instance['showdigital'] : '',
57 + 'digitalcolor' => !empty($instance['digitalcolor']) ? $instance['digitalcolor'] : '',
58 + 'scale' => !empty($instance['scale']) ? $instance['scale'] : 'linear',
59 + 'align' => !empty($instance['align']) ? $instance['align'] : 'center',
60 + 'subtext' => !empty($instance['subtext']) ? apply_filters('widget_text', $instance['subtext'], $instance) : ''
61 + ) );
82 62
63 + echo apply_filters( 'coolclock_widget_advanced', $output, $args, $instance );
64 +
83 65 echo $after_widget;
84 66 }
85 67
86 68 /** @see WP_Widget::update -- do not rename this */
87 - public function update( $new_instance, $old_instance )
88 - {
89 - // parse custom skin code
90 - $skin_array = !empty($new_instance['custom_skin']) ? CoolClock::skin_array( wp_strip_all_tags( $new_instance['custom_skin'] ) ) : array();
69 + public function update( $new_instance, $old_instance ) {
70 + $instance['title'] = strip_tags( $new_instance['title'] );
71 + $instance['skin'] = strip_tags( $new_instance['skin'] );
72 + $instance['custom_skin'] = strip_tags( $new_instance['custom_skin'] );
73 + $instance['radius'] = ( (int) $new_instance['radius'] < 5 ) ? 5 : (int) $new_instance['radius'];
74 + $instance['noseconds'] = (bool) $new_instance['noseconds'];
75 + $instance['gmtoffset'] = ( $new_instance['gmtoffset'] == '' ) ? '' : (float) $new_instance['gmtoffset'];
76 + $instance['showdigital'] = strip_tags( $new_instance['showdigital'] );
77 + $instance['digitalcolor'] = strip_tags( $new_instance['digitalcolor'] );
78 + $instance['scale'] = strip_tags( $new_instance['scale'] );
79 + $instance['align'] = strip_tags( $new_instance['align'] );
91 80
92 - $instance['title'] = !empty($new_instance['title']) ? wp_strip_all_tags( $new_instance['title'] ) : '';
93 - $instance['skin'] = !empty($new_instance['skin']) ? wp_strip_all_tags( $new_instance['skin'] ) : '';
94 - $instance['custom_skin'] = !empty($skin_array) ? wp_json_encode( $skin_array ) : '';
95 - $instance['radius'] = ( empty($new_instance['radius']) || (int) $new_instance['radius'] < 5 ) ? 5 : (int) $new_instance['radius'];
96 - $instance['noseconds'] = !empty($new_instance['noseconds']) ? '1' : '';
97 - $instance['gmtoffset'] = isset($new_instance['gmtoffset']) && $new_instance['gmtoffset'] !== '' ? (float) $new_instance['gmtoffset'] : '';
98 - $instance['showdigital'] = !empty($new_instance['showdigital']) ? wp_strip_all_tags( $new_instance['showdigital'] ) : '';
99 - $instance['fontcolor'] = !empty($new_instance['fontcolor']) ? CoolClock::colorval( $new_instance['fontcolor'] ) : '';
100 - $instance['scale'] = !empty($new_instance['scale']) ? wp_strip_all_tags( $new_instance['scale'] ) : '';
101 - $instance['align'] = !empty($new_instance['align']) ? wp_strip_all_tags( $new_instance['align'] ) : '';
102 - $instance['subtext'] = wp_kses( $new_instance['subtext'], CoolClock::$allowed_tags );
81 + if ( current_user_can('unfiltered_html') )
82 + $instance['subtext'] = $new_instance['subtext'];
83 + else
84 + // wp_filter_post_kses() expects slashed
85 + $instance['subtext'] = stripslashes( wp_filter_post_kses( addslashes($new_instance['subtext']) ) );
103 86
104 - return apply_filters( 'coolclock_widget_update_advanced', $instance, $new_instance );
87 + return apply_filters( 'coolclock_widget_update_advanced', $instance, $new_instance );
105 88 }
106 89
107 90 /** @see WP_Widget::form -- do not rename this */
108 - public function form( $instance )
109 - {
110 - $output = '';
111 - $advanced = '';
112 -
113 - // backward compat
114 - if ( isset($instance['digitalcolor']) && !isset($instance['fontcolor']) ) $instance['fontcolor'] = $instance['digitalcolor'];
115 -
91 + public function form( $instance ) {
92 + // Print output
93 + //echo CoolClock::form( $this, $instance );
116 94 $defaults = array_merge( array('title'=>'','custom_skin'=>''), CoolClock::$defaults, CoolClock::$advanced_defaults );
117 95
118 96 $instance = wp_parse_args( (array) $instance, $defaults );
119 97
@@ -122,49 +100,48 @@
122 100 $custom_skin = esc_attr( $instance['custom_skin'] );
123 101
124 102 // Translatable skin names go here
125 103 $skin_names = array (
126 - 'swissrail' => __('Swiss Rail','coolclock'),
127 - 'chunkyswiss' => __('Chunky Swiss','coolclock'),
128 - 'chunkyswissonblack' => __('Chunky Swiss White','coolclock'),
129 - 'fancy' => __('Fancy','coolclock'),
130 - 'machine' => __('Machine','coolclock'),
131 - 'simonbaird_com' => __('SimonBaird.com','coolclock'),
132 - 'classic' => __('Classic by Bonstio','coolclock'),
133 - 'modern' => __('Modern by Bonstio','coolclock'),
134 - 'simple' => __('Simple by Bonstio','coolclock'),
135 - 'securephp' => __('SecurePHP','coolclock'),
136 - 'tes2' => __('Tes2','coolclock'),
137 - 'lev' => __('Lev','coolclock'),
138 - 'sand' => __('Sand','coolclock'),
139 - 'sun' => __('Sun','coolclock'),
140 - 'tor' => __('Tor','coolclock'),
141 - 'cold' => __('Cold','coolclock'),
142 - 'babosa' => __('Babosa','coolclock'),
143 - 'tumb' => __('Tumb','coolclock'),
144 - 'stone' => __('Stone','coolclock'),
145 - 'disc' => __('Disc','coolclock'),
146 - 'watermelon' => __('Watermelon by Yoo Nhe','coolclock'),
147 - 'mister' => __('Mister by Carl Lister','coolclock'),
148 - 'minimal' => __('Minimal','coolclock')
149 - );
104 + 'swissRail' => __('Swiss Rail','coolclock'),
105 + 'chunkySwiss' => __('Chunky Swiss','coolclock'),
106 + 'chunkySwissOnBlack' => __('Chunky Swiss White','coolclock'),
107 + 'fancy' => __('Fancy','coolclock'),
108 + 'machine' => __('Machine','coolclock'),
109 + 'simonbaird_com' => __('SimonBaird.com','coolclock'),
110 + 'classic' => __('Classic by Bonstio','coolclock'),
111 + 'modern' => __('Modern by Bonstio','coolclock'),
112 + 'simple' => __('Simple by Bonstio','coolclock'),
113 + 'securephp' => __('SecurePHP','coolclock'),
114 + 'Tes2' => __('Tes2','coolclock'),
115 + 'Lev' => __('Lev','coolclock'),
116 + 'Sand' => __('Sand','coolclock'),
117 + 'Sun' => __('Sun','coolclock'),
118 + 'Tor' => __('Tor','coolclock'),
119 + 'Cold' => __('Cold','coolclock'),
120 + 'Babosa' => __('Babosa','coolclock'),
121 + 'Tumb' => __('Tumb','coolclock'),
122 + 'Stone' => __('Stone','coolclock'),
123 + 'Disc' => __('Disc','coolclock'),
124 + 'watermelon' => __('Watermelon by Yoo Nhe','coolclock'),
125 + 'mister' => __('Mister by Carl Lister','coolclock'),
126 + 'minimal' => __('Minimal','coolclock')
127 + );
150 128
129 + $skins = array_merge( CoolClock::$default_skins, CoolClock::$more_skins, CoolClock::$advanced_skins );
130 +
151 131 // Translatable type names go here
152 132 $type_names = array (
153 - 'linear' => __('Linear','coolclock'),
154 - 'logclock' => __('Logarithmic','coolclock'),
155 - 'logclockrev' => __('Logarithmic reversed','coolclock')
156 - );
133 + 'linear' => __('Linear','coolclock'),
134 + 'logClock' => __('Logarithmic','coolclock'),
135 + 'logClockRev' => __('Logarithmic reversed','coolclock')
136 + );
157 137
158 138 // Translatable show digital options go here
159 139 $showdigital_names = array (
160 - '' => translate('No'),
161 - 'digital12' => __('time (am/pm)','coolclock'),
162 - 'digital24' => __('time (24h)','coolclock'),
163 - 'date' => __('date','coolclock'),
164 - 'digital12+' => __('time + seconds (am/pm)','coolclock'),
165 - 'digital24+' => __('time + seconds (24h)','coolclock'),
166 - 'text' => __('custom text','coolclock')
140 + '' => __('none','coolclock'),
141 + 'digital12' => __('time (am/pm)','coolclock'),
142 + 'digital24' => __('time (24h)','coolclock'),
143 + 'date' => __('date','coolclock')
167 144 );
168 145
169 146 // Misc translations
170 147 $stray = array(
@@ -171,33 +148,29 @@
171 148 'extra_settings' => __('Extra settings for the CoolClock widget.', 'coolclock')
172 149 );
173 150
174 151 // Title
175 - $output .= '<style type="text/css">#available-widgets [class*=clock] .widget-title:before{content:"\f469"}</style>
176 - <p><label for="' . $this->get_field_id('title') . '">' . __('Title:') . '</label> ';
152 + $output = '<style type="text/css">#available-widgets [class*=clock] .widget-title:before{content:"\f469"}</style>
153 + <p><label for="' . $this->get_field_id('title') . '">' . __('Title:') . '</label> ';
177 154 $output .= '<input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . $title . '" /></p>';
178 155
179 156 // Clock settings
180 157 $output .= '<p><strong>' . __('Clock', 'coolclock') . '</strong></p>';
181 - $output .= '<p><a href="https://premium.status301.com/coolclock-widget-settings/" target="_blank">' . __('CoolClock widget instructions &raquo;', 'coolclock') . '</a></p>';
182 -
183 158 $output .= '<p><label for="' . $this->get_field_id('skin') . '">' . __('Skin:', 'coolclock') . '</label> ';
184 159 $output .= '<select class="select" id="' . $this->get_field_id('skin') . '" name="' . $this->get_field_name('skin') . '">';
185 - $output .= '<option value="' . $defaults['skin'] . '" ' . selected( $defaults['skin'], $instance['skin'], false ) . '>';
186 - $output .= ( isset($skin_names[$defaults['skin']]) ) ? $skin_names[$defaults['skin']] : $defaults['skin'];
187 - $output .= '</option>';
188 - foreach ( CoolClock::get_all_skins() as $skin => $parms ) {
189 - $output .= '<option value="' . $skin . '" ' . selected( $skin, $instance['skin'], false ) . '>';
190 - $output .= ( isset($skin_names[$skin]) ) ? $skin_names[$skin] : $skin;
160 + foreach ($skins as $value) {
161 + $output .= '<option value="' . $value . '"';
162 + $output .= ( $value == $instance['skin'] ) ? ' selected="selected">' : '>';
163 + $output .= ( isset($skin_names[$value]) ) ? $skin_names[$value] : $value;
191 164 $output .= '</option>';
192 - }
193 - $output .= '<option value="custom_' . $this->number . '" ' . selected( 'custom_'.$this->number, $instance['skin'], false ) . '>';
165 + } unset($value);
166 + $output .= '<option value="custom_' . $this->number . '"';
167 + $output .= ( 'custom_'.$this->number == $instance['skin'] ) ? ' selected="selected">' : '>';
194 168 $output .= __('Custom (define below)', 'coolclock') . '</option></select></p>';
195 169
196 170 // Custom skin field
197 171 $output .= '<p><label for="' . $this->get_field_id('custom_skin') . '">' . __('Custom skin parameters:', 'coolclock') . '</label> ';
198 - $output .= '<textarea class="widefat" id="' . $this->get_field_id('custom_skin') . '" name="' . $this->get_field_name('custom_skin') . '">' . $custom_skin . '</textarea> ';
199 - $output .= '<em>' . sprintf( __('(set Skin to Custom above, then add %s here)', 'coolclock'), '<a href="https://premium.status301.com/coolclock-custom-skin/" target="_blank">' . __('parameters in JSON format', 'coolclock') . '</a>' ) . '</em></p>';
172 + $output .= '<textarea class="widefat" id="' . $this->get_field_id('custom_skin') . '" name="' . $this->get_field_name('custom_skin') . '">' . $custom_skin . '</textarea> <em>' . __('(set Skin to Custom above)', 'coolclock') . '</em></p>';
200 173
201 174 // Radius
202 175 $output .= '<p><label for="' . $this->get_field_id('radius') . '">' . __('Radius:', 'coolclock') . '</label> ';
203 176 $output .= '<input class="small-text" id="' . $this->get_field_id('radius') . '" name="' . $this->get_field_name('radius') . '" type="number" min="10" value="' . $instance['radius'] . '" /></p>';
@@ -206,18 +179,33 @@
206 179 $output .= '<p><input id="' . $this->get_field_id('noseconds') . '" name="' . $this->get_field_name('noseconds') . '" type="checkbox" value=';
207 180 $output .= ( $instance['noseconds'] ) ? '"true" checked="checked" />' : '"false" />';
208 181 $output .= ' <label for="' . $this->get_field_id('noseconds') . '">' . __('Hide second hand', 'coolclock') . '</label></p>';
209 182
183 + // Scale
184 + $output .= '<p><label for="' . $this->get_field_id('scale') . '">' . __('Scale:', 'coolclock') . '</label> ';
185 + $output .= '<select class="select" id="' . $this->get_field_id('scale') . '" name="' . $this->get_field_name('scale') . '">';
186 + foreach ( CoolClock::$clock_types as $key => $value ) {
187 + $output .= '<option value="' . $key . '"';
188 + $output .= ( $key == $instance['scale'] ) ? ' selected="selected">' : '>';
189 + $output .= ( isset($type_names[$key]) ) ? $type_names[$key] : $value;
190 + $output .= '</option>';
191 + }
192 + $output .= '</select></p>';
193 +
210 194 // Align
211 195 $output .= '<p><label for="' . $this->get_field_id('align') . '">' . __('Align:', 'coolclock') . '</label> ';
212 196 $output .= '<select class="select" id="' . $this->get_field_id('align') . '" name="' . $this->get_field_name('align') . '">';
213 - $output .= '<option value="">';
214 - $output .= translate('none') . '</option>';
215 - $output .= '<option value="left" ' . selected( $instance['align'], 'left', false ) . '>';
197 + $output .= '<option value=""';
198 + $output .= ( $instance['align'] == '' ) ? ' selected="selected">' : '>';
199 + $output .= __('none', 'coolclock') . '</option>';
200 + $output .= '<option value="left"';
201 + $output .= ( $instance['align'] == 'left' ) ? ' selected="selected">' : '>';
216 202 $output .= __('left', 'coolclock') . '</option>';
217 - $output .= '<option value="right" ' . selected( $instance['align'], 'right', false ) . '>';
203 + $output .= '<option value="right"';
204 + $output .= ( $instance['align'] == 'right' ) ? ' selected="selected">' : '>';
218 205 $output .= __('right', 'coolclock') . '</option>';
219 - $output .= '<option value="center" ' . selected( $instance['align'], 'center', false ) . '>';
206 + $output .= '<option value="center"';
207 + $output .= ( $instance['align'] == 'center' ) ? ' selected="selected">' : '>';
220 208 $output .= __('center', 'coolclock') . '</option>';
221 209 $output .= '</select></p>';
222 210
223 211 // Subtext
@@ -223,26 +211,12 @@
223 211 // Subtext
224 212 $output .= '<p><label for="' . $this->get_field_id('subtext') . '">' . __('Subtext:', 'coolclock') . '</label> ';
225 213 $output .= '<input class="widefat" id="' . $this->get_field_id('subtext') . '" name="' . $this->get_field_name('subtext') . '" type="text" value="' . $subtext . '" /> <em>' . __('(basic HTML allowed)', 'coolclock') . '</em></p>';
226 214
227 - $output .= '<div class="coolclock-advanced" style="background-color:rgba(0,0,0,.03);padding:1px 7px;border-radius:5px;margin-bottom:10px">';
228 -
229 - $output .= '<p><strong>' . translate('Advanced') . '</strong></p>';
230 -
231 215 // Use GMT offset
232 216 $output .= '<p><label for="' . $this->get_field_id('gmtoffset') . '">' . __('GMT offset:', 'coolclock') . '</label> ';
233 217 $output .= '<input class="small-text" id="' . $this->get_field_id('gmtoffset') . '" name="' . $this->get_field_name('gmtoffset') . '" type="number" step="0.5" value="' . $instance['gmtoffset'] . '" /> <em>' . __('(leave blank for visitor local time)', 'coolclock') . '</em></p>';
234 218
235 - // Scale
236 - $output .= '<p><label for="' . $this->get_field_id('scale') . '">' . __('Scale:', 'coolclock') . '</label> ';
237 - $output .= '<select class="select" id="' . $this->get_field_id('scale') . '" name="' . $this->get_field_name('scale') . '">';
238 - foreach ( CoolClock::$clock_types as $key => $value ) {
239 - $output .= '<option value="' . $key . '" ' . selected( $key, strtolower($instance['scale']), false ) . '>';
240 - $output .= ( isset($type_names[$key]) ) ? $type_names[$key] : $value;
241 - $output .= '</option>';
242 - }
243 - $output .= '</select></p>';
244 -
245 219 // Show digital
246 220 if ( $instance['showdigital'] == 'true' || $instance['showdigital'] == '1' )
247 221 $instance['showdigital'] = 'digital12'; // backward compat
248 222
@@ -248,29 +222,28 @@
248 222
249 223 $output .= '<p><label for="' . $this->get_field_id('showdigital') . '">' . __('Show digital:', 'coolclock') . '</label> ';
250 224 $output .= '<select class="select" id="' . $this->get_field_id('showdigital') . '" name="' . $this->get_field_name('showdigital') . '">';
251 225 foreach ( CoolClock::$showdigital_options as $key => $value ) {
252 - $output .= '<option value="' . $key . '" ' . selected( $key, $instance['showdigital'], false ) . '>';
226 + $output .= '<option value="' . $key . '"';
227 + $output .= ( $key == $instance['showdigital'] ) ? ' selected="selected">' : '>';
253 228 $output .= ( isset($showdigital_names[$key]) ) ? $showdigital_names[$key] : $value;
254 229 $output .= '</option>';
255 230 }
256 231 $output .= '</select></p>';
257 232
258 - $output .= '<p><label for="' . $this->get_field_id('fontcolor') . '">' . __('Digital font color:', 'coolclock') . '</label> ';
259 - $output .= '<input id="' . $this->get_field_id('fontcolor') . '" name="' . $this->get_field_name('fontcolor') . '" type="text" value="' . $instance['fontcolor'] . '" /> <em>' . __('(use a valid HTML color code or name)', 'coolclock') . '</em></p>';
233 + $advanced = '<p><label for="' . $this->get_field_id('digitalcolor') . '">' . __('Digital color:', 'coolclock') . '</label> ';
234 + $advanced .= '<input id="' . $this->get_field_id('digitalcolor') . '" name="' . $this->get_field_name('digitalcolor') . '" type="text" value="' . $instance['digitalcolor'] . '" /> <em>' . __('(use a valid HTML color code or name)', 'coolclock') . '</em></p>';
260 235
261 - $advanced .= '<p><a href="https://premium.status301.com/downloads/coolclock-advanced/">' . __('More digital font options &raquo;', 'coolclock') . '</a></p>
262 - <p><strong>' . __('Background') . '</strong></p><p><a href="https://premium.status301.com/downloads/coolclock-advanced/">' . __('Available in the Advanced extension &raquo;', 'coolclock') . '</a></p>';
236 + $advanced .= '<p><a href="http://premium.status301.net/downloads/coolclock-advanced/">' . __('More digital font options &raquo;', 'coolclock') . '</a></p>
237 + <p><strong>' . __('Background') . '</strong></p><p><a href="http://premium.status301.net/downloads/coolclock-advanced/">' . __('Available in the Advanced extension &raquo;', 'coolclock') . '</a></p>';
263 238
264 239 // Advanced filter
265 240 $output .= apply_filters( 'coolclock_widget_form_advanced', $advanced, $this, $instance, $defaults );
266 241
267 - $output .= '</div>';
268 -
269 - if ( class_exists( 'CoolClockAdvanced' ) && isset(CoolClockAdvanced::$plugin_version) && version_compare( CoolClockAdvanced::$plugin_version, '7.1', '<' ) ) { // add an upgrade notice
270 - $output .= '<div class="update-nag"><strong>' . __('Please upgrade the CoolClock - Advanced extension.', 'coolclock') . '</strong> '. ' <a href="https://premium.status301.com/account/" target="_blank">' . __('Please log in with your account credentials here.', 'coolclock') . '</a>' . __('You can download the new version using the link in the downloads list.', 'coolclock') . '</div>';
242 + if ( class_exists( 'CoolClockAdvanced' ) && isset(CoolClockAdvanced::$plugin_version) && version_compare( CoolClockAdvanced::$plugin_version, '7.0', '<' ) ) { // add an upgrade notice
243 + $output .= '<div class="update-nag"><strong>' . __('Please upgrade the CoolClock - Advanced extension.', 'coolclock') . '</strong> '. ' <a href="http://premium.status301.net/account/" target="_blank">' . __('Please log in with your account credentials here.', 'coolclock') . '</a>' . __('You can download the new version using the link in the downloads list.', 'coolclock') . '</div>';
271 244 }
272 245
273 246 echo $output;
247 +
274 248 }
275 -
276 249 }