WP to Twitter - Version 3.3.9

Version Description

  • Added filter to cancel Tweets for custom reasons after all other filters executed.
  • Removed video on app creation, due to Twitter's radical revision of creation process.
  • Update setup instructions inside app.
Download this release

Release Info

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

Code changes from version 3.3.8 to 3.3.9

Files changed (5) hide show
  1. css/styles.css +103 -98
  2. readme.txt +11 -3
  3. wp-to-twitter-oauth.php +13 -10
  4. wp-to-twitter.php +15 -5
  5. wpt-rate-limiting.php +1 -0
css/styles.css CHANGED
@@ -1,50 +1,55 @@
1
  #wp-to-twitter .jd-settings {
2
- clear: both;
3
  }
4
 
5
  #wp-to-twitter form .error p {
6
- background: none;
7
- border: none;
8
  }
9
 
10
  #wp-to-twitter legend, #wpt_settings_page legend {
11
- padding: 6px 1%;
12
- background: #f3f4f5;
13
- width: 98%;
14
- color: #000;
15
  margin-top: 4px;
16
  }
17
 
18
  #wp-to-twitter .resources {
19
- text-align: center;
20
  }
21
 
22
  #wp-to-twitter .resources form {
23
- margin: 0;
24
  }
25
 
26
  .settings {
27
- margin: 25px 0;
28
- background: #fff;
29
- padding: 10px;
30
- border: 1px solid #000;
 
 
 
 
 
31
  }
32
 
33
  #wp-to-twitter .inside em {
34
- color: #f33;
35
  }
36
 
37
  #wp-to-twitter .button-side {
38
- position: absolute;
39
- top: 0;
40
- right: 10px;
41
  }
42
 
43
  #wp-to-twitter .tokens label {
44
- width: 13em;
45
- display: block;
46
- float: left;
47
- margin-top: 5px;
48
  }
49
 
50
  #wp-to-twitter .wpt-terms p {
@@ -58,108 +63,108 @@
58
  #wp-to-twitter .wpt-terms ul {
59
  column-count: 3;
60
  column-gap: 20px;
61
- -moz-column-count: 3;
62
- -moz-column-gap: 20px;
63
- -webkit-column-count: 3;
64
- -webkit-column-gap: 20px;
65
- margin: 0 0 20px;
66
- padding: 6px 2%;
67
  width: 96%;
68
  }
69
 
70
  #wp-to-twitter .wpt-terms li {
71
- list-style-type: none;
72
- margin: 3px 0;
73
- padding: 0;
74
  }
75
 
76
  #wp-to-twitter .inside .clear {
77
- display: block;
78
- clear: both;
79
  }
80
 
81
  #wp-to-twitter .inside .comments {
82
- clear: both;
83
  }
84
 
85
  #wp-to-twitter .postbox {
86
- margin: 10px 10px 0 0;
87
  }
88
 
89
  #wp-to-twitter .meta-box-sortables {
90
- min-height: 0;
91
  }
92
 
93
  #wp-to-twitter .wpt-template, #wp-to-twitter .support-request {
94
- width: 100%;
95
  }
96
 
97
  .wpt_image {
98
- padding-left: 20px;
99
- background: url(../images/image.png) left 50% no-repeat;
100
- display: block;
101
  }
102
 
103
  #wpt_license_key {
104
- font-size: 1.3em;
105
- padding: 5px;
106
- letter-spacing: .5px;
107
  }
108
 
109
  #wp-to-twitter input {
110
- max-width: 100%;
111
  }
112
 
113
  label[for="wpt_license_key"] {
114
- font-size: 1.3em;
115
  }
116
 
117
  #wp-to-twitter .wpt-upgrade {
118
- background: #e25822;
119
- color: #fff;
120
- text-shadow: #000 0 1px 0;
121
- border-radius: 2px 2px 0 0;
122
  }
123
 
124
  .wp-tweets-pro .widefat input[type=text] {
125
- width: 100%;
126
  }
127
 
128
  #wpt_settings_page .tabs {
