Twitter Widget Pro - Version 2.4.0

Version Description

Better linking to fix issues with links followed by punctuation plus support for extended characters in hashtags

Download this release

Release Info

Developer aaroncampbell
Plugin Icon wp plugin Twitter Widget Pro
Version 2.4.0
Comparing to
See all releases

Code changes from version 2.3.11 to 2.4.0

languages/twitter-widget-pro.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/twitter-widget-pro\n"
7
- "POT-Creation-Date: 2012-01-15 19:18:11+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,51 +12,51 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: xavisys-plugin-framework.php:249
16
  msgid "Update Options &raquo;"
17
  msgstr ""
18
 
19
- #: xavisys-plugin-framework.php:296
20
- msgid "Donate"
21
  msgstr ""
22
 
23
- #: xavisys-plugin-framework.php:303
24
- msgid "Support Forum"
25
  msgstr ""
26
 
27
- #: xavisys-plugin-framework.php:311
28
  msgid "Donate to show your appreciation."
29
  msgstr ""
30
 
31
- #: xavisys-plugin-framework.php:322
 
 
 
 
32
  msgid "Settings"
33
  msgstr ""
34
 
35
- #: xavisys-plugin-framework.php:340
36
  msgid "Like this Plugin?"
37
  msgstr ""
38
 
39
- #: xavisys-plugin-framework.php:343
40
  msgid "Need Support?"
41
  msgstr ""
42
 
43
- #: xavisys-plugin-framework.php:346
44
- msgid "Latest news from Xavisys"
45
  msgstr ""
46
 
47
- #: xavisys-plugin-framework.php:352
48
  msgid "Then please do any or all of the following:"
49
  msgstr ""
50
 
51
- #: xavisys-plugin-framework.php:357
52
  msgid "Link to it so others can find out about it."
53
  msgstr ""
54
 
55
- #: xavisys-plugin-framework.php:362
56
- msgid "Give it a good rating on WordPress.org."
57
- msgstr ""
58
-
59
- #: xavisys-plugin-framework.php:372
60
  msgid ""
61
  "If you have any problems with this plugin or ideas for improvements or "
62
  "enhancements, please use the <a href=\"%s\">Support Forums</a>."
@@ -66,234 +66,293 @@ msgstr ""
66
  msgid "Follow a Twitter Feed"
67
  msgstr ""
68
 
69
- #: wp-twitter-widget.php:51 wp-twitter-widget.php:196
70
  msgid "Twitter Widget Pro"
71
  msgstr ""
72
 
73
- #: wp-twitter-widget.php:66 wp-twitter-widget.php:271
74
  msgid "Twitter username:"
75
  msgstr ""
76
 
77
- #: wp-twitter-widget.php:70 wp-twitter-widget.php:279
78
  msgid "Give the feed a title ( optional ):"
79
  msgstr ""
80
 
81
- #: wp-twitter-widget.php:74 wp-twitter-widget.php:287
82
  msgid "How many items would you like to display?"
83
  msgstr ""
84
 
85
- #: wp-twitter-widget.php:84 wp-twitter-widget.php:301
86
  msgid "Display profile image?"
87
  msgstr ""
88
 
89
- #: wp-twitter-widget.php:86 wp-twitter-widget.php:305
90
  msgid "Do not show"
91
  msgstr ""
92
 
93
- #: wp-twitter-widget.php:87 wp-twitter-widget.php:306
94
  msgid "Mini - 24px by 24px"
95
  msgstr ""
96
 
97
- #: wp-twitter-widget.php:88 wp-twitter-widget.php:307
98
  msgid "Normal - 48px by 48px"
99
  msgstr ""
100
 
101
- #: wp-twitter-widget.php:89 wp-twitter-widget.php:308
102
  msgid "Bigger - 73px by 73px"
103
  msgstr ""
104
 
105
- #: wp-twitter-widget.php:90 wp-twitter-widget.php:309
106
  msgid "Original"
107
  msgstr ""
108
 
109
- #: wp-twitter-widget.php:95 wp-twitter-widget.php:359
110
  msgid "Include retweets"
111
  msgstr ""
112
 
113
- #: wp-twitter-widget.php:99 wp-twitter-widget.php:362
114
  msgid "Hide @replies"
115
  msgstr ""
116
 
117
- #: wp-twitter-widget.php:103 wp-twitter-widget.php:365
118
  msgid "Hide sending applications"
119
  msgstr ""
120
 
121
- #: wp-twitter-widget.php:108 wp-twitter-widget.php:369
122
  msgid "Show Tweet Intents (reply, retweet, favorite)"
123
  msgstr ""
124
 
125
- #: wp-twitter-widget.php:113 wp-twitter-widget.php:373
126
  msgid "Show Follow Link"
127
  msgstr ""
128
 
129
- #: wp-twitter-widget.php:116 wp-twitter-widget.php:315
130
  msgid "What to display when Twitter is down ( optional ):"
131
  msgstr ""
132
 
133
- #: wp-twitter-widget.php:120 wp-twitter-widget.php:323
134
  msgid "Number of seconds to wait for a response from Twitter ( default 2 ):"
135
  msgstr ""
136
 
137
- #: wp-twitter-widget.php:124 wp-twitter-widget.php:331
138
  msgid "Show date/time of Tweet ( rather than 2 ____ ago ):"
139
  msgstr ""
140
 
141
- #: wp-twitter-widget.php:126 wp-twitter-widget.php:335
142
  msgid "Always"
143
  msgstr ""
144
 
145
- #: wp-twitter-widget.php:127 wp-twitter-widget.php:336
146
  msgid "If over an hour old"
147
  msgstr ""
148
 
149
- #: wp-twitter-widget.php:128 wp-twitter-widget.php:337
150
  msgid "If over a day old"
151
  msgstr ""
152
 
153
- #: wp-twitter-widget.php:129 wp-twitter-widget.php:338
154
  msgid "If over a week old"
155
  msgstr ""
156
 
157
- #: wp-twitter-widget.php:130 wp-twitter-widget.php:339
158
  msgid "If over a month old"
159
  msgstr ""
160
 
161
- #: wp-twitter-widget.php:131 wp-twitter-widget.php:340
162
  msgid "If over a year old"
163
  msgstr ""
164
 
165
- #: wp-twitter-widget.php:132 wp-twitter-widget.php:341
166
  msgid "Never"
167
  msgstr ""
168
 
169
- #: wp-twitter-widget.php:136 wp-twitter-widget.php:347
170
  msgid ""
171
- "Format to dispaly the date in, uses <a href=\"%s\">PHP date()</a> format:"
172
  msgstr ""
173
 
174
- #: wp-twitter-widget.php:141 wp-twitter-widget.php:376
175
  msgid "Open links in a new window"
176
  msgstr ""
177
 
178
- #: wp-twitter-widget.php:145 wp-twitter-widget.php:379
179
  msgid "Show Link to Twitter Widget Pro"
180
  msgstr ""
181
 
182
- #: wp-twitter-widget.php:197
183
  msgid "Twitter Widget"
184
  msgstr ""
185
 
186
- #: wp-twitter-widget.php:242
 
 
 
 
 
 
 
 
 
 
187
  msgid "General Settings"
188
  msgstr ""
189
 
190
- #: wp-twitter-widget.php:243
191
- msgid "Defaults"
192
  msgstr ""
193
 
194
- #: wp-twitter-widget.php:251
195
- msgid "HTTP vs HTTPS:"
196
  msgstr ""
197
 
198
- #: wp-twitter-widget.php:255
199
  msgid "Use Twitter API via HTTPS"
200
  msgstr ""
201
 
202
- #: wp-twitter-widget.php:258
203
  msgid "Use Twitter API via HTTP"
204
  msgstr ""
205
 
206
- #: wp-twitter-widget.php:355
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  msgid "Other Setting:"
208
  msgstr ""
209
 
210
- #: wp-twitter-widget.php:537
211
  msgid "No Tweets Available"
212
  msgstr ""
213
 
214
- #: wp-twitter-widget.php:555
215
  msgid "from %s"
216
  msgstr ""
217
 
218
- #: wp-twitter-widget.php:559
219
  msgid "in reply to %s"
220
  msgstr ""
221
 
222
- #: wp-twitter-widget.php:576
223
  msgid "Reply"
224
  msgstr ""
225
 
226
- #: wp-twitter-widget.php:582
227
  msgid "Retweet"
228
  msgstr ""
229
 
230
- #: wp-twitter-widget.php:588
231
  msgid "Favorite"
232
  msgstr ""
233
 
234
- #: wp-twitter-widget.php:609
235
  msgid "Follow %s"
236
  msgstr ""
237
 
238
- #: wp-twitter-widget.php:623
239
- msgid ""
240
- "Brought to you by BlueDog Web Services - A WordPress development company"
241
  msgstr ""
242
 
243
- #: wp-twitter-widget.php:625
244
  msgid "Powered by"
245
  msgstr ""
246
 
247
- #: wp-twitter-widget.php:691
248
  msgid "Invalid Twitter Response."
249
  msgstr ""
250
 
251
- #: wp-twitter-widget.php:701
252
  msgid "Could not connect to Twitter"
253
  msgstr ""
254
 
255
- #: wp-twitter-widget.php:783
256
  msgid "about %s year ago"
257
  msgid_plural "about %s years ago"
258
  msgstr[0] ""
259
  msgstr[1] ""
260
 
261
- #: wp-twitter-widget.php:784
262
  msgid "about %s month ago"
263
  msgid_plural "about %s months ago"
264
  msgstr[0] ""
265
  msgstr[1] ""
266
 
267
- #: wp-twitter-widget.php:785
268
  msgid "about %s week ago"
