WP to Twitter - Version 3.1.0

Version Description

  • Moved changelog entries older than 3.0.0 into changelog.txt
  • Update PHP 4 class constructors to PHP 5.
  • Added template tags for all categories and all category descriptions.
  • Better loading of text domain.
  • Improve preview character counting when featured images are being uploaded. (WP Tweets PRO)
  • Require users to add an email to send a support request.
  • Added check for constant WPT_STAGING_MODE; disables posting to Twitter on staging servers.
  • New feature: Rate limiting. Enable rate limiting to restrict the number of posts per category per hour can be sent to your Twitter account.
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 WP to Twitter
Version 3.1.0
Comparing to
See all releases

Code changes from version 3.0.7 to 3.1.0

changelog.txt ADDED
@@ -0,0 +1,979 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ = 2.9.8 =
2
+
3
+ * Feature: Upload images from remote servers (WP Tweets PRO)
4
+ * Updated User's Guide.
5
+
6
+ = 2.9.7 =
7
+
8
+ * New filter: wpt_allow_reposts to filter whether a specific post should schedule retweets (WP Tweets PRO).
9
+ * Alter image selection criteria to use first uploaded image as the default instead of the last uploaded image (WP Tweets PRO)
10
+ * Pass media data into Tweet Now AJAX function (WP Tweets PRO);
11
+ * Fixed issue with 400 error for "Tweet Now" button for unauthenticated logged-in users (WP Tweets PRO)
12
+ * Add filter to disable use of featured image for uploading (wpt_use_featured_image; returns boolean) (WP Tweets PRO)
13
+ * Bug fix: In translated context, successful Tweet notices picked up wrong notice class.
14
+ * Extensive code cleanup and reformatting.
15
+
16
+ = 2.9.6 =
17
+
18
+ * Bug fix: Expiration not set on retweets.
19
+
20
+ = 2.9.5 =
21
+
22
+ * Added test to prevent duplicate sending of Tweets. Any Tweets to the same author sent within 30 seconds are blocked silently.
23
+ * Feature: Add Twitter widget for search API
24
+ * Add support for YOURLS signature tokens
25
+ * Deprecate support for YOURLS access with username/password.
26
+ * Revised debugging setup
27
+ * Translation updated: German
28
+
29
+ = 2.9.4 =
30
+
31
+ * Security Fix: https://vexatioustendencies.com/wordpress-plugin-vulnerability-dump-part-2/; No thanks to reporter.
32
+
33
+ = 2.9.3 =
34
+
35
+ * Feature: Use display URL for URLs in Twitter Widget
36
+ * Bug fix: user's Twitter account not assigned to #author# tag
37
+ * Bug fix: reverted bug fix #4 from 2.9.1; didn't accomplish what it was supposed to and caused new issues.
38
+
39
+ = 2.9.2 =
40
+
41
+ * Bug fix: Accidentally enabled upload images in free edition; feature is problematic without the controls in WP Tweets PRO!
42
+
43
+ = 2.9.1 =
44
+
45
+ * Bug fix: too many fallbacks for #author#, display name never shows
46
+ * Bug fix: stripslashes on AJAX tweet
47
+ * Bug fix: prevent PHP warnings on invalid shortener return values
48
+ * Bug fix: [WP Tweets PRO] if images are to be uploaded, but were added to post after publication, they were not tweeted.
49
+ * Updated Dutch, German translations.
50
+
51
+ = 2.9.0 =
52
+
53
+ * Revamp roles and capabilities management
54
+ * Add filter: wpt_max_tweet_length; returns array with max Tweet lengths. Default array( 'with_media'=>119, 'without_media' => 137 );
55
+ * Bug fix: When a Tweet was truncated due to long raw text, truncation would be 5 chars too aggressive.
56
+ * Changed base capability from 'update_core' to 'manage_options' for multi-site admins
57
+ * Post to Twitter function returns false on all errors, rather than just Twitter errors.
58
+ * Removed upgrade cycles for versions more than 2 1/2 years old.
59
+ * Add "Tweet Now" button to send a Tweet without saving post.
60
+ * Add Tweet Scheduler button for WP Tweets PRO users; set time and date and schedule from post without saving.
61
+ * Language update: Italian
62
+
63
+ = 2.8.9 =
64
+
65
+ * Bug fix: Tweet this post toggle incorrectly set when editing an unpublished post with edits default set to not Tweet.
66
+
67
+ = 2.8.8 =
68
+
69
+ * Added missing debugging parameter
70
+ * Added alternative contact method for failed support email requests.
71
+ * Updated search target URL for hashtags in Twitter widget
72
+ * Automatic truncation of title/excerpt now trims off entire last word.
73
+ * Localized base tabs script.
74
+ * Bug fix: if post title was contained in custom Tweet & Tweet > 140 characters, title could be removed from Tweet if truncating not altered
75
+ * Bug fix: use reply-to header in support requests.
76
+ * Bug fix: error log not visible in Tweet history for post.
77
+ * UI: Tweet History now collapsed by default.
78
+ * Prep work for WP Tweets PRO 1.7.
79
+ * Added filter to insert HTML before and after Tweet list items in widget.
80
+ * Added link to download PDF user's guide.
81
+ * Deprecated support for WordPress versions 3.5.x
82
+ * French, Dutch translations updated.
83
+
84
+ = 2.8.7 =
85
+
86
+ * Updated: Changed URLs to Twitter app creation
87
+ * Bug fix: Error message clean up.
88
+ * Bug fix: if excerpt value was contained in custom Tweet & custom Tweet included line breaks & Tweet > 140 characters, excerpt custom Tweet would have characters missing from the middle of the Tweet.
89
+ * Updated: tested up to value
90
+
91
+ = 2.8.6 =
92
+
93
+ * Bug fix: wasn't possible to remove custom Twitter text.
94
+ * Bug fix: remove 403 error generated by duplicate posting with XMLRPC instant posts.
95
+ * Bug fix: Check data type returned by JSON query
96
+ * Bug fix: Tweet post status message should not show up except when Tweet has been published.
97
+
98
+ = 2.8.5 =
99
+
100
+ * Wrapped 5.3+ only function in function_exists
101
+
102
+ = 2.8.4 =
103
+
104
+ * Rewrite Twitter App setup instructions to match re-designed Application Management page at Twitter.
105
+ * Change time query address to main Twitter domain to avoid http_query errors.
106
+ * Re-vamped error message generation.
107
+ * Added notification messages post-publication.
108
+ * Added 'last Tweet' status notification in settings.
109
+ * Added option to disable feed stylesheet if not in use.
110
+
111
+ = 2.8.3 =
112
+
113
+ * Don't fetch subscribers in user lists.
114
+ * Disables debugging.
115
+
116
+ = 2.8.2 =
117
+
118
+ * Improve performance by checking against Tweetable post types earlier.
119
+ * Added filters for utm_medium and utm_source in Google Analytics; wpt_utm_medium and wpt_utm_source.
120
+ * Deprecated support for WP versions older than 3.4.2
121
+ * Bug fix: image references in twitter feed CSS.
122
+ * Update Spanish translation.
123
+
124
+ = 2.8.1 =
125
+
126
+ * Bug fix: Twitter feed styles enqueued via script hook instead of style hook do to enqueuing within shortcode.
127
+ * New filter: wpt_feed_stylesheet -- replace URL of feed stylesheet with custom URL.
128
+ * New filter: wpt_enqueue_feed_styles -- return false to disable stylesheet.
129
+ * Removed option to connect to Twitter on HTTP, due to https://dev.twitter.com/discussions/24239
130
+ * Russian translation updated.
131
+ * Dutch translation updated.
132
+ * Spanish translation updated.
133
+
134
+ = 2.8.0 =
135
+
136
+ * Removed category filtering in favor of WP Tweets PRO update allowing filtering on all taxonomies.
137
+ * Removed obsolete functions handling older WP versions.
138
+ * UI updates.
139
+ * Updated fallbacks for multibyte string functions.
140
+ * Added wpt_tag_default filter to choose the default hashtag symbol.
141
+ * Miscellaneous PHP notice eliminations.
142
+ * File reorganization.
143
+ * Bug fix: Twitter feed widget errors if not authenticated.
144
+
145
+ = 2.7.7 =
146
+
147
+ * Bug fix: #author# template tag
148
+ * Bug fix: tag filtering error.
149
+ * Bug fix: eliminated one PHP notice.
150
+ * Minor text changes.
151
+ * Updated: Russian translation.
152
+
153
+ = 2.7.6 =
154
+
155
+ * Added citation for StormTwitter feed source.
156
+ * Reverted use of 'extract()' due to very obscure bug.
157
+ * New feature for WP Tweets PRO: custom templates for re-posts
158
+ * Update Dutch translation.
159
+
160
+ = 2.7.5 =
161
+
162
+ * Setting a post to 'pending' or any custom status caused a Tweet to be published in 2.7.4
163
+
164
+ = 2.7.4 =
165
+
166
+ * Update API endpoint for Bit.ly
167
+ * Added filter to modify "Tweet this" value during editing, based on $_POST data. ('wpt_tweet_this_edit')
168
+ * Altered order of limits for determining whether to Tweet.
169
+ * Deprecated upgrade routine for versions below 2.2.9. (Upgrade will still work.)
170
+ * Added questions to support request form.
171
+ * Added option to delete Tweet history for a post.
172
+ * Made Twitter Feed available via shortcode [get_tweets id='twitter_username']
173
+ * Debugging improvements.
174
+ * Moved to save_post actions
175
+ * Removed option to disable XMLRPC-based Tweeting.
176
+ * Deprecated support for WP versions older than 3.3.3.
177
+ * Renamed StormTwitter class for better namespacing and because it's substantively changed as I'm using it.
178
+ * Modified Twitter feed caching to save as local file or as transient if file system not available.
179
+ * Removed PHP < 5 warning, since I no longer support versions of WordPress that allow PHP 4.
180
+ * #author# Template tag only worked if WP Tweets PRO installed.
181
+ * Updated Portuguese Brazilian & added Swedish translations. (Partial)
182
+
183
+ = 2.7.3 =
184
+
185
+ * Don't display promotional notice if donation option checked.
186
+ * WP Tweets PRO: fix for broken prepend text.
187
+ * WP Tweets PRO: Improved truncating if image uploads enabled.
188
+ * Updated translation: Italian
189
+
190
+ = 2.7.2 =
191
+
192
+ * Bug fix: Twitter Feed CSS enqueued on all pages, instead of just when activated.
193
+ * Bug fix: test parameters in tmhOAuth caused plug-in conflict.
194
+ * Bug fix: Major issue with WP Tweets PRO if no individual accounts were authorized with Twitter.
195
+
196
+ = 2.7.1 =
197
+
198
+ * Cleared un-noticed PHP warnings.
199
+ * Updated .pot language files.
200
+
201
+ = 2.7.0 =
202
+
203
+ * Bug fix to character counter to adapt to updated t.co lengths.
204
+ * Bug fix to test URL to return unencoded URL.
205
+ * Bug fix: could not save setting to use dynamic campaign ID with Google Analytics
206
+ * Bug fix: Could not re-order template tag truncation order.
207
+ * Bug fix: Corrected encoding of category names and descriptions.
208
+ * Bug fix: Better handling of wp_get_shortlink for custom post types. (Custom post types don't support wp_get_shortlink)
209
+ * Adds a Twitter Feed widget. Original code source from StormTwitter feed by [Liam Gladdy](http://www.stormconsultancy.co.uk/blog/development/tools-plugins/oauth-twitter-feed-for-developers-library-and-wordpress-plugin/)
210
+ * Deprecated support for WP 3.1.4.
211
+
212
+ = 2.6.9 =
213
+
214
+ * Error with post_with_media check. All apologies.
215
+
216
+ = 2.6.8 =
217
+
218
+ * Filter post_with_media to only handle posts with attached media. (WP Tweets PRO)
219
+ * Expose past and failed Tweets on edited posts when Tweeting edits disabled.
220
+
221
+ = 2.6.7 =
222
+
223
+ * Fix tmhOAuth already exists issue.
224
+ * Bug fix: do not Tweet edits unless explicitly directed to, rather than depending on meta data.
225
+ * Bug fix: Scheduled posts/image uploads (for WP Tweets PRO)
226
+ * Improved error messaging.
227
+ * Misc. minor bug fixes
228
+
229
+ = 2.6.6 =
230
+
231
+ * Improved & removed feature: Tweet comments. Moved to WP Tweets PRO.
232
+ * Improved view: post edit screen when Tweeting edits is disabled.
233
+ * Added filter: wpt_custom_shortcode. Args: $post_ID, custom field name. Filter output from [[your_custom_field]].
234
+ * Changed twitter analytics options to radio selector.
235
+ * Bug fix: disable inline edit Tweets did not also disable bulk edit Tweets
236
+ * Bug fix: URL re-fetch issue with jotURL.
237
+ * Updated Italian translation.
238
+
239
+ = 2.6.5 =
240
+
241
+ * Whoops. I left in some debugging. Hurt me more than it hurt you...
242
+
243
+ = 2.6.4 =
244
+
245
+ * Bug fix: sslverify=false to fix cURL issue.
246
+ * Bug fix: #@# and #author# reference tags did not always return correct results.
247
+ * Bug fix: charset retrieval incorrect
248
+ * Updated languages: French, Italian, German
249
+
250
+ = 2.6.3 =
251
+
252
+ * Bug fix: Fallback function for filter_var in PHP <5.2
253
+ * Added shortener: [JotURL](https://www.joturl.com/), contributed by Massimo Poli
254
+ * Language updates: Italian, Dutch, Russian.
255
+
256
+ = 2.6.2 =
257
+
258
+ * Bug fix: Rapidly-posted edits processed as new posts.
259
+ * Bug fix: URL shortener error produced on https when no shortener chosen.
260
+
261
+ = 2.6.1 =
262
+
263
+ * Translatable role names for Permissions.
264
+ * Bug fix: Goo.gl URL shortening. Incorrect URL posted.
265
+
266
+ = 2.6.0 =
267
+
268
+ * Support for new features in WP Tweets PRO 1.4.0.
269
+ * Minor interface tweaks.
270
+ * Removed settings export (it was out of date and nobody sent it anyway).
271
+ * Bug fix: bad settings link in API failure warnings.
272
+ * Bug fix: URL shortener returned error when not shortening URLs.
273
+ * Bug fix: Category limits are not applied if 'category' is not an available taxonomy.
274
+ * Bug fix: Prevent publish actions from running twice for scheduled posts.
275
+ * Change: significant changes to large portions of plug-in text. My apologies to translators...but there's less text, now!
276
+ * File restructuring and code cleanup.
277
+ * Added Danish translation.
278
+ * Updated French translation.
279
+
280
+ = 2.5.9 =
281
+
282
+ * Using tag slug instead of tag name is a problem for languages with characters outside of [RFC 1738](http://www.faqs.org/rfcs/rfc1738.html) URL specs. Transformed into selectable option, default off.
283
+
284
+ = 2.5.8 =
285
+
286
+ * WP to Twitter now uses tag slug instead of tag name to convert tags into hashtags. Allows you to customize the hashtag sent for each tag.
287
+ * Set up changes necessary for pending t.co URL length change on 2/20/2013. [Blog post](https://dev.twitter.com/blog/upcoming-tco-changes)
288
+ * Updated: Danish, French, German translations.
289
+
290
+ = 2.5.7 =
291
+
292
+ * Minor fixes for stupid mistakes. I apologize for the inconvenience.
293
+
294
+ = 2.5.6 =
295
+
296
+ * Various fixes related to WP Tweets PRO updates.
297
+
298
+ = 2.5.5 =
299
+
300
+ * Backed out an efficiency tweak that didn't work as expected.
301
+
302
+ = 2.5.4 =
303
+
304
+ * Modified system for handling scheduled posts to get around recent issues with Tweeting scheduled posts.
305
+ * Update to Italian translation
306
+
307
+ = 2.5.3 =
308
+
309
+ * Truncation fix: Tweet not truncated if no template tags in use.
310
+ * Now sanitizing titles and categories when using for Google analytics
311
+ * Updated Italian translation, added Catalan translation.
312
+
313
+ = 2.5.2 =
314
+
315
+ * Another bug fix to truncating.
316
+ * Updated Italian translation.
317
+
318
+ = 2.5.1 =
319
+
320
+ * Removed hardcoding of /wp-content/
321
+ * Fixed truncation bug causing Tweets to be truncated when unnecessary.
322
+ * Improved error messages.
323
+
324
+ = 2.5.0 =
325
+
326
+ * Updated French Translation
327
+ * Fixed issue with multiple-savings of post meta data
328
+ * Added #displayname# template tag.
329
+ * Deprecated support for WordPress versions before 3.0.6.
330
+ * Updated to Twitter API endpoint version 1.1
331
+ * Updated: t.co URLs are now 20 characters. (Were 19.)
332
+ * Change: length of any prepended or appended text is included in character counts.
333
+ * Bug fix: Prepend/Append fields not stripped.
334
+ * Bug fix: undefined variable when Tweeting links
335
+ * Bug fix: truncating of Tweets when no URL shortcode is included.
336
+ * Bug fix: Post had to have a successful previous tweet in order to display failed tweets.
337
+ * Bug fix: if your Twitter application has read/write/dm capabilities, will no longer claim you don't have read/write caps.
338
+ * Improved information in failed tweet listing
339
+ * Clear admin message immediately when clearing errors.
340
+ * Change: test type for default Tweet is positive test if Tweets should be posted by default; negative if not.
341
+ * Verified: WP 3.5 compatibility.
342
+
343
+ = 2.4.13 =
344
+
345
+ * Issue if standard roles had been removed.
346
+ * Added option to hide account information in Tweets as a user profile setting. (If checked, return #account# as blank for that user.)
347
+
348
+ = 2.4.12 =
349
+
350
+ * Bug fix: Issues with permissions disallowing some behaviors incorrectly.
351
+ * Bug fix: Stripping of nonalphanumerics in hashtags is now UTF8 friendly.
352
+ * Change: Tweaking of the meaning of some permissions.
353
+ * Add: permission to disallow a role from Tweeting at all.
354
+
355
+ = 2.4.11 =
356
+
357
+ * Bug fix: Mismatched rules for when to enqueue charCount script and when to insert inline script calling that script.
358
+ * Bug fix: Added long-missing 'do not post Tweets by default when editing' option.
359
+ * Bug fix: 2 bugs when sending test Tweet and using WordPress as a shortening service
360
+ * Translation updated: French
361
+
362
+ = 2.4.10 =
363
+
364
+ * Bug fix: Error in truncation routine left tweets 2 characters too long when truncating.
365
+ * Change: minor tweak to administrative UI.
366
+ * Added: check of read-write status of application when posting.
367
+
368
+ = 2.4.9 =
369
+
370
+ * Bug (notice) fix: undefined variable.
371
+ * Bug fix: url encoding on Retweet links
372
+ * Removed some functions providing upgrade support with older versions of WP to Twitter (pre OAuth)
373
+ * Fixed bug in WP Tweets PRO which broke archiving of past Tweets. (Requires WP Tweets PRO 1.2.1)
374
+ * Added support for Twitter Friendly Links if installed.
375
+ * Added: Saves failed tweets for reference and manual tweeting.
376
+
377
+ = 2.4.8 =
378
+
379
+ * Bug fix: #account# shortcode broken in 2.4.7
380
+ * Bug fix: Missing function if WP Tweets PRO installed but not upgraded to 1.2.0
381
+
382
+ = 2.4.7 =
383
+
384
+ * Bug fix: Fatal error could be triggered if WP HTTP query returns error object.
385
+ * Bug fix: Fixed missing index when saving users without changing Twitter options.
386
+ * Bug fix: With custom post types, save_post ran after publish_{custom_post_type}. Moved save metadata function into publish_{cpt} action.
387
+ * Bug fix: 2.4.1 upgrade cycle was still running for all upgrades.
388
+ * Change: suggest HTTP switch for any connection error, since not all SSL related errors report as such.
389
+ * Italian and Dutch translations updated.
390
+
391
+ = 2.4.6 =
392
+
393
+ * Added strip_tags to custom template tag values.
394
+ * Tweet character counter now processes values for #title#, #url# and #blog#. Courtesy of Arnout Veenman.
395
+ * Truncation array error bug fix courtesy of Arnout Veenman.
396
+ * Truncation routine tags modification courtesy of Arnout Veenman.
397
+ * Bug fix: bug fix for final truncation check.
398
+ * Change: #author# template tag now returns the Twitter account @ reference if it's available, user's display name if not.
399
+ * Bug fix: Su.pr uses the longURL as an array key - the ampersands in URL needed to be encoded.
400
+ * Bug fix: WP to Twitter box showed up on disabled post types.
401
+ * Bug fix: undefined variable when posting using Su.pr as shortener.
402
+ * Change: changed Bit.ly API url to new recommended query URL.
403
+ * Change: moved character counter under Custom Tweet box so there's sufficient space if the meta box is in a side position.
404
+
405
+ = 2.4.5 =
406
+
407
+ * Added #modified# to use post modified date in templates.
408
+ * Corrected unstripped slashes for template preview in WP to Twitter post box
409
+ * Character count for custom tweet text was incorrect on initial load in edit mode.
410
+ * Replaced character counter with a more Twitter-like character counter (counting down.)
411
+ * Removed JavaScript from post box so that WP to Twitter box is properly draggable.
412
+ * Added ampersand to normalizer function
413
+ * Updated Brazilian Portuguese translation
414
+
415
+ = 2.4.4 =
416
+
417
+ * Bug fix: Truncation error if no crucial elements are truncatable
418
+ * Bug fix: Unclosed if/else caused empty Settings link on plugins page.
419
+ * Bug fix: "Post on XMLRPC" option must not be selected if using WP Tweets Pro with XML RPC
420
+ * Bug fix: Windows Live Writer (and perhaps other apps) send entity-converted characters on XMLRPC post; need to decode entities in text before sending to Twitter.
421
+ * Bug fix/change: Provides option to switch to http connections to Twitter if https connection returns SSL errors.
422
+
423
+ = 2.4.3 =
424
+
425
+ * Bug fix: In some cases, Administrators were not granted permissions to add custom tweets and other capability restricted tasks.
426
+ * MAJOR bug fix: broke an element of the authorization routine which caused an early exit out of posting to Twitter for some users.
427
+ * Settings link on plugins listing incorrect if WP Tweets Pro enabled.
428
+
429
+ = 2.4.2 =
430
+
431
+ * 2.4.1 had an error in the upgrade routine which broke the upgrade.
432
+
433
+ = 2.4.1 =
434
+
435
+ * I had mistakenly restricted WP Tweets PRO administrators from setting their own accounts, which was a problem for sites with multiple admin-level authors.
436
+ * Revised permissions model to use custom capability to control access to user accounts rather than default capabilities.
437
+ * Also switched to custom capability to control access to custom tweet options.
438
+ * URL to settings page pointed to wrong location if WP Tweets PRO was installed before configuring WP to Twitter.
439
+ * Support request form submitted to invalid URL if WP Tweets PRO installed.
440
+ * If append or prepend fields were in use, they were duplicated in Tweets on reposts.
441
+ * Added option so that users can be allowed to toggle the Tweet/Don't Tweet custom option without being able to edit other permissions.
442
+
443
+ = 2.4.0 =
444
+
445
+ * Bug fix/change: Twitter automatically shortens all URLs sent. As a result, all URLs are by definition 19 characters for the purpose of Tweeting. WP to Twitter now measures the value of the #url# tag as 19 characters, regardless of actual length.
446
+ * Category limiting can now either mean "tweet checked categories" or "don't tweet checked categories".
447
+ * Option to hide custom tweet box and options based on user roles.
448
+ * User role permissions now support custom roles
449
+ * Ability to determine the sequence in which fields are truncated or removed from Tweets if they exceed status length limits.
450
+ * Replace cURL requirement with WP_HTTP wrapper.
451
+ * Significant re-write of underlying code.
452
+ * Redesign of settings pages.
453
+ * Significant text revisions.
454
+ * Release of [WP Tweets Pro](http://www.joedolson.com/wp-tweets-pro/), a pro upgrade to WP to Twitter.
455
+
456
+ = 2.3.18 =
457
+
458
+ * Bug fix: resolved case where new backdated posts were treated as edits.
459
+ * Some changes to Tweet truncating routines to avoid modifying the URL during truncation.
460
+
461
+ = 2.3.17 =
462
+
463
+ * Bug fix: Custom Tweet text not sent for custom post types if the post was not saved prior to publishing.
464
+ * Bug fix: Scheduled posts would not Tweet if certain plug-ins were installed, due to modifications of post dates.
465
+
466
+ = 2.3.16 =
467
+
468
+ * Bug fix: Change in 2.3.15 to fix XMLRPC publishing edits also classed scheduled posts as edits.
469
+
470
+ = 2.3.15 =
471
+
472
+ * Eliminated unnecessary duplication in error messages.
473
+ * If application is not authenticated, status updates on posting now fail silently.
474
+ * Added additional error help if cURL is not supported.
475
+ * Improved error response information for other http_code responses from Twitter
476
+ * Added reminder of your template format to WP to Twitter custom box
477
+ * Moved tags from an option to a template tag.
478
+ * Fixed bug where shortcodes were not stripped from post excerpts
479
+ * Bug fix: If a scheduled post was edited once, without changing publishing time, custom Tweet text was lost.
480
+ * Added support for the app_publish_post hook
481
+ * Bug fix: XMLRPC published edits to Twitter when post updates on edit disabled
482
+
483
+ = 2.3.14 =
484
+
485
+ * Bug fix for value treated as array without verifying
486
+ * Update to Italian translation
487
+
488
+ = 2.3.13 =
489
+
490
+ * Fixes missing function_exists check for Normalizer.
491
+
492
+ = 2.3.12 =
493
+
494
+ * Links added in link manager were getting run through the manual WP link shortener
495
+ * Added appropriate normalizer call for PHP versions above 5
496
+ * Adjustment to Tweet truncation to hopefully avoid runaway truncating.
497
+ * Added a new FAQ to my web site about character counting.
498
+ * Fixed URL wrapper error with fopen()
499
+ * Bug fix: Switched 'Tweet this post' checkbox to a radio selector for simpler logic.
500
+ * Now saving all past Tweets for each post.
501
+
502
+ = 2.3.11 =
503
+
504
+ * Error in commenter field; accidentally defined braces as template wrapper instead of hashes
505
+ * Text updates
506
+ * Removed PluginSponsors.com
507
+ * Changed API query address to https.
508
+
509
+ = 2.3.10 =
510
+
511
+ * Did not expect people would submit support requests without actually adding a message. Message now required.
512
+
513
+ = 2.3.9 =
514
+
515
+ * Fixed issue with category detection
516
+ * Changed one function name to a non-generic name.
517
+ * Modified remote URL calls; should fix problem contacting Bit.ly
518
+ * Added template tag #commenter# available in comment Tweet template. Use with caution.
519
+ * Added plug-in support request form.
520
+ * Fixed bug where custom Tweet text was over written in a quick edit
521
+ * Fixed "Don't Tweet this Post' checkbox
522
+ * Added Goo.gl as an additional URL shortener.
523
+ * Added custom keyword option for YOURLS shortener.
524
+
525
+ = 2.3.8 =
526
+
527
+ * Bug fix: Warning message about 2.9.2 limited support no longer displays on public site.
528
+
529
+ = 2.3.7 =
530
+
531
+ * Double Tweeting problem fixed.
532
+ * Missing custom Tweets fixed.
533
+ * Revised WordPress version support notes.
534
+ * I hope.
535
+
536
+ = 2.3.6 =
537
+
538
+ * Error in runtime created function fixed.
539
+
540
+ = 2.3.5 =
541
+
542
+ * Bug fix to custom shortcode support to allow use of multiple custom shortcodes simultaneously
543
+ * Bug fix to (hopefully) solve duplicate posting when tags are included on scheduled posts.
544
+ * Added comparison of your server time to Twitter's server time for information when installing.
545
+ * Updated Italian translation.
546
+
547
+ = 2.3.4 =
548
+
549
+ * Re-wrote instructions for connecting to OAuth to reflect redesigned Twitter Apps registration process
550
+ * Code clean-up to remove some redundancies
551
+ * Bug fixes:
552
+ - Occasional double Tweeting on future post seems to be fixed.
553
+ - Tweeting on edits/quick edits when not checked
554
+ * Added Ukrainian translation
555
+
556
+ = 2.3.3 =
557
+
558
+ * Improved support for non-standard publishing mechanisms.
559
+ * Fixed 'Tweet this' option.
560
+ * Quickpress setting made obsolete
561
+ * Now uses wp_get_shortlink() when available for generating WP-based shortlink.
562
+
563
+ = 2.3.2 =
564
+
565
+ * Fixed XMLRPC support
566
+ * Updated Italian translation
567
+
568
+ = 2.3.1 =
569
+
570
+ * Added version check and update cycle into Tweet routine
571
+
572
+ = 2.3.0 =
573
+
574
+ * Added support for custom post types.
575
+ * Added support for Tweeting when comments are posted.
576
+ * Bug fix: results of checking/unchecking 'Don't Tweet this' box not consistent.
577
+ * Added Japanese translation. [kndb](http://blog.layer8.sh/)
578
+
579
+ = 2.2.12 =
580
+
581
+ * Bug fix release. Sorry.
582
+ * Added translation to Brazilian Portugese [Matheus Bratfisch](http://www.matbra.com)
583
+
584
+ = 2.2.11 =
585
+
586
+ * Missing break statement caused remote YOURLS URLs to be replaced with Su.pr URLs
587
+
588
+ = 2.2.10 =
589
+
590
+ * Bug in user settings retrieval; don't know how long it's been a problem.
591
+ * Added updated Italian translation
592
+
593
+ = 2.2.9 =
594
+
595
+ * Blocked posting on custom post types
596
+ * Added time check, for servers with incorrect time.
597
+ * Added cURL check.
598
+ * Due to ongoing problems with Cli.gs, removed that URL shortening service and replaced with Su.pr
599
+ * Changed default shortening to 'no shortening'
600
+ * Saves every Tweet into post meta on save; adds link to re-post status update in WP to Twitter post box.
601
+ * Revised error messages to increase detail.
602
+
603
+ = 2.2.8 =
604
+
605
+ * Enhancement: protect against duplicate Tweets
606
+ * Bug fix: hash tag replacement with spaces problematic if alphanumeric limit also set
607
+ * Bug fix: issue with scheduled posts posting when 'Do not Tweet' checked.
608
+ * Added Danish translation by Rasmus Himmelstrup
609
+ * Updates to compensate for changes in YOURLS 1.5
610
+
611
+ = 2.2.7 =
612
+
613
+ * Enhancement: strips shortcodes before sending post excerpts to Tweet
614
+ * Enhancement: Added PHP version check and warning.
615
+ * Added a default case to check on HTTP response code from Twitter.
616
+ * Added a specific error message for out of sync server times.
617
+ * Added link to [WP to Twitter's Fundry.com page](https://fundry.com/project/10-wp-to-twitter).
618
+ * Bug fix: hash tag space removal fixed
619
+ * Enhancement: Respects wp content directory constants if set.
620
+
621
+ = 2.2.6 =
622
+
623
+ * Modification: renamed OAuth files to maybe avoid collision with alternate OAuth versions which do not include needed methods
624
+ * Eliminated postbox toggles
625
+ * Clean out deprecated functions
626
+ * Updated admin styles and separated into a separate file.
627
+ * Bug fix: Edited pages did not Tweet
628
+ * Bug fix: May have reduced occurrences of URL not being sent in status update. Maybe.
629
+ * Bug fix: Forced lowercase on Bit.ly API username (Thanks, Bit.ly for NOT DOCUMENTING this.)
630
+ * Added option to strip non-alphanumeric characters from hash tags
631
+ * Added control to adjust which levels of users will see custom Profile settings
632
+ * Found myself becoming unnecessarily sarcastic in Changelog notes. Will fix in next version. :)
633
+
634
+ = 2.2.5 =
635
+
636
+ * Bug fix: shouldn't see error 'Could not redeclare OAuth..' again.
637
+ * Bug fix: shouldn't see 'Fatal error: Class 'OAuthSignatureMethod...' again.
638
+ * Bug fix: updated API endpoints
639
+
640
+ = 2.2.4 =
641
+
642
+ * Blocked global error messages from being seen by non-admin level users.
643
+ * Added #account# shortcode to supply Twitter username @ reference in Tweet templates.
644
+ * Updated debugging output
645
+ * Deletes obsolete options from database
646
+
647
+ = 2.2.3 =
648
+
649
+ * Fixed: Bug which added unnecessary duplications of post meta
650
+ * Fixed: broken analytics campaign info
651
+ * Fix attempt to clear up problems with urlencoding of links
652
+ * Fix attempt to clear up problems with some 403 errors and status update truncation
653
+
654
+ = 2.2.2 =
655
+
656
+ * Fixed a bug where new Pages did not Tweet.
657
+ * Minor text changes to try and clarify OAuth process.
658
+ * Fixed bug where any post with a customized status update would post, regardless of settings.
659
+ * Fixed faulty shortening when new links were added.
660
+
661
+ = 2.2.1 =
662
+
663
+ * Not a Beta anymore.
664
+ * Fixed issue with non-shortening links when using XMLRPC clients
665
+ * Fixed issue with double-urlencoding of links before shortening
666
+ * Added Dutch translation
667
+ * Updated Italian translation
668
+
669
+
670
+ = 2.2.0 (beta 7) =
671
+
672
+ * Significantly improved error reporting.
673
+ * Completely revamped secondary author support to give some value in Twitter.
674
+ * Completely eliminated secondary posting service support. Too much trouble, too little application.
675
+ * Removed the custom post meta data clutter; WP to Twitter's post meta data is now private to the plugin.
676
+ * Fixed a couple of error situations with Bit.ly
677
+ * Made it possible for contributor posts to be Tweeted
678
+ * This is the last beta version.
679
+
680
+ = 2.2.0 (beta 6) =
681
+
682
+ * Fixed bug where errors were reported on categories not intended to be sent to Twitter
683
+ * Allowed OAuth notice to be disabled for users not intending to use that service.
684
+ * Added a debugging option to output some process data if OAuth connection fails
685
+ * Fixed bug which prevented posting of edited status updates
686
+
687
+ = 2.2.0 (beta 5) =
688
+
689
+ * Eliminated an incompatibility with alternate versions of twitterOAuth class
690
+ * Significant revisions of error message processes and details
691
+ * Fixed some URL shortener problems
692
+ * Added simplified Chinese translation
693
+
694
+ = 2.2.0 (beta 4) =
695
+
696
+ * Fixed long-standing issue with serialization of option arrays
697
+ * Fixed trimming of white space from authentication keys
698
+ * Clarification of some texts to help explain some of the changes
699
+ * Clarification of some texts to help explain how to connect to Twitter with OAuth
700
+ * Added credit for Estonian translation by Raivo Ratsep.
701
+
702
+ = 2.2.0 (beta 3) =
703
+
704
+ * Fixed issue with failing to post to Twitter.
705
+
706
+ = 2.2.0 (beta 2) =
707
+
708
+ * Fixed false positive error message on Twitter check routine failure
709
+ * Adjusted twitteroauth file to hopefully avoid certain errors
710
+
711
+ = 2.2.0 (beta) =
712
+
713
+ * Added OAuth support
714
+ * Fixed problem with default Tweet status not defaulting to 'no.'
715
+ * Revised a few other minor issues
716
+ * No longer supporting WordPress versions below 2.9.2
717
+ * Eliminated features: Author's Twitter account posting; Use of additional service to post to Twitter on a second account. These features are not possible with simple OAuth authentication; they require XAuth. This makes the features of extremely limited value, since you, as the user, would be required to apply for XAuth permissions on your own installation. I regret the necessity to remove these features. Both options will still function with Twitter-compatible API services using Basic authentication.
718
+
719
+ = 2.1.3 =
720
+
721
+ * Fixed copy typo.
722
+
723
+ = 2.1.2 =
724
+
725
+ * Last update before oAuth integration, I hope.
726
+ * Fixed problems with Postie compatibility
727
+ * Fixed bug where local YOURLS path could not be unset
728
+ * Fixed some issues with upgrades which re-wrote status update templates, occasionally removing the #url# shortcode.
729
+ * Despite numerous reports of issues API behavior with Bit.ly or Twitter, I was unable, in testing, to reproduce any issues, including on servers which I know have had failed requests in the past.
730
+ * Revised upgrade routines to avoid future problems.
731
+
732
+ = 2.1.1 =
733
+
734
+ * Added a control to disable error messages.
735
+ * Separated URL shortener errors from Twitter API errors.
736
+ * Added stored value with the error message from Bit.ly to try and identify source of errors.
737
+
738
+ = 2.1.0 =
739
+
740
+ * Now compatible through WP 3.0 series
741
+ * Fixed bug related to failed responses from URL shortener API requests.
742
+ * Added #author# shortcode for status update templates.
743
+ * Fixed a problem with non-posting of scheduled posts when default status updates are disabled.
744
+
745
+ = 2.0.4 =
746
+
747
+ * Fixed bug where status updates were not posted when a post changed from pending to published. (Thanks to Justin Heideman for the catch and fix.)
748
+ * Fixed bug where passwords with special characters were not used correctly
749
+ * Eliminated use of LongURL API due to closure of the service. Hope to replace this functionality at some point, so I've left the framework intact, just removed the API call.
750
+ * Improved error reporting in support check routines.
751
+
752
+ = 2.0.3 =
753
+
754
+ * Updated for Bit.ly API v3 (should fix recent issues with incorrect reporting from Bit.ly API and API request failures.)
755
+
756
+ = 2.0.2 =
757
+
758
+ * Bug fixed where appended text was placed before hash tags.
759
+ * Added method for error messages to be automatically cleared following a successful status update. It seems a lot of people couldn't find the button to clear errors, and thought they were getting an error every time.
760
+ * Moved short URL selection option to a more prominent location.
761
+
762
+ = 2.0.1 =
763
+
764
+ * Bug found with YOURLS short url creation when using multiple sites with one YOURLS installation and short URLS are created using post ID. Added option to disable post_ID as shortURL generating key in YOURLS account settings.
765
+ * Missing semicolon replaced in uninstall.php
766
+
767
+ = 2.0.0 =
768
+
769
+ * Fixed bug introduced in WordPress 2.9 where logged in users could only edit their own profiles and associated issues.
770
+ * Fixed bug which caused #url# to repeatedly be added to the end of Tweet texts on reactivation or upgrade.
771
+ * Fixed bug which generated shortener API error messages when no URL shortener was used.
772
+ * Fixed bug which prevented display of URL on edit screen if no URL shortener was used.
773
+ * Added Spanish translation courtesy of [David Gil P&eacute;rez](http://www.sohelet.com)
774
+ * Made so many language changes that aforementioned translation is now terribly out of date, as are all others...
775
+ * Added ability to restrict posting to certain categories.
776
+ * Added option to dynamically generate Google Analytics campaign identifier by category, post title, author, or post id.
777
+ * Added option to configure plugin to use other services using the Twitter-compatible API.
778
+ * Added support for YOURLS installations as your URL shortener. (Either local or remote.)
779
+ * Redesigned administrative interface.
780
+ * Removed use of Snoopy and alternate HTTP request methods.
781
+ * Discontinued support for WordPress versions below version 2.7.
782
+ * Major revisions to support checks.
783
+ * Version jumped to 2.0.0
784
+
785
+ = 1.5.7 =
786
+
787
+ * Quick bug fix contributed by DougV from WordPress Forums.
788
+
789
+ = 1.5.6 =
790
+
791
+ * WP 2.9 added support for JSON on PHP versions below 5.2; changes made to do WP version checking before adding JSON support.
792
+ * Stripslashes added to viewable data fields.
793
+ * Added option for spaces to be removed in hashtags.
794
+ * A few post meta updates.
795
+ * Barring major disasters, this will be the last release in the 1.x series. Expect version 2 sometime in late January.
796
+
797
+ = 1.5.5 =
798
+
799
+ * Fixed issue with stray hashtags appearing when Tweeting edited posts was disabled and adding hashtags was enabled.
800
+ * Added shortcode (#date#) for post date. Uses your WordPress date settings to format date, but allows you to customize for WP to Twitter.
801
+
802
+ = 1.5.4 =
803
+
804
+ * Fixed issue with spaces in hashtags.
805
+ * Added configurable replacement character in hashtags.
806
+
807
+ = 1.5.3 =
808
+
809
+ * Revised the function which checks whether your Tweet is under the 140 character limit imposed by Twitter. This function had a number of awkward bugs which have now (hopefully) been eradicated.
810
+ * Revised the tags->hashtags generation for better reliability. Fixes bugs with failing to send hashtags to Twitter if they haven't been saved and allowing hashtags on scheduled posts.
811
+ * Option to use WP default URL as a short URL. (http://yourdomain.com/yourblog/?p=id).
812
+
813
+ = 1.5.2 =
814
+
815
+ * Minor code cleanup
816
+ * Fixed uncommon bug where draft posts would not Tweet when published.
817
+ * Fixed bug where #title# shortcode wouldn't work due to prior URL encoding. (Also covers some other obscure bugs.) Thanks to [Daniel Chcouri](http://www.anarchy.co.il) for the great catch.
818
+ * Added new shortcode (#category#) to fetch the first post category.
819
+ * Provided a substitute function for hosts not supportin mb_substr().
820
+ * Fixed a bug where a hashtag would be posted on edits when posting updates was not enabled for edits.
821
+ * Put Cli.gs change revisions on hold barring updates from Pierre at Cli.gs
822
+
823
+ = 1.5.1 =
824
+
825
+ * Because that's what I get for making last minute changes.
826
+
827
+ = 1.5.0 =
828
+
829
+ * Due to a large number of problems in the 1.4.x series, I'm launching a significant revision to the base code earlier than initially planned. This is because many of these features were already in development, and it's simply too much work to maintain both branches of the code.
830
+ * Added option to export settings in plain text for troubleshooting.
831
+ * Simplified some aspects of the settings page.
832
+ * Added custom text options for WordPress Pages to match support for Posts.
833
+ * Improved tags as hashtags handling.
834
+ * Added the ability to use custom shortcodes to access information in custom fields.
835
+ * Improved some error messages to clarify certain issues.
836
+
837
+ = 1.4.11 =
838
+
839
+ * Fixed a bug which allowed editing of posts to be Tweeted if status updates on editing Pages were permitted.
840
+ * Fixed a bug in the support check routine which caused all Cli.gs tests to fail.
841
+ * Streamlined logic controlling whether a new or edited item should be Tweeted.
842
+ * Added Italian translation. Thanks to [Gianni Diurno](http://www.gidibao.net)!
843
+
844
+ = 1.4.10 =
845
+
846
+ * Was never supposed to exist, except that I *forgot* to include a backup function.
847
+
848
+ = 1.4.9 =
849
+
850
+ * Added German translation. Thanks to [Melvin](http://www.toxicavenger.de/)!
851
+ * Fixed a bug relating to missing support for a function or two.
852
+ * Fixed a bug relating to extraneous # symbols in tags
853
+
854
+ = 1.4.8 =
855
+
856
+ * Adds a function to provide PHP5s str_split functionality for PHP4 installations.
857
+
858
+ = 1.4.7 =
859
+
860
+ * Actually resolves the bug which 1.4.6 was supposed to fix.
861
+
862
+ = 1.4.6 =
863
+
864
+ * Hopefully resolved bug with empty value for new field in 1.4.5. It's late, so I won't know until tomorrow...
865
+
866
+ = 1.4.5 =
867
+
868
+ * Resolved bug with extraneous hash sign when no tags are attached.
869
+ * Resolved bug where #url# would appear when included in posting string but with 'link to blog' disabled.
870
+ * Added expansion of short URL via longURL.org stored in post meta data.
871
+ * Resolved additional uncommon bug with PHP 4.
872
+ * Added option to incorporate optional post excerpt.
873
+ * Better handling of multibyte character sets.
874
+
875
+ = 1.4.4 =
876
+
877
+ * Resolved two bugs with hashtag support: spaces in multi-word tags and the posting of hashtag-only status updates when posting shouldn't happen.
878
+
879
+ = 1.4.3 =
880
+
881
+ * Resolved plugin conflict with pre-existing function name.
882
+
883
+ = 1.4.2 =
884
+
885
+ * No changes, just adding a missing file from previous commit.
886
+
887
+ = 1.4.1 =
888
+
889
+ * Revised to not require functions from PHP 5.2
890
+ * Fixed bug in hashtag conversion
891
+
892
+ = 1.4.0 =
893
+
894
+ * Added support for the Bit.ly URL shortening service.
895
+ * Added option to not use URL shortening.
896
+ * Added option to add tags to end of status update as hashtag references.
897
+ * Fixed a bug where the #url# shortcode failed when editing posts.
898
+ * Reduced some redundant code.
899
+ * Converted version notes to new Changelog format.
900
+
901
+ = 1.3.7 =
902
+
903
+ * Revised interface to take advantage of features added in versions 2.5 and 2.7. You can now drag and drop the WP to Twitter configuration panel in Post and Page authoring pages.
904
+ * Fixed bug where post titles were not Tweeted when using the "Press This" bookmarklet
905
+ * Security bug fix.
906
+
907
+ = 1.3.6 =
908
+
909
+ *Bug fix release.
910
+
911
+ = 1.3.5 =
912
+
913
+ * Bug fix: when "Send link to Twitter" is disabled, Twitter status and shortcodes were not parsed correctly.
914
+
915
+ = 1.3.4 =
916
+
917
+ * Bug fix: html tags in titles are stripped from Tweets
918
+ * Bug fix: thanks to [Andrea Baccega](http://www.andreabaccega.com), some problems related to WP 2.7.1 should be fixed.
919
+ * Added optional prepend/append text fields.
920
+
921
+ = 1.3.3 =
922
+
923
+ * Added support for shortcodes in custom Tweet fields.
924
+ * Bug fix when #url# is the first element in a Tweet string.
925
+ * Minor interface changes.
926
+
927
+ = 1.3.2 =
928
+
929
+ * Added a #url# shortcode so you can decide where your short URL will appear in the Tweet.
930
+ * Couple small bug fixes.
931
+ * Small changes to the settings page.
932
+
933
+ = 1.3.1 =
934
+
935
+ * Modification for multiple authors with independent Twitter accounts -- there are now three options:
936
+
937
+ 1. Tweet to your own account, instead of the blog account.
938
+ 1. Tweet to your account with an @ reference to the main blog account.
939
+ 1. Tweet to the main blog account with an @ reference to your own account.
940
+
941
+ * Added an option to enable or disable Tweeting of Pages when edited.
942
+ * **Fixed scheduled posting and posting from QuickPress, so both of these options will now be Tweeted.**
943
+
944
+ = 1.3.0 =
945
+
946
+ *Support for multiple authors with independent Twitter &amp; Cligs accounts.
947
+ *Other minor textual revisions, addition of API availability check in the Settings panel.
948
+ *Bugfixes: If editing a post by XMLRPC, you could not disable Tweeting your edits. FIXED.
949
+
950
+ = 1.2.8 =
951
+
952
+ *Bug fix to 1.2.7.
953
+
954
+ = 1.2.7 =
955
+
956
+ *Uses the Snoopy class to retrieve information from Cligs and to post Twitter updates. Hopefully this will solve a variety of issues.
957
+ *Added an option to track traffic from your Tweeted Posts using Google Analytics (Thanks to [Joost](http://yoast.com/twitter-analytics/))
958
+
959
+ = 1.2.6 =
960
+
961
+ *Bugfix with XMLRPC publishing -- controls to disable XMLRPC publishing now work correctly.
962
+ *Bugfix with error reporting and clearing.
963
+ *Added the option to supply an alternate URL along with your post, to be Tweeted in place of the WP permalink. (Courtesy Bill Berry)
964
+
965
+ = 1.2.5 =
966
+
967
+ *Support for publishing via XMLRPC
968
+ *Corrected a couple minor bugs
969
+ *Added internationalization support
970
+
971
+ = 1.2.0 =
972
+
973
+ *option to post your new blogroll links to Twitter, using the description field as your status update text.
974
+ *option to decide on a post level whether or not that blog post should be posted to Twitter
975
+ *option to set a global default 'to Tweet or not to Tweet.'
976
+
977
+ = 1.1.0 =
978
+
979
+ *Update to use cURL as an option to fetch information from the Cli.gs API.
css/styles.css CHANGED
@@ -1,8 +1,3 @@
1
- #wp-to-twitter #message {
2
- margin: 10px 0;
3
- padding: 5px;
4
- }
5
-
6
  #wp-to-twitter .jd-settings {
7
  clear: both;
8
  }
@@ -133,7 +128,7 @@ label[for="wpt_license_key"] {
133
  padding: 0 4px;
134
  position: relative;
135
  top: 1px;
136
- font-size: 1.2em;
137
  }
138
 
139
  #wpt_settings_page .tabs li {
@@ -144,7 +139,7 @@ label[for="wpt_license_key"] {
144
 
145
  #wpt_settings_page .tabs a {
146
  display: inline-block;
147
- padding: 6px 12px;
148
  border-radius: 4px 4px 0 0;
149
  border: 1px solid #ccc;
150
  background: #f3f3f3;
 
 
 
 
 
1
  #wp-to-twitter .jd-settings {
2
  clear: both;
3
  }
128
  padding: 0 4px;
129
  position: relative;
130
  top: 1px;
131
+ font-size: 1.1em;
132
  }
133
 
134
  #wpt_settings_page .tabs li {
139
 
140
  #wpt_settings_page .tabs a {
141
  display: inline-block;
142
+ padding: 6px 10px;
143
  border-radius: 4px 4px 0 0;
144
  border: 1px solid #ccc;
145
  background: #f3f3f3;
js/jquery.charcount.js CHANGED
@@ -34,8 +34,9 @@
34
  var urlcount = $(obj).val().indexOf('#url#') > -1 ? 18 : 0;
35
  var titlecount = $(obj).val().indexOf('#title#') > -1 ? ($('#title').val().length - 7) : 0;
36
  var namecount = $(obj).val().indexOf('#blog#') > -1 ? ($('#wp-admin-bar-site-name').val().length - 6) : 0;
37
-
38
- var available = options.allowed - (count + urlcount + titlecount + namecount);
 
39
 
40
  if (available <= options.warning && available >= 0) {
41
  $(obj).next().addClass(options.cssWarning);
34
  var urlcount = $(obj).val().indexOf('#url#') > -1 ? 18 : 0;
35
  var titlecount = $(obj).val().indexOf('#title#') > -1 ? ($('#title').val().length - 7) : 0;
36
  var namecount = $(obj).val().indexOf('#blog#') > -1 ? ($('#wp-admin-bar-site-name').val().length - 6) : 0;
37
+ var imgcount = ( $('#wpt_image_yes:checked').length && $( '#remove-post-thumbnail' ).length ) ? 22 : 0;
38
+
39
+ var available = options.allowed - ( count + urlcount + titlecount + namecount + imgcount );
40
 
41
  if (available <= options.warning && available >= 0) {
42
  $(obj).next().addClass(options.cssWarning);
lang/wp-to-twitter-de_DE.mo CHANGED
Binary file
readme.txt CHANGED
@@ -6,7 +6,7 @@ Requires at least: 3.9.2
6
  Tested up to: 4.2.2
7
  License: GPLv2 or later
8
  Text Domain: wp-to-twitter
9
- Stable tag: 3.0.6
10
 
11
  Posts a Twitter update when you update your WordPress blog or add a link, with your chosen URL shortening service.
12
 
@@ -22,6 +22,8 @@ Yep. That's the basic functionality. But it's not the only thing you can do:
22
 
23
  [Upgrade to WP Tweets Pro](http://www.joedolson.com/wp-tweets-pro/) and schedule Tweets, set up automatic reposts, upload images and more!
24
 
 
 
25
  WP to Twitter uses a customizable Tweet template for Tweets sent when updating or editing posts and pages or custom post types. You can customize your Tweet for each post, using custom template tags to generate the Tweet.
26
 
27
  = Free Features =
@@ -31,6 +33,7 @@ WP to Twitter uses a customizable Tweet template for Tweets sent when updating o
31
  * Support for Google Analytics
32
  * Support for XMLRPC remote clients
33
  * Select from YOURLS, Goo.gl, Bit.ly, jotURL, or Su.pr as external URL shorteners.
 
34
 
35
  = Premium Features =
36
 
@@ -66,6 +69,17 @@ Translating my plug-ins is always appreciated. Visit <a href="http://translate.j
66
  * Add regex filter to detect URLs typed into Tweet fields for counting/shortening purposes. [todo]
67
  * 4.2 added compat function for mb_substr; drop mine when I drop support for 4.1
68
 
 
 
 
 
 
 
 
 
 
 
 
69
  = 3.0.7 =
70
 
71
  * Bug fix: Twitter Feed search broken.
@@ -132,993 +146,13 @@ Translating my plug-ins is always appreciated. Visit <a href="http://translate.j
132
  * Moved Twitter server time check out of basic set-up & set up to only run on demand.
133
  * Minor design changes.
134
 
135
- = 2.9.8 =
136
-
137
- * Feature: Upload images from remote servers (WP Tweets PRO)
138
- * Updated User's Guide.
139
-
140
- = 2.9.7 =
141
-
142
- * New filter: wpt_allow_reposts to filter whether a specific post should schedule retweets (WP Tweets PRO).
143
- * Alter image selection criteria to use first uploaded image as the default instead of the last uploaded image (WP Tweets PRO)
144
- * Pass media data into Tweet Now AJAX function (WP Tweets PRO);
145
- * Fixed issue with 400 error for "Tweet Now" button for unauthenticated logged-in users (WP Tweets PRO)
146
- * Add filter to disable use of featured image for uploading (wpt_use_featured_image; returns boolean) (WP Tweets PRO)
147
- * Bug fix: In translated context, successful Tweet notices picked up wrong notice class.
148
- * Extensive code cleanup and reformatting.
149
-
150
- = 2.9.6 =
151
-
152
- * Bug fix: Expiration not set on retweets.
153
-
154
- = 2.9.5 =
155
-
156
- * Added test to prevent duplicate sending of Tweets. Any Tweets to the same author sent within 30 seconds are blocked silently.
157
- * Feature: Add Twitter widget for search API
158
- * Add support for YOURLS signature tokens
159
- * Deprecate support for YOURLS access with username/password.
160
- * Revised debugging setup
161
- * Translation updated: German
162
-
163
- = 2.9.4 =
164
-
165
- * Security Fix: https://vexatioustendencies.com/wordpress-plugin-vulnerability-dump-part-2/; No thanks to reporter.
166
-
167
- = 2.9.3 =
168
-
169
- * Feature: Use display URL for URLs in Twitter Widget
170
- * Bug fix: user's Twitter account not assigned to #author# tag
171
- * Bug fix: reverted bug fix #4 from 2.9.1; didn't accomplish what it was supposed to and caused new issues.
172
-
173
- = 2.9.2 =
174
-
175
- * Bug fix: Accidentally enabled upload images in free edition; feature is problematic without the controls in WP Tweets PRO!
176
-
177
- = 2.9.1 =
178
-
179
- * Bug fix: too many fallbacks for #author#, display name never shows
180
- * Bug fix: stripslashes on AJAX tweet
181
- * Bug fix: prevent PHP warnings on invalid shortener return values
182
- * Bug fix: [WP Tweets PRO] if images are to be uploaded, but were added to post after publication, they were not tweeted.
183
- * Updated Dutch, German translations.
184
-
185
- = 2.9.0 =
186
-
187
- * Revamp roles and capabilities management
188
- * Add filter: wpt_max_tweet_length; returns array with max Tweet lengths. Default array( 'with_media'=>119, 'without_media' => 137 );
189
- * Bug fix: When a Tweet was truncated due to long raw text, truncation would be 5 chars too aggressive.
190
- * Changed base capability from 'update_core' to 'manage_options' for multi-site admins
191
- * Post to Twitter function returns false on all errors, rather than just Twitter errors.
192
- * Removed upgrade cycles for versions more than 2 1/2 years old.
193
- * Add "Tweet Now" button to send a Tweet without saving post.
194
- * Add Tweet Scheduler button for WP Tweets PRO users; set time and date and schedule from post without saving.
195
- * Language update: Italian
196
-
197
- = 2.8.9 =
198
-
199
- * Bug fix: Tweet this post toggle incorrectly set when editing an unpublished post with edits default set to not Tweet.
200
-
201
- = 2.8.8 =
202
-
203
- * Added missing debugging parameter
204
- * Added alternative contact method for failed support email requests.
205
- * Updated search target URL for hashtags in Twitter widget
206
- * Automatic truncation of title/excerpt now trims off entire last word.
207
- * Localized base tabs script.
208
- * Bug fix: if post title was contained in custom Tweet & Tweet > 140 characters, title could be removed from Tweet if truncating not altered
209
- * Bug fix: use reply-to header in support requests.
210
- * Bug fix: error log not visible in Tweet history for post.
211
- * UI: Tweet History now collapsed by default.
212
- * Prep work for WP Tweets PRO 1.7.
213
- * Added filter to insert HTML before and after Tweet list items in widget.
214
- * Added link to download PDF user's guide.
215
- * Deprecated support for WordPress versions 3.5.x
216
- * French, Dutch translations updated.
217
-
218
- = 2.8.7 =
219
-
220
- * Updated: Changed URLs to Twitter app creation
221
- * Bug fix: Error message clean up.
222
- * Bug fix: if excerpt value was contained in custom Tweet & custom Tweet included line breaks & Tweet > 140 characters, excerpt custom Tweet would have characters missing from the middle of the Tweet.
223
- * Updated: tested up to value
224
-
225
- = 2.8.6 =
226
-
227
- * Bug fix: wasn't possible to remove custom Twitter text.
228
- * Bug fix: remove 403 error generated by duplicate posting with XMLRPC instant posts.
229
- * Bug fix: Check data type returned by JSON query
230
- * Bug fix: Tweet post status message should not show up except when Tweet has been published.
231
-
232
- = 2.8.5 =
233
-
234
- * Wrapped 5.3+ only function in function_exists
235
-
236
- = 2.8.4 =
237
-
238
- * Rewrite Twitter App setup instructions to match re-designed Application Management page at Twitter.
239
- * Change time query address to main Twitter domain to avoid http_query errors.
240
- * Re-vamped error message generation.
241
- * Added notification messages post-publication.
242
- * Added 'last Tweet' status notification in settings.
243
- * Added option to disable feed stylesheet if not in use.
244
-
245
- = 2.8.3 =
246
-
247
- * Don't fetch subscribers in user lists.
248
- * Disables debugging.
249
-
250
- = 2.8.2 =
251
-
252
- * Improve performance by checking against Tweetable post types earlier.
253
- * Added filters for utm_medium and utm_source in Google Analytics; wpt_utm_medium and wpt_utm_source.
254
- * Deprecated support for WP versions older than 3.4.2
255
- * Bug fix: image references in twitter feed CSS.
256
- * Update Spanish translation.
257
-
258
- = 2.8.1 =
259
-
260
- * Bug fix: Twitter feed styles enqueued via script hook instead of style hook do to enqueuing within shortcode.
261
- * New filter: wpt_feed_stylesheet -- replace URL of feed stylesheet with custom URL.
262
- * New filter: wpt_enqueue_feed_styles -- return false to disable stylesheet.
263
- * Removed option to connect to Twitter on HTTP, due to https://dev.twitter.com/discussions/24239
264
- * Russian translation updated.
265
- * Dutch translation updated.
266
- * Spanish translation updated.
267
-
268
- = 2.8.0 =
269
-
270
- * Removed category filtering in favor of WP Tweets PRO update allowing filtering on all taxonomies.
271
- * Removed obsolete functions handling older WP versions.
272
- * UI updates.
273
- * Updated fallbacks for multibyte string functions.
274
- * Added wpt_tag_default filter to choose the default hashtag symbol.
275
- * Miscellaneous PHP notice eliminations.
276
- * File reorganization.
277
- * Bug fix: Twitter feed widget errors if not authenticated.
278
-
279
- = 2.7.7 =
280
-
281
- * Bug fix: #author# template tag
282
- * Bug fix: tag filtering error.
283
- * Bug fix: eliminated one PHP notice.
284
- * Minor text changes.
285
- * Updated: Russian translation.
286
-
287
- = 2.7.6 =
288
-
289
- * Added citation for StormTwitter feed source.
290
- * Reverted use of 'extract()' due to very obscure bug.
291
- * New feature for WP Tweets PRO: custom templates for re-posts
292
- * Update Dutch translation.
293
-
294
- = 2.7.5 =
295
-
296
- * Setting a post to 'pending' or any custom status caused a Tweet to be published in 2.7.4
297
-
298
- = 2.7.4 =
299
-
300
- * Update API endpoint for Bit.ly
301
- * Added filter to modify "Tweet this" value during editing, based on $_POST data. ('wpt_tweet_this_edit')
302
- * Altered order of limits for determining whether to Tweet.
303
- * Deprecated upgrade routine for versions below 2.2.9. (Upgrade will still work.)
304
- * Added questions to support request form.
305
- * Added option to delete Tweet history for a post.
306
- * Made Twitter Feed available via shortcode [get_tweets id='twitter_username']
307
- * Debugging improvements.
308
- * Moved to save_post actions
309
- * Removed option to disable XMLRPC-based Tweeting.
310
- * Deprecated support for WP versions older than 3.3.3.
311
- * Renamed StormTwitter class for better namespacing and because it's substantively changed as I'm using it.
312
- * Modified Twitter feed caching to save as local file or as transient if file system not available.
313
- * Removed PHP < 5 warning, since I no longer support versions of WordPress that allow PHP 4.
314
- * #author# Template tag only worked if WP Tweets PRO installed.
315
- * Updated Portuguese Brazilian & added Swedish translations. (Partial)
316
-
317
- = 2.7.3 =
318
-
319
- * Don't display promotional notice if donation option checked.
320
- * WP Tweets PRO: fix for broken prepend text.
321
- * WP Tweets PRO: Improved truncating if image uploads enabled.
322
- * Updated translation: Italian
323
-
324
- = 2.7.2 =
325
-
326
- * Bug fix: Twitter Feed CSS enqueued on all pages, instead of just when activated.
327
- * Bug fix: test parameters in tmhOAuth caused plug-in conflict.
328
- * Bug fix: Major issue with WP Tweets PRO if no individual accounts were authorized with Twitter.
329
-
330
- = 2.7.1 =
331
-
332
- * Cleared un-noticed PHP warnings.
333
- * Updated .pot language files.
334
-
335
- = 2.7.0 =
336
-
337
- * Bug fix to character counter to adapt to updated t.co lengths.
338
- * Bug fix to test URL to return unencoded URL.
339
- * Bug fix: could not save setting to use dynamic campaign ID with Google Analytics
340
- * Bug fix: Could not re-order template tag truncation order.
341
- * Bug fix: Corrected encoding of category names and descriptions.
342
- * Bug fix: Better handling of wp_get_shortlink for custom post types. (Custom post types don't support wp_get_shortlink)
343
- * Adds a Twitter Feed widget. Original code source from StormTwitter feed by [Liam Gladdy](http://www.stormconsultancy.co.uk/blog/development/tools-plugins/oauth-twitter-feed-for-developers-library-and-wordpress-plugin/)
344
- * Deprecated support for WP 3.1.4.
345
-
346
- = 2.6.9 =
347
-
348
- * Error with post_with_media check. All apologies.
349
-
350
- = 2.6.8 =
351
-
352
- * Filter post_with_media to only handle posts with attached media. (WP Tweets PRO)
353
- * Expose past and failed Tweets on edited posts when Tweeting edits disabled.
354
-
355
- = 2.6.7 =
356
-
357
- * Fix tmhOAuth already exists issue.
358
- * Bug fix: do not Tweet edits unless explicitly directed to, rather than depending on meta data.
359
- * Bug fix: Scheduled posts/image uploads (for WP Tweets PRO)
360
- * Improved error messaging.
361
- * Misc. minor bug fixes
362
-
363
- = 2.6.6 =
364
-
365
- * Improved & removed feature: Tweet comments. Moved to WP Tweets PRO.
366
- * Improved view: post edit screen when Tweeting edits is disabled.
367
- * Added filter: wpt_custom_shortcode. Args: $post_ID, custom field name. Filter output from [[your_custom_field]].
368
- * Changed twitter analytics options to radio selector.
369
- * Bug fix: disable inline edit Tweets did not also disable bulk edit Tweets
370
- * Bug fix: URL re-fetch issue with jotURL.
371
- * Updated Italian translation.
372
-
373
- = 2.6.5 =
374
-
375
- * Whoops. I left in some debugging. Hurt me more than it hurt you...
376
-
377
- = 2.6.4 =
378
-
379
- * Bug fix: sslverify=false to fix cURL issue.
380
- * Bug fix: #@# and #author# reference tags did not always return correct results.
381
- * Bug fix: charset retrieval incorrect
382
- * Updated languages: French, Italian, German
383
-
384
- = 2.6.3 =
385
-
386
- * Bug fix: Fallback function for filter_var in PHP <5.2
387
- * Added shortener: [JotURL](https://www.joturl.com/), contributed by Massimo Poli
388
- * Language updates: Italian, Dutch, Russian.
389
-
390
- = 2.6.2 =
391
-
392
- * Bug fix: Rapidly-posted edits processed as new posts.
393
- * Bug fix: URL shortener error produced on https when no shortener chosen.
394
-
395
- = 2.6.1 =
396
-
397
- * Translatable role names for Permissions.
398
- * Bug fix: Goo.gl URL shortening. Incorrect URL posted.
399
-
400
- = 2.6.0 =
401
-
402
- * Support for new features in WP Tweets PRO 1.4.0.
403
- * Minor interface tweaks.
404
- * Removed settings export (it was out of date and nobody sent it anyway).
405
- * Bug fix: bad settings link in API failure warnings.
406
- * Bug fix: URL shortener returned error when not shortening URLs.
407
- * Bug fix: Category limits are not applied if 'category' is not an available taxonomy.
408
- * Bug fix: Prevent publish actions from running twice for scheduled posts.
409
- * Change: significant changes to large portions of plug-in text. My apologies to translators...but there's less text, now!
410
- * File restructuring and code cleanup.
411
- * Added Danish translation.
412
- * Updated French translation.
413
-
414
- = 2.5.9 =
415
-
416
- * Using tag slug instead of tag name is a problem for languages with characters outside of [RFC 1738](http://www.faqs.org/rfcs/rfc1738.html) URL specs. Transformed into selectable option, default off.
417
-
418
- = 2.5.8 =
419
-
420
- * WP to Twitter now uses tag slug instead of tag name to convert tags into hashtags. Allows you to customize the hashtag sent for each tag.
421
- * Set up changes necessary for pending t.co URL length change on 2/20/2013. [Blog post](https://dev.twitter.com/blog/upcoming-tco-changes)
422
- * Updated: Danish, French, German translations.
423
-
424
- = 2.5.7 =
425
-
426
- * Minor fixes for stupid mistakes. I apologize for the inconvenience.
427
-
428
- = 2.5.6 =
429
-
430
- * Various fixes related to WP Tweets PRO updates.
431
-
432
- = 2.5.5 =
433
-
434
- * Backed out an efficiency tweak that didn't work as expected.
435
-
436
- = 2.5.4 =
437
-
438
- * Modified system for handling scheduled posts to get around recent issues with Tweeting scheduled posts.
439
- * Update to Italian translation
440
-
441
- = 2.5.3 =
442
-
443
- * Truncation fix: Tweet not truncated if no template tags in use.
444
- * Now sanitizing titles and categories when using for Google analytics
445
- * Updated Italian translation, added Catalan translation.
446
-
447
- = 2.5.2 =
448
-
449
- * Another bug fix to truncating.
450
- * Updated Italian translation.
451
-
452
- = 2.5.1 =
453
-
454
- * Removed hardcoding of /wp-content/
455
- * Fixed truncation bug causing Tweets to be truncated when unnecessary.
456
- * Improved error messages.
457
-
458
- = 2.5.0 =
459
-
460
- * Updated French Translation
461
- * Fixed issue with multiple-savings of post meta data
462
- * Added #displayname# template tag.
463
- * Deprecated support for WordPress versions before 3.0.6.
464
- * Updated to Twitter API endpoint version 1.1
465
- * Updated: t.co URLs are now 20 characters. (Were 19.)
466
- * Change: length of any prepended or appended text is included in character counts.
467
- * Bug fix: Prepend/Append fields not stripped.
468
- * Bug fix: undefined variable when Tweeting links
469
- * Bug fix: truncating of Tweets when no URL shortcode is included.
470
- * Bug fix: Post had to have a successful previous tweet in order to display failed tweets.
471
- * Bug fix: if your Twitter application has read/write/dm capabilities, will no longer claim you don't have read/write caps.
472
- * Improved information in failed tweet listing
473
- * Clear admin message immediately when clearing errors.
474
- * Change: test type for default Tweet is positive test if Tweets should be posted by default; negative if not.
475
- * Verified: WP 3.5 compatibility.
476
-
477
- = 2.4.13 =
478
-
479
- * Issue if standard roles had been removed.
480
- * Added option to hide account information in Tweets as a user profile setting. (If checked, return #account# as blank for that user.)
481
-
482
- = 2.4.12 =
483
-
484
- * Bug fix: Issues with permissions disallowing some behaviors incorrectly.
485
- * Bug fix: Stripping of nonalphanumerics in hashtags is now UTF8 friendly.
486
- * Change: Tweaking of the meaning of some permissions.
487
- * Add: permission to disallow a role from Tweeting at all.
488
-
489
- = 2.4.11 =
490
-
491
- * Bug fix: Mismatched rules for when to enqueue charCount script and when to insert inline script calling that script.
492
- * Bug fix: Added long-missing 'do not post Tweets by default when editing' option.
493
- * Bug fix: 2 bugs when sending test Tweet and using WordPress as a shortening service
494
- * Translation updated: French
495
-
496
- = 2.4.10 =
497
-
498
- * Bug fix: Error in truncation routine left tweets 2 characters too long when truncating.
499
- * Change: minor tweak to administrative UI.
500
- * Added: check of read-write status of application when posting.
501
-
502
- = 2.4.9 =
503
-
504
- * Bug (notice) fix: undefined variable.
505
- * Bug fix: url encoding on Retweet links
506
- * Removed some functions providing upgrade support with older versions of WP to Twitter (pre OAuth)
507
- * Fixed bug in WP Tweets PRO which broke archiving of past Tweets. (Requires WP Tweets PRO 1.2.1)
508
- * Added support for Twitter Friendly Links if installed.
509
- * Added: Saves failed tweets for reference and manual tweeting.
510
-
511
- = 2.4.8 =
512
-
513
- * Bug fix: #account# shortcode broken in 2.4.7
514
- * Bug fix: Missing function if WP Tweets PRO installed but not upgraded to 1.2.0
515
-
516
- = 2.4.7 =
517
-
518
- * Bug fix: Fatal error could be triggered if WP HTTP query returns error object.
519
- * Bug fix: Fixed missing index when saving users without changing Twitter options.
520
- * Bug fix: With custom post types, save_post ran after publish_{custom_post_type}. Moved save metadata function into publish_{cpt} action.
521
- * Bug fix: 2.4.1 upgrade cycle was still running for all upgrades.
522
- * Change: suggest HTTP switch for any connection error, since not all SSL related errors report as such.
523
- * Italian and Dutch translations updated.
524
-
525
- = 2.4.6 =
526
-
527
- * Added strip_tags to custom template tag values.
528
- * Tweet character counter now processes values for #title#, #url# and #blog#. Courtesy of Arnout Veenman.
529
- * Truncation array error bug fix courtesy of Arnout Veenman.
530
- * Truncation routine tags modification courtesy of Arnout Veenman.
531
- * Bug fix: bug fix for final truncation check.
532
- * Change: #author# template tag now returns the Twitter account @ reference if it's available, user's display name if not.
533
- * Bug fix: Su.pr uses the longURL as an array key - the ampersands in URL needed to be encoded.
534
- * Bug fix: WP to Twitter box showed up on disabled post types.
535
- * Bug fix: undefined variable when posting using Su.pr as shortener.
536
- * Change: changed Bit.ly API url to new recommended query URL.
537
- * Change: moved character counter under Custom Tweet box so there's sufficient space if the meta box is in a side position.
538
-
539
- = 2.4.5 =
540
-
541
- * Added #modified# to use post modified date in templates.
542
- * Corrected unstripped slashes for template preview in WP to Twitter post box
543
- * Character count for custom tweet text was incorrect on initial load in edit mode.
544
- * Replaced character counter with a more Twitter-like character counter (counting down.)
545
- * Removed JavaScript from post box so that WP to Twitter box is properly draggable.
546
- * Added ampersand to normalizer function
547
- * Updated Brazilian Portuguese translation
548
-
549
- = 2.4.4 =
550
-
551
- * Bug fix: Truncation error if no crucial elements are truncatable
552
- * Bug fix: Unclosed if/else caused empty Settings link on plugins page.
553
- * Bug fix: "Post on XMLRPC" option must not be selected if using WP Tweets Pro with XML RPC
554
- * Bug fix: Windows Live Writer (and perhaps other apps) send entity-converted characters on XMLRPC post; need to decode entities in text before sending to Twitter.
555
- * Bug fix/change: Provides option to switch to http connections to Twitter if https connection returns SSL errors.
556
-
557
- = 2.4.3 =
558
-
559
- * Bug fix: In some cases, Administrators were not granted permissions to add custom tweets and other capability restricted tasks.
560
- * MAJOR bug fix: broke an element of the authorization routine which caused an early exit out of posting to Twitter for some users.
561
- * Settings link on plugins listing incorrect if WP Tweets Pro enabled.
562
-
563
- = 2.4.2 =
564
-
565
- * 2.4.1 had an error in the upgrade routine which broke the upgrade.
566
-
567
- = 2.4.1 =
568
-
569
- * I had mistakenly restricted WP Tweets PRO administrators from setting their own accounts, which was a problem for sites with multiple admin-level authors.
570
- * Revised permissions model to use custom capability to control access to user accounts rather than default capabilities.
571
- * Also switched to custom capability to control access to custom tweet options.
572
- * URL to settings page pointed to wrong location if WP Tweets PRO was installed before configuring WP to Twitter.
573
- * Support request form submitted to invalid URL if WP Tweets PRO installed.
574
- * If append or prepend fields were in use, they were duplicated in Tweets on reposts.
575
- * Added option so that users can be allowed to toggle the Tweet/Don't Tweet custom option without being able to edit other permissions.
576
-
577
- = 2.4.0 =
578
-
579
- * Bug fix/change: Twitter automatically shortens all URLs sent. As a result, all URLs are by definition 19 characters for the purpose of Tweeting. WP to Twitter now measures the value of the #url# tag as 19 characters, regardless of actual length.
580
- * Category limiting can now either mean "tweet checked categories" or "don't tweet checked categories".
581
- * Option to hide custom tweet box and options based on user roles.
582
- * User role permissions now support custom roles
583
- * Ability to determine the sequence in which fields are truncated or removed from Tweets if they exceed status length limits.
584
- * Replace cURL requirement with WP_HTTP wrapper.
585
- * Significant re-write of underlying code.
586
- * Redesign of settings pages.
587
- * Significant text revisions.
588
- * Release of [WP Tweets Pro](http://www.joedolson.com/wp-tweets-pro/), a pro upgrade to WP to Twitter.
589
-
590
- = 2.3.18 =
591
-
592
- * Bug fix: resolved case where new backdated posts were treated as edits.
593
- * Some changes to Tweet truncating routines to avoid modifying the URL during truncation.
594
-
595
- = 2.3.17 =
596
-
597
- * Bug fix: Custom Tweet text not sent for custom post types if the post was not saved prior to publishing.
598
- * Bug fix: Scheduled posts would not Tweet if certain plug-ins were installed, due to modifications of post dates.
599
-
600
- = 2.3.16 =
601
-
602
- * Bug fix: Change in 2.3.15 to fix XMLRPC publishing edits also classed scheduled posts as edits.
603
-
604
- = 2.3.15 =
605
-
606
- * Eliminated unnecessary duplication in error messages.
607
- * If application is not authenticated, status updates on posting now fail silently.
608
- * Added additional error help if cURL is not supported.
609
- * Improved error response information for other http_code responses from Twitter
610
- * Added reminder of your template format to WP to Twitter custom box
611
- * Moved tags from an option to a template tag.
612
- * Fixed bug where shortcodes were not stripped from post excerpts
613
- * Bug fix: If a scheduled post was edited once, without changing publishing time, custom Tweet text was lost.
614
- * Added support for the app_publish_post hook
615
- * Bug fix: XMLRPC published edits to Twitter when post updates on edit disabled
616
-
617
- = 2.3.14 =
618
-
619
- * Bug fix for value treated as array without verifying
620
- * Update to Italian translation
621
-
622
- = 2.3.13 =
623
-
624
- * Fixes missing function_exists check for Normalizer.
625
-
626
- = 2.3.12 =
627
-
628
- * Links added in link manager were getting run through the manual WP link shortener
629
- * Added appropriate normalizer call for PHP versions above 5
630
- * Adjustment to Tweet truncation to hopefully avoid runaway truncating.
631
- * Added a new FAQ to my web site about character counting.
632
- * Fixed URL wrapper error with fopen()
633
- * Bug fix: Switched 'Tweet this post' checkbox to a radio selector for simpler logic.
634
- * Now saving all past Tweets for each post.
635
-
636
- = 2.3.11 =
637
-
638
- * Error in commenter field; accidentally defined braces as template wrapper instead of hashes
639
- * Text updates
640
- * Removed PluginSponsors.com
641
- * Changed API query address to https.
642
-
643
- = 2.3.10 =
644
-
645
- * Did not expect people would submit support requests without actually adding a message. Message now required.
646
-
647
- = 2.3.9 =
648
-
649
- * Fixed issue with category detection
650
- * Changed one function name to a non-generic name.
651
- * Modified remote URL calls; should fix problem contacting Bit.ly
652
- * Added template tag #commenter# available in comment Tweet template. Use with caution.
653
- * Added plug-in support request form.
654
- * Fixed bug where custom Tweet text was over written in a quick edit
655
- * Fixed "Don't Tweet this Post' checkbox
656
- * Added Goo.gl as an additional URL shortener.
657
- * Added custom keyword option for YOURLS shortener.
658
-
659
- = 2.3.8 =
660
-
661
- * Bug fix: Warning message about 2.9.2 limited support no longer displays on public site.
662
-
663
- = 2.3.7 =
664
-
665
- * Double Tweeting problem fixed.
666
- * Missing custom Tweets fixed.
667
- * Revised WordPress version support notes.
668
- * I hope.
669
-
670
- = 2.3.6 =
671
-
672
- * Error in runtime created function fixed.
673
-
674
- = 2.3.5 =
675
-
676
- * Bug fix to custom shortcode support to allow use of multiple custom shortcodes simultaneously
677
- * Bug fix to (hopefully) solve duplicate posting when tags are included on scheduled posts.
678
- * Added comparison of your server time to Twitter's server time for information when installing.
679
- * Updated Italian translation.
680
-
681
- = 2.3.4 =
682
-
683
- * Re-wrote instructions for connecting to OAuth to reflect redesigned Twitter Apps registration process
684
- * Code clean-up to remove some redundancies
685
- * Bug fixes:
686
- - Occasional double Tweeting on future post seems to be fixed.
687
- - Tweeting on edits/quick edits when not checked
688
- * Added Ukrainian translation
689
-
690
- = 2.3.3 =
691
-
692
- * Improved support for non-standard publishing mechanisms.
693
- * Fixed 'Tweet this' option.
694
- * Quickpress setting made obsolete
695
- * Now uses wp_get_shortlink() when available for generating WP-based shortlink.
696
-
697
- = 2.3.2 =
698
-
699
- * Fixed XMLRPC support
700
- * Updated Italian translation
701
-
702
- = 2.3.1 =
703
-
704
- * Added version check and update cycle into Tweet routine
705
-
706
- = 2.3.0 =
707
-
708
- * Added support for custom post types.
709
- * Added support for Tweeting when comments are posted.
710
- * Bug fix: results of checking/unchecking 'Don't Tweet this' box not consistent.
711
- * Added Japanese translation. [kndb](http://blog.layer8.sh/)
712
-
713
- = 2.2.12 =
714
-
715
- * Bug fix release. Sorry.
716
- * Added translation to Brazilian Portugese [Matheus Bratfisch](http://www.matbra.com)
717
-
718
- = 2.2.11 =
719
-
720
- * Missing break statement caused remote YOURLS URLs to be replaced with Su.pr URLs
721
-
722
- = 2.2.10 =
723
-
724
- * Bug in user settings retrieval; don't know how long it's been a problem.
725
- * Added updated Italian translation
726
-
727
- = 2.2.9 =
728
-
729
- * Blocked posting on custom post types
730
- * Added time check, for servers with incorrect time.
731
- * Added cURL check.
732
- * Due to ongoing problems with Cli.gs, removed that URL shortening service and replaced with Su.pr
733
- * Changed default shortening to 'no shortening'
734
- * Saves every Tweet into post meta on save; adds link to re-post status update in WP to Twitter post box.
735
- * Revised error messages to increase detail.
736
-
737
- = 2.2.8 =
738
-
739
- * Enhancement: protect against duplicate Tweets
740
- * Bug fix: hash tag replacement with spaces problematic if alphanumeric limit also set
741
- * Bug fix: issue with scheduled posts posting when 'Do not Tweet' checked.
742
- * Added Danish translation by Rasmus Himmelstrup
743
- * Updates to compensate for changes in YOURLS 1.5
744
-
745
- = 2.2.7 =
746
-
747
- * Enhancement: strips shortcodes before sending post excerpts to Tweet
748
- * Enhancement: Added PHP version check and warning.
749
- * Added a default case to check on HTTP response code from Twitter.
750
- * Added a specific error message for out of sync server times.
751
- * Added link to [WP to Twitter's Fundry.com page](https://fundry.com/project/10-wp-to-twitter).
752
- * Bug fix: hash tag space removal fixed
753
- * Enhancement: Respects wp content directory constants if set.
754
-
755
- = 2.2.6 =
756
-
757
- * Modification: renamed OAuth files to maybe avoid collision with alternate OAuth versions which do not include needed methods
758
- * Eliminated postbox toggles
759
- * Clean out deprecated functions
760
- * Updated admin styles and separated into a separate file.
761
- * Bug fix: Edited pages did not Tweet
762
- * Bug fix: May have reduced occurrences of URL not being sent in status update. Maybe.
763
- * Bug fix: Forced lowercase on Bit.ly API username (Thanks, Bit.ly for NOT DOCUMENTING this.)
764
- * Added option to strip non-alphanumeric characters from hash tags
765
- * Added control to adjust which levels of users will see custom Profile settings
766
- * Found myself becoming unnecessarily sarcastic in Changelog notes. Will fix in next version. :)
767
-
768
- = 2.2.5 =
769
-
770
- * Bug fix: shouldn't see error 'Could not redeclare OAuth..' again.
771
- * Bug fix: shouldn't see 'Fatal error: Class 'OAuthSignatureMethod...' again.
772
- * Bug fix: updated API endpoints
773
-
774
- = 2.2.4 =
775
-
776
- * Blocked global error messages from being seen by non-admin level users.
777
- * Added #account# shortcode to supply Twitter username @ reference in Tweet templates.
778
- * Updated debugging output
779
- * Deletes obsolete options from database
780
-
781
- = 2.2.3 =
782
-
783
- * Fixed: Bug which added unnecessary duplications of post meta
784
- * Fixed: broken analytics campaign info
785
- * Fix attempt to clear up problems with urlencoding of links
786
- * Fix attempt to clear up problems with some 403 errors and status update truncation
787
-
788
- = 2.2.2 =
789
-
790
- * Fixed a bug where new Pages did not Tweet.
791
- * Minor text changes to try and clarify OAuth process.
792
- * Fixed bug where any post with a customized status update would post, regardless of settings.
793
- * Fixed faulty shortening when new links were added.
794
-
795
- = 2.2.1 =
796
-
797
- * Not a Beta anymore.
798
- * Fixed issue with non-shortening links when using XMLRPC clients
799
- * Fixed issue with double-urlencoding of links before shortening
800
- * Added Dutch translation
801
- * Updated Italian translation
802
-
803
-
804
- = 2.2.0 (beta 7) =
805
-
806
- * Significantly improved error reporting.
807
- * Completely revamped secondary author support to give some value in Twitter.
808
- * Completely eliminated secondary posting service support. Too much trouble, too little application.
809
- * Removed the custom post meta data clutter; WP to Twitter's post meta data is now private to the plugin.
810
- * Fixed a couple of error situations with Bit.ly
811
- * Made it possible for contributor posts to be Tweeted
812
- * This is the last beta version.
813
-
814
- = 2.2.0 (beta 6) =
815
-
816
- * Fixed bug where errors were reported on categories not intended to be sent to Twitter
817
- * Allowed OAuth notice to be disabled for users not intending to use that service.
818
- * Added a debugging option to output some process data if OAuth connection fails
819
- * Fixed bug which prevented posting of edited status updates
820
-
821
- = 2.2.0 (beta 5) =
822
-
823
- * Eliminated an incompatibility with alternate versions of twitterOAuth class
824
- * Significant revisions of error message processes and details
825
- * Fixed some URL shortener problems
826
- * Added simplified Chinese translation
827
-
828
- = 2.2.0 (beta 4) =
829
-
830
- * Fixed long-standing issue with serialization of option arrays
831
- * Fixed trimming of white space from authentication keys
832
- * Clarification of some texts to help explain some of the changes
833
- * Clarification of some texts to help explain how to connect to Twitter with OAuth
834
- * Added credit for Estonian translation by Raivo Ratsep.
835
-
836
- = 2.2.0 (beta 3) =
837
-
838
- * Fixed issue with failing to post to Twitter.
839
-
840
- = 2.2.0 (beta 2) =
841
-
842
- * Fixed false positive error message on Twitter check routine failure
843
- * Adjusted twitteroauth file to hopefully avoid certain errors
844
-
845
- = 2.2.0 (beta) =
846
-
847
- * Added OAuth support
848
- * Fixed problem with default Tweet status not defaulting to 'no.'
849
- * Revised a few other minor issues
850
- * No longer supporting WordPress versions below 2.9.2
851
- * Eliminated features: Author's Twitter account posting; Use of additional service to post to Twitter on a second account. These features are not possible with simple OAuth authentication; they require XAuth. This makes the features of extremely limited value, since you, as the user, would be required to apply for XAuth permissions on your own installation. I regret the necessity to remove these features. Both options will still function with Twitter-compatible API services using Basic authentication.
852
-
853
- = 2.1.3 =
854
-
855
- * Fixed copy typo.
856
-
857
- = 2.1.2 =
858
-
859
- * Last update before oAuth integration, I hope.
860
- * Fixed problems with Postie compatibility
861
- * Fixed bug where local YOURLS path could not be unset
862
- * Fixed some issues with upgrades which re-wrote status update templates, occasionally removing the #url# shortcode.
863
- * Despite numerous reports of issues API behavior with Bit.ly or Twitter, I was unable, in testing, to reproduce any issues, including on servers which I know have had failed requests in the past.
864
- * Revised upgrade routines to avoid future problems.
865
-
866
- = 2.1.1 =
867
-
868
- * Added a control to disable error messages.
869
- * Separated URL shortener errors from Twitter API errors.
870
- * Added stored value with the error message from Bit.ly to try and identify source of errors.
871
-
872
- = 2.1.0 =
873
-
874
- * Now compatible through WP 3.0 series
875
- * Fixed bug related to failed responses from URL shortener API requests.
876
- * Added #author# shortcode for status update templates.
877
- * Fixed a problem with non-posting of scheduled posts when default status updates are disabled.
878
-
879
- = 2.0.4 =
880
-
881
- * Fixed bug where status updates were not posted when a post changed from pending to published. (Thanks to Justin Heideman for the catch and fix.)
882
- * Fixed bug where passwords with special characters were not used correctly
883
- * Eliminated use of LongURL API due to closure of the service. Hope to replace this functionality at some point, so I've left the framework intact, just removed the API call.
884
- * Improved error reporting in support check routines.
885
-
886
- = 2.0.3 =
887
-
888
- * Updated for Bit.ly API v3 (should fix recent issues with incorrect reporting from Bit.ly API and API request failures.)
889
-
890
- = 2.0.2 =
891
-
892
- * Bug fixed where appended text was placed before hash tags.
893
- * Added method for error messages to be automatically cleared following a successful status update. It seems a lot of people couldn't find the button to clear errors, and thought they were getting an error every time.
894
- * Moved short URL selection option to a more prominent location.
895
-
896
- = 2.0.1 =
897
-
898
- * Bug found with YOURLS short url creation when using multiple sites with one YOURLS installation and short URLS are created using post ID. Added option to disable post_ID as shortURL generating key in YOURLS account settings.
899
- * Missing semicolon replaced in uninstall.php
900
-
901
- = 2.0.0 =
902
-
903
- * Fixed bug introduced in WordPress 2.9 where logged in users could only edit their own profiles and associated issues.
904
- * Fixed bug which caused #url# to repeatedly be added to the end of Tweet texts on reactivation or upgrade.
905
- * Fixed bug which generated shortener API error messages when no URL shortener was used.
906
- * Fixed bug which prevented display of URL on edit screen if no URL shortener was used.
907
- * Added Spanish translation courtesy of [David Gil P&eacute;rez](http://www.sohelet.com)
908
- * Made so many language changes that aforementioned translation is now terribly out of date, as are all others...
909
- * Added ability to restrict posting to certain categories.
910
- * Added option to dynamically generate Google Analytics campaign identifier by category, post title, author, or post id.
911
- * Added option to configure plugin to use other services using the Twitter-compatible API.
912
- * Added support for YOURLS installations as your URL shortener. (Either local or remote.)
913
- * Redesigned administrative interface.
914
- * Removed use of Snoopy and alternate HTTP request methods.
915
- * Discontinued support for WordPress versions below version 2.7.
916
- * Major revisions to support checks.
917
- * Version jumped to 2.0.0
918
-
919
- = 1.5.7 =
920
-
921
- * Quick bug fix contributed by DougV from WordPress Forums.
922
-
923
- = 1.5.6 =
924
-
925
- * WP 2.9 added support for JSON on PHP versions below 5.2; changes made to do WP version checking before adding JSON support.
926
- * Stripslashes added to viewable data fields.
927
- * Added option for spaces to be removed in hashtags.
928
- * A few post meta updates.
929
- * Barring major disasters, this will be the last release in the 1.x series. Expect version 2 sometime in late January.
930
-
931
- = 1.5.5 =
932
-
933
- * Fixed issue with stray hashtags appearing when Tweeting edited posts was disabled and adding hashtags was enabled.
934
- * Added shortcode (#date#) for post date. Uses your WordPress date settings to format date, but allows you to customize for WP to Twitter.
935
-
936
- = 1.5.4 =
937
-
938
- * Fixed issue with spaces in hashtags.
939
- * Added configurable replacement character in hashtags.
940
-
941
- = 1.5.3 =
942
-
943
- * Revised the function which checks whether your Tweet is under the 140 character limit imposed by Twitter. This function had a number of awkward bugs which have now (hopefully) been eradicated.
944
- * Revised the tags->hashtags generation for better reliability. Fixes bugs with failing to send hashtags to Twitter if they haven't been saved and allowing hashtags on scheduled posts.
945
- * Option to use WP default URL as a short URL. (http://yourdomain.com/yourblog/?p=id).
946
-
947
- = 1.5.2 =
948
-
949
- * Minor code cleanup
950
- * Fixed uncommon bug where draft posts would not Tweet when published.
951
- * Fixed bug where #title# shortcode wouldn't work due to prior URL encoding. (Also covers some other obscure bugs.) Thanks to [Daniel Chcouri](http://www.anarchy.co.il) for the great catch.
952
- * Added new shortcode (#category#) to fetch the first post category.
953
- * Provided a substitute function for hosts not supportin mb_substr().
954
- * Fixed a bug where a hashtag would be posted on edits when posting updates was not enabled for edits.
955
- * Put Cli.gs change revisions on hold barring updates from Pierre at Cli.gs
956
-
957
- = 1.5.1 =
958
-
959
- * Because that's what I get for making last minute changes.
960
-
961
- = 1.5.0 =
962
-
963
- * Due to a large number of problems in the 1.4.x series, I'm launching a significant revision to the base code earlier than initially planned. This is because many of these features were already in development, and it's simply too much work to maintain both branches of the code.
964
- * Added option to export settings in plain text for troubleshooting.
965
- * Simplified some aspects of the settings page.
966
- * Added custom text options for WordPress Pages to match support for Posts.
967
- * Improved tags as hashtags handling.
968
- * Added the ability to use custom shortcodes to access information in custom fields.
969
- * Improved some error messages to clarify certain issues.
970
-
971
- = 1.4.11 =
972
-
973
- * Fixed a bug which allowed editing of posts to be Tweeted if status updates on editing Pages were permitted.
974
- * Fixed a bug in the support check routine which caused all Cli.gs tests to fail.
975
- * Streamlined logic controlling whether a new or edited item should be Tweeted.
976
- * Added Italian translation. Thanks to [Gianni Diurno](http://www.gidibao.net)!
977
-
978
- = 1.4.10 =
979
-
980
- * Was never supposed to exist, except that I *forgot* to include a backup function.
981
-
982
- = 1.4.9 =
983
-
984
- * Added German translation. Thanks to [Melvin](http://www.toxicavenger.de/)!
985
- * Fixed a bug relating to missing support for a function or two.
986
- * Fixed a bug relating to extraneous # symbols in tags
987
-
988
- = 1.4.8 =
989
-
990
- * Adds a function to provide PHP5s str_split functionality for PHP4 installations.
991
-
992
- = 1.4.7 =
993
-
994
- * Actually resolves the bug which 1.4.6 was supposed to fix.
995
-
996
- = 1.4.6 =
997
-
998
- * Hopefully resolved bug with empty value for new field in 1.4.5. It's late, so I won't know until tomorrow...
999
-
1000
- = 1.4.5 =
1001
-
1002
- * Resolved bug with extraneous hash sign when no tags are attached.
1003
- * Resolved bug where #url# would appear when included in posting string but with 'link to blog' disabled.
1004
- * Added expansion of short URL via longURL.org stored in post meta data.
1005
- * Resolved additional uncommon bug with PHP 4.
1006
- * Added option to incorporate optional post excerpt.
1007
- * Better handling of multibyte character sets.
1008
-
1009
- = 1.4.4 =
1010
-
1011
- * Resolved two bugs with hashtag support: spaces in multi-word tags and the posting of hashtag-only status updates when posting shouldn't happen.
1012
-
1013
- = 1.4.3 =
1014
-
1015
- * Resolved plugin conflict with pre-existing function name.
1016
-
1017
- = 1.4.2 =
1018
-
1019
- * No changes, just adding a missing file from previous commit.
1020
-
1021
- = 1.4.1 =
1022
-
1023
- * Revised to not require functions from PHP 5.2
1024
- * Fixed bug in hashtag conversion
1025
-
1026
- = 1.4.0 =
1027
-
1028
- * Added support for the Bit.ly URL shortening service.
1029
- * Added option to not use URL shortening.
1030
- * Added option to add tags to end of status update as hashtag references.
1031
- * Fixed a bug where the #url# shortcode failed when editing posts.
1032
- * Reduced some redundant code.
1033
- * Converted version notes to new Changelog format.
1034
-
1035
- = 1.3.7 =
1036
-
1037
- * Revised interface to take advantage of features added in versions 2.5 and 2.7. You can now drag and drop the WP to Twitter configuration panel in Post and Page authoring pages.
1038
- * Fixed bug where post titles were not Tweeted when using the "Press This" bookmarklet
1039
- * Security bug fix.
1040
-
1041
- = 1.3.6 =
1042
-
1043
- *Bug fix release.
1044
-
1045
- = 1.3.5 =
1046
-
1047
- * Bug fix: when "Send link to Twitter" is disabled, Twitter status and shortcodes were not parsed correctly.
1048
-
1049
- = 1.3.4 =
1050
-
1051
- * Bug fix: html tags in titles are stripped from Tweets
1052
- * Bug fix: thanks to [Andrea Baccega](http://www.andreabaccega.com), some problems related to WP 2.7.1 should be fixed.
1053
- * Added optional prepend/append text fields.
1054
-
1055
- = 1.3.3 =
1056
-
1057
- * Added support for shortcodes in custom Tweet fields.
1058
- * Bug fix when #url# is the first element in a Tweet string.
1059
- * Minor interface changes.
1060
-
1061
- = 1.3.2 =
1062
-
1063
- * Added a #url# shortcode so you can decide where your short URL will appear in the Tweet.
1064
- * Couple small bug fixes.
1065
- * Small changes to the settings page.
1066
-
1067
- = 1.3.1 =
1068
-
1069
- * Modification for multiple authors with independent Twitter accounts -- there are now three options:
1070
-
1071
- 1. Tweet to your own account, instead of the blog account.
1072
- 1. Tweet to your account with an @ reference to the main blog account.
1073
- 1. Tweet to the main blog account with an @ reference to your own account.
1074
-
1075
- * Added an option to enable or disable Tweeting of Pages when edited.
1076
- * **Fixed scheduled posting and posting from QuickPress, so both of these options will now be Tweeted.**
1077
-
1078
- = 1.3.0 =
1079
-
1080
- *Support for multiple authors with independent Twitter &amp; Cligs accounts.
1081
- *Other minor textual revisions, addition of API availability check in the Settings panel.
1082
- *Bugfixes: If editing a post by XMLRPC, you could not disable Tweeting your edits. FIXED.
1083
-
1084
- = 1.2.8 =
1085
-
1086
- *Bug fix to 1.2.7.
1087
-
1088
- = 1.2.7 =
1089
-
1090
- *Uses the Snoopy class to retrieve information from Cligs and to post Twitter updates. Hopefully this will solve a variety of issues.
1091
- *Added an option to track traffic from your Tweeted Posts using Google Analytics (Thanks to [Joost](http://yoast.com/twitter-analytics/))
1092
-
1093
- = 1.2.6 =
1094
-
1095
- *Bugfix with XMLRPC publishing -- controls to disable XMLRPC publishing now work correctly.
1096
- *Bugfix with error reporting and clearing.
1097
- *Added the option to supply an alternate URL along with your post, to be Tweeted in place of the WP permalink. (Courtesy Bill Berry)
1098
-
1099
- = 1.2.5 =
1100
-
1101
- *Support for publishing via XMLRPC
1102
- *Corrected a couple minor bugs
1103
- *Added internationalization support
1104
-
1105
- = 1.2.0 =
1106
-
1107
- *option to post your new blogroll links to Twitter, using the description field as your status update text.
1108
- *option to decide on a post level whether or not that blog post should be posted to Twitter
1109
- *option to set a global default 'to Tweet or not to Tweet.'
1110
-
1111
- = 1.1.0 =
1112
-
1113
- *Update to use cURL as an option to fetch information from the Cli.gs API.
1114
-
1115
  == Installation ==
1116
 
1117
  1. Upload the `wp-to-twitter` folder to your `/wp-content/plugins/` directory
1118
  2. Activate the plugin using the `Plugins` menu in WordPress
1119
  3. Go to Settings > WP to Twitter
1120
  4. Adjust the WP to Twitter Options as you prefer them.
1121
- 5. Create a Twitter application at Twitter and Configure your OAuth setup keys
1122
 
1123
  == Frequently Asked Questions ==
1124
 
@@ -1141,4 +175,4 @@ Writing and maintaining a plug-in is a lot of work. You can help me by providing
1141
 
1142
  == Upgrade Notice ==
1143
 
1144
- * 3.0.5 - I don't think I'm sleeping enough. Sorry about all the rapid updates!
6
  Tested up to: 4.2.2
7
  License: GPLv2 or later
8
  Text Domain: wp-to-twitter
9
+ Stable tag: 3.0.7
10
 
11
  Posts a Twitter update when you update your WordPress blog or add a link, with your chosen URL shortening service.
12
 
22
 
23
  [Upgrade to WP Tweets Pro](http://www.joedolson.com/wp-tweets-pro/) and schedule Tweets, set up automatic reposts, upload images and more!
24
 
25
+ [youtube https://www.youtube.com/watch?v=3YIia5dQBSk]
26
+
27
  WP to Twitter uses a customizable Tweet template for Tweets sent when updating or editing posts and pages or custom post types. You can customize your Tweet for each post, using custom template tags to generate the Tweet.
28
 
29
  = Free Features =
33
  * Support for Google Analytics
34
  * Support for XMLRPC remote clients
35
  * Select from YOURLS, Goo.gl, Bit.ly, jotURL, or Su.pr as external URL shorteners.
36
+ * Rate limiting: make sure you don't exceed Twitter's API rate limits.
37
 
38
  = Premium Features =
39
 
69
  * Add regex filter to detect URLs typed into Tweet fields for counting/shortening purposes. [todo]
70
  * 4.2 added compat function for mb_substr; drop mine when I drop support for 4.1
71
 
72
+ = 3.1.0 =
73
+
74
+ * Moved changelog entries older than 3.0.0 into changelog.txt
75
+ * Update PHP 4 class constructors to PHP 5.
76
+ * Added template tags for all categories and all category descriptions.
77
+ * Better loading of text domain.
78
+ * Improve preview character counting when featured images are being uploaded. (WP Tweets PRO)
79
+ * Require users to add an email to send a support request.
80
+ * Added check for constant WPT_STAGING_MODE; disables posting to Twitter on staging servers.
81
+ * New feature: Rate limiting. Enable rate limiting to restrict the number of posts per category per hour can be sent to your Twitter account.
82
+
83
  = 3.0.7 =
84
 
85
  * Bug fix: Twitter Feed search broken.
146
  * Moved Twitter server time check out of basic set-up & set up to only run on demand.
147
  * Minor design changes.
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  == Installation ==
150
 
151
  1. Upload the `wp-to-twitter` folder to your `/wp-content/plugins/` directory
152
  2. Activate the plugin using the `Plugins` menu in WordPress
153
  3. Go to Settings > WP to Twitter
154
  4. Adjust the WP to Twitter Options as you prefer them.
155
+ 5. Create a Twitter application at Twitter and Configure your OAuth keys
156
 
157
  == Frequently Asked Questions ==
158
 
175
 
176
  == Upgrade Notice ==
177
 
178
+ * 3.1.0 - New feature: Rate limiting by category; Staging mode; misc. bug fixes
uninstall.php CHANGED
@@ -8,7 +8,8 @@ if ( ! defined( 'ABSPATH' ) && ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
8
 
9
  delete_option( 'comment-published-update' );
10
  delete_option( 'comment-published-text' );
11
-
 
12
  // Su.pr API
13
  delete_option( 'suprapi' );
14
 
@@ -20,6 +21,11 @@ if ( ! defined( 'ABSPATH' ) && ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
20
  delete_option( 'wp_bitly_failure' );
21
  delete_option( 'wpt_curl_error' );
22
 
 
 
 
 
 
23
  // Blogroll options
24
  delete_option( 'jd-use-link-title' );
25
  delete_option( 'jd-use-link-description' );
8
 
9
  delete_option( 'comment-published-update' );
10
  delete_option( 'comment-published-text' );
11
+ delete_option( 'wpt_status_message_last' );
12
+ delete_option( 'wtt_twitter_username' );
13
  // Su.pr API
14
  delete_option( 'suprapi' );
15
 
21
  delete_option( 'wp_bitly_failure' );
22
  delete_option( 'wpt_curl_error' );
23
 
24
+ // Rate Limiting
25
+ delete_option( 'wpt_rate_limits' );
26
+ delete_option( 'wpt_default_rate_limit' );
27
+ delete_option( 'wpt_rate_limit' );
28
+
29
  // Blogroll options
30
  delete_option( 'jd-use-link-title' );
31
  delete_option( 'jd-use-link-description' );
wp-to-twitter-manager.php CHANGED
@@ -28,7 +28,7 @@ function wpt_updated_settings() {
28
 
29
  print( '
30
  <div id="message" class="updated fade">
31
- <p>' . __( 'WP to Twitter is now connected with Twitter.', 'wp-to-twitter' ) . "<a href='$admin_url'>" . __( 'Configure your Tweet templates', 'wp-to-twitter' ) . '</a></p>
32
  </div>
33
  ' );
34
  } else if ( $oauth_message == "failed" ) {
@@ -61,9 +61,20 @@ function wpt_updated_settings() {
61
  if ( isset( $_POST['submit-type'] ) && $_POST['submit-type'] == 'advanced' ) {
62
  update_option( 'jd_tweet_default', ( isset( $_POST['jd_tweet_default'] ) ) ? $_POST['jd_tweet_default'] : 0 );
63
  update_option( 'jd_tweet_default_edit', ( isset( $_POST['jd_tweet_default_edit'] ) ) ? $_POST['jd_tweet_default_edit'] : 0 );
 
 
 
 
 
 
 
 
 
 
64
  update_option( 'wpt_inline_edits', ( isset( $_POST['wpt_inline_edits'] ) ) ? $_POST['wpt_inline_edits'] : 0 );
65
  update_option( 'jd_twit_remote', ( isset( $_POST['jd_twit_remote'] ) ) ? $_POST['jd_twit_remote'] : 0 );
66
  update_option( 'jd_twit_custom_url', $_POST['jd_twit_custom_url'] );
 
67
  update_option( 'jd_strip_nonan', ( isset( $_POST['jd_strip_nonan'] ) ) ? $_POST['jd_strip_nonan'] : 0 );
68
  update_option( 'jd_twit_prepend', $_POST['jd_twit_prepend'] );
69
  update_option( 'jd_twit_append', $_POST['jd_twit_append'] );
@@ -122,7 +133,7 @@ function wpt_updated_settings() {
122
  update_option( 'jd_donations', ( isset( $_POST['jd_donations'] ) ) ? 1 : 0 );
123
  $wpt_truncation_order = $_POST['wpt_truncation_order'];
124
  update_option( 'wpt_truncation_order', $wpt_truncation_order );
125
- $message .= __( 'WP to Twitter Advanced Options Updated', 'wp-to-twitter' );
126
  }
127
 
128
  if ( isset( $_POST['submit-type'] ) && $_POST['submit-type'] == 'options' ) {
@@ -163,8 +174,10 @@ function wpt_update_settings() {
163
  ?>
164
  <div class="wrap" id="wp-to-twitter">
165
  <?php
 
 
 
166
  wpt_updated_settings();
167
- wpt_manual_migrate();
168
  wpt_show_last_tweet();
169
  wpt_handle_errors();
170
  ?>
@@ -568,7 +581,7 @@ function wpt_update_settings() {
568
  </p>
569
  </fieldset>
570
  <fieldset>
571
- <legend><?php _e( "Special Cases when WordPress should send a Tweet", 'wp-to-twitter' ); ?></legend>
572
  <p>
573
  <input type="checkbox" name="jd_tweet_default" id="jd_tweet_default"
574
  value="1" <?php echo jd_checkCheckbox( 'jd_tweet_default' ) ?> />
@@ -582,11 +595,24 @@ function wpt_update_settings() {
582
  value="1" <?php echo jd_checkCheckbox( 'wpt_inline_edits' ) ?> />
583
  <label
584
  for="wpt_inline_edits"><?php _e( "Allow status updates from Quick Edit", 'wp-to-twitter' ); ?></label><br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
585
  </p>
586
  </fieldset>
587
  <fieldset>
588
  <legend><?php _e( "Google Analytics Settings", 'wp-to-twitter' ); ?></legend>
589
- <p><?php _e( "You can track the response from Twitter using Google Analytics by defining a campaign identifier here. You can either define a static identifier or a dynamic identifier. Static identifiers don't change from post to post; dynamic identifiers are derived from information relevant to the specific post. Dynamic identifiers will allow you to break down your statistics by an additional variable.", "wp-to-twitter" ); ?></p>
590
 
591
  <p>
592
  <input type="radio" name="twitter-analytics" id="use-twitter-analytics"
@@ -627,15 +653,12 @@ function wpt_update_settings() {
627
  <fieldset id="indauthors">
628
  <legend><?php _e( 'Author Settings', 'wp-to-twitter' ); ?></legend>
629
  <p>
630
- <input aria-describedby="jd_individual_twitter_users_label" type="checkbox"
631
- name="jd_individual_twitter_users" id="jd_individual_twitter_users"
632
  value="1" <?php echo jd_checkCheckbox( 'jd_individual_twitter_users' ) ?> />
633
  <label
634
  for="jd_individual_twitter_users"><?php _e( "Authors have individual Twitter accounts", 'wp-to-twitter' ); ?></label>
635
  </p>
636
 
637
- <p id="jd_individual_twitter_users_label"><?php _e( 'Authors can add their username in their user profile. With the free edition of WP to Twitter, it adds an @reference to the author. The @reference is placed using the <code>#account#</code> shortcode, which will pick up the main account if the user account isn\'t configured.', 'wp-to-twitter' ); ?>
638
- </p>
639
  </fieldset>
640
  <div class='wpt-permissions'>
641
  <fieldset>
@@ -802,6 +825,19 @@ function wpt_sidebar() {
802
  </div>
803
  </div>
804
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
805
  </div>
806
  <?php
807
  }
28
 
29
  print( '
30
  <div id="message" class="updated fade">
31
+ <p>' . __( 'WP to Twitter is now connected with Twitter.', 'wp-to-twitter' ) . " <a href='$admin_url'>" . __( 'Configure your Tweet templates', 'wp-to-twitter' ) . '</a></p>
32
  </div>
33
  ' );
34
  } else if ( $oauth_message == "failed" ) {
61
  if ( isset( $_POST['submit-type'] ) && $_POST['submit-type'] == 'advanced' ) {
62
  update_option( 'jd_tweet_default', ( isset( $_POST['jd_tweet_default'] ) ) ? $_POST['jd_tweet_default'] : 0 );
63
  update_option( 'jd_tweet_default_edit', ( isset( $_POST['jd_tweet_default_edit'] ) ) ? $_POST['jd_tweet_default_edit'] : 0 );
64
+
65
+ if ( isset( $_POST['wpt_rate_limiting'] ) && get_option( 'wpt_rate_limiting' ) != 1 ) {
66
+ $extend = __( 'Rate Limiting is enabled. Default rate limits are set at 10 posts per category/term per hour. <a href="#special_cases">Edit global default</a> or edit individual terms to customize limits for each category or taxonomy term.', 'wp-to-twitter' );
67
+ wp_schedule_event( current_time( 'timestamp' )+3600, 'hourly', 'wptratelimits' );
68
+ } else {
69
+ $extend = '';
70
+ wp_clear_scheduled_hook( 'wptratelimits' );
71
+ }
72
+
73
+ update_option( 'wpt_rate_limiting', ( isset( $_POST['wpt_rate_limiting'] ) ) ? 1 : 0 );
74
  update_option( 'wpt_inline_edits', ( isset( $_POST['wpt_inline_edits'] ) ) ? $_POST['wpt_inline_edits'] : 0 );
75
  update_option( 'jd_twit_remote', ( isset( $_POST['jd_twit_remote'] ) ) ? $_POST['jd_twit_remote'] : 0 );
76
  update_option( 'jd_twit_custom_url', $_POST['jd_twit_custom_url'] );
77
+ update_option( 'wpt_default_rate_limit', intval( $_POST['wpt_default_rate_limit'] ) );
78
  update_option( 'jd_strip_nonan', ( isset( $_POST['jd_strip_nonan'] ) ) ? $_POST['jd_strip_nonan'] : 0 );
79
  update_option( 'jd_twit_prepend', $_POST['jd_twit_prepend'] );
80
  update_option( 'jd_twit_append', $_POST['jd_twit_append'] );
133
  update_option( 'jd_donations', ( isset( $_POST['jd_donations'] ) ) ? 1 : 0 );
134
  $wpt_truncation_order = $_POST['wpt_truncation_order'];
135
  update_option( 'wpt_truncation_order', $wpt_truncation_order );
136
+ $message .= __( 'WP to Twitter Advanced Options Updated', 'wp-to-twitter' ) . '. ' . $extend;
137
  }
138
 
139
  if ( isset( $_POST['submit-type'] ) && $_POST['submit-type'] == 'options' ) {
174
  ?>
175
  <div class="wrap" id="wp-to-twitter">
176
  <?php
177
+ if ( defined( 'WPT_STAGING_MODE' ) && WPT_STAGING_MODE == true ) {
178
+ echo "<div class='updated notice'><p>" . __( 'WP to Twitter is in staging mode. Tweets will be reported as if successfully sent to Twitter but will not be sent.', 'wp-to-twitter' ) . "</p></div>";
179
+ }
180
  wpt_updated_settings();
 
181
  wpt_show_last_tweet();
182
  wpt_handle_errors();
183
  ?>
581
  </p>
582
  </fieldset>
583
  <fieldset>
584
+ <legend id="special_cases"><?php _e( "Special Cases", 'wp-to-twitter' ); ?></legend>
585
  <p>
586
  <input type="checkbox" name="jd_tweet_default" id="jd_tweet_default"
587
  value="1" <?php echo jd_checkCheckbox( 'jd_tweet_default' ) ?> />
595
  value="1" <?php echo jd_checkCheckbox( 'wpt_inline_edits' ) ?> />
596
  <label
597
  for="wpt_inline_edits"><?php _e( "Allow status updates from Quick Edit", 'wp-to-twitter' ); ?></label><br/>
598
+ <input type="checkbox" name="wpt_rate_limiting" id="wpt_rate_limiting"
599
+ value="1" <?php echo jd_checkCheckbox( 'wpt_rate_limiting' ) ?> />
600
+ <label
601
+ for="wpt_rate_limiting"><?php _e( "Enable Rate Limiting", 'wp-to-twitter' ); ?></label><br/>
602
+ <?php
603
+ if ( get_option( 'wpt_rate_limiting' ) == 1 ) {
604
+ ?>
605
+ <input type="number" name="wpt_default_rate_limit" id="wpt_default_rate_limit"
606
+ value="<?php echo wpt_default_rate_limit(); ?>" />
607
+ <label
608
+ for="wpt_default_rate_limit"><?php _e( "Default Rate Limit per category per hour", 'wp-to-twitter' ); ?></label><br/>
609
+ <?php
610
+ }
611
+ ?>
612
  </p>
613
  </fieldset>
614
  <fieldset>
615
  <legend><?php _e( "Google Analytics Settings", 'wp-to-twitter' ); ?></legend>
 
616
 
617
  <p>
618
  <input type="radio" name="twitter-analytics" id="use-twitter-analytics"
653
  <fieldset id="indauthors">
654
  <legend><?php _e( 'Author Settings', 'wp-to-twitter' ); ?></legend>
655
  <p>
656
+ <input type="checkbox" name="jd_individual_twitter_users" id="jd_individual_twitter_users"
 
657
  value="1" <?php echo jd_checkCheckbox( 'jd_individual_twitter_users' ) ?> />
658
  <label
659
  for="jd_individual_twitter_users"><?php _e( "Authors have individual Twitter accounts", 'wp-to-twitter' ); ?></label>
660
  </p>
661
 
 
 
662
  </fieldset>
663
  <div class='wpt-permissions'>
664
  <fieldset>
825
  </div>
826
  </div>
827
  </div>
828
+
829
+ <?php if ( get_option( 'wpt_rate_limiting' ) == 1 ) { ?>
830
+ <div class="ui-sortable meta-box-sortables">
831
+ <div class="postbox">
832
+ <div class="handlediv"><span class="screen-reader-text">Click to toggle</span></div>
833
+ <h3 class='hndle'><?php _e( 'Monitor Rate Limiting', 'wp-to-twitter' ); ?></h3>
834
+
835
+ <div class="inside server">
836
+ <?php echo wpt_view_rate_limits(); ?>
837
+ </div>
838
+ </div>
839
+ </div>
840
+ <?php } ?>
841
  </div>
842
  <?php
843
  }
wp-to-twitter.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP to Twitter
4
  Plugin URI: http://www.joedolson.com/wp-to-twitter/
5
  Description: Posts a Tweet when you update your WordPress blog or post a link, using your URL shortening service. Rich in features for customizing and promoting your Tweets.
6
- Version: 3.0.7
7
  Author: Joseph Dolson
8
  Author URI: http://www.joedolson.com/
9
  */
@@ -52,10 +52,15 @@ require_once( plugin_dir_path( __FILE__ ) . '/wp-to-twitter-manager.php' );
52
  require_once( plugin_dir_path( __FILE__ ) . '/wpt-truncate.php' );
53
  require_once( plugin_dir_path( __FILE__ ) . '/wpt-feed.php' );
54
  require_once( plugin_dir_path( __FILE__ ) . '/wpt-widget.php' );
 
55
 
56
  global $wpt_version;
57
- $wpt_version = "3.0.7";
58
- load_plugin_textdomain( 'wp-to-twitter', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
 
 
 
 
59
 
60
  // check for OAuth configuration
61
  function wpt_check_oauth( $auth = false ) {
@@ -264,9 +269,8 @@ function wptotwitter_activate() {
264
  $upgrade = version_compare( $prev_version, "2.9.8", "<=" );
265
  if ( $upgrade ) {
266
  // migrate stored short URL fields.
267
- $count_posts = wp_count_posts();
268
- $published_posts = $count_posts->publish;
269
- if ( $published_posts > 2 ) {
270
  // if more than 1000 posts, don't run this during update process.
271
  update_option( 'wpt_needs_migration', 'true' );
272
  } else {
@@ -278,12 +282,11 @@ function wptotwitter_activate() {
278
  }
279
 
280
 
281
- /* Function migrates post meta to new format. */
282
- function wpt_migrate_url_meta() {
283
  $posts = get_posts(
284
  array( 'numberposts'=>-1, 'meta_query'=>
285
  array(
286
- array(
287
  'key' => '_wp_jd_target',
288
  'value' => 'http',
289
  'compare' => 'LIKE'
@@ -291,6 +294,15 @@ function wpt_migrate_url_meta() {
291
  )
292
  )
293
  );
 
 
 
 
 
 
 
 
 
294
  foreach ( $posts as $post ) {
295
  $post_id = $post->ID;
296
  $short = '';
@@ -332,7 +344,7 @@ function wpt_migrate_url_meta() {
332
  }
333
  update_post_meta( $post_id, '_wpt_short_url', $short );
334
  }
335
- delete_option( 'wpt_needs_migration' );
336
  }
337
 
338
  // Function checks for an alternate URL to be Tweeted. Contribution by Bill Berry.
@@ -357,11 +369,16 @@ function wpt_saves_error( $id, $auth, $twit, $error, $http_code, $ts ) {
357
  'code' => $http_code,
358
  'timestamp' => $ts
359
  ) );
 
 
 
 
360
  }
361
  }
362
 
 
363
  /*
364
- * Checks whether WP to Twitter has sent a tweet on this post to this author within the last 15 seconds and blocks it if so. Prevents double posting.
365
  *
366
  * uses filter wpt_recent_tweet_threshold
367
  */
@@ -403,7 +420,16 @@ function wpt_check_recent_tweet( $id, $auth ) {
403
  * @return boolean Success of query.
404
  */
405
  function jd_doTwitterAPIPost( $twit, $auth = false, $id = false, $media = false ) {
406
- $recent = wpt_check_recent_tweet( $id, $auth );
 
 
 
 
 
 
 
 
 
407
  $http_code = 0;
408
  if ( $recent ) {
409
  return false;
@@ -463,8 +489,17 @@ function jd_doTwitterAPIPost( $twit, $auth = false, $id = false, $media = false
463
  if ( empty( $connection ) ) {
464
  $connection = array( 'connection' => 'undefined' );
465
  } else {
466
- $connection->post( $api, $status );
467
- $http_code = ( $connection ) ? $connection->http_code : 'failed';
 
 
 
 
 
 
 
 
 
468
  }
469
  wpt_mail( 'Twitter Connection', print_r( $connection, 1 ) . " - $twit, $auth, $id, $media" );
470
  if ( $connection ) {
@@ -556,7 +591,7 @@ function jd_doTwitterAPIPost( $twit, $auth = false, $id = false, $media = false
556
  if ( ! $return ) {
557
  wpt_set_log( 'wpt_status_message', $id, $error );
558
  } else {
559
- wpt_set_log( 'wpt_status_message', $id, __( 'Tweet sent successfully.', 'wp-to-twitter' ) );
560
  }
561
 
562
  return $return;
@@ -590,7 +625,6 @@ function fake_normalize( $string ) {
590
  }
591
 
592
  return $normalizer->normalize( $string );
593
- //return preg_replace( '~&([a-z]{1,2})(acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml|mp);~i', '$1', htmlentities( $string, ENT_NOQUOTES, 'UTF-8' ) );
594
  }
595
  }
596
 
@@ -633,7 +667,7 @@ function wpt_in_allowed_category( $array ) {
633
  *
634
  * @return array Post data used in Tweet functions.
635
  */
636
- function jd_post_info( $post_ID ) {
637
  $encoding = get_option( 'blog_charset' );
638
  if ( $encoding == '' ) {
639
  $encoding = 'UTF-8';
@@ -666,12 +700,18 @@ function jd_post_info( $post_ID ) {
666
  }
667
  foreach ( $categories AS $cat ) {
668
  $category_ids[] = $cat->term_id;
 
 
669
  }
 
 
670
  } else {
671
  $category = '';
672
  $cat_desc = '';
673
  $category_ids = array();
674
  }
 
 
675
  $values['categoryIds'] = $category_ids;
676
  $values['category'] = html_entity_decode( $category, ENT_COMPAT, $encoding );
677
  $values['cat_desc'] = html_entity_decode( $cat_desc, ENT_COMPAT, $encoding );
@@ -759,9 +799,7 @@ function wpt_category_limit( $post_type, $post_info, $post_ID ) {
759
  $continue = ( wpt_in_allowed_category( $post_info['categoryIds'] ) ) ? true : false;
760
  }
761
  }
762
- if ( ! $continue ) {
763
- wpt_mail( "3b: Category limits applied #$post_ID", print_r( $post_info['categoryIds'], 1 ) );
764
- }
765
  $continue = ( get_option( 'limit_categories' ) == '0' ) ? true : $continue;
766
  $args = array( 'type' => $post_type, 'info' => $post_info, 'id' => $post_ID );
767
 
@@ -776,7 +814,7 @@ function wpt_category_limit( $post_type, $post_info, $post_ID ) {
776
  *
777
  * @return integer $post_ID
778
  */
779
- function jd_twit( $post_ID, $type = 'instant' ) {
780
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE || wp_is_post_revision( $post_ID ) ) {
781
  return $post_ID;
782
  }
@@ -801,7 +839,7 @@ function jd_twit( $post_ID, $type = 'instant' ) {
801
  }
802
  wpt_mail( "1: JD Tweet This Value: #$post_ID", "Tweet this: $jd_tweet_this /" . get_option( 'jd_tweet_default' ) . " / $type" ); // DEBUG
803
  if ( $default ) { // default switch: depend on default settings.
804
- $post_info = jd_post_info( $post_ID );
805
  $media = wpt_post_with_media( $post_ID, $post_info );
806
  if ( function_exists( 'wpt_pro_exists' ) && wpt_pro_exists() == true ) {
807
  $auth = ( get_option( 'wpt_cotweet_lock' ) == 'false' || ! get_option( 'wpt_cotweet_lock' ) ) ? $post_info['authId'] : get_option( 'wpt_cotweet_lock' );
@@ -904,14 +942,8 @@ function jd_twit( $post_ID, $type = 'instant' ) {
904
  }
905
  } else {
906
  foreach ( $wpt_selected_users as $acct ) {
907
- if ( $acct == 'main' ) {
908
- $acct = false;
909
- }
910
- if ( $auth != $acct ) {
911
- $offset = rand( 60, 480 ); // offset by 1-8 minutes for additional users
912
- } else {
913
- $offset = 0;
914
- }
915
  if ( wtt_oauth_test( $acct, 'verify' ) ) {
916
  $time = apply_filters( 'wpt_schedule_delay', ( (int) $post_info['wpt_delay_tweet'] ) * 60, $acct );
917
  wp_schedule_single_event( time() + $time + $offset, 'wpt_schedule_tweet_action', array(
@@ -921,11 +953,7 @@ function jd_twit( $post_ID, $type = 'instant' ) {
921
  'post_id' => $post_ID
922
  ) );
923
  if ( WPT_DEBUG && function_exists( 'wpt_pro_exists' ) ) {
924
- if ( $acct ) {
925
- $author_id = "#$acct";
926
- } else {
927
- $author_id = 'Main';
928
- }
929
  wpt_mail( "7a: Tweet Scheduled for Auth ID $author_id #$post_ID", print_r( array(
930
  'id' => $acct,
931
  'sentence' => $sentence,
@@ -1014,7 +1042,7 @@ function jd_twit( $post_ID, $type = 'instant' ) {
1014
  *
1015
  * @return mixed boolean/integer link ID if successful, false if failure.
1016
  */
1017
- function jd_twit_link( $link_ID ) {
1018
  wpt_check_version();
1019
  $thislinkprivate = $_POST['link_visible'];
1020
  if ( $thislinkprivate != 'N' ) {
@@ -1116,11 +1144,11 @@ function wpt_generate_hash_tags( $post_ID ) {
1116
  return $hashtags;
1117
  }
1118
 
1119
- add_action( 'admin_menu', 'jd_add_twitter_outer_box' );
1120
  /**
1121
  * Set up post meta box.
1122
  */
1123
- function jd_add_twitter_outer_box() {
1124
  wpt_check_version();
1125
  // add Twitter panel to post types where it's enabled.
1126
  $wpt_post_types = get_option( 'wpt_post_types' );
@@ -1128,7 +1156,7 @@ function jd_add_twitter_outer_box() {
1128
  if ( is_array( $wpt_post_types ) ) {
1129
  foreach ( $wpt_post_types as $key => $value ) {
1130
  if ( $value['post-published-update'] == 1 || $value['post-edited-update'] == 1 ) {
1131
- add_meta_box( 'wp2t', 'WP to Twitter', 'jd_add_twitter_inner_box', $key, 'side' );
1132
  }
1133
  }
1134
  }
@@ -1138,7 +1166,7 @@ function jd_add_twitter_outer_box() {
1138
  /**
1139
  * Print post meta box
1140
  */
1141
- function jd_add_twitter_inner_box( $post ) {
1142
  if ( current_user_can( 'wpt_can_tweet' ) ) {
1143
  $is_pro = ( function_exists( 'wpt_pro_exists' ) ) ? 'pro' : 'free'; ?>
1144
  <div class='wp-to-twitter <?php echo $is_pro; ?>'>
@@ -1469,12 +1497,12 @@ function wpt_ajax_tweet() {
1469
  $default = ( isset( $options[ $type ]['post-edited-text'] ) ) ? $options[ $type ]['post-edited-text'] : '';
1470
  $sentence = ( isset( $_REQUEST['tweet_text'] ) && trim( $_REQUEST['tweet_text'] ) != '' ) ? $_REQUEST['tweet_text'] : $default;
1471
  $sentence = stripcslashes( trim( $sentence ) );
1472
- $sentence = jd_truncate_tweet( $sentence, jd_post_info( $post_ID ), $post_ID, false, $user_ID );
 
1473
  $schedule = ( isset( $_REQUEST['tweet_schedule'] ) ) ? strtotime( $_REQUEST['tweet_schedule'] ) : rand( 60, 240 );
1474
  $print_schedule = date_i18n( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), $schedule );
1475
  $offset = ( 60 * 60 * get_option( 'gmt_offset' ) );
1476
  $schedule = $schedule - $offset;
1477
- $post_info = jd_post_info( $post_ID );
1478
  $media = wpt_post_with_media( $post_ID, $post_info );
1479
  switch ( $action ) {
1480
  case 'tweet' :
@@ -1538,7 +1566,7 @@ function wpt_admin_script() {
1538
  * @param integer $id Post ID.
1539
  *
1540
  */
1541
- function post_jd_twitter( $id ) {
1542
  if ( empty( $_POST ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || wp_is_post_revision( $id ) || isset( $_POST['_inline_edit'] ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ! wpt_in_post_type( $id ) ) {
1543
  return;
1544
  }
@@ -1689,21 +1717,21 @@ function wpt_twitter_save_profile() {
1689
  apply_filters( 'wpt_save_user', $edit_id, $_POST );
1690
  }
1691
 
1692
- add_action( 'admin_menu', 'jd_addTwitterAdminPages' );
1693
  /**
1694
  * Add the administrative settings to the "Settings" menu.
1695
  */
1696
- function jd_addTwitterAdminPages() {
1697
  if ( function_exists( 'add_options_page' ) && ! function_exists( 'wpt_pro_functions' ) ) {
1698
  add_options_page( 'WP to Twitter', 'WP to Twitter', 'manage_options', __FILE__, 'wpt_update_settings' );
1699
  }
1700
  }
1701
 
1702
- add_action( 'admin_head', 'jd_addTwitterAdminStyles' );
1703
  /**
1704
  * Add stylesheets to WP to Twitter pages.
1705
  */
1706
- function jd_addTwitterAdminStyles() {
1707
  if ( isset( $_GET['page'] ) && ( $_GET['page'] == "wp-to-twitter" || $_GET['page'] == "wp-to-twitter/wp-to-twitter.php" || $_GET['page'] == "wp-tweets-pro" || $_GET['page'] == "wp-to-twitter-schedule" || $_GET['page'] == "wp-to-twitter-tweets" || $_GET['page'] == "wp-to-twitter-errors" ) ) {
1708
  wp_enqueue_style( 'wpt-styles', plugins_url( 'css/styles.css', __FILE__ ) );
1709
  }
@@ -1755,11 +1783,11 @@ function wpt_plugin_update_message() {
1755
  }
1756
 
1757
  if ( get_option( 'jd_twit_blogroll' ) == '1' ) {
1758
- add_action( 'add_link', 'jd_twit_link' );
1759
  }
1760
 
1761
  add_action( 'save_post', 'wpt_twit', 15 );
1762
- add_action( 'save_post', 'post_jd_twitter', 10 );
1763
 
1764
  /**
1765
  * Check whether a given post is in an allowed post type and has an update template configured.
@@ -1825,7 +1853,7 @@ function wpt_twit_future( $id ) {
1825
 
1826
  return;
1827
  }
1828
- jd_twit( $id, 'future' );
1829
  }
1830
 
1831
  /**
@@ -1847,7 +1875,7 @@ function wpt_twit_instant( $id ) {
1847
 
1848
  return;
1849
  }
1850
- jd_twit( $id, 'instant' );
1851
  }
1852
 
1853
  /**
@@ -1858,7 +1886,7 @@ function wpt_twit_xmlrpc( $id ) {
1858
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE || wp_is_post_revision( $id ) || ! wpt_in_post_type( $id ) ) {
1859
  return $id;
1860
  }
1861
- jd_twit( $id, 'xmlrpc' );
1862
  return $id;
1863
  }
1864
 
@@ -1881,9 +1909,8 @@ function wpt_dismiss_promotion() {
1881
  }
1882
  }
1883
 
1884
- wpt_dismiss_promotion();
1885
-
1886
- add_action( 'admin_notices', 'wpt_promotion_notice' );
1887
  /**
1888
  * Display promotion notice to admin users who have not donated or purchased WP Tweets PRO.
1889
  */
@@ -1895,23 +1922,29 @@ function wpt_promotion_notice() {
1895
  }
1896
  }
1897
 
1898
- add_action( 'admin_notices', 'wpt_migration_notice' );
 
1899
  /**
1900
  * Display migration notice if WPT was unable to auto migrate.
1901
  */
1902
  function wpt_migration_notice() {
1903
  if ( current_user_can( 'activate_plugins' ) && get_option( 'wpt_needs_migration' ) == 'true' ) {
1904
- $dismiss = ( is_plugin_active( 'wp-tweets-pro/wpt-pro-functions.php' ) ) ? admin_url( 'admin.php?page=wp-tweets-pro&action=migration' ) : admin_url( 'options-general.php?page=wp-to-twitter/wp-to-twitter.php&action=migration' );
1905
- echo "<div class='updated fade'><p>" . sprintf( __( "WP to Twitter needs to perform a database update. This may take a few minutes. <a href='%s'>Update Database</a>", 'wp-to-twitter' ), $dismiss ) . "</p></div>";
 
1906
  }
1907
  }
1908
 
 
1909
  function wpt_manual_migrate() {
1910
  if ( isset( $_GET['action'] ) && $_GET['action'] == 'migration' ) {
1911
  echo "<p>" . __( 'Processing data migration...', 'wp-to-twitter' ) . "</p>";
1912
  wpt_migrate_url_meta();
1913
  echo "<p>" . __( 'Data migration complete.', 'wp-to-twitter' ) . "</p>";
1914
  }
 
 
 
1915
  }
1916
 
1917
  add_action( 'wp_enqueue_scripts', 'wpt_stylesheet' );
3
  Plugin Name: WP to Twitter
4
  Plugin URI: http://www.joedolson.com/wp-to-twitter/
5
  Description: Posts a Tweet when you update your WordPress blog or post a link, using your URL shortening service. Rich in features for customizing and promoting your Tweets.
6
+ Version: 3.1.0
7
  Author: Joseph Dolson
8
  Author URI: http://www.joedolson.com/
9
  */
52
  require_once( plugin_dir_path( __FILE__ ) . '/wpt-truncate.php' );
53
  require_once( plugin_dir_path( __FILE__ ) . '/wpt-feed.php' );
54
  require_once( plugin_dir_path( __FILE__ ) . '/wpt-widget.php' );
55
+ require_once( plugin_dir_path( __FILE__ ) . '/wpt-rate-limiting.php' );
56
 
57
  global $wpt_version;
58
+ $wpt_version = "3.1.0";
59
+
60
+ add_action( 'plugins_loaded', 'wpt_load_textdomain' );
61
+ function wpt_load_textdomain() {
62
+ load_plugin_textdomain( 'wp-to-twitter', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
63
+ }
64
 
65
  // check for OAuth configuration
66
  function wpt_check_oauth( $auth = false ) {
269
  $upgrade = version_compare( $prev_version, "2.9.8", "<=" );
270
  if ( $upgrade ) {
271
  // migrate stored short URL fields.
272
+ $count = wpt_get_migration_posts( 'count' );
273
+ if ( $count > 1000 ) {
 
274
  // if more than 1000 posts, don't run this during update process.
275
  update_option( 'wpt_needs_migration', 'true' );
276
  } else {
282
  }
283
 
284
 
285
+ function wpt_get_migration_posts( $type = 'posts' ) {
 
286
  $posts = get_posts(
287
  array( 'numberposts'=>-1, 'meta_query'=>
288
  array(
289
+ array(
290
  'key' => '_wp_jd_target',
291
  'value' => 'http',
292
  'compare' => 'LIKE'
294
  )
295
  )
296
  );
297
+
298
+ $count = count( $posts );
299
+
300
+ return ( $type == 'posts' ) ? $posts : $count;
301
+ }
302
+
303
+ /* Function migrates post meta to new format. */
304
+ function wpt_migrate_url_meta() {
305
+ $posts = wpt_get_migration_posts();
306
  foreach ( $posts as $post ) {
307
  $post_id = $post->ID;
308
  $short = '';
344
  }
345
  update_post_meta( $post_id, '_wpt_short_url', $short );
346
  }
347
+ update_option( 'wpt_needs_migration', 'false' );
348
  }
349
 
350
  // Function checks for an alternate URL to be Tweeted. Contribution by Bill Berry.
369
  'code' => $http_code,
370
  'timestamp' => $ts
371
  ) );
372
+ } else {
373
+ if ( get_option( 'wpt_rate_limiting' ) == 1 ) {
374
+ wpt_log_success( $auth, $ts, $id );
375
+ }
376
  }
377
  }
378
 
379
+
380
  /*
381
+ * Checks whether WP to Twitter has sent a tweet on this post to this author within the last 30 seconds and blocks it if so. Prevents double posting.
382
  *
383
  * uses filter wpt_recent_tweet_threshold
384
  */
420
  * @return boolean Success of query.
421
  */
422
  function jd_doTwitterAPIPost( $twit, $auth = false, $id = false, $media = false ) {
423
+ $recent = wpt_check_recent_tweet( $id, $auth );
424
+
425
+ if ( get_option( 'wpt_rate_limiting' ) == 1 ) {
426
+ // check whether this post needs to be rate limited.
427
+ $continue = wpt_test_rate_limit( $id, $auth );
428
+ if ( !$continue ) {
429
+ return false;
430
+ }
431
+ }
432
+
433
  $http_code = 0;
434
  if ( $recent ) {
435
  return false;
489
  if ( empty( $connection ) ) {
490
  $connection = array( 'connection' => 'undefined' );
491
  } else {
492
+ $staging_mode = apply_filters( 'wpt_staging_mode', false, $auth, $id );
493
+ if ( ( defined( 'WPT_STAGING_MODE' ) && WPT_STAGING_MODE == true ) || $staging_mode ) {
494
+ // if in staging mode, we'll behave as if the Tweet succeeded, but not send it.
495
+ $connection = true;
496
+ $http_code = 200;
497
+ $notice = __( 'In Staging Mode:', 'wp-to-twitter' ) . ' ';
498
+ } else {
499
+ $connection->post( $api, $status );
500
+ $http_code = ( $connection ) ? $connection->http_code : 'failed';
501
+ $notice = '';
502
+ }
503
  }
504
  wpt_mail( 'Twitter Connection', print_r( $connection, 1 ) . " - $twit, $auth, $id, $media" );
505
  if ( $connection ) {
591
  if ( ! $return ) {
592
  wpt_set_log( 'wpt_status_message', $id, $error );
593
  } else {
594
+ wpt_set_log( 'wpt_status_message', $id, $notice . __( 'Tweet sent successfully.', 'wp-to-twitter' ) );
595
  }
596
 
597
  return $return;
625
  }
626
 
627
  return $normalizer->normalize( $string );
 
628
  }
629
  }
630
 
667
  *
668
  * @return array Post data used in Tweet functions.
669
  */
670
+ function wpt_post_info( $post_ID ) {
671
  $encoding = get_option( 'blog_charset' );
672
  if ( $encoding == '' ) {
673
  $encoding = 'UTF-8';
700
  }
701
  foreach ( $categories AS $cat ) {
702
  $category_ids[] = $cat->term_id;
703
+ $cats[] = $cat->cat_name;
704
+ $cat_descs[] = $cat->description;
705
  }
706
+ $cat_names = implode( ' ', apply_filters( 'wpt_twitter_category_names', $cats ) );
707
+ $cat_descs = implode( ' ', apply_filters( 'wpt_twitter_category_descs', $cat_descs ) );
708
  } else {
709
  $category = '';
710
  $cat_desc = '';
711
  $category_ids = array();
712
  }
713
+ $values['cats'] = $cat_names;
714
+ $values['cat_descs'] = $cat_descs;
715
  $values['categoryIds'] = $category_ids;
716
  $values['category'] = html_entity_decode( $category, ENT_COMPAT, $encoding );
717
  $values['cat_desc'] = html_entity_decode( $cat_desc, ENT_COMPAT, $encoding );
799
  $continue = ( wpt_in_allowed_category( $post_info['categoryIds'] ) ) ? true : false;
800
  }
801
  }
802
+
 
 
803
  $continue = ( get_option( 'limit_categories' ) == '0' ) ? true : $continue;
804
  $args = array( 'type' => $post_type, 'info' => $post_info, 'id' => $post_ID );
805
 
814
  *
815
  * @return integer $post_ID
816
  */
817
+ function wpt_tweet( $post_ID, $type = 'instant' ) {
818
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE || wp_is_post_revision( $post_ID ) ) {
819
  return $post_ID;
820
  }
839
  }
840
  wpt_mail( "1: JD Tweet This Value: #$post_ID", "Tweet this: $jd_tweet_this /" . get_option( 'jd_tweet_default' ) . " / $type" ); // DEBUG
841
  if ( $default ) { // default switch: depend on default settings.
842
+ $post_info = wpt_post_info( $post_ID );
843
  $media = wpt_post_with_media( $post_ID, $post_info );
844
  if ( function_exists( 'wpt_pro_exists' ) && wpt_pro_exists() == true ) {
845
  $auth = ( get_option( 'wpt_cotweet_lock' ) == 'false' || ! get_option( 'wpt_cotweet_lock' ) ) ? $post_info['authId'] : get_option( 'wpt_cotweet_lock' );
942
  }
943
  } else {
944
  foreach ( $wpt_selected_users as $acct ) {
945
+ $acct = ( $acct == 'main' ) ? false : $acct;
946
+ $offset = ( $auth != $acct ) ? rand( 60, 480 ) : 0;
 
 
 
 
 
 
947
  if ( wtt_oauth_test( $acct, 'verify' ) ) {
948
  $time = apply_filters( 'wpt_schedule_delay', ( (int) $post_info['wpt_delay_tweet'] ) * 60, $acct );
949
  wp_schedule_single_event( time() + $time + $offset, 'wpt_schedule_tweet_action', array(
953
  'post_id' => $post_ID
954
  ) );
955
  if ( WPT_DEBUG && function_exists( 'wpt_pro_exists' ) ) {
956
+ $author_id = ( $acct ) ? "#$acct" : 'Main';
 
 
 
 
957
  wpt_mail( "7a: Tweet Scheduled for Auth ID $author_id #$post_ID", print_r( array(
958
  'id' => $acct,
959
  'sentence' => $sentence,
1042
  *
1043
  * @return mixed boolean/integer link ID if successful, false if failure.
1044
  */
1045
+ function wpt_twit_link( $link_ID ) {
1046
  wpt_check_version();
1047
  $thislinkprivate = $_POST['link_visible'];
1048
  if ( $thislinkprivate != 'N' ) {
1144
  return $hashtags;
1145
  }
1146
 
1147
+ add_action( 'admin_menu', 'wpt_add_twitter_outer_box' );
1148
  /**
1149
  * Set up post meta box.
1150
  */
1151
+ function wpt_add_twitter_outer_box() {
1152
  wpt_check_version();
1153
  // add Twitter panel to post types where it's enabled.
1154
  $wpt_post_types = get_option( 'wpt_post_types' );
1156
  if ( is_array( $wpt_post_types ) ) {
1157
  foreach ( $wpt_post_types as $key => $value ) {
1158
  if ( $value['post-published-update'] == 1 || $value['post-edited-update'] == 1 ) {
1159
+ add_meta_box( 'wp2t', 'WP to Twitter', 'wpt_add_twitter_inner_box', $key, 'side' );
1160
  }
1161
  }
1162
  }
1166
  /**
1167
  * Print post meta box
1168
  */
1169
+ function wpt_add_twitter_inner_box( $post ) {
1170
  if ( current_user_can( 'wpt_can_tweet' ) ) {
1171
  $is_pro = ( function_exists( 'wpt_pro_exists' ) ) ? 'pro' : 'free'; ?>
1172
  <div class='wp-to-twitter <?php echo $is_pro; ?>'>
1497
  $default = ( isset( $options[ $type ]['post-edited-text'] ) ) ? $options[ $type ]['post-edited-text'] : '';
1498
  $sentence = ( isset( $_REQUEST['tweet_text'] ) && trim( $_REQUEST['tweet_text'] ) != '' ) ? $_REQUEST['tweet_text'] : $default;
1499
  $sentence = stripcslashes( trim( $sentence ) );
1500
+ $post_info = wpt_post_info( $post_ID );
1501
+ $sentence = jd_truncate_tweet( $sentence, $post_info, $post_ID, false, $user_ID );
1502
  $schedule = ( isset( $_REQUEST['tweet_schedule'] ) ) ? strtotime( $_REQUEST['tweet_schedule'] ) : rand( 60, 240 );
1503
  $print_schedule = date_i18n( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), $schedule );
1504
  $offset = ( 60 * 60 * get_option( 'gmt_offset' ) );
1505
  $schedule = $schedule - $offset;
 
1506
  $media = wpt_post_with_media( $post_ID, $post_info );
1507
  switch ( $action ) {
1508
  case 'tweet' :
1566
  * @param integer $id Post ID.
1567
  *
1568
  */
1569
+ function wpt_save_post( $id ) {
1570
  if ( empty( $_POST ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || wp_is_post_revision( $id ) || isset( $_POST['_inline_edit'] ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ! wpt_in_post_type( $id ) ) {
1571
  return;
1572
  }
1717
  apply_filters( 'wpt_save_user', $edit_id, $_POST );
1718
  }
1719
 
1720
+ add_action( 'admin_menu', 'wpt_admin_page' );
1721
  /**
1722
  * Add the administrative settings to the "Settings" menu.
1723
  */
1724
+ function wpt_admin_page() {
1725
  if ( function_exists( 'add_options_page' ) && ! function_exists( 'wpt_pro_functions' ) ) {
1726
  add_options_page( 'WP to Twitter', 'WP to Twitter', 'manage_options', __FILE__, 'wpt_update_settings' );
1727
  }
1728
  }
1729
 
1730
+ add_action( 'admin_head', 'wpt_admin_style' );
1731
  /**
1732
  * Add stylesheets to WP to Twitter pages.
1733
  */
1734
+ function wpt_admin_style() {
1735
  if ( isset( $_GET['page'] ) && ( $_GET['page'] == "wp-to-twitter" || $_GET['page'] == "wp-to-twitter/wp-to-twitter.php" || $_GET['page'] == "wp-tweets-pro" || $_GET['page'] == "wp-to-twitter-schedule" || $_GET['page'] == "wp-to-twitter-tweets" || $_GET['page'] == "wp-to-twitter-errors" ) ) {
1736
  wp_enqueue_style( 'wpt-styles', plugins_url( 'css/styles.css', __FILE__ ) );
1737
  }
1783
  }
1784
 
1785
  if ( get_option( 'jd_twit_blogroll' ) == '1' ) {
1786
+ add_action( 'add_link', 'wpt_twit_link' );
1787
  }
1788
 
1789
  add_action( 'save_post', 'wpt_twit', 15 );
1790
+ add_action( 'save_post', 'wpt_save_post', 10 );
1791
 
1792
  /**
1793
  * Check whether a given post is in an allowed post type and has an update template configured.
1853
 
1854
  return;
1855
  }
1856
+ wpt_tweet( $id, 'future' );
1857
  }
1858
 
1859
  /**
1875
 
1876
  return;
1877
  }
1878
+ wpt_tweet( $id, 'instant' );
1879
  }
1880
 
1881
  /**
1886
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE || wp_is_post_revision( $id ) || ! wpt_in_post_type( $id ) ) {
1887
  return $id;
1888
  }
1889
+ wpt_tweet( $id, 'xmlrpc' );
1890
  return $id;
1891
  }
1892
 
1909
  }
1910
  }
1911
 
1912
+ add_action( 'admin_notices', 'wpt_dismiss_promotion', 5 );
1913
+ add_action( 'admin_notices', 'wpt_promotion_notice', 10 );
 
1914
  /**
1915
  * Display promotion notice to admin users who have not donated or purchased WP Tweets PRO.
1916
  */
1922
  }
1923
  }
1924
 
1925
+ add_action( 'admin_notices', 'wpt_manual_migrate', 5 );
1926
+ add_action( 'admin_notices', 'wpt_migration_notice', 10 );
1927
  /**
1928
  * Display migration notice if WPT was unable to auto migrate.
1929
  */
1930
  function wpt_migration_notice() {
1931
  if ( current_user_can( 'activate_plugins' ) && get_option( 'wpt_needs_migration' ) == 'true' ) {
1932
+ $update = ( is_plugin_active( 'wp-tweets-pro/wpt-pro-functions.php' ) ) ? admin_url( 'admin.php?page=wp-tweets-pro&action=migration' ) : admin_url( 'options-general.php?page=wp-to-twitter/wp-to-twitter.php&action=migration' );
1933
+ $dismiss = ( is_plugin_active( 'wp-tweets-pro/wpt-pro-functions.php' ) ) ? admin_url( 'admin.php?page=wp-tweets-pro&action=migration' ) : admin_url( 'options-general.php?page=wp-to-twitter/wp-to-twitter.php&action=dismiss' );
1934
+ echo "<div class='updated fade'><p>" . sprintf( __( "WP to Twitter needs to perform an optional database update. It may take a few minutes. <a href='%s'>Update Database</a> or <a href='%s'>Dismiss Notice</a>", 'wp-to-twitter' ), $update, $dismiss ) . "</p></div>";
1935
  }
1936
  }
1937
 
1938
+
1939
  function wpt_manual_migrate() {
1940
  if ( isset( $_GET['action'] ) && $_GET['action'] == 'migration' ) {
1941
  echo "<p>" . __( 'Processing data migration...', 'wp-to-twitter' ) . "</p>";
1942
  wpt_migrate_url_meta();
1943
  echo "<p>" . __( 'Data migration complete.', 'wp-to-twitter' ) . "</p>";
1944
  }
1945
+ if ( isset( $_GET['action'] ) && $_GET['action'] == 'dismiss' ) {
1946
+ update_option( 'wpt_needs_migration', 'false' );
1947
+ }
1948
  }
1949
 
1950
  add_action( 'wp_enqueue_scripts', 'wpt_stylesheet' );
wpt-functions.php CHANGED
@@ -5,8 +5,6 @@ if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
6
  } // Exit if accessed directly
7
 
8
-
9
-
10
  // FUNCTION to see if checkboxes should be checked
11
  function jd_checkCheckbox( $field, $sub1 = false, $sub2 = '' ) {
12
  if ( $sub1 ) {
@@ -474,6 +472,7 @@ function wpt_get_support_form() {
474
  global $current_user, $wpt_version;
475
  get_currentuserinfo();
476
  $request = '';
 
477
  // send fields for WP to Twitter
478
  $license = ( get_option( 'wpt_license_key' ) != '' ) ? get_option( 'wpt_license_key' ) : 'none';
479
  if ( $license != '' ) {
@@ -565,23 +564,26 @@ $plugins_string
565
  if ( substr( $sitename, 0, 4 ) == 'www.' ) {
566
  $sitename = substr( $sitename, 4 );
567
  }
 
568
  $from_email = 'wordpress@' . $sitename;
569
- $from = "From: \"$current_user->display_name\" <$current_user->user_email>\r\nReply-to: \"$current_user->display_name\" <$current_user->user_email>\r\n";
570
 
571
  if ( ! $has_read_faq ) {
572
- echo "<div class='message error'><p>" . __( 'Please read the FAQ and other Help documents before making a support request.', 'wp-to-twitter' ) . "</p></div>";
 
 
573
  } else if ( ! $request ) {
574
- echo "<div class='message error'><p>" . __( 'Please describe your problem. I\'m not psychic.', 'wp-to-twitter' ) . "</p></div>";
575
  } else {
576
  $sent = wp_mail( "plugins@joedolson.com", $subject, $message, $from );
577
  if ( $sent ) {
578
  if ( $has_donated == 'Donor' ) {
579
- echo "<div class='message updated'><p>" . sprintf( __( 'Thank you for supporting WP to Twitter! I\'ll get back to you as soon as I can. Please make sure you can receive email at <code>%s</code>.', 'wp-to-twitter' ), $current_user->user_email ) . "</p></div>";
580
  } else {
581
- echo "<div class='message updated'><p>" . sprintf( __( "Thanks for using WP to Twitter. Please ensure that you can receive email at <code>%s</code>.", 'wp-to-twitter' ), $current_user->user_email ) . "</p></div>";
582
  }
583
  } else {
584
- echo "<div class='message error'><p>" . __( "Sorry! I couldn't send that message. Here's the text of your request:", 'my-calendar' ) . "</p><p>" . sprintf( __( '<a href="%s">Contact me here</a>, instead.', 'wp-to-twitter' ), 'https://www.joedolson.com/contact/' ) . "</p><pre>$request</pre></div>";
585
  }
586
  }
587
  }
@@ -606,7 +608,8 @@ $plugins_string
606
  <li>" . __( 'What happened instead?', 'wp-to-twitter' ) . "</li>
607
  </ul>
608
  <p>
609
- <code>" . __( 'Reply to:', 'wp-to-twitter' ) . " \"$current_user->display_name\" &lt;$current_user->user_email&gt;</code>
 
610
  </p>
611
  <p>
612
  <input type='checkbox' name='has_read_faq' id='has_read_faq' value='on' required='required' aria-required='true' /> <label for='has_read_faq'>" . sprintf( __( 'I have read <a href="%1$s">the FAQ for this plug-in</a> <span>(required)</span>', 'wp-to-twitter' ), 'http://www.joedolson.com/wp-to-twitter/support-2/' ) . "
@@ -812,14 +815,11 @@ class WPT_Normalizer
812
  $i = 0;
813
  $len = strlen($s);
814
 
815
- while ($i < $len)
816
- {
817
- if ($s[$i] < "\x80")
818
- {
819
  // ASCII chars
820
 
821
- if ($c)
822
- {
823
  ksort($c);
824
  $result .= implode('', $c);
825
  $c = array();
@@ -828,37 +828,29 @@ class WPT_Normalizer
828
  $j = 1 + strspn($s, $ASCII, $i+1);
829
  $result .= substr($s, $i, $j);
830
  $i += $j;
831
- }
832
- else
833
- {
834
  $ulen = $ulen_mask[$s[$i] & "\xF0"];
835
  $uchr = substr($s, $i, $ulen);
836
  $i += $ulen;
837
 
838
- if (isset($combClass[$uchr]))
839
- {
840
  // Combining chars, for sorting
841
 
842
  isset($c[$combClass[$uchr]]) || $c[$combClass[$uchr]] = '';
843
  $c[$combClass[$uchr]] .= isset($compatMap[$uchr]) ? $compatMap[$uchr] : (isset($decompMap[$uchr]) ? $decompMap[$uchr] : $uchr);
844
- }
845
- else
846
- {
847
- if ($c)
848
- {
849
  ksort($c);
850
  $result .= implode('', $c);
851
  $c = array();
852
  }
853
 
854
- if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr)
855
- {
856
  // Table lookup
857
 
858
  $j = isset($compatMap[$uchr]) ? $compatMap[$uchr] : (isset($decompMap[$uchr]) ? $decompMap[$uchr] : $uchr);
859
 
860
- if ($uchr != $j)
861
- {
862
  $uchr = $j;
863
 
864
  $j = strlen($uchr);
@@ -883,9 +875,7 @@ class WPT_Normalizer
883
  $uchr = substr($uchr, 0, $ulen);
884
  }
885
  }
886
- }
887
- else
888
- {
889
  // Hangul chars
890
 
891
  $uchr = unpack('C*', $uchr);
@@ -907,8 +897,7 @@ class WPT_Normalizer
907
  }
908
  }
909
 
910
- if ($c)
911
- {
912
  ksort($c);
913
  $result .= implode('', $c);
914
  }
@@ -916,10 +905,31 @@ class WPT_Normalizer
916
  return $result;
917
  }
918
 
919
- protected static function getData($file)
920
- {
921
  $file = __DIR__ . '/unidata/' . $file . '.ser';
922
- if (file_exists($file)) return unserialize(file_get_contents($file));
923
- else return false;
 
 
 
924
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
925
  }
5
  exit;
6
  } // Exit if accessed directly
7
 
 
 
8
  // FUNCTION to see if checkboxes should be checked
9
  function jd_checkCheckbox( $field, $sub1 = false, $sub2 = '' ) {
10
  if ( $sub1 ) {
472
  global $current_user, $wpt_version;
473
  get_currentuserinfo();
474
  $request = '';
475
+ $response_email = '';
476
  // send fields for WP to Twitter
477
  $license = ( get_option( 'wpt_license_key' ) != '' ) ? get_option( 'wpt_license_key' ) : 'none';
478
  if ( $license != '' ) {
564
  if ( substr( $sitename, 0, 4 ) == 'www.' ) {
565
  $sitename = substr( $sitename, 4 );
566
  }
567
+ $response_email = ( isset( $_POST['response_email'] ) ) ? $_POST['response_email'] : false;
568
  $from_email = 'wordpress@' . $sitename;
569
+ $from = "From: \"$current_user->display_name\" <$response_email>\r\nReply-to: \"$current_user->display_name\" <$response_email>\r\n";
570
 
571
  if ( ! $has_read_faq ) {
572
+ echo "<div class='notice error'><p>" . __( 'Please read the FAQ and other Help documents before making a support request.', 'wp-to-twitter' ) . "</p></div>";
573
+ } else if ( ! $response_email ) {
574
+ echo "<div class='notice error'><p>" . __( 'Please supply a valid email where you can receive support responses.', 'wp-to-twitter' ) . "</p></div>";
575
  } else if ( ! $request ) {
576
+ echo "<div class='notice error'><p>" . __( 'Please describe your problem. I\'m not psychic.', 'wp-to-twitter' ) . "</p></div>";
577
  } else {
578
  $sent = wp_mail( "plugins@joedolson.com", $subject, $message, $from );
579
  if ( $sent ) {
580
  if ( $has_donated == 'Donor' ) {
581
+ echo "<div class='notice updated'><p>" . sprintf( __( 'Thank you for supporting WP to Twitter! I\'ll get back to you as soon as I can. Please make sure you can receive email at <code>%s</code>.', 'wp-to-twitter' ), $response_email ) . "</p></div>";
582
  } else {
583
+ echo "<div class='notice updated'><p>" . sprintf( __( "Thanks for using WP to Twitter. Please ensure that you can receive email at <code>%s</code>.", 'wp-to-twitter' ), $response_email ) . "</p></div>";
584
  }
585
  } else {
586
+ echo "<div class='notice error'><p>" . __( "Sorry! I couldn't send that message. Here's the text of your request:", 'my-calendar' ) . "</p><p>" . sprintf( __( '<a href="%s">Contact me here</a>, instead.', 'wp-to-twitter' ), 'https://www.joedolson.com/contact/' ) . "</p><pre>$request</pre></div>";
587
  }
588
  }
589
  }
608
  <li>" . __( 'What happened instead?', 'wp-to-twitter' ) . "</li>
609
  </ul>
610
  <p>
611
+ <label for='response_email'>" . __( 'Your Email', 'wp-to-twitter' ) . "</label><br />
612
+ <input type='email' name='response_email' id='response_email' value='$response_email' class='widefat' required='required' aria-required='true' />
613
  </p>
614
  <p>
615
  <input type='checkbox' name='has_read_faq' id='has_read_faq' value='on' required='required' aria-required='true' /> <label for='has_read_faq'>" . sprintf( __( 'I have read <a href="%1$s">the FAQ for this plug-in</a> <span>(required)</span>', 'wp-to-twitter' ), 'http://www.joedolson.com/wp-to-twitter/support-2/' ) . "
815
  $i = 0;
816
  $len = strlen($s);
817
 
818
+ while ($i < $len) {
819
+ if ($s[$i] < "\x80") {
 
 
820
  // ASCII chars
821
 
822
+ if ($c) {
 
823
  ksort($c);
824
  $result .= implode('', $c);
825
  $c = array();
828
  $j = 1 + strspn($s, $ASCII, $i+1);
829
  $result .= substr($s, $i, $j);
830
  $i += $j;
831
+ } else {
 
 
832
  $ulen = $ulen_mask[$s[$i] & "\xF0"];
833
  $uchr = substr($s, $i, $ulen);
834
  $i += $ulen;
835
 
836
+ if (isset($combClass[$uchr])) {
 
837
  // Combining chars, for sorting
838
 
839
  isset($c[$combClass[$uchr]]) || $c[$combClass[$uchr]] = '';
840
  $c[$combClass[$uchr]] .= isset($compatMap[$uchr]) ? $compatMap[$uchr] : (isset($decompMap[$uchr]) ? $decompMap[$uchr] : $uchr);
841
+ } else {
842
+ if ($c) {
 
 
 
843
  ksort($c);
844
  $result .= implode('', $c);
845
  $c = array();
846
  }
847
 
848
+ if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) {
 
849
  // Table lookup
850
 
851
  $j = isset($compatMap[$uchr]) ? $compatMap[$uchr] : (isset($decompMap[$uchr]) ? $decompMap[$uchr] : $uchr);
852
 
853
+ if ($uchr != $j) {
 
854
  $uchr = $j;
855
 
856
  $j = strlen($uchr);
875
  $uchr = substr($uchr, 0, $ulen);
876
  }
877
  }
878
+ } else {
 
 
879
  // Hangul chars
880
 
881
  $uchr = unpack('C*', $uchr);
897
  }
898
  }
899
 
900
+ if ( $c ) {
 
901
  ksort($c);
902
  $result .= implode('', $c);
903
  }
905
  return $result;
906
  }
907
 
908
+ protected static function getData($file) {
 
909
  $file = __DIR__ . '/unidata/' . $file . '.ser';
910
+ if ( file_exists( $file ) ) {
911
+ return unserialize( file_get_contents( $file ) );
912
+ } else {
913
+ return false;
914
+ }
915
  }
916
+ }
917
+
918
+ /**
919
+ * Functions to provide fallbacks for changed function names in case any plug-ins or themes are calling WP to Twitter functions in custom code.
920
+ */
921
+ function jd_twit_link( $link_ID ) {
922
+ return wpt_twit_link( $link_ID );
923
+ }
924
+
925
+ function jd_post_info( $post_ID ) {
926
+ return wpt_post_info( $post_ID );
927
+ }
928
+
929
+ function jd_twit( $post_ID, $type = 'instant' ) {
930
+ return wpt_tweet( $post_ID, $type );
931
+ }
932
+
933
+ function jd_addTwitterAdminStyles() {
934
+ return wpt_admin_style();
935
  }
wpt-rate-limiting.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+
6
+
7
+ /**
8
+ * Hourly cron job to reset rate limits
9
+ */
10
+ add_action( 'wptratelimits', 'wpt_clear_rate_limits' );
11
+ function wpt_clear_rate_limits() {
12
+ delete_option( 'wpt_rate_limits' );
13
+ }
14
+
15
+ /**
16
+ * Logs successful Tweets for rate limiting.
17
+ *
18
+ * @param $id Post ID
19
+ */
20
+ function wpt_log_success( $auth, $ts, $post_ID ) {
21
+ if ( !$post_ID ) { return; }
22
+
23
+ // get record of recent Tweets
24
+ $rate_limit = get_option( 'wpt_rate_limits' );
25
+ if ( ! is_array( $rate_limit ) ) {
26
+ $rate_limit = array();
27
+ }
28
+ $post = get_post( $post_ID );
29
+ $post_type = $post->post_type;
30
+ $object_taxonomies = get_object_taxonomies( $post_type );
31
+ $terms = wp_get_object_terms( $post_ID, $object_taxonomies, array( 'fields' => 'all' ) );
32
+
33
+ foreach( $terms as $term ) {
34
+ $term_id = $term->term_id;
35
+ $tax = $term->taxonomy;
36
+
37
+ $rate_limit[$auth][$term_id.'+'.$tax][] = $post_ID;
38
+ }
39
+
40
+ update_option( 'wpt_rate_limits', $rate_limit );
41
+ }
42
+
43
+ /**
44
+ * Test Tweets against rate limiting rules.
45
+ *
46
+ * @param $post_ID Post ID
47
+ *
48
+ * @return boolean True if OK to Tweet.
49
+ */
50
+ function wpt_test_rate_limit( $post_ID, $auth ) {
51
+ // record of recent Tweets
52
+ $rate_limit = get_option( 'wpt_rate_limits' );
53
+ $return = true;
54
+ if ( !$rate_limit ) {
55
+ return true;
56
+ } else {
57
+ $post = get_post( $post_ID );
58
+ $post_type = $post->post_type;
59
+ $object_taxonomies = get_object_taxonomies( $post_type );
60
+ $terms = wp_get_object_terms( $post_ID, $object_taxonomies, array( 'fields' => 'all' ) );
61
+
62
+ foreach( $terms as $term ) {
63
+ $term_id = $term->term_id;
64
+ $limit = wpt_get_rate_limit( $term_id );
65
+ $tax = $term->taxonomy;
66
+ $count = ( isset( $rate_limit[$auth][$term_id.'+'.$tax] ) ) ? count( $rate_limit[$auth][$term_id.'+'.$tax] ) : false;
67
+ if ( $count && $count >= $limit ) {
68
+ $return = false;
69
+ }
70
+ }
71
+ }
72
+
73
+ return $return;
74
+ }
75
+
76
+ /**
77
+ * Default rate limiting value.
78
+ *
79
+ * @param $term Term ID
80
+ *
81
+ * @return integer Default rate limit
82
+ */
83
+ function wpt_default_rate_limit( $term = false ) {
84
+ $limit = ( get_option( 'wpt_default_rate_limit' ) != '' ) ? get_option( 'wpt_default_rate_limit' ) : 10;
85
+ return apply_filters( 'wpt_default_rate_limit', $limit, $term );
86
+ }
87
+
88
+ /**
89
+ * Get the current rate limit for a given term ID.
90
+ *
91
+ * @param $term Term ID
92
+ *
93
+ * @uses filter wpt_default_rate_limit
94
+ *
95
+ * @return integer Number of Tweets allowed per hour in this category.
96
+ */
97
+ function wpt_get_rate_limit( $term ) {
98
+ $limits = get_option( 'wpt_rate_limit' );
99
+ $limit = isset( $limits[$term] ) ? $limits[$term] : wpt_default_rate_limit( $term );
100
+
101
+ return $limit;
102
+ }
103
+
104
+ add_action( 'init', 'wpt_term_rate_limits' );
105
+ function wpt_term_rate_limits() {
106
+ $args = apply_filters( 'wpt_rate_limit_taxonomies', array() );
107
+ $taxonomies = get_taxonomies( $args );
108
+ if ( ! is_array( $taxonomies ) ) {
109
+ $taxonomies = array();
110
+ }
111
+ foreach ( $taxonomies as $value ) {
112
+ add_action( $value . '_add_form_fields', 'wpt_add_term_rate_limit', 10, 1 );
113
+ add_action( $value . '_edit_form_fields', 'wpt_edit_term_rate_limit', 10, 2 );
114
+ add_action( 'edit_'.$value, 'wpt_save_term_rate_limit', 10, 2 );
115
+ add_action( 'created_'.$value, 'wpt_save_term_rate_limit', 10, 2 );
116
+ }
117
+ }
118
+
119
+ function wpt_save_term_rate_limit( $term_id, $tax_id ) {
120
+ $limits = get_option( 'wpt_rate_limit' );
121
+ $option_set = isset( $_POST['wpt_rate_limit'] ) ? $_POST['wpt_rate_limit'] : wpt_default_rate_limit( $term_id );
122
+ if ( isset( $_POST['taxonomy'] ) ) {
123
+ if ( isset( $_POST['wpt_rate_limit'] ) ) {
124
+ $limits[$term_id] = $option_set;
125
+ update_option( 'wpt_rate_limit', $limits );
126
+ }
127
+ }
128
+ }
129
+
130
+ function wpt_edit_term_rate_limit( $term, $taxonomy ) {
131
+ $t_id = $term->term_id;
132
+ $limits = get_option( 'wpt_rate_limit' );
133
+ $option_set = isset( $limits[$t_id] ) ? $limits[$t_id] : wpt_default_rate_limit( $t_id );
134
+ ?>
135
+ <tr class="form-field">
136
+ <th valign="top" scope="row">
137
+ <label for="wpt_rate_limit"><?php _e( 'Max Tweets per hour on this term','wp-tweets-pro' ); ?></label>
138
+ </th>
139
+ <td>
140
+ <input type='number' size='4' value='<?php echo esc_attr( $option_set ); ?>' name='wpt_rate_limit' id='wpt_rate_limit' />
141
+ </td>
142
+ </tr>
143
+ <?php
144
+ }
145
+
146
+ function wpt_add_term_rate_limit( $term ) {
147
+ $default = wpt_default_rate_limit();
148
+ ?>
149
+ <div class="form-field">
150
+ <label for="wpt_rate_limit"><?php _e( 'Max Tweets per hour on this term','wp-tweets-pro' ); ?></label> <input type='number' value='<?php echo esc_attr( $default ); ?>' id='wpt_rate_limit' name='wpt_rate_limit' />
151
+ </div>
152
+ <?php
153
+ }
154
+
155
+ function wpt_view_rate_limits() {
156
+ $limits = get_option( 'wpt_rate_limits' );
157
+ if ( is_array( $limits ) ) {
158
+
159
+ $output = '<ul>';
160
+ foreach( $limits as $auth => $term ) {
161
+ $author = ( $auth == 0 ) ? get_option( 'wtt_twitter_username' ) : get_user_meta( $auth, 'wtt_twitter_username', true );
162
+ $output .= "<li><h4><a href='https://twitter.com/$author'>@$author</a>:</h4><ul>";
163
+ foreach ( $term as $id => $value ) {
164
+ $count = count( $value );
165
+ $term_array = explode( '+', $id );
166
+ $t = $term_array[0];
167
+ $x = $term_array[1];
168
+ $limit = wpt_get_rate_limit( $t );
169
+ $term_object = get_term( $t, $x );
170
+ $term_label = $term_object->name;
171
+ $rate_limiting = ( $count >= $limit ) ? 'rate-limited' : 'active';
172
+ $dashicon = ( $count >= $limit ) ? "<span class='dashicons dashicons-no' aria-hidden='true'></span>" : "<span class='dashicons dashicons-yes' aria-hidden='true'></span>";
173
+ $output .= "<li class='$rate_limiting'>$dashicon<strong>$term_label</strong>: "
174
+ . sprintf( _n( '%s Tweet sent, %s allowed.', '%s Tweets sent, %s allowed.', $count, 'wp-to-twitter' ), "<strong>$count</strong>", "<strong>$limit</strong>" )
175
+ . "</li>";
176
+ }
177
+ $output .= "</ul>";
178
+ }
179
+ $output .= "</ul>";
180
+
181
+ } else {
182
+ $output = __( 'No Tweets have been sent this hour.', 'wp-to-twitter' );
183
+ }
184
+
185
+ return $output;
186
+ }
wpt-widget.php CHANGED
@@ -55,7 +55,7 @@ function wpt_get_twitter_feed( $atts, $content ) {
55
  function wpt_twitter_feed( $instance ) {
56
  $header = '';
57
  if ( ! isset( $instance['search'] ) ) {
58
- $twitter_ID = esc_html( ( isset( $instance['twitter_id'] ) && $instance['twitter_id'] != '' ) ? $instance['twitter_id'] : get_option( 'wtt_twitter_username' ) );
59
  $user = wpt_get_user( $twitter_ID );
60
  if ( isset( $user->errors ) && $user->errors[0]->message ) {
61
  return __( "Error: ", 'wp-to-twitter' ) . $user->errors[0]->message;
@@ -66,13 +66,13 @@ function wpt_twitter_feed( $instance ) {
66
  $img_alignment = ( is_rtl() ) ? 'wpt-right' : 'wpt-left';
67
  $follow_alignment = ( is_rtl() ) ? 'wpt-left' : 'wpt-right';
68
  $follow_url = esc_url( 'https://twitter.com/' . $twitter_ID );
69
- $follow_button = apply_filters( 'wpt_follow_button', "<a href='$follow_url' class='twitter-follow-button $follow_alignment' data-width='30px' data-show-screen-name='false' data-size='large' data-show-count='false' data-lang='en'>Follow @$twitter_ID</a>" );
70
  $header .= '<div class="wpt-header">';
71
  $header .= "<p>
72
  $follow_button
73
  <img src='$avatar' alt='' class='wpt-twitter-avatar $img_alignment $verified' />
74
  <span class='wpt-twitter-name'>$name</span><br />
75
- <span class='wpt-twitter-id'><a href='$follow_url'>@$twitter_ID</a></span>
76
  </p>";
77
  $header .= '</div>';
78
  }
@@ -86,7 +86,6 @@ function wpt_twitter_feed( $instance ) {
86
  $options['search'] = $instance['search'];
87
  $options['geocode'] = $instance['geocode'];
88
  $options['result_type'] = $instance['result_type'];
89
- $instance['twitter_id'] = get_option( 'wtt_twitter_username' );
90
  }
91
 
92
  if ( $hide_header ) {
@@ -99,7 +98,7 @@ function wpt_twitter_feed( $instance ) {
99
  $opts['mentions'] = $instance['link_mentions'];
100
  $opts['hashtags'] = $instance['link_hashtags'];
101
  $opts['show_images'] = isset( $instance['show_images'] ) ? $instance['show_images'] : false;
102
- $rawtweets = WPT_getTweets( $instance['twitter_num'], $instance['twitter_id'], $options );
103
 
104
  if ( isset( $rawtweets['error'] ) ) {
105
  $return .= "<li>" . $rawtweets['error'] . "</li>";
@@ -113,9 +112,9 @@ function wpt_twitter_feed( $instance ) {
113
  }
114
  if ( $instance['source'] ) {
115
  $source = $tweet['source'];
116
- $timetweet = sprintf( __( '<a href="%3$s">about %1$s ago</a> via %2$s', 'wp-to-twitter' ), human_time_diff( strtotime( $tweet['created_at'] ) ), $source, "http://twitter.com/$instance[twitter_id]/status/$tweet[id_str]" );
117
  } else {
118
- $timetweet = sprintf( __( '<a href="%2$s">about %1$s ago</a>', 'wp-to-twitter' ), human_time_diff( strtotime( $tweet['created_at'] ) ), "http://twitter.com/$instance[twitter_id]/status/$tweet[id_str]" );
119
  }
120
  $tweet_classes = wpt_generate_classes( $tweet );
121
 
@@ -179,7 +178,7 @@ class WPT_Latest_Tweets_Widget extends WP_Widget {
179
  'width' => 200,
180
  'height' => 250,
181
  );
182
- $this->WP_Widget( 'wpt-latest-tweets', __( 'WP to Twitter - Latest Tweets', 'wp-to-twitter' ), $widget_ops, $control_ops );
183
  }
184
 
185
  /**
@@ -379,7 +378,7 @@ class WPT_Search_Tweets_Widget extends WP_Widget {
379
  'width' => 200,
380
  'height' => 250,
381
  );
382
- $this->WP_Widget( 'wpt-search-tweets', __( 'WP to Twitter - Searched Tweets', 'wp-to-twitter' ), $widget_ops, $control_ops );
383
  }
384
 
385
  /**
55
  function wpt_twitter_feed( $instance ) {
56
  $header = '';
57
  if ( ! isset( $instance['search'] ) ) {
58
+ $twitter_ID = ( isset( $instance['twitter_id'] ) && $instance['twitter_id'] != '' ) ? $instance['twitter_id'] : get_option( 'wtt_twitter_username' );
59
  $user = wpt_get_user( $twitter_ID );
60
  if ( isset( $user->errors ) && $user->errors[0]->message ) {
61
  return __( "Error: ", 'wp-to-twitter' ) . $user->errors[0]->message;
66
  $img_alignment = ( is_rtl() ) ? 'wpt-right' : 'wpt-left';
67
  $follow_alignment = ( is_rtl() ) ? 'wpt-left' : 'wpt-right';
68
  $follow_url = esc_url( 'https://twitter.com/' . $twitter_ID );
69
+ $follow_button = apply_filters( 'wpt_follow_button', "<a href='$follow_url' class='twitter-follow-button $follow_alignment' data-width='30px' data-show-screen-name='false' data-size='large' data-show-count='false' data-lang='en'>Follow @" . esc_html( $twitter_ID ) . "</a>" );
70
  $header .= '<div class="wpt-header">';
71
  $header .= "<p>
72
  $follow_button
73
  <img src='$avatar' alt='' class='wpt-twitter-avatar $img_alignment $verified' />
74
  <span class='wpt-twitter-name'>$name</span><br />
75
+ <span class='wpt-twitter-id'><a href='$follow_url'>@" . esc_html( $twitter_ID ) . "</a></span>
76
  </p>";
77
  $header .= '</div>';
78
  }
86
  $options['search'] = $instance['search'];
87
  $options['geocode'] = $instance['geocode'];
88
  $options['result_type'] = $instance['result_type'];
 
89
  }
90
 
91
  if ( $hide_header ) {
98
  $opts['mentions'] = $instance['link_mentions'];
99
  $opts['hashtags'] = $instance['link_hashtags'];
100
  $opts['show_images'] = isset( $instance['show_images'] ) ? $instance['show_images'] : false;
101
+ $rawtweets = WPT_getTweets( $instance['twitter_num'], $twitter_ID, $options );
102
 
103
  if ( isset( $rawtweets['error'] ) ) {
104
  $return .= "<li>" . $rawtweets['error'] . "</li>";
112
  }
113
  if ( $instance['source'] ) {
114
  $source = $tweet['source'];
115
+ $timetweet = sprintf( __( '<a href="%3$s">about %1$s ago</a> via %2$s', 'wp-to-twitter' ), human_time_diff( strtotime( $tweet['created_at'] ) ), $source, "http://twitter.com/" . $twitter_ID . "/status/$tweet[id_str]" );
116
  } else {
117
+ $timetweet = sprintf( __( '<a href="%2$s">about %1$s ago</a>', 'wp-to-twitter' ), human_time_diff( strtotime( $tweet['created_at'] ) ), "http://twitter.com/$twitter_ID/status/$tweet[id_str]" );
118
  }
119
  $tweet_classes = wpt_generate_classes( $tweet );
120
 
178
  'width' => 200,
179
  'height' => 250,
180
  );
181
+ parent::__construct( 'wpt-latest-tweets', __( 'WP to Twitter - Latest Tweets', 'wp-to-twitter' ), $widget_ops, $control_ops );
182
  }
183
 
184
  /**
378
  'width' => 200,
379
  'height' => 250,
380
  );
381
+ parent::__construct( 'wpt-search-tweets', __( 'WP to Twitter - Searched Tweets', 'wp-to-twitter' ), $widget_ops, $control_ops );
382
  }
383
 
384
  /**