129
- margin: .5em 0 0;
130
- padding: 0 4px;
131
- position: relative;
132
- top: 1px;
133
  font-size: 1.1em;
134
  }
135
 
136
  #wpt_settings_page .tabs li {
137
- display: inline;
138
- margin: 0 auto;
139
- line-height: 1;
140
  }
141
 
142
  #wpt_settings_page .tabs a {
143
- display: inline-block;
144
- padding: 6px 10px;
145
- border-radius: 4px 4px 0 0;
146
- border: 1px solid #ccc;
147
- background: #f3f3f3;
148
  }
149
 
150
  #wpt_settings_page .tabs a.active {
151
- border-bottom: 1px solid #fefefe;
152
- background: #fefefe;
153
  text-decoration: none;
154
  color: #333;
155
  font-weight: 700;
156
  }
157
 
158
  #wpt_settings_page .wptab {
159
- background: #fff;
160
- margin-bottom: 10px;
161
- min-height: 200px;
162
- border-top: 1px solid #ccc;
163
  }
164
 
165
  #wpt_settings_page .inside.purchase ul {
@@ -178,18 +183,18 @@ label[for="wpt_license_key"] {
178
  }
179
 
180
  #wpt_settings_page input[type=text] {
181
- font-size: 1.3em;
182
- padding: 4px;
183
- margin: 0 0 4px;
184
  }
185
 
186
  .wpt-permissions .wptab {
187
- padding: 10px;
188
- min-height: 160px !important;
189
  }
190
 
191
  #wpt_settings_page .wpt-permissions .wptab legend {
192
- background: none;
193
  padding: 0;
194
  }
195
 
@@ -204,31 +209,31 @@ label[for="wpt_license_key"] {
204
  }
205
 
206
  .wpt-terms li {
207
- padding: 2px !important;
208
- border-radius: 3px;
209
  }
210
 
211
  .tweet {
212
- background: #070 url(../images/Ok.png) 99% 50% no-repeat;
213
- color: #fff;
214
  }
215
 
216
  .notweet {
217
- background: #9d1309 url(../images/Error.png) 99% 50% no-repeat;
218
- color: #fff;
219
  }
220
 
221
  .donations * {
222
- vertical-align: middle;
223
- display: inline-block;
224
  }
225
 
226
  .jcd-wide {
227
- width: 75%;
228
  }
229
 
230
  .jcd-narrow {
231
- width: 20%;
232
  }
233
 
234
  label[for='wpt_prepend_rt'], label[for='wpt_prepend_rt2'], label[for='wpt_prepend_rt3'] {
@@ -301,21 +306,21 @@ label[for='wpt_prepend_rt'], label[for='wpt_prepend_rt2'], label[for='wpt_prepen
301
  }
302
 
303
  .wpt-support-me p {
304
- font-size: 1.6em;
305
- font-weight: 600;
306
- background: #007eb3;
307
- text-shadow: 1px 1px rgb( 35, 60, 127 );
308
- padding: 1em;
309
- text-align: center;
310
- margin: 0 0 1em;
311
  }
312
 
313
  .wpt-support-me p, .wpt-support-me a {
314
- color: #fff;
315
  }
316
 
317
  .wpt-support-me a:hover, .wpt-support-me a:focus {
318
- text-decoration: none;
319
  }
320
 
321
  .toplevel_page_wp-tweets-pro #fs_connect .fs-terms a {
@@ -323,13 +328,13 @@ label[for='wpt_prepend_rt'], label[for='wpt_prepend_rt2'], label[for='wpt_prepen
323
  }
324
 
325
  @media (max-width: 782px) {
326
- .jcd-narrow {
327
- width: 100%;
328
- }
329
 
330
- .jcd-wide {
331
- width: 100%;
332
- }
333
 
334
  #wp-to-twitter .wpt-terms p {
335
  margin: 0;
1
  #wp-to-twitter .jd-settings {
2
+ clear: both;
3
  }
4
 
5
  #wp-to-twitter form .error p {
6
+ background: none;
7
+ border: none;
8
  }
9
 
10
  #wp-to-twitter legend, #wpt_settings_page legend {