269
  msgid_plural "about %s weeks ago"
270
  msgstr[0] ""
271
  msgstr[1] ""
272
 
273
- #: wp-twitter-widget.php:786
274
  msgid "about %s day ago"
275
  msgid_plural "about %s days ago"
276
  msgstr[0] ""
277
  msgstr[1] ""
278
 
279
- #: wp-twitter-widget.php:787
280
  msgid "about %s hour ago"
281
  msgid_plural "about %s hours ago"
282
  msgstr[0] ""
283
  msgstr[1] ""
284
 
285
- #: wp-twitter-widget.php:788
286
  msgid "about %s minute ago"
287
  msgid_plural "about %s minutes ago"
288
  msgstr[0] ""
289
  msgstr[1] ""
290
 
291
- #: wp-twitter-widget.php:789
292
  msgid "about %s second ago"
293
  msgid_plural "about %s seconds ago"
294
  msgstr[0] ""
295
  msgstr[1] ""
296
 
297
- #: wp-twitter-widget.php:841 wp-twitter-widget.php:915
298
  msgid "h:i:s A F d, Y"
299
  msgstr ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/twitter-widget-pro\n"
7
+ "POT-Creation-Date: 2012-10-11 14:15:52+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: range-plugin-framework.php:251
16
  msgid "Update Options &raquo;"
17
  msgstr ""
18
 
19
+ #: range-plugin-framework.php:297
20
+ msgid "Rate Plugin"
21
  msgstr ""
22
 
23
+ #: range-plugin-framework.php:303
24
+ msgid "Support"
25
  msgstr ""
26
 
27
+ #: range-plugin-framework.php:311
28
  msgid "Donate to show your appreciation."
29
  msgstr ""
30
 
31
+ #: range-plugin-framework.php:322
32
+ msgid "Give it a good rating on WordPress.org."
33
+ msgstr ""
34
+
35
+ #: range-plugin-framework.php:332
36
  msgid "Settings"
37
  msgstr ""
38
 
39
+ #: range-plugin-framework.php:361
40
  msgid "Like this Plugin?"
41
  msgstr ""
42
 
43
+ #: range-plugin-framework.php:364
44
  msgid "Need Support?"
45
  msgstr ""
46
 
47
+ #: range-plugin-framework.php:367
48
+ msgid "Latest news from Range"
49
  msgstr ""
50
 
51
+ #: range-plugin-framework.php:372
52
  msgid "Then please do any or all of the following:"
53
  msgstr ""
54
 
55
+ #: range-plugin-framework.php:377
56
  msgid "Link to it so others can find out about it."
57
  msgstr ""
58
 
59
+ #: range-plugin-framework.php:389
 
 
 
 
60
  msgid ""
61
  "If you have any problems with this plugin or ideas for improvements or "
62
  "enhancements, please use the <a href=\"%s\">Support Forums</a>."
66
  msgid "Follow a Twitter Feed"
67
  msgstr ""
68
 
69
+ #: wp-twitter-widget.php:51 wp-twitter-widget.php:197
70
  msgid "Twitter Widget Pro"
71
  msgstr ""
72
 
73
+ #: wp-twitter-widget.php:66 wp-twitter-widget.php:340
74
  msgid "Twitter username:"
75
  msgstr ""
76
 
77
+ #: wp-twitter-widget.php:70 wp-twitter-widget.php:348
78
  msgid "Give the feed a title ( optional ):"
79
  msgstr ""
80
 
81
+ #: wp-twitter-widget.php:74 wp-twitter-widget.php:356
82
  msgid "How many items would you like to display?"
83
  msgstr ""
84
 
85
+ #: wp-twitter-widget.php:84 wp-twitter-widget.php:370
86
  msgid "Display profile image?"
87
  msgstr ""
88
 
89
+ #: wp-twitter-widget.php:86 wp-twitter-widget.php:374
90
  msgid "Do not show"
91
  msgstr ""
92
 
93
+ #: wp-twitter-widget.php:87 wp-twitter-widget.php:375
94
  msgid "Mini - 24px by 24px"
95
  msgstr ""
96
 
97
+ #: wp-twitter-widget.php:88 wp-twitter-widget.php:376
98
  msgid "Normal - 48px by 48px"
99
  msgstr ""
100
 
101
+ #: wp-twitter-widget.php:89 wp-twitter-widget.php:377
102
  msgid "Bigger - 73px by 73px"
103
  msgstr ""
104
 
105
+ #: wp-twitter-widget.php:90 wp-twitter-widget.php:378
106
  msgid "Original"
107
  msgstr ""
108
 
109
+ #: wp-twitter-widget.php:96 wp-twitter-widget.php:429
110
  msgid "Include retweets"
111
  msgstr ""
112
 
113
+ #: wp-twitter-widget.php:100 wp-twitter-widget.php:432
114
  msgid "Hide @replies"
115
  msgstr ""
116
 
117
+ #: wp-twitter-widget.php:104 wp-twitter-widget.php:435
118
  msgid "Hide sending applications"
119
  msgstr ""
120
 
121
+ #: wp-twitter-widget.php:109 wp-twitter-widget.php:439
122
  msgid "Show Tweet Intents (reply, retweet, favorite)"
123
  msgstr ""
124
 
125
+ #: wp-twitter-widget.php:114 wp-twitter-widget.php:443
126
  msgid "Show Follow Link"
127
  msgstr ""
128
 
129
+ #: wp-twitter-widget.php:117 wp-twitter-widget.php:384
130
  msgid "What to display when Twitter is down ( optional ):"
131
  msgstr ""
132
 
133
+ #: wp-twitter-widget.php:121 wp-twitter-widget.php:392
134
  msgid "Number of seconds to wait for a response from Twitter ( default 2 ):"
135
  msgstr ""
136
 
137
+ #: wp-twitter-widget.php:125 wp-twitter-widget.php:400
138
  msgid "Show date/time of Tweet ( rather than 2 ____ ago ):"
139
  msgstr ""
140
 
141
+ #: wp-twitter-widget.php:127 wp-twitter-widget.php:404
142
  msgid "Always"
143
  msgstr ""
144
 
145
+ #: wp-twitter-widget.php:128 wp-twitter-widget.php:405
146
  msgid "If over an hour old"
147
  msgstr ""
148
 
149
+ #: wp-twitter-widget.php:129 wp-twitter-widget.php:406
150
  msgid "If over a day old"
151
  msgstr ""
152
 
153
+ #: wp-twitter-widget.php:130 wp-twitter-widget.php:407
154
  msgid "If over a week old"
155
  msgstr ""
156
 
157
+ #: wp-twitter-widget.php:131 wp-twitter-widget.php:408
158
  msgid "If over a month old"
159
  msgstr ""
160
 
161
+ #: wp-twitter-widget.php:132 wp-twitter-widget.php:409
162
  msgid "If over a year old"
163
  msgstr ""
164
 
165
+ #: wp-twitter-widget.php:133 wp-twitter-widget.php:410
166
  msgid "Never"
167
  msgstr ""
168
 
169
+ #: wp-twitter-widget.php:137 wp-twitter-widget.php:416
170
  msgid ""
171
+ "Format to display the date in, uses <a href=\"%s\">PHP date()</a> format:"
172
  msgstr ""
173
 
174
+ #: wp-twitter-widget.php:142 wp-twitter-widget.php:446
175
  msgid "Open links in a new window"
176
  msgstr ""
177
 
178
+ #: wp-twitter-widget.php:146 wp-twitter-widget.php:449
179
  msgid "Show Link to Twitter Widget Pro"
180
  msgstr ""
181
 
182
+ #: wp-twitter-widget.php:198
183
  msgid "Twitter Widget"
184
  msgstr ""
185
 
186
+ #: wp-twitter-widget.php:262
187
+ msgid "There were no locks to clear!"
188
+ msgstr ""
189
+
190
+ #: wp-twitter-widget.php:264
191
+ msgid "Successfully cleared %d lock."
192
+ msgid_plural "Successfully cleared %d locks."
193
+ msgstr[0] ""
194
+ msgstr[1] ""
195
+
196
+ #: wp-twitter-widget.php:270
197
  msgid "General Settings"
198
  msgstr ""
199
 
200
+ #: wp-twitter-widget.php:271
201
+ msgid "Default Settings for Shortcodes"
202
  msgstr ""
203
 
204
+ #: wp-twitter-widget.php:280
205
+ msgid "HTTP vs HTTPS"
206
  msgstr ""
207
 
208
+ #: wp-twitter-widget.php:284
209
  msgid "Use Twitter API via HTTPS"
210
  msgstr ""
211
 
212
+ #: wp-twitter-widget.php:287
213
  msgid "Use Twitter API via HTTP"
214
  msgstr ""
215
 