11
+ padding: 6px 1%;
12
+ background: #f3f4f5;
13
+ width: 98%;
14
+ color: #000;
15
  margin-top: 4px;
16
  }
17
 
18
  #wp-to-twitter .resources {
19
+ text-align: center;
20
  }
21
 
22
  #wp-to-twitter .resources form {
23
+ margin: 0;
24
  }
25
 
26
  .settings {
27
+ margin: 25px 0;
28
+ background: #fff;
29
+ padding: 10px;
30
+ border: 1px solid #000;
31
+ }
32
+
33
+ .wpt-bullets li {
34
+ list-style: disc;
35
+ margin-left: 2em;
36
  }
37
 
38
  #wp-to-twitter .inside em {
39
+ color: #f33;
40
  }
41
 
42
  #wp-to-twitter .button-side {
43
+ position: absolute;
44
+ top: 0;
45
+ right: 10px;
46
  }
47
 
48
  #wp-to-twitter .tokens label {
49
+ width: 13em;
50
+ display: block;
51
+ float: left;
52
+ margin-top: 5px;
53
  }
54
 
55
  #wp-to-twitter .wpt-terms p {
63
  #wp-to-twitter .wpt-terms ul {
64
  column-count: 3;
65
  column-gap: 20px;
66
+ -moz-column-count: 3;
67
+ -moz-column-gap: 20px;
68
+ -webkit-column-count: 3;
69
+ -webkit-column-gap: 20px;
70
+ margin: 0 0 20px;
71
+ padding: 6px 2%;
72
  width: 96%;
73
  }
74
 
75
  #wp-to-twitter .wpt-terms li {
76
+ list-style-type: none;
77
+ margin: 3px 0;
78
+ padding: 0;
79
  }
80
 
81
  #wp-to-twitter .inside .clear {
82
+ display: block;
83
+ clear: both;
84
  }
85
 
86
  #wp-to-twitter .inside .comments {
87
+ clear: both;
88
  }
89
 
90
  #wp-to-twitter .postbox {
91
+ margin: 10px 10px 0 0;
92
  }
93
 
94
  #wp-to-twitter .meta-box-sortables {
95
+ min-height: 0;
96
  }
97
 
98
  #wp-to-twitter .wpt-template, #wp-to-twitter .support-request {
99
+ width: 100%;
100
  }
101
 
102
  .wpt_image {
103
+ padding-left: 20px;
104
+ background: url(../images/image.png) left 50% no-repeat;
105
+ display: block;
106
  }
107
 
108
  #wpt_license_key {
109
+ font-size: 1.3em;
110
+ padding: 5px;
111
+ letter-spacing: .5px;
112
  }
113
 
114
  #wp-to-twitter input {
115
+ max-width: 100%;
116
  }
117
 
118
  label[for="wpt_license_key"] {
119
+ font-size: 1.3em;
120
  }
121
 
122
  #wp-to-twitter .wpt-upgrade {
123
+ background: #e25822;
124
+ color: #fff;
125
+ text-shadow: #000 0 1px 0;
126
+ border-radius: 2px 2px 0 0;
127
  }
128
 
129
  .wp-tweets-pro .widefat input[type=text] {
130
+ width: 100%;
131
  }
132
 
133
  #wpt_settings_page .tabs {
134
+ margin: .5em 0 0;
135
+ padding: 0 4px;
136
+ position: relative;
137
+ top: 1px;
138
  font-size: 1.1em;
139
  }
140
 
141
  #wpt_settings_page .tabs li {
142
+ display: inline;
143
+ margin: 0 auto;
144
+ line-height: 1;
145
  }
146
 
147
  #wpt_settings_page .tabs a {
148
+ display: inline-block;
149
+ padding: 6px 10px;
150
+ border-radius: 4px 4px 0 0;
151
+ border: 1px solid #ccc;
152
+ background: #f3f3f3;
153
  }
154
 
155
  #wpt_settings_page .tabs a.active {
156
+ border-bottom: 1px solid #fefefe;
157
+ background: #fefefe;
158
  text-decoration: none;
159
  color: #333;