216
+ #: wp-twitter-widget.php:289
217
+ msgid ""
218
+ "Some servers seem to have issues connecting via HTTPS. If you're "
219
+ "experiencing issues with your feed not updating, try setting this to HTTP."
220
+ msgstr ""
221
+
222
+ #: wp-twitter-widget.php:294 wp-twitter-widget.php:297
223
+ msgid "Clear Update Locks"
224
+ msgstr ""
225
+
226
+ #: wp-twitter-widget.php:298
227
+ msgid ""
228
+ "A small percentage of servers seem to have issues where an update lock isn't "
229
+ "getting cleared. If you're experiencing issues with your feed not updating, "
230
+ "try clearing the update locks."
231
+ msgstr ""
232
+
233
+ #: wp-twitter-widget.php:303
234
+ msgid "Current API Usage"
235
+ msgstr ""
236
+
237
+ #: wp-twitter-widget.php:314
238
+ msgid "Used: %d"
239
+ msgstr ""
240
+
241
+ #: wp-twitter-widget.php:315
242
+ msgid "Remaining: %d"
243
+ msgstr ""
244
+
245
+ #: wp-twitter-widget.php:318
246
+ msgid "Limits reset in: %d minutes"
247
+ msgid_plural "Limits reset in: %d minutes"
248
+ msgstr[0] ""
249
+ msgstr[1] ""
250
+
251
+ #: wp-twitter-widget.php:320
252
+ msgid "This is overall usage, not just usage from Twitter Widget Pro"
253
+ msgstr ""
254
+
255
+ #: wp-twitter-widget.php:325
256
+ msgid "There was an error checking your rate limit."
257
+ msgstr ""
258
+
259
+ #: wp-twitter-widget.php:336
260
+ msgid ""
261
+ "These settings are the default for the shortcodes and all of them can be "
262
+ "overridden by specifying a different value in the shortcode itself. All "
263
+ "settings for widgets are locate in the individual widget."
264
+ msgstr ""
265
+
266
+ #: wp-twitter-widget.php:424
267
  msgid "Other Setting:"
268
  msgstr ""
269
 
270
+ #: wp-twitter-widget.php:637
271
  msgid "No Tweets Available"
272
  msgstr ""
273
 
274
+ #: wp-twitter-widget.php:655
275
  msgid "from %s"
276
  msgstr ""
277
 
278
+ #: wp-twitter-widget.php:659
279
  msgid "in reply to %s"
280
  msgstr ""
281
 
282
+ #: wp-twitter-widget.php:676
283
  msgid "Reply"
284
  msgstr ""
285
 
286
+ #: wp-twitter-widget.php:682
287
  msgid "Retweet"
288
  msgstr ""
289
 
290
+ #: wp-twitter-widget.php:688
291
  msgid "Favorite"
292
  msgstr ""
293
 
294
+ #: wp-twitter-widget.php:709
295
  msgid "Follow %s"
296
  msgstr ""
297
 
298
+ #: wp-twitter-widget.php:723
299
+ msgid "Brought to you by Range - A WordPress design and development company"
 
300
  msgstr ""
301
 
302
+ #: wp-twitter-widget.php:725
303
  msgid "Powered by"
304
  msgstr ""
305
 
306
+ #: wp-twitter-widget.php:794
307
  msgid "Invalid Twitter Response."
308
  msgstr ""
309
 
310
+ #: wp-twitter-widget.php:804
311
  msgid "Could not connect to Twitter"
312
  msgstr ""
313
 
314
+ #: wp-twitter-widget.php:886
315
  msgid "about %s year ago"
316
  msgid_plural "about %s years ago"
317
  msgstr[0] ""
318
  msgstr[1] ""
319
 
320
+ #: wp-twitter-widget.php:887
321
  msgid "about %s month ago"
322
  msgid_plural "about %s months ago"
323
  msgstr[0] ""
324
  msgstr[1] ""
325
 
326
+ #: wp-twitter-widget.php:888
327
  msgid "about %s week ago"
328
  msgid_plural "about %s weeks ago"
329
  msgstr[0] ""
330
  msgstr[1] ""
331
 
332
+ #: wp-twitter-widget.php:889
333
  msgid "about %s day ago"
334
  msgid_plural "about %s days ago"
335
  msgstr[0] ""
336
  msgstr[1] ""
337
 
338
+ #: wp-twitter-widget.php:890
339
  msgid "about %s hour ago"
340
  msgid_plural "about %s hours ago"
341
  msgstr[0] ""
342
  msgstr[1] ""
343
 
344
+ #: wp-twitter-widget.php:891
345
  msgid "about %s minute ago"
346
  msgid_plural "about %s minutes ago"
347
  msgstr[0] ""
348
  msgstr[1] ""
349
 
350
+ #: wp-twitter-widget.php:892
351
  msgid "about %s second ago"
352
  msgid_plural "about %s seconds ago"
353
  msgstr[0] ""
354
  msgstr[1] ""
355
 
356
+ #: wp-twitter-widget.php:944 wp-twitter-widget.php:1018
357
  msgid "h:i:s A F d, Y"
358
  msgstr ""
xavisys-plugin-framework.php → range-plugin-framework.php RENAMED
@@ -1,10 +1,16 @@
1
  <?php
2
  /**
3
- * Version: 1.0.15
4
  */
5
  /**
6
  * Changelog:
7
  *
 
 
 
 
 
 
8
  * 1.0.15:
9
  * - Fix support forum link
10
  * - Update feed to Ran.ge
@@ -48,13 +54,13 @@
48
  * 1.0.3:
49
  * - Changed to use new cdn for images
50
  */
51
- if (!class_exists('XavisysPlugin')) {
52
  /**
53
- * Abstract class XavisysPlugin used as a WordPress Plugin framework
54
  *
55
  * @abstract
56
  */
57
- abstract class XavisysPlugin {
58
  /**
59
  * @var array Plugin settings
60
  */
@@ -101,12 +107,12 @@ if (!class_exists('XavisysPlugin')) {
101
  protected $_optionCallbacks = array();
102
 
103
  /**
104
- * @var string - The plugin slug used on WordPress.org and/or Xavisys forums
105
  */
106
  protected $_slug = '';
107
 
108
  /**
109
- * @var string - The feed URL for Xavisys
110
  */
111
  protected $_feed_url = 'http://ran.ge/feed/';
112
 
@@ -122,33 +128,27 @@ if (!class_exists('XavisysPlugin')) {
122
  * @return void
123
  */
124
  protected function __construct() {
125
- if ( is_callable( array($this, '_init') ) ) {
126
  $this->_init();
127
- }
128
- $this->_getSettings();
129
- if ( is_callable( array($this, '_postSettingsInit') ) ) {
130
- $this->_postSettingsInit();
131
- }
132
  add_filter( 'init', array( $this, 'init_locale' ) );
133
- add_action( 'admin_init', array( $this, 'registerOptions' ) );
134
- add_filter( 'plugin_action_links', array( $this, 'addPluginPageLinks' ), 10, 2 );
135
- add_filter( 'plugin_row_meta', array( $this, 'addPluginMetaLinks' ), 10, 2 );
136
- add_action( 'admin_menu', array( $this, 'registerOptionsPage' ) );
137
- if ( is_callable(array( $this, 'addOptionsMetaBoxes' )) ) {
138
- add_action( 'admin_init', array( $this, 'addOptionsMetaBoxes' ) );
139
- }
140
- add_action( 'admin_init', array( $this, 'addDefaultOptionsMetaBoxes' ) );
141
- add_action( 'wp_dashboard_setup', array( $this, 'addDashboardWidgets' ), null, 9 );
142
- add_action( 'admin_print_scripts', array( $this,'optionsPageScripts' ) );
143
- add_action( 'admin_print_styles', array( $this,'optionsPageStyles' ) );
144
- /**
145
- * Add update messages that can be attached to the CURRENT release (not
146
- * this one), but only for 2.8+
147
- */
148
- global $wp_version;
149
- if ( version_compare('2.8', $wp_version, '<=') ) {
150
- add_action ( 'in_plugin_update_message-'.$this->_file , array ( $this , 'changelog' ), null, 2 );
151
- }
152
  }
153
 
154
  /**
@@ -161,13 +161,13 @@ if (!class_exists('XavisysPlugin')) {
161
  load_plugin_textdomain( $this->_slug, 'wp-content/plugins/' . $lang_dir, $lang_dir);
162
  }
163
 
164
- protected function _getSettings() {
165
  foreach ( $this->_optionNames as $opt ) {
166
  $this->_settings[$opt] = apply_filters($this->_slug.'-opt-'.$opt, get_option($opt));
167
  }
168
  }
169
 
170
- public function registerOptions() {
171
  foreach ( $this->_optionNames as $opt ) {
172
  if ( !empty($this->_optionCallbacks[$opt]) && is_callable( $this->_optionCallbacks[$opt] ) ) {
173
  $callback = $this->_optionCallbacks[$opt];
@@ -200,53 +200,52 @@ if (!class_exists('XavisysPlugin')) {
200
  echo str_replace( array_keys($replace), $replace, $changes );
201
  }
202
 
203
- public function registerOptionsPage() {
204
- if ( apply_filters( 'xpf-options_page-'.$this->_slug, true ) && is_callable( array( $this, 'options_page' ) ) ) {
205
  add_options_page( $this->_pageTitle, $this->_menuTitle, $this->_accessLevel, $this->_hook, array( $this, 'options_page' ) );
206
- }
207
  }
208
 
209
- protected function _filterBoxesMain($boxName) {
210
- if ( 'main' == strtolower($boxName) ) {
211
  return false;
212
- }
213
- return $this->_filterBoxesHelper($boxName, 'main');
214
  }
215
 
216
- protected function _filterBoxesSidebar($boxName) {
217
- return $this->_filterBoxesHelper($boxName, 'sidebar');
218
  }
219
 
220
- protected function _filterBoxesHelper($boxName, $test) {
221
  return ( strpos( strtolower($boxName), strtolower($test) ) !== false );
222
  }
223
 
224
  public function options_page() {
225
  global $wp_meta_boxes;
226
- $allBoxes = array_keys( $wp_meta_boxes['xavisys-'.$this->_slug] );
227
- $mainBoxes = array_filter( $allBoxes, array( $this, '_filterBoxesMain' ) );
228
  unset($mainBoxes['main']);
229
  sort($mainBoxes);
230
- $sidebarBoxes = array_filter( $allBoxes, array( $this, '_filterBoxesSidebar' ) );
231
  unset($sidebarBoxes['sidebar']);
232
  sort($sidebarBoxes);
233
 
234
  $main_width = empty( $sidebarBoxes )? '100%' : '75%';
235
  ?>
236
  <div class="wrap">
237
- <?php $this->screenIconLink(); ?>
238
  <h2><?php echo esc_html($this->_pageTitle); ?></h2>
239
  <div class="metabox-holder">
240
  <div class="postbox-container" style="width:<?php echo $main_width; ?>;">
241
  <?php
242
- do_action( 'xpf-pre-main-metabox', $main_width );
243
  if ( in_array( 'main', $allBoxes ) ) {
244
  ?>
245
- <form action="<?php esc_attr_e( $this->_optionsPageAction ); ?>" method="post"<?php do_action( 'xpf-options-page-form-tag' ) ?>>
246
  <?php
247
  settings_fields( $this->_optionGroup );
248
- do_meta_boxes( 'xavisys-' . $this->_slug, 'main', '' );
249
- if ( apply_filters( 'xpf-show-general-settings-submit'.$this->_slug, true ) ) {
250
  ?>
251
  <p class="submit">
252
  <input type="submit" name="Submit" value="<?php esc_attr_e('Update Options &raquo;', $this->_slug); ?>" />
@@ -258,7 +257,7 @@ if (!class_exists('XavisysPlugin')) {
258
  <?php
259
  }
260
  foreach( $mainBoxes as $context ) {
261
- do_meta_boxes( 'xavisys-' . $this->_slug, $context, '' );
262
  }
263
  ?>
264
  </div>
@@ -268,7 +267,7 @@ if (!class_exists('XavisysPlugin')) {
268
  <div class="alignright" style="width:24%;">
269
  <?php
270
  foreach( $sidebarBoxes as $context ) {
271
- do_meta_boxes( 'xavisys-' . $this->_slug, $context, '' );
272
  }
273
  ?>
274
  </div>
@@ -280,35 +279,33 @@ if (!class_exists('XavisysPlugin')) {
280
  <?php
281
  }
282
 
283
- public function addPluginPageLinks( $links, $file ){
284
  if ( $file == $this->_file ) {
285
  // Add Widget Page link to our plugin
286
- $link = $this->getOptionsLink();
287
  array_unshift( $links, $link );
288
 
289
  // Add Support Forum link to our plugin
290
- $link = $this->getSupportForumLink();
291
  array_unshift( $links, $link );
292
  }
293
  return $links;
294
  }
295
 
296
- public function addPluginMetaLinks( $meta, $file ){
297
- if ( $file == $this->_file ) {
298
- // Add Widget Page link to our plugin
299
- $meta[] = $this->getDonateLink(__('Donate'));
300
- }
301
  return $meta;
302
  }
303
 
304
- public function getSupportForumLink( $linkText = '' ) {
305
  if ( empty($linkText) ) {
306
- $linkText = __( 'Support Forum', $this->_slug );
307
  }
308
- return '<a href="' . $this->getSupportForumUrl() . '">' . $linkText . '</a>';
309
  }
310
 
311
- public function getDonateLink( $linkText = '' ) {
312
  $url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=' . $this->_paypalButtonId;
313
  if ( empty($linkText) ) {
314
  $linkText = __( 'Donate to show your appreciation.', $this->_slug );
@@ -316,67 +313,84 @@ if (!class_exists('XavisysPlugin')) {
316
  return "<a href='{$url}'>{$linkText}</a>";
317
  }
318
 
319
- public function getSupportForumUrl() {
320
  return 'http://wordpress.org/support/plugin/' . $this->_slug;
321
  }
322
 
323
- public function getOptionsLink( $linkText = '' ) {
 
 
 
 
 
 
 
 
 
 
324
  if ( empty($linkText) ) {
325
  $linkText = __( 'Settings', $this->_slug );
326
  }
327
- return '<a href="' . $this->getOptionsUrl() . '">' . $linkText . '</a>';
328
  }
329
 
330
- public function getOptionsUrl() {
331
  return admin_url( 'options-general.php?page=' . $this->_hook );
332
  }
333
 
334
- public function optionsPageStyles() {
335
  if (isset($_GET['page']) && $_GET['page'] == $this->_hook) {
336
  wp_enqueue_style('dashboard');
337
- wp_enqueue_style('xavisys-options-css', plugin_dir_url( __FILE__ ) . 'xavisys-plugin-framework.css');
338
  }
339
  }
340
 
341
- public function addDefaultOptionsMetaBoxes() {
342
- if ( apply_filters( 'show-xavisys-like-this', true ) ) {
343
- add_meta_box( $this->_slug . '-like-this', __('Like this Plugin?', $this->_slug), array($this, 'likeThisMetaBox'), 'xavisys-' . $this->_slug, 'sidebar');
344
- }
345
- if ( apply_filters( 'show-xavisys-support', true ) ) {
346
- add_meta_box( $this->_slug . '-support', __('Need Support?', $this->_slug), array($this, 'supportMetaBox'), 'xavisys-' . $this->_slug, 'sidebar');
347
- }
348
- if ( apply_filters( 'show-xavisys-feed', true ) ) {
349
- add_meta_box( $this->_slug . '-xavisys-feed', __('Latest news from Xavisys', $this->_slug), array($this, 'xavisysFeedMetaBox'), 'xavisys-' . $this->_slug, 'sidebar');
350
- }
351
  }
352
 
353
- public function likeThisMetaBox() {
 
 
 
 
 
 
 
 
 
 
 
354
  echo '<p>';
355
  _e('Then please do any or all of the following:', $this->_slug);
356
  echo '</p><ul>';
357
 
358
- $url = apply_filters('xavisys-plugin-url-'.$this->_slug, 'http://bluedogwebservices.com/wordpress-plugin/'.$this->_slug);
359
  echo "<li><a href='{$url}'>";
360
  _e('Link to it so others can find out about it.', $this->_slug);
361
  echo "</a></li>";
362
 
363
- $url = 'http://wordpress.org/extend/plugins/' . $this->_slug;
364
- echo "<li><a href='{$url}'>";
365
- _e('Give it a good rating on WordPress.org.', $this->_slug);
366
- echo "</a></li>";
367
 
368
- echo '<li>' . $this->getDonateLink() . '</li>';
369
 
370
  echo '</ul>';
371
  }
372
 
373
- public function supportMetaBox() {
374
  echo '<p>';
375
- echo sprintf(__('If you have any problems with this plugin or ideas for improvements or enhancements, please use the <a href="%s">Support Forums</a>.', $this->_slug), $this->getSupportForumUrl() );
376
  echo '</p>';
377
  }
378
 
379
- public function xavisysFeedMetaBox() {
380
  $args = array(
381
  'url' => $this->_feed_url,
382
  'items' => '5',
@@ -386,29 +400,30 @@ if (!class_exists('XavisysPlugin')) {
386
  echo "</div>";
387
  }
388
 
389
- public function addDashboardWidgets() {
390
- if ( apply_filters( 'xpf-dashboard-widget', true ) ) {
391
- wp_add_dashboard_widget( 'dashboardb_xavisys' , 'The Latest News From Range' , array( $this, 'dashboardWidget' ) );
392
- }
393
  }
394
 
395
- public function dashboardWidget() {
396
  $args = array(
397
  'url' => $this->_feed_url,
398
  'items' => '3',
399
  'show_date' => 1,
400
  'show_summary' => 1,
401
  );
 
 
402
  echo '<div class="rss-widget">';
403
- echo '<a href="http://ran.ge"><img class="alignright" src="http://s1.ran.ge/content/uploads/2012/06/range-trans.png" /></a>';
404
  wp_widget_rss_output( $args );
405
  echo '<p style="border-top: 1px solid #CCC; padding-top: 10px; font-weight: bold;">';
406
- echo '<a href="' . $this->_feed_url . '"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
407
  echo "</p>";
408
  echo "</div>";
409
  }
410
 
411
- public function screenIconLink($name = 'xavisys') {
412
  $link = '<a href="http://ran.ge">';
413
  if ( function_exists( 'get_screen_icon' ) ) {
414
  $link .= get_screen_icon( $name );
@@ -418,10 +433,10 @@ if (!class_exists('XavisysPlugin')) {
418
  $link .= ob_get_clean();
419
  }
420
  $link .= '</a>';
421
- echo apply_filters('xpf-screenIconLink', $link, $name );
422
  }
423
 
424
- public function optionsPageScripts() {
425
  if (isset($_GET['page']) && $_GET['page'] == $this->_hook) {
426
  wp_enqueue_script('postbox');
427
  wp_enqueue_script('dashboard');
1
  <?php
2
  /**
3
+ * Version: 1.1.0
4
  */
5
  /**
6
  * Changelog:
7
  *
8
+ * 1.1.0:
9
+ * - Complete change to Range framework
10
+ * - Coding standards
11
+ * - Move from camelCase to underscores for function names
12
+ * - Drop support for WP 2.8 & 2.9
13
+ *
14
  * 1.0.15:
15
  * - Fix support forum link
16
  * - Update feed to Ran.ge
54
  * 1.0.3:
55
  * - Changed to use new cdn for images
56
  */
57
+ if (!class_exists('RangePlugin')) {
58
  /**
59
+ * Abstract class RangePlugin used as a WordPress Plugin framework
60
  *
61
  * @abstract
62
  */
63
+ abstract class RangePlugin {
64
  /**
65
  * @var array Plugin settings
66
  */
107
  protected $_optionCallbacks = array();
108
 
109
  /**
110
+ * @var string - The plugin slug used on WordPress.org
111
  */
112
  protected $_slug = '';
113
 
114
  /**
115
+ * @var string - The feed URL for Range
116
  */
117
  protected $_feed_url = 'http://ran.ge/feed/';
118
 
128
  * @return void
129
  */
130
  protected function __construct() {
131
+ if ( is_callable( array($this, '_init') ) )
132
  $this->_init();
133
+
134
+ $this->_get_settings();
135
+ if ( is_callable( array($this, '_post_settings_init') ) )
136
+ $this->_post_settings_init();
137
+
138
  add_filter( 'init', array( $this, 'init_locale' ) );
139
+ add_action( 'admin_init', array( $this, 'register_options' ) );
140
+ add_filter( 'plugin_action_links', array( $this, 'add_plugin_page_links' ), 10, 2 );
141
+ add_filter( 'plugin_row_meta', array( $this, 'add_plugin_meta_links' ), 10, 2 );
142
+ add_action( 'admin_menu', array( $this, 'register_options_page' ) );
143
+ if ( is_callable(array( $this, 'add_options_meta_boxes' )) )
144
+ add_action( 'admin_init', array( $this, 'add_options_meta_boxes' ) );
145
+
146
+ add_action( 'admin_init', array( $this, 'add_default_options_meta_boxes' ) );
147
+ add_action( 'wp_dashboard_setup', array( $this, 'add_dashboard_widgets' ), null, 9 );
148
+ add_action( 'admin_print_scripts', array( $this,'admin_print_scripts' ) );
149
+ add_action( 'admin_enqueue_scripts', array( $this,'admin_enqueue_scripts' ) );
150
+
151
+ add_action ( 'in_plugin_update_message-'.$this->_file , array ( $this , 'changelog' ), null, 2 );
 
 
 
 
 
 
152
  }
153
 
154
  /**
161
  load_plugin_textdomain( $this->_slug, 'wp-content/plugins/' . $lang_dir, $lang_dir);
162
  }
163
 
164
+ protected function _get_settings() {
165
  foreach ( $this->_optionNames as $opt ) {
166
  $this->_settings[$opt] = apply_filters($this->_slug.'-opt-'.$opt, get_option($opt));
167
  }
168
  }
169
 
170
+ public function register_options() {
171
  foreach ( $this->_optionNames as $opt ) {
172
  if ( !empty($this->_optionCallbacks[$opt]) && is_callable( $this->_optionCallbacks[$opt] ) ) {
173
  $callback = $this->_optionCallbacks[$opt];
200
  echo str_replace( array_keys($replace), $replace, $changes );
201
  }
202
 
203
+ public function register_options_page() {
204
+ if ( apply_filters( 'rpf-options_page-'.$this->_slug, true ) && is_callable( array( $this, 'options_page' ) ) )
205
  add_options_page( $this->_pageTitle, $this->_menuTitle, $this->_accessLevel, $this->_hook, array( $this, 'options_page' ) );
 
206
  }
207
 
208
+ protected function _filter_boxes_main($boxName) {
209
+ if ( 'main' == strtolower($boxName) )
210
  return false;
211
+
212
+ return $this->_filter_boxes_helper($boxName, 'main');
213
  }
214
 
215
+ protected function _filter_boxes_sidebar($boxName) {
216
+ return $this->_filter_boxes_helper($boxName, 'sidebar');
217
  }
218
 
219
+ protected function _filter_boxes_helper($boxName, $test) {
220
  return ( strpos( strtolower($boxName), strtolower($test) ) !== false );
221
  }
222
 
223
  public function options_page() {
224
  global $wp_meta_boxes;
225
+ $allBoxes = array_keys( $wp_meta_boxes['range-'.$this->_slug] );
226
+ $mainBoxes = array_filter( $allBoxes, array( $this, '_filter_boxes_main' ) );
227
  unset($mainBoxes['main']);
228
  sort($mainBoxes);
229
+ $sidebarBoxes = array_filter( $allBoxes, array( $this, '_filter_boxes_sidebar' ) );
230
  unset($sidebarBoxes['sidebar']);
231
  sort($sidebarBoxes);
232
 
233
  $main_width = empty( $sidebarBoxes )? '100%' : '75%';
234
  ?>
235
  <div class="wrap">
236
+ <?php $this->screen_icon_link(); ?>
237
  <h2><?php echo esc_html($this->_pageTitle); ?></h2>
238
  <div class="metabox-holder">
239
  <div class="postbox-container" style="width:<?php echo $main_width; ?>;">
240
  <?php
241
+ do_action( 'rpf-pre-main-metabox', $main_width );
242
  if ( in_array( 'main', $allBoxes ) ) {
243
  ?>
244
+ <form action="<?php esc_attr_e( $this->_optionsPageAction ); ?>" method="post"<?php do_action( 'rpf-options-page-form-tag' ) ?>>
245
  <?php
246
  settings_fields( $this->_optionGroup );
247
+ do_meta_boxes( 'range-' . $this->_slug, 'main', '' );
248
+ if ( apply_filters( 'rpf-show-general-settings-submit'.$this->_slug, true ) ) {
249
  ?>
250
  <p class="submit">
251
  <input type="submit" name="Submit" value="<?php esc_attr_e('Update Options &raquo;', $this->_slug); ?>" />
257
  <?php
258
  }
259
  foreach( $mainBoxes as $context ) {
260
+ do_meta_boxes( 'range-' . $this->_slug, $context, '' );
261
  }
262
  ?>
263
  </div>
267
  <div class="alignright" style="width:24%;">
268
  <?php
269
  foreach( $sidebarBoxes as $context ) {
270
+ do_meta_boxes( 'range-' . $this->_slug, $context, '' );
271
  }
272
  ?>
273
  </div>
279
  <?php
280
  }
281
 
282
+ public function add_plugin_page_links( $links, $file ){
283
  if ( $file == $this->_file ) {
284
  // Add Widget Page link to our plugin
285
+ $link = $this->get_options_link();
286
  array_unshift( $links, $link );
287
 
288
  // Add Support Forum link to our plugin
289
+ $link = $this->get_support_forum_link();
290
  array_unshift( $links, $link );
291
  }
292
  return $links;
293
  }
294
 
295
+ public function add_plugin_meta_links( $meta, $file ){
296
+ if ( $file == $this->_file )
297
+ $meta[] = $this->get_plugin_link(__('Rate Plugin'));
 
 
298
  return $meta;
299
  }
300
 
301
+ public function get_support_forum_link( $linkText = '' ) {
302
  if ( empty($linkText) ) {
303
+ $linkText = __( 'Support', $this->_slug );
304
  }
305
+ return '<a href="' . $this->get_support_forum_url() . '">' . $linkText . '</a>';
306
  }
307
 
308
+ public function get_donate_link( $linkText = '' ) {
309
  $url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=' . $this->_paypalButtonId;
310
  if ( empty($linkText) ) {
311
  $linkText = __( 'Donate to show your appreciation.', $this->_slug );
313
  return "<a href='{$url}'>{$linkText}</a>";
314
  }
315
 
316
+ public function get_support_forum_url() {
317
  return 'http://wordpress.org/support/plugin/' . $this->_slug;
318
  }
319
 
320
+ public function get_plugin_link( $linkText = '' ) {
321
+ if ( empty($linkText) )
322
+ $linkText = __( 'Give it a good rating on WordPress.org.', $this->_slug );
323
+ return "<a href='" . $this->get_plugin_url() . "'>{$linkText}</a>";
324
+ }
325
+
326
+ public function get_plugin_url() {
327
+ return 'http://wordpress.org/extend/plugins/' . $this->_slug;
328
+ }
329
+
330
+ public function get_options_link( $linkText = '' ) {
331
  if ( empty($linkText) ) {
332
  $linkText = __( 'Settings', $this->_slug );
333
  }
334
+ return '<a href="' . $this->get_options_url() . '">' . $linkText . '</a>';
335
  }
336
 
337
+ public function get_options_url() {
338
  return admin_url( 'options-general.php?page=' . $this->_hook );
339
  }
340
 
341
+ public function admin_enqueue_scripts() {
342
  if (isset($_GET['page']) && $_GET['page'] == $this->_hook) {
343
  wp_enqueue_style('dashboard');
344
+ add_action( 'admin_print_styles-settings_page_' . $this->_hook, array( $this, 'option_page_styles' ) );
345
  }
346
  }
347
 
348
+ public function option_page_styles() {
349
+ $logo_url = sprintf( 'http%s://range-wphost.netdna-ssl.com/assets/range-icon-square-32x32.png' , is_ssl()? 's':'' );
350
+ ?>
351
+ <style type="text/css">
352
+ #icon-range {
353
+ background:transparent url(<?php echo esc_url_raw( $logo_url ); ?>) no-repeat scroll bottom left;
354
+ }
355
+ </style>
356
+ <?php
 
357
  }
358
 
359
+ public function add_default_options_meta_boxes() {
360
+ if ( apply_filters( 'show-range-like-this', true ) )
361
+ add_meta_box( $this->_slug . '-like-this', __('Like this Plugin?', $this->_slug), array($this, 'like_this_meta_box'), 'range-' . $this->_slug, 'sidebar');
362
+
363
+ if ( apply_filters( 'show-range-support', true ) )
364
+ add_meta_box( $this->_slug . '-support', __('Need Support?', $this->_slug), array($this, 'support_meta_box'), 'range-' . $this->_slug, 'sidebar');
365
+
366
+ if ( apply_filters( 'show-range-feed', true ) )
367
+ add_meta_box( $this->_slug . '-range-feed', __('Latest news from Range', $this->_slug), array($this, 'range_feed_meta_box'), 'range-' . $this->_slug, 'sidebar');
368
+ }
369
+
370
+ public function like_this_meta_box() {
371
  echo '<p>';
372
  _e('Then please do any or all of the following:', $this->_slug);
373
  echo '</p><ul>';
374
 
375
+ $url = apply_filters('range-plugin-url-'.$this->_slug, 'http://bluedogwebservices.com/wordpress-plugin/'.$this->_slug);
376
  echo "<li><a href='{$url}'>";
377
  _e('Link to it so others can find out about it.', $this->_slug);
378
  echo "</a></li>";
379
 
380
+ echo '<li>' . $this->get_plugin_link() . '</li>';
 
 
 
381
 
382
+ echo '<li>' . $this->get_donate_link() . '</li>';
383
 
384
  echo '</ul>';
385
  }
386
 
387
+ public function support_meta_box() {
388
  echo '<p>';
389
+ echo sprintf(__('If you have any problems with this plugin or ideas for improvements or enhancements, please use the <a href="%s">Support Forums</a>.', $this->_slug), $this->get_support_forum_url() );
390
  echo '</p>';
391
  }
392
 
393
+ public function range_feed_meta_box() {
394
  $args = array(
395
  'url' => $this->_feed_url,
396
  'items' => '5',
400
  echo "</div>";
401
  }
402
 
403
+ public function add_dashboard_widgets() {
404
+ if ( apply_filters( 'rpf-dashboard-widget', true ) )
405
+ wp_add_dashboard_widget( 'dashboardb_range' , 'The Latest News From Range' , array( $this, 'dashboard_widget' ) );
 
406
  }
407
 
408
+ public function dashboard_widget() {
409
  $args = array(
410
  'url' => $this->_feed_url,
411
  'items' => '3',
412
  'show_date' => 1,
413
  'show_summary' => 1,
414
  );
415
+ $logo_url = sprintf( 'http%s://range-wphost.netdna-ssl.com/content/uploads/2012/06/range-trans.png' , is_ssl()? 's':'' );
416
+ $icon = includes_url('images/rss.png');
417
  echo '<div class="rss-widget">';
418
+ echo '<a href="http://ran.ge"><img class="alignright" style="padding:0 0 5px 10px;" src="' . esc_url_raw( $logo_url ) . '" /></a>';
419
  wp_widget_rss_output( $args );
420
  echo '<p style="border-top: 1px solid #CCC; padding-top: 10px; font-weight: bold;">';
421
+ echo '<a href="' . $this->_feed_url . '"><img src="' . $icon . '" alt=""/> Subscribe with RSS</a>';
422
  echo "</p>";
423
  echo "</div>";
424
  }
425
 
426
+ public function screen_icon_link($name = 'range') {
427
  $link = '<a href="http://ran.ge">';
428
  if ( function_exists( 'get_screen_icon' ) ) {
429
  $link .= get_screen_icon( $name );
433
  $link .= ob_get_clean();
434
  }
435
  $link .= '</a>';
436
+ echo apply_filters('rpf-screen_icon_link', $link, $name );
437
  }
438
 
439
+ public function admin_print_scripts() {
440
  if (isset($_GET['page']) && $_GET['page'] == $this->_hook) {
441
  wp_enqueue_script('postbox');
442
  wp_enqueue_script('dashboard');
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: twitter, widget, feed
5
  Requires at least: 3.0
6
  Tested up to: 3.4.2
7
- Stable tag: 2.3.11
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links.
10
 
@@ -130,6 +130,9 @@ Aparently the database queries required to display the friends feed was causing
130
 
131
  == Upgrade Notice ==
132
 
 
 
 
133
  = 2.3.11 =
134
  Fix issue with "Include Retweets" not unchecking
135
 
@@ -168,6 +171,16 @@ Fewer "could not connect to Twitter" messages, new links (reply, retweet, favori
168
 
169
  == Changelog ==
170
 
 
 
 
 
 
 
 
 
 
 
171
  = 2.3.11 =
172
  * Fix issue with "Include Retweets" not unchecking
173
 
4
  Tags: twitter, widget, feed
5
  Requires at least: 3.0
6
  Tested up to: 3.4.2
7
+ Stable tag: 2.4.0
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links.
10
 
130
 
131
  == Upgrade Notice ==
132
 
133
+ = 2.4.0 =
134
+ Better linking to fix issues with links followed by punctuation plus support for extended characters in hashtags
135
+
136
  = 2.3.11 =
137
  Fix issue with "Include Retweets" not unchecking
138
 
171
 
172
  == Changelog ==
173
 
174
+ = 2.4.0 =
175
+ * Better linking of URLs, especially handling of punctuation at end of URLs
176
+ * Support for extended characters in hashtags
177
+ * Allow externally linked images to serve via ssl
178
+ * More efficient regex for link parsing
179
+ * Link FTP links
180
+ * Link E-Mail addresses
181
+ * Complete conversion to Range plugin framework from Xavisys framework
182
+ * Added place to check API usage
183
+
184
  = 2.3.11 =
185
  * Fix issue with "Include Retweets" not unchecking
186
 
tlc-transients.php CHANGED
@@ -1,21 +1,23 @@
1
  <?php
2
 
3
- class TLC_Transient_Update_Server {
4
- public function __construct() {
5
- add_action( 'init', array( $this, 'init' ) );
6
- }
7
-
8
- public function init() {
9
- if ( isset( $_POST['_tlc_update'] ) ) {
10
- $update = get_transient( 'tlc_up__' . $_POST['key'] );
11
- if ( $update && $update[0] == $_POST['_tlc_update'] ) {
12
- tlc_transient( $update[1] )
13
- ->expires_in( $update[2] )
14
- ->updates_with( $update[3], (array) $update[4] )
15
- ->set_lock( $update[0] )
16
- ->fetch_and_cache();
 
 
 
17
  }
18
- exit();
19
  }
20
  }
21
  }
@@ -76,9 +78,11 @@ if ( !class_exists( 'TLC_Transient' ) ) {
76
  if ( $this->has_update_lock() && !$this->owns_update_lock() )
77
  return; // Race... let the other process handle it
78
  try {
79
- $data = call_user_func_array( $this->callback, $this->params );
80
  $this->set( $data );
81
- } catch( Exception $e ) {}
 
 
82
  $this->release_update_lock();
83
  return $data;
84
  }
@@ -141,7 +145,31 @@ if ( !class_exists( 'TLC_Transient' ) ) {
141
  }
142
 
143
  // API so you don't have to use "new"
144
- function tlc_transient( $key ) {
145
- $transient = new TLC_Transient( $key );
146
- return $transient;
 
 
147
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
+ if ( !class_exists( 'TLC_Transient_Update_Server' ) ) {
4
+ class TLC_Transient_Update_Server {
5
+ public function __construct() {
6
+ add_action( 'init', array( $this, 'init' ) );
7
+ }
8
+
9
+ public function init() {
10
+ if ( isset( $_POST['_tlc_update'] ) ) {
11
+ $update = get_transient( 'tlc_up__' . $_POST['key'] );
12
+ if ( $update && $update[0] == $_POST['_tlc_update'] ) {
13
+ tlc_transient( $update[1] )
14
+ ->expires_in( $update[2] )
15
+ ->updates_with( $update[3], (array) $update[4] )
16
+ ->set_lock( $update[0] )
17
+ ->fetch_and_cache();
18
+ }
19
+ exit();
20
  }
 
21
  }
22
  }
23
  }
78
  if ( $this->has_update_lock() && !$this->owns_update_lock() )
79
  return; // Race... let the other process handle it
80
  try {
81
+ $data = call_user_func_array( $this->callback, $this->params );
82
  $this->set( $data );
83
+ } catch( Exception $e ) {
84
+ $data = false;
85
+ }
86
  $this->release_update_lock();
87
  return $data;
88
  }
145
  }
146
 
147
  // API so you don't have to use "new"
148
+ if ( !function_exists( 'tlc_transient' ) ) {
149
+ function tlc_transient( $key ) {
150
+ $transient = new TLC_Transient( $key );
151
+ return $transient;
152
+ }
153
  }
154
+
155
+ // Example:
156
+ /*
157
+ function sample_fetch_and_append( $url, $append ) {
158
+ $f = wp_remote_retrieve_body( wp_remote_get( $url, array( 'timeout' => 30 ) ) );
159
+ $f .= $append;
160
+ return $f;
161
+ }
162
+
163
+ function test_tlc_transient() {
164
+ $t = tlc_transient( 'foo' )
165
+ ->expires_in( 30 )
166
+ ->background_only()
167
+ ->updates_with( 'sample_fetch_and_append', array( 'http://coveredwebservices.com/tools/long-running-request.php', ' appendfooparam ' ) )
168
+ ->get();
169
+ var_dump( $t );
170
+ if ( !$t )
171
+ echo "The request is false, because it isn't yet in the cache. It'll be there in about 10 seconds. Keep refreshing!";
172
+ }
173
+
174
+ add_action( 'wp_footer', 'test_tlc_transient' );
175
+ */
wp-twitter-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://bluedogwebservices.com/wordpress-plugin/twitter-widget-pro/
5
  * Description: A widget that properly handles twitter feeds, including @username, #hashtag, and link parsing. It can even display profile images for the users. Requires PHP5.
6
- * Version: 2.3.11
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://ran.ge/
9
  * License: GPLv2 or later
@@ -29,8 +29,8 @@
29
  */
30
 
31
  require_once( 'tlc-transients.php' );
32
- require_once( 'xavisys-plugin-framework.php' );
33
- define( 'TWP_VERSION', '2.3.11' );
34
 
35
  /**
36
  * WP_Widget_Twitter_Pro is the class that handles the main widget.
@@ -134,7 +134,7 @@ class WP_Widget_Twitter_Pro extends WP_Widget {
134
  </select>
135
  </p>
136
  <p>
137
- <label for="<?php echo $this->get_field_id( 'dateFormat' ); ?>"><?php echo sprintf( __( 'Format to dispaly the date in, uses <a href="%s">PHP date()</a> format:', $this->_slug ), 'http://php.net/date' ); ?></label>
138
  <input class="widefat" id="<?php echo $this->get_field_id( 'dateFormat' ); ?>" name="<?php echo $this->get_field_name( 'dateFormat' ); ?>" type="text" value="<?php esc_attr_e( $instance['dateFormat'] ); ?>" />
139
  </p>
140
  <p>
@@ -145,7 +145,7 @@ class WP_Widget_Twitter_Pro extends WP_Widget {
145
  <input class="checkbox" type="checkbox" value="true" id="<?php echo $this->get_field_id( 'showXavisysLink' ); ?>" name="<?php echo $this->get_field_name( 'showXavisysLink' ); ?>"<?php checked( $instance['showXavisysLink'], 'true' ); ?> />
146
  <label for="<?php echo $this->get_field_id( 'showXavisysLink' ); ?>"><?php _e( 'Show Link to Twitter Widget Pro', $this->_slug ); ?></label>
147
  </p>
148
- <p><?php echo $wpTwitterWidget->getSupportForumLink(); ?></p>
149
  <?php
150
  return;
151
  }
@@ -183,7 +183,7 @@ class WP_Widget_Twitter_Pro extends WP_Widget {
183
  * includes filters that modify tweet content for things like linked usernames.
184
  * It also helps us avoid name collisions.
185
  */
186
- class wpTwitterWidget extends XavisysPlugin {
187
  private $_api_url;
188
 
189
  /**
@@ -221,7 +221,7 @@ class wpTwitterWidget extends XavisysPlugin {
221
  update_option( 'twp_version', TWP_VERSION );
222
  }
223
 
224
- protected function _postSettingsInit() {
225
  if ( ! in_array( $this->_settings['twp']['http_vs_https'], array( 'http', 'https' ) ) )
226
  $this->_settings['twp']['http_vs_https'] = 'https';
227
  $this->_api_url = $this->_settings['twp']['http_vs_https'] . '://api.twitter.com/1/';
@@ -266,18 +266,18 @@ class wpTwitterWidget extends XavisysPlugin {
266
  }
267
  }
268
 
269
- public function addOptionsMetaBoxes() {
270
- add_meta_box( $this->_slug . '-general-settings', __( 'General Settings', $this->_slug ), array( $this, 'generalSettingsMetaBox' ), 'xavisys-' . $this->_slug, 'main' );
271
- add_meta_box( $this->_slug . '-defaults', __( 'Defaults', $this->_slug ), array( $this, 'defaultSettingsMetaBox' ), 'xavisys-' . $this->_slug, 'main' );
272
  }
273
 
274
- public function generalSettingsMetaBox() {
275
  $clear_locks_url = wp_nonce_url( add_query_arg( array( 'action' => 'clear-locks' ) ), 'clear-locks' );
276
  ?>
277
  <table class="form-table">
278
  <tr valign="top">
279
  <th scope="row">
280
- <?php _e( "HTTP vs HTTPS:", $this->_slug );?>
281
  </th>
282
  <td>
283
  <input class="checkbox" type="radio" value="https" id="twp_http_vs_https_https" name="twp[http_vs_https]"<?php checked( $this->_settings['twp']['http_vs_https'], 'https' ); ?> />
@@ -291,18 +291,49 @@ class wpTwitterWidget extends XavisysPlugin {
291
  </tr>
292
  <tr>
293
  <th scope="row">
294
- <?php _e( "Clear Update Locks:", $this->_slug );?>
295
  </th>
296
  <td>
297
  <a href="<?php echo esc_url( $clear_locks_url ); ?>"><?php _e( 'Clear Update Locks', $this->_slug ); ?></a><br />
298
- <small><?php _e( "A small perecntage of servers seem to have issues where an update lock isn't getting cleared. If you're experiencing issues with your feed not updating, try clearing the update locks.", $this->_slug ); ?></small>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  </td>
300
  </tr>
301
  </table>
302
  <?php
303
  }
304
- public function defaultSettingsMetaBox() {
305
  ?>
 
306
  <table class="form-table">
307
  <tr valign="top">
308
  <th scope="row">
@@ -382,7 +413,7 @@ class wpTwitterWidget extends XavisysPlugin {
382
  </tr>
383
  <tr valign="top">
384
  <th scope="row">
385
- <label for="twp_dateFormat"><?php echo sprintf( __( 'Format to dispaly the date in, uses <a href="%s">PHP date()</a> format:', $this->_slug ), 'http://php.net/date' ); ?></label>
386
  </th>
387
  <td>
388
  <input id="twp_dateFormat" name="twp[dateFormat]" type="text" class="regular-text code" value="<?php esc_attr_e( $this->_settings['twp']['dateFormat'] ); ?>" size="40" />
@@ -448,7 +479,7 @@ class wpTwitterWidget extends XavisysPlugin {
448
  * @return string - Tweet text with #hashtags linked
449
  */
450
  public function linkHashtags( $text ) {
451
- $text = preg_replace_callback('/(^|\s)(#\w*)/i', array($this, '_linkHashtagsCallback'), $text);
452
  return $text;
453
  }
454
 
@@ -473,30 +504,62 @@ class wpTwitterWidget extends XavisysPlugin {
473
  * @return string - Tweet text with URLs repalced with links
474
  */
475
  public function linkUrls( $text ) {
476
- /**
477
- * match protocol://address/path/file.extension?some=variable&another=asf%
478
- * $1 is a possible space, this keeps us from linking href="[link]" etc
479
- * $2 is the whole URL
480
- * $3 is protocol://
481
- * $4 is the URL without the protocol://
482
- * $5 is the URL parameters
483
- */
484
- $text = preg_replace_callback("/(^|\s)(([a-zA-Z]+:\/\/)([a-z][a-z0-9_\..-]*[a-z]{2,6})([a-zA-Z0-9~\/*-?&%]*))/i", array($this, '_linkUrlsCallback'), $text);
485
-
486
- /**
487
- * match www.something.domain/path/file.extension?some=variable&another=asf%
488
- * $1 is a possible space, this keeps us from linking href="[link]" etc
489
- * $2 is the whole URL that was matched. The protocol is missing, so we assume http://
490
- * $3 is www.
491
- * $4 is the URL matched without the www.
492
- * $5 is the URL parameters
493
- */
494
- $text = preg_replace_callback("/(^|\s)(www\.([a-z][a-z0-9_\..-]*[a-z]{2,6})([a-zA-Z0-9~\/*-?&%]*))/i", array($this, '_linkUrlsCallback'), $text);
 
 
 
 
 
495
 
496
  return $text;
497
  }
498
 
499
- private function _linkUrlsCallback ( $matches ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
500
  $linkAttrs = array(
501
  'href' => $matches[2]
502
  );
@@ -511,8 +574,6 @@ class wpTwitterWidget extends XavisysPlugin {
511
  $attributes = array_filter( wp_parse_args( $attributes ), array( $this, '_notEmpty' ) );
512
  $attributes = apply_filters( 'widget_twitter_link_attributes', $attributes );
513
  $attributes = wp_parse_args( $attributes );
514
- if ( strtolower( 'www' == substr( $attributes['href'], 0, 3 ) ) )
515
- $attributes['href'] = 'http://' . $attributes['href'];
516
 
517
  $text = apply_filters( 'widget_twitter_link_text', $text );
518
  $link = '<a';
@@ -656,10 +717,10 @@ class wpTwitterWidget extends XavisysPlugin {
656
  }
657
 
658
  if ( 'true' == $args['showXavisysLink'] ) {
659
- $widgetContent .= '<div class="xavisys-link"><span class="xavisys-link-text">';
660
  $linkAttrs = array(
661
  'href' => 'http://bluedogwebservices.com/wordpress-plugin/twitter-widget-pro/',
662
- 'title' => __( 'Brought to you by BlueDog Web Services - A WordPress development company', $this->_slug )
663
  );
664
  $widgetContent .= __( 'Powered by', $this->_slug );
665
  $widgetContent .= $this->_buildLink( 'WordPress Twitter Widget Pro', $linkAttrs );
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://bluedogwebservices.com/wordpress-plugin/twitter-widget-pro/
5
  * Description: A widget that properly handles twitter feeds, including @username, #hashtag, and link parsing. It can even display profile images for the users. Requires PHP5.
6
+ * Version: 2.4.0
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://ran.ge/
9
  * License: GPLv2 or later
29
  */
30
 
31
  require_once( 'tlc-transients.php' );
32
+ require_once( 'range-plugin-framework.php' );
33
+ define( 'TWP_VERSION', '2.4.0' );
34
 
35
  /**
36
  * WP_Widget_Twitter_Pro is the class that handles the main widget.
134
  </select>
135
  </p>
136
  <p>
137
+ <label for="<?php echo $this->get_field_id( 'dateFormat' ); ?>"><?php echo sprintf( __( 'Format to display the date in, uses <a href="%s">PHP date()</a> format:', $this->_slug ), 'http://php.net/date' ); ?></label>
138
  <input class="widefat" id="<?php echo $this->get_field_id( 'dateFormat' ); ?>" name="<?php echo $this->get_field_name( 'dateFormat' ); ?>" type="text" value="<?php esc_attr_e( $instance['dateFormat'] ); ?>" />
139
  </p>
140
  <p>
145
  <input class="checkbox" type="checkbox" value="true" id="<?php echo $this->get_field_id( 'showXavisysLink' ); ?>" name="<?php echo $this->get_field_name( 'showXavisysLink' ); ?>"<?php checked( $instance['showXavisysLink'], 'true' ); ?> />
146
  <label for="<?php echo $this->get_field_id( 'showXavisysLink' ); ?>"><?php _e( 'Show Link to Twitter Widget Pro', $this->_slug ); ?></label>
147
  </p>
148
+ <p><?php echo $wpTwitterWidget->get_support_forum_link(); ?></p>
149
  <?php
150
  return;
151
  }
183
  * includes filters that modify tweet content for things like linked usernames.
184
  * It also helps us avoid name collisions.
185
  */
186
+ class wpTwitterWidget extends RangePlugin {
187
  private $_api_url;
188
 
189
  /**
221
  update_option( 'twp_version', TWP_VERSION );
222
  }
223
 
224
+ protected function _post_settings_init() {
225
  if ( ! in_array( $this->_settings['twp']['http_vs_https'], array( 'http', 'https' ) ) )
226
  $this->_settings['twp']['http_vs_https'] = 'https';
227
  $this->_api_url = $this->_settings['twp']['http_vs_https'] . '://api.twitter.com/1/';
266
  }
267
  }
268
 
269
+ public function add_options_meta_boxes() {
270
+ add_meta_box( $this->_slug . '-general-settings', __( 'General Settings', $this->_slug ), array( $this, 'general_settings_meta_box' ), 'range-' . $this->_slug, 'main' );
271
+ add_meta_box( $this->_slug . '-defaults', __( 'Default Settings for Shortcodes', $this->_slug ), array( $this, 'default_settings_meta_box' ), 'range-' . $this->_slug, 'main' );
272
  }
273
 
274
+ public function general_settings_meta_box() {
275
  $clear_locks_url = wp_nonce_url( add_query_arg( array( 'action' => 'clear-locks' ) ), 'clear-locks' );
276
  ?>
277
  <table class="form-table">
278
  <tr valign="top">
279
  <th scope="row">
280
+ <?php _e( "HTTP vs HTTPS", $this->_slug );?>
281
  </th>
282
  <td>
283
  <input class="checkbox" type="radio" value="https" id="twp_http_vs_https_https" name="twp[http_vs_https]"<?php checked( $this->_settings['twp']['http_vs_https'], 'https' ); ?> />
291
  </tr>
292
  <tr>
293
  <th scope="row">
294
+ <?php _e( "Clear Update Locks", $this->_slug );?>
295
  </th>
296
  <td>
297
  <a href="<?php echo esc_url( $clear_locks_url ); ?>"><?php _e( 'Clear Update Locks', $this->_slug ); ?></a><br />
298
+ <small><?php _e( "A small percentage of servers seem to have issues where an update lock isn't getting cleared. If you're experiencing issues with your feed not updating, try clearing the update locks.", $this->_slug ); ?></small>
299
+ </td>
300
+ </tr>
301
+ <tr>
302
+ <th scope="row">
303
+ <?php _e( 'Current API Usage', $this->_slug );?>
304
+ </th>
305
+ <td>
306
+ <?php
307
+ $limit_url = $this->_api_url . "account/rate_limit_status.json";
308
+ $resp = wp_remote_request( $limit_url );
309
+
310
+ if ( !is_wp_error( $resp ) && $resp['response']['code'] >= 200 && $resp['response']['code'] < 300 ) {
311
+ $decodedResponse = json_decode( $resp['body'] );
312
+ ?>
313
+ <p>
314
+ <?php echo sprintf( __( 'Used: %d', $this->_slug ), $decodedResponse->hourly_limit - $decodedResponse->remaining_hits ); ?><br />
315
+ <?php echo sprintf( __( 'Remaining: %d', $this->_slug ), $decodedResponse->remaining_hits ); ?><br />
316
+ <?php
317
+ $minutes = ceil( ( $decodedResponse->reset_time_in_seconds - gmdate( 'U' ) ) / 60 );
318
+ echo sprintf( _n( 'Limits reset in: %d minutes', 'Limits reset in: %d minutes', $minutes, $this->_slug ), $minutes );
319
+ ?><br />
320
+ <small><?php _e( 'This is overall usage, not just usage from Twitter Widget Pro', $this->_slug ); ?></small>
321
+ </p>
322
+ <?php
323
+ } else {
324
+ ?>
325
+ <p><?php _e( 'There was an error checking your rate limit.', $this->_slug ); ?></p>
326
+ <?php
327
+ }
328
+ ?>
329
  </td>
330
  </tr>
331
  </table>
332
  <?php
333
  }
334
+ public function default_settings_meta_box() {
335
  ?>
336
+ <p><?php _e( 'These settings are the default for the shortcodes and all of them can be overridden by specifying a different value in the shortcode itself. All settings for widgets are locate in the individual widget.', $this->_slug ) ?></p>
337
  <table class="form-table">
338
  <tr valign="top">
339
  <th scope="row">
413
  </tr>
414
  <tr valign="top">
415
  <th scope="row">
416
+ <label for="twp_dateFormat"><?php echo sprintf( __( 'Format to display the date in, uses <a href="%s">PHP date()</a> format:', $this->_slug ), 'http://php.net/date' ); ?></label>
417
  </th>
418
  <td>
419
  <input id="twp_dateFormat" name="twp[dateFormat]" type="text" class="regular-text code" value="<?php esc_attr_e( $this->_settings['twp']['dateFormat'] ); ?>" size="40" />
479
  * @return string - Tweet text with #hashtags linked
480
  */
481
  public function linkHashtags( $text ) {
482
+ $text = preg_replace_callback('/(^|\s)(#[\w\x{00C0}-\x{00D6}\x{00D8}-\x{00F6}\x{00F8}-\x{00FF}]*)/i', array($this, '_linkHashtagsCallback'), $text);
483
  return $text;
484
  }
485
 
504
  * @return string - Tweet text with URLs repalced with links
505
  */
506
  public function linkUrls( $text ) {
507
+ $text = " {$text} "; // Pad with whitespace to simplify the regexes
508
+
509
+ $url_clickable = '~
510
+ ([\\s(<.,;:!?]) # 1: Leading whitespace, or punctuation
511
+ ( # 2: URL
512
+ [\\w]{1,20}+:// # Scheme and hier-part prefix
513
+ (?=\S{1,2000}\s) # Limit to URLs less than about 2000 characters long
514
+ [\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]*+ # Non-punctuation URL character
515
+ (?: # Unroll the Loop: Only allow puctuation URL character if followed by a non-punctuation URL character
516
+ [\'.,;:!?)] # Punctuation URL character
517
+ [\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]++ # Non-punctuation URL character
518
+ )*
519
+ )
520
+ (\)?) # 3: Trailing closing parenthesis (for parethesis balancing post processing)
521
+ ~xS';
522
+ // The regex is a non-anchored pattern and does not have a single fixed starting character.
523
+ // Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
524
+
525
+ $text = preg_replace_callback( $url_clickable, array($this, '_make_url_clickable_cb'), $text );
526
+
527
+ $text = preg_replace_callback( '#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', array($this, '_make_web_ftp_clickable_cb' ), $text );
528
+ $text = preg_replace_callback( '#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', array($this, '_make_email_clickable_cb' ), $text );
529
+
530
+ $text = substr( $text, 1, -1 ); // Remove our whitespace padding.
531
 
532
  return $text;
533
  }
534
 
535
+ function _make_web_ftp_clickable_cb($matches) {
536
+ $ret = '';
537
+ $dest = $matches[2];
538
+ $dest = 'http://' . $dest;
539
+ $dest = esc_url($dest);
540
+ if ( empty($dest) )
541
+ return $matches[0];
542
+
543
+ // removed trailing [.,;:)] from URL
544
+ if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
545
+ $ret = substr($dest, -1);
546
+ $dest = substr($dest, 0, strlen($dest)-1);
547
+ }
548
+ $linkAttrs = array(
549
+ 'href' => $dest
550
+ );
551
+ return $matches[1] . $this->_buildLink( $dest, $linkAttrs ) . $ret;
552
+ }
553
+
554
+ private function _make_email_clickable_cb( $matches ) {
555
+ $email = $matches[2] . '@' . $matches[3];
556
+ $linkAttrs = array(
557
+ 'href' => 'mailto:' . $email
558
+ );
559
+ return $matches[1] . $this->_buildLink( $email, $linkAttrs );
560
+ }
561
+
562
+ private function _make_url_clickable_cb ( $matches ) {
563
  $linkAttrs = array(
564
  'href' => $matches[2]
565
  );
574
  $attributes = array_filter( wp_parse_args( $attributes ), array( $this, '_notEmpty' ) );
575
  $attributes = apply_filters( 'widget_twitter_link_attributes', $attributes );
576
  $attributes = wp_parse_args( $attributes );
 
 
577
 
578
  $text = apply_filters( 'widget_twitter_link_text', $text );
579
  $link = '<a';
717
  }
718
 
719
  if ( 'true' == $args['showXavisysLink'] ) {
720
+ $widgetContent .= '<div class="range-link"><span class="range-link-text">';
721
  $linkAttrs = array(
722
  'href' => 'http://bluedogwebservices.com/wordpress-plugin/twitter-widget-pro/',
723
+ 'title' => __( 'Brought to you by Range - A WordPress design and development company', $this->_slug )
724
  );
725
  $widgetContent .= __( 'Powered by', $this->_slug );
726
  $widgetContent .= $this->_buildLink( 'WordPress Twitter Widget Pro', $linkAttrs );
xavisys-plugin-framework.css DELETED
@@ -1,3 +0,0 @@
1
- #icon-xavisys {
2
- background:transparent url(http://static.xavisys.com/xavisys-logo-32.png) no-repeat scroll bottom left;
3
- }