160
  font-weight: 700;
161
  }
162
 
163
  #wpt_settings_page .wptab {
164
+ background: #fff;
165
+ margin-bottom: 10px;
166
+ min-height: 200px;
167
+ border-top: 1px solid #ccc;
168
  }
169
 
170
  #wpt_settings_page .inside.purchase ul {
183
  }
184
 
185
  #wpt_settings_page input[type=text] {
186
+ font-size: 1.3em;
187
+ padding: 4px;
188
+ margin: 0 0 4px;
189
  }
190
 
191
  .wpt-permissions .wptab {
192
+ padding: 10px;
193
+ min-height: 160px !important;
194
  }
195
 
196
  #wpt_settings_page .wpt-permissions .wptab legend {
197
+ background: none;
198
  padding: 0;
199
  }
200
 
209
  }
210
 
211
  .wpt-terms li {
212
+ padding: 2px !important;
213
+ border-radius: 3px;
214
  }
215
 
216
  .tweet {
217
+ background: #070 url(../images/Ok.png) 99% 50% no-repeat;
218
+ color: #fff;
219
  }
220
 
221
  .notweet {
222
+ background: #9d1309 url(../images/Error.png) 99% 50% no-repeat;
223
+ color: #fff;
224
  }
225
 
226
  .donations * {
227
+ vertical-align: middle;
228
+ display: inline-block;
229
  }
230
 
231
  .jcd-wide {
232
+ width: 75%;
233
  }
234
 
235
  .jcd-narrow {
236
+ width: 20%;
237
  }
238
 
239
  label[for='wpt_prepend_rt'], label[for='wpt_prepend_rt2'], label[for='wpt_prepend_rt3'] {
306
  }
307
 
308
  .wpt-support-me p {
309
+ font-size: 1.6em;
310
+ font-weight: 600;
311
+ background: #007eb3;
312
+ text-shadow: 1px 1px rgb( 35, 60, 127 );
313
+ padding: 1em;
314
+ text-align: center;
315
+ margin: 0 0 1em;
316
  }
317
 
318
  .wpt-support-me p, .wpt-support-me a {
319
+ color: #fff;
320
  }
321
 
322
  .wpt-support-me a:hover, .wpt-support-me a:focus {
323
+ text-decoration: none;
324
  }
325
 
326
  .toplevel_page_wp-tweets-pro #fs_connect .fs-terms a {
328
  }
329
 
330
  @media (max-width: 782px) {
331
+ .jcd-narrow {
332
+ width: 100%;
333
+ }
334
 
335
+ .jcd-wide {
336
+ width: 100%;
337
+ }
338
 
339
  #wp-to-twitter .wpt-terms p {
340
  margin: 0;
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tested up to: 4.9
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  Text Domain: wp-to-twitter
10
- Stable tag: 3.3.8
11
 
12
  Posts a Twitter update when you update your WordPress blog or add a link, with your chosen URL shortening service.
13
 
@@ -23,8 +23,6 @@ Yep. That's the basic functionality. But it's not the only thing you can do:
23
 
24
  [Upgrade to WP Tweets Pro](http://www.joedolson.com/wp-tweets-pro/) and schedule Tweets, set up automatic reposts, upload images and more!
25
 
26
- [youtube https://www.youtube.com/watch?v=3YIia5dQBSk]
27
-
28
  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.
29
 
30
  = Free Features =
@@ -65,6 +63,12 @@ Check out my <a href="https://github.com/joedolson/plugin-extensions/tree/master
65
 
66
  == Changelog ==
67
 
 
 
 
 
 
 
68
  = 3.3.8 =
69
 
70
  * Change function name for checking edit vs. new for clarity.
@@ -406,6 +410,10 @@ Check out my <a href="https://github.com/joedolson/plugin-extensions/tree/master
406
 
407
  Right here: [WP to Twitter FAQ](http://www.joedolson.com/wp-to-twitter/support-2/). I don't maintain them here because I would prefer to only maintain one copy. This is better for everybody, since the responses are much more likely to be up to date!
408
 
 
 
 
 
409
  = How can I help you make WP to Twitter a better plug-in? =
410
 
411
  Writing and maintaining a plug-in is a lot of work. You can help me by providing detailed support requests (which saves me time), or by providing financial support, either via my [plug-in donations page](https://www.joedolson.com/donate/) or by [upgrading to WP Tweets Pro](http://www.wptweetspro.com/wp-tweets-pro). Believe me, your donation really makes a difference!
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  Text Domain: wp-to-twitter
10
+ Stable tag: 3.3.9
11
 
12
  Posts a Twitter update when you update your WordPress blog or add a link, with your chosen URL shortening service.
13
 
23
 
24
  [Upgrade to WP Tweets Pro](http://www.joedolson.com/wp-tweets-pro/) and schedule Tweets, set up automatic reposts, upload images and more!
25
 
 
 
26
  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.
27
 
28
  = Free Features =
63
 
64
  == Changelog ==
65
 
66
+ = 3.3.9 =
67
+
68
+ * Added filter to cancel Tweets for custom reasons after all other filters executed.
69
+ * Removed video on app creation, due to Twitter's radical revision of creation process.
70
+ * Update setup instructions inside app.
71
+
72
  = 3.3.8 =
73
 
74
  * Change function name for checking edit vs. new for clarity.
410
 
411
  Right here: [WP to Twitter FAQ](http://www.joedolson.com/wp-to-twitter/support-2/). I don't maintain them here because I would prefer to only maintain one copy. This is better for everybody, since the responses are much more likely to be up to date!
412
 
413
+ = Twitter's Application creation process is very difficult. Why do I have to do this? =
414
+
415
+ WP to Twitter has always followed the principle that you are the owner of your own application. Many other applications require you to pass your data through a 3rd party that you authenticate to post to Twitter. Twitter has gradually made the process to create a new application more and more difficult. There is nothing I can do about that.
416
+
417
  = How can I help you make WP to Twitter a better plug-in? =
418
 
419
  Writing and maintaining a plug-in is a lot of work. You can help me by providing detailed support requests (which saves me time), or by providing financial support, either via my [plug-in donations page](https://www.joedolson.com/donate/) or by [upgrading to WP Tweets Pro](http://www.wptweetspro.com/wp-tweets-pro). Believe me, your donation really makes a difference!
wp-to-twitter-oauth.php CHANGED
@@ -259,20 +259,23 @@ function wtt_connect_oauth( $auth = false ) {
259
  <div class="notes">
260
  <h4>' . __( 'WP to Twitter Set-up', 'wp-to-twitter' ) . '</h4>
261
  </div>
262
- <h4>' . __( '1. Register this site as an application on ', 'wp-to-twitter' ) . '<a href="https://apps.twitter.com/app/new/">' . __( 'Twitter\'s application registration page', 'wp-to-twitter' ) . '</a></h4>
263
- <ul>
 
264
  <li>' . __( 'If you\'re not currently logged in to Twitter, log-in to the account you want associated with this site', 'wp-to-twitter' ) . '</li>
265
- <li>' . __( 'Your application name cannot include the word "Twitter."', 'wp-to-twitter' ) . '</li>
266
  <li>' . __( 'Your Application Description can be anything.', 'wp-to-twitter' ) . '</li>
267
- <li>' . __( 'The WebSite and Callback URL should be ', 'wp-to-twitter' ) . '<strong>' . esc_url( home_url() ) . '</strong></li>
 
 
268
  </ul>
269
- <p><em>' . __( 'Agree to the Twitter Developer Agreement and continue.', 'wp-to-twitter' ) . '</em></p>
270
- <h4>' . __( '2. Switch to the "Permissions" tab in Twitter apps', 'wp-to-twitter' ) . '</h4>
271
  <ul>
272
- <li>' . __( 'Select "Read and Write" for the Application Type', 'wp-to-twitter' ) . '</li>
273
- <li>' . __( 'Update the application settings', 'wp-to-twitter' ) . '</li>
274
  </ul>
275
- <h4>' . __( '3. Switch to the Keys and Access Tokens tab and regenerate your consumer key and secret, then create your access token.', 'wp-to-twitter' ) . '</h4>
276
  <ul>
277
  <li>' . __( 'Copy your API key and API secret from the "Application Settings" section.', 'wp-to-twitter' ) . '</li>
278
  <li>' . __( 'Copy your Access token and Access token secret from the "Your Access Token" section.', 'wp-to-twitter' ) . '</li>
@@ -290,7 +293,7 @@ function wtt_connect_oauth( $auth = false ) {
290
  </p>
291
  </div>
292
  <h4>' . __( '4. Copy and paste your Access Token and Access Token Secret into the fields below', 'wp-to-twitter' ) . '</h4>
293
- <p>' . __( 'If the Access Level for your Access Token is not "<em>Read and write</em>", you must return to step 2 and generate a new Access Token.', 'wp-to-twitter' ) . '</p>
294
  <div class="tokens">
295
  <p>
296
  <label for="wtt_oauth_token">' . __( 'Access Token', 'wp-to-twitter' ) . '</label>
259
  <div class="notes">
260
  <h4>' . __( 'WP to Twitter Set-up', 'wp-to-twitter' ) . '</h4>
261
  </div>
262
+ <h4>' . __( '1. Apply for a Developer Account with Twitter at <a href="https://developer.twitter.com/">Twitter</a>', 'wp-to-twitter' ) . '</h4>
263
+ <h4>' . __( '2. Register this site as an application on ', 'wp-to-twitter' ) . '<a href="https://developer.twitter.com/en/apps">' . __( 'Twitter\'s application registration page', 'wp-to-twitter' ) . '</a></h4>
264
+ <ul class="wpt-bullets">
265
  <li>' . __( 'If you\'re not currently logged in to Twitter, log-in to the account you want associated with this site', 'wp-to-twitter' ) . '</li>
266
+ <li>' . __( 'Your app name cannot include the word "Twitter."', 'wp-to-twitter' ) . '</li>
267
  <li>' . __( 'Your Application Description can be anything.', 'wp-to-twitter' ) . '</li>
268
+ <li>' . __( 'The WebSite and Callback URL should be: ', 'wp-to-twitter' ) . '<strong>' . esc_url( home_url() ) . '</strong></li>
269
+ <li>' . __( 'For this app, you do not need any other URL fields.', 'wp-to-twitter' ) . '</li>
270
+ <li>' . __( 'Describe how the app will be used. E.g. "This app will be used to send notifications about new WordPress posts or other types of WordPress content to Twitter on or after publication."' ) . '</li>
271
  </ul>
272
+ <p><em>' . __( 'Read the Twitter Developer Agreement and continue.', 'wp-to-twitter' ) . '</em></p>
273
+ <h4>' . __( '3. Switch to the "Permissions" tab in Twitter apps', 'wp-to-twitter' ) . '</h4>
274
  <ul>
275
+ <li>' . __( 'Select "Read and Write" for the Access Permission', 'wp-to-twitter' ) . '</li>
276
+ <li>' . __( 'Save the application settings', 'wp-to-twitter' ) . '</li>
277
  </ul>
278
+ <h4>' . __( '4. Switch to the Keys and Access Tokens tab and regenerate your consumer key and secret, then create your access token.', 'wp-to-twitter' ) . '</h4>
279
  <ul>
280
  <li>' . __( 'Copy your API key and API secret from the "Application Settings" section.', 'wp-to-twitter' ) . '</li>
281
  <li>' . __( 'Copy your Access token and Access token secret from the "Your Access Token" section.', 'wp-to-twitter' ) . '</li>
293
  </p>
294
  </div>
295
  <h4>' . __( '4. Copy and paste your Access Token and Access Token Secret into the fields below', 'wp-to-twitter' ) . '</h4>
296
+ <p>' . __( 'If the Access Level for your Access Token is not "<em>Read and write</em>", you must return to step 3, set your permissions correctly, and generate a new Access Token.', 'wp-to-twitter' ) . '</p>
297
  <div class="tokens">
298
  <p>
299
  <label for="wtt_oauth_token">' . __( 'Access Token', 'wp-to-twitter' ) . '</label>
wp-to-twitter.php CHANGED
@@ -17,7 +17,7 @@
17
  * License: GPL-2.0+
18
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
19
  * Domain Path: lang
20
- * Version: 3.3.8
21
  */
22
 
23
  /*
@@ -57,7 +57,7 @@ require_once( plugin_dir_path( __FILE__ ) . 'wpt-widget.php' );
57
  require_once( plugin_dir_path( __FILE__ ) . 'wpt-rate-limiting.php' );
58
 
59
  global $wpt_version;
60
- $wpt_version = '3.3.8';
61
 
62
  add_action( 'init', 'wpt_load_textdomain' );
63
  /**
@@ -385,9 +385,16 @@ function wpt_post_to_twitter( $twit, $auth = false, $id = false, $media = false
385
  $http_code = 200;
386
  $notice = __( 'In Staging Mode:', 'wp-to-twitter' ) . ' ';
387
  } else {
388
- $connection->post( $api, $status );
389
- $http_code = ( $connection ) ? $connection->http_code : 'failed';
390
- $notice = '';
 
 
 
 
 
 
 
391
  }
392
  }
393
  wpt_mail( 'Twitter Connection', print_r( $connection, 1 ) . " - $twit, $auth, $id, $media", $id );
@@ -400,6 +407,9 @@ function wpt_post_to_twitter( $twit, $auth = false, $id = false, $media = false
400
  }
401
  $return = false;
402
  switch ( $http_code ) {
 
 
 
403
  case '100':
404
  $error = __( '100 Continue: Twitter received the header of your submission, but your server did not follow through by sending the body of the data.', 'wp-to-twitter' );
405
  break;
17
  * License: GPL-2.0+
18
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
19
  * Domain Path: lang
20
+ * Version: 3.3.9
21
  */
22
 
23
  /*
57
  require_once( plugin_dir_path( __FILE__ ) . 'wpt-rate-limiting.php' );
58
 
59
  global $wpt_version;
60
+ $wpt_version = '3.3.9';
61
 
62
  add_action( 'init', 'wpt_load_textdomain' );
63
  /**
385
  $http_code = 200;
386
  $notice = __( 'In Staging Mode:', 'wp-to-twitter' ) . ' ';
387
  } else {
388
+ // Cancel this Tweet for your own custom reasons.
389
+ $do_tweet = apply_filters( 'wpt_do_tweet', true, $auth, $id );
390
+ if ( $do_tweet ) {
391
+ $connection->post( $api, $status );
392
+ $http_code = ( $connection ) ? $connection->http_code : 'failed';
393
+ $notice = '';
394
+ } else {
395
+ $http_code = '000';
396
+ $notice = __( 'Tweet Canceled by custom filter.', 'wp-to-twitter' );
397
+ }
398
  }
399
  }
400
  wpt_mail( 'Twitter Connection', print_r( $connection, 1 ) . " - $twit, $auth, $id, $media", $id );
407
  }
408
  $return = false;
409
  switch ( $http_code ) {
410
+ case '000':
411
+ $error = '';
412
+ break;
413
  case '100':
414
  $error = __( '100 Continue: Twitter received the header of your submission, but your server did not follow through by sending the body of the data.', 'wp-to-twitter' );
415
  break;
wpt-rate-limiting.php CHANGED
@@ -231,6 +231,7 @@ function wpt_view_rate_limits() {
231
  } else {
232
  $output = __( 'No Tweets have been sent this hour.', 'wp-to-twitter' );
233
  }
 
234
  $next = wpautop( sprintf( __( ' Next reset in %s.', 'wp-to-twitter' ), $next_scheduled ) );
235
 
236
  return $output . $next;
231
  } else {
232
  $output = __( 'No Tweets have been sent this hour.', 'wp-to-twitter' );
233
  }
234
+ // Translators: Time until next scheduled rate limiting reset.
235
  $next = wpautop( sprintf( __( ' Next reset in %s.', 'wp-to-twitter' ), $next_scheduled ) );
236
 
237
  return $output . $next;