Version Description
- Change: Twitter app setup instructions updated.
- Removed: URL data migration. Any data that needs migrating should be long completed.
Download this release
Release Info
Developer | joedolson |
Plugin | WP to Twitter |
Version | 3.5.5 |
Comparing to | |
See all releases |
Code changes from version 3.5.4 to 3.5.5
- readme.txt +6 -1
- wp-to-twitter-oauth.php +20 -20
- wp-to-twitter.php +4 -4
- wpt-functions.php +1 -66
readme.txt
CHANGED
@@ -7,7 +7,7 @@ Tested up to: 5.8
|
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
Text Domain: wp-to-twitter
|
10 |
-
Stable tag: 3.5.
|
11 |
|
12 |
Posts a Twitter update when you update your WordPress blog or add a link, with your chosen URL shortening service.
|
13 |
|
@@ -64,6 +64,11 @@ Check out my <a href="https://github.com/joedolson/plugin-extensions/tree/master
|
|
64 |
|
65 |
== Changelog ==
|
66 |
|
|
|
|
|
|
|
|
|
|
|
67 |
= 3.5.4 =
|
68 |
|
69 |
* Change: Twitter help/configuration endpoint retired. Values changed to static.
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
Text Domain: wp-to-twitter
|
10 |
+
Stable tag: 3.5.5
|
11 |
|
12 |
Posts a Twitter update when you update your WordPress blog or add a link, with your chosen URL shortening service.
|
13 |
|
64 |
|
65 |
== Changelog ==
|
66 |
|
67 |
+
= 3.5.5 =
|
68 |
+
|
69 |
+
* Change: Twitter app setup instructions updated.
|
70 |
+
* Removed: URL data migration. Any data that needs migrating should be long completed.
|
71 |
+
|
72 |
= 3.5.4 =
|
73 |
|
74 |
* Change: Twitter help/configuration endpoint retired. Values changed to static.
|
wp-to-twitter-oauth.php
CHANGED
@@ -276,25 +276,17 @@ function wtt_connect_oauth( $auth = false ) {
|
|
276 |
<h3><span>' . __( 'Connect to Twitter', 'wp-to-twitter' ) . '</span></h3>
|
277 |
<div class="inside ' . $class . '">
|
278 |
<ol class="wpt-oauth-settings">
|
279 |
-
<li>' . __( 'Apply for a <a href="https://developer.twitter.com/en/apply-for-access">Developer Account with Twitter</a>', 'wp-to-twitter' ) . '
|
280 |
-
|
|
|
|
|
|
|
281 |
<ul>
|
282 |
-
<li>' . __( '
|
283 |
-
<li>' . __( '
|
284 |
-
<li>' . __( 'Your Application Description can be anything.', 'wp-to-twitter' ) . '</li>
|
285 |
</ul>
|
286 |
</li>
|
287 |
-
<li>' . __( '
|
288 |
-
<ul>
|
289 |
-
<li>' . __( 'Edit, and select "Read and Write" for your app\'s Access Permissions', 'wp-to-twitter' ) . '</li>
|
290 |
-
<li>' . __( 'Save the application settings', 'wp-to-twitter' ) . '</li>
|
291 |
-
</ul>
|
292 |
-
</li>
|
293 |
-
<li>' . __( 'Switch to the Keys and Tokens tab at the top of the screen.', 'wp-to-twitter' ) . '
|
294 |
-
<ul>
|
295 |
-
<li>' . __( 'Regenerate your API key and secret from the "Consumer Keys" section.', 'wp-to-twitter' ) . '</li>
|
296 |
-
</ul>
|
297 |
-
|
298 |
' . $form . '
|
299 |
<div class="tokens">
|
300 |
<p>
|
@@ -302,14 +294,22 @@ function wtt_connect_oauth( $auth = false ) {
|
|
302 |
<input type="text" size="45" name="wtt_app_consumer_key" id="wtt_app_consumer_key" value="' . esc_attr( wpt_mask_attr( $ack ) ) . '" />
|
303 |
</p>
|
304 |
<p>
|
305 |
-
<label for="wtt_app_consumer_secret">' . __( 'API Secret', 'wp-to-twitter' ) . '</label>
|
306 |
<input type="text" size="45" name="wtt_app_consumer_secret" id="wtt_app_consumer_secret" value="' . esc_attr( wpt_mask_attr( $acs ) ) . '" />
|
307 |
</p>
|
308 |
</div>
|
309 |
</li>
|
310 |
-
<li>' . __( '
|
311 |
-
<li>' . __( '
|
312 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
<div class="tokens">
|
314 |
<p>
|
315 |
<label for="wtt_oauth_token">' . __( 'Access Token', 'wp-to-twitter' ) . '</label>
|
276 |
<h3><span>' . __( 'Connect to Twitter', 'wp-to-twitter' ) . '</span></h3>
|
277 |
<div class="inside ' . $class . '">
|
278 |
<ol class="wpt-oauth-settings">
|
279 |
+
<li>' . __( 'Apply for a <a href="https://developer.twitter.com/en/apply-for-access">Developer Account with Twitter</a>', 'wp-to-twitter' ) . '<ul>
|
280 |
+
<li><a href="https://developer.twitter.com/en/developer-terms/policy">' . __( 'Review the Terms of Service for use of the Twitter API', 'wp-to-twitter' ) . '</a></li>
|
281 |
+
<li>' . __( 'If your app is suspended by Twitter, contact <a href="https://help.twitter.com/forms/platform">their API Policy Support</a>.', 'wp-to-twitter' ) . '</li>
|
282 |
+
</ul></li>
|
283 |
+
<li>' . __( 'Add a new application in <a href="https://developer.twitter.com/en/portal/apps/new">Twitter\'s project and app portal</a>', 'wp-to-twitter' ) . '
|
284 |
<ul>
|
285 |
+
<li>' . __( 'Name your application.', 'wp-to-twitter' ) . '(' . __( 'Your app name cannot include the word "Twitter."', 'wp-to-twitter' ) . ')</li>
|
286 |
+
<li>' . __( 'Click "Next" to move to the Keys & Tokens step.', 'wp-to-twitter' ) . '</li>
|
|
|
287 |
</ul>
|
288 |
</li>
|
289 |
+
<li>' . __( 'Copy your API Key and API Key secret.', 'wp-to-twitter' ) . '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
' . $form . '
|
291 |
<div class="tokens">
|
292 |
<p>
|
294 |
<input type="text" size="45" name="wtt_app_consumer_key" id="wtt_app_consumer_key" value="' . esc_attr( wpt_mask_attr( $ack ) ) . '" />
|
295 |
</p>
|
296 |
<p>
|
297 |
+
<label for="wtt_app_consumer_secret">' . __( 'API Key Secret', 'wp-to-twitter' ) . '</label>
|
298 |
<input type="text" size="45" name="wtt_app_consumer_secret" id="wtt_app_consumer_secret" value="' . esc_attr( wpt_mask_attr( $acs ) ) . '" />
|
299 |
</p>
|
300 |
</div>
|
301 |
</li>
|
302 |
+
<li>' . __( 'Click "App Settings" to configure your app', 'wp-to-twitter' ) . '</li>
|
303 |
+
<li>' . __( 'Click "Set up" to configure User authentication settings', 'wp-to-twitter' ) . '</li>
|
304 |
+
<li>' . __( 'Enable OAuth 1.0a', 'wp-to-twitter' ) . '</li>
|
305 |
+
<li>' . __( 'Set "App Permissions" to "Read and write".', 'wp-to-twitter' ) . '</li>' .
|
306 |
+
// Translators: Site URL.
|
307 |
+
'<li>' . sprintf( __( 'Add your website as the Website URL and the Callback URI: %s', 'wp-to-twitter' ), '<code>' . home_url() . '</code>' ) . '</li>
|
308 |
+
<li>' . __( 'Click "Save" to save settings.', 'wp-to-twitter' ) . '</li>
|
309 |
+
<li>' . __( 'Click "Edit" at top of Settings screen to edit your App', 'wp-to-twitter' ) . '</li>
|
310 |
+
<li>' . __( 'Change to the "Keys and Tokens" tab', 'wp-to-twitter' ) . '</li>
|
311 |
+
<li>' . __( 'Generate your Access Token and Secret from the "Authentication Tokens" section.', 'wp-to-twitter' ) . '</li>
|
312 |
+
<li>' . __( 'Paste your Access Token and Secret into the fields below', 'wp-to-twitter' ) . ' (' . __( 'If the Access Level for your Access Token is not "<em>Read and write</em>", return to step 7, change your permissions, and generate new Tokens.', 'wp-to-twitter' ) . ')
|
313 |
<div class="tokens">
|
314 |
<p>
|
315 |
<label for="wtt_oauth_token">' . __( 'Access Token', 'wp-to-twitter' ) . '</label>
|
wp-to-twitter.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @package WP to Twitter
|
6 |
* @author Joe Dolson
|
7 |
-
* @copyright 2008-
|
8 |
* @license GPL-2.0+
|
9 |
*
|
10 |
* @wordpress-plugin
|
@@ -17,11 +17,11 @@
|
|
17 |
* License: GPL-2.0+
|
18 |
* License URI: http://www.gnu.org/license/gpl-2.0.txt
|
19 |
* Domain Path: lang
|
20 |
-
* Version: 3.5.
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
-
Copyright 2008-
|
25 |
|
26 |
This program is free software; you can redistribute it and/or modify
|
27 |
it under the terms of the GNU General Public License as published by
|
@@ -64,7 +64,7 @@ require_once( plugin_dir_path( __FILE__ ) . 'wpt-widget.php' );
|
|
64 |
require_once( plugin_dir_path( __FILE__ ) . 'wpt-rate-limiting.php' );
|
65 |
|
66 |
global $wpt_version;
|
67 |
-
$wpt_version = '3.5.
|
68 |
|
69 |
add_action( 'init', 'wpt_load_textdomain' );
|
70 |
/**
|
4 |
*
|
5 |
* @package WP to Twitter
|
6 |
* @author Joe Dolson
|
7 |
+
* @copyright 2008-2022 Joe Dolson
|
8 |
* @license GPL-2.0+
|
9 |
*
|
10 |
* @wordpress-plugin
|
17 |
* License: GPL-2.0+
|
18 |
* License URI: http://www.gnu.org/license/gpl-2.0.txt
|
19 |
* Domain Path: lang
|
20 |
+
* Version: 3.5.5
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
+
Copyright 2008-2022 Joe Dolson (email : joe@joedolson.com)
|
25 |
|
26 |
This program is free software; you can redistribute it and/or modify
|
27 |
it under the terms of the GNU General Public License as published by
|
64 |
require_once( plugin_dir_path( __FILE__ ) . 'wpt-rate-limiting.php' );
|
65 |
|
66 |
global $wpt_version;
|
67 |
+
$wpt_version = '3.5.5';
|
68 |
|
69 |
add_action( 'init', 'wpt_load_textdomain' );
|
70 |
/**
|
wpt-functions.php
CHANGED
@@ -579,7 +579,7 @@ function wpt_post_attachment( $post_ID ) {
|
|
579 |
$args = array(
|
580 |
'post_type' => 'attachment',
|
581 |
'numberposts' => 1,
|
582 |
-
'post_status' => '
|
583 |
'post_parent' => $post_ID,
|
584 |
'post_mime_type' => 'image',
|
585 |
'order' => 'ASC',
|
@@ -783,71 +783,6 @@ function wpt_is_writable( $file ) {
|
|
783 |
return $is_writable;
|
784 |
}
|
785 |
|
786 |
-
add_action( 'load-post.php', 'wpt_migrate_url_meta' );
|
787 |
-
/**
|
788 |
-
* Migrates post meta to new format when post is called in editor.
|
789 |
-
*
|
790 |
-
* Migration started 12/10/2015. This can probably be removed soon.
|
791 |
-
*/
|
792 |
-
function wpt_migrate_url_meta() {
|
793 |
-
$post_id = isset( $_GET['post'] ) ? intval( $_GET['post'] ) : false;
|
794 |
-
if ( ! $post_id ) {
|
795 |
-
// if this is a new post screen, no migration.
|
796 |
-
return;
|
797 |
-
}
|
798 |
-
|
799 |
-
$post = get_post( $post_id );
|
800 |
-
if ( ! $post || strtotime( $post->post_date ) > 1449764285 ) {
|
801 |
-
// if this post was added after the migration function was added, it will not need to be migrated. Guaranteed.
|
802 |
-
return;
|
803 |
-
}
|
804 |
-
|
805 |
-
$short = wpt_short_url( $post_id );
|
806 |
-
if ( false !== $short ) {
|
807 |
-
return;
|
808 |
-
}
|
809 |
-
if ( false === $short ) {
|
810 |
-
$short = get_post_meta( $post_id, '_wp_jd_goo', true );
|
811 |
-
delete_post_meta( $post_id, '_wp_jd_goo' );
|
812 |
-
}
|
813 |
-
if ( false === $short || '' === $short ) {
|
814 |
-
$short = get_post_meta( $post_id, '_wp_jd_supr', true );
|
815 |
-
delete_post_meta( $post_id, '_wp_jd_supr' );
|
816 |
-
}
|
817 |
-
if ( false === $short || '' === $short ) {
|
818 |
-
$short = get_post_meta( $post_id, '_wp_jd_wp', true );
|
819 |
-
delete_post_meta( $post_id, '_wp_jd_wp' );
|
820 |
-
}
|
821 |
-
if ( false === $short || '' === $short ) {
|
822 |
-
$short = get_post_meta( $post_id, '_wp_jd_ind', true );
|
823 |
-
delete_post_meta( $post_id, '_wp_jd_ind' );
|
824 |
-
}
|
825 |
-
if ( false === $short || '' === $short ) {
|
826 |
-
$short = get_post_meta( $post_id, '_wp_jd_yourls', true );
|
827 |
-
delete_post_meta( $post_id, '_wp_jd_yourls' );
|
828 |
-
}
|
829 |
-
if ( false === $short || '' === $short ) {
|
830 |
-
$short = get_post_meta( $post_id, '_wp_jd_url', true );
|
831 |
-
delete_post_meta( $post_id, '_wp_jd_url' );
|
832 |
-
}
|
833 |
-
if ( false === $short || '' === $short ) {
|
834 |
-
$short = get_post_meta( $post_id, '_wp_jd_joturl', true );
|
835 |
-
delete_post_meta( $post_id, '_wp_jd_joturl' );
|
836 |
-
}
|
837 |
-
if ( false === $short || '' === $short ) {
|
838 |
-
// don't delete target link.
|
839 |
-
$short = get_post_meta( $post_id, '_wp_jd_target', true );
|
840 |
-
}
|
841 |
-
if ( false === $short || '' === $short ) {
|
842 |
-
$short = get_post_meta( $post_id, '_wp_jd_clig', true );
|
843 |
-
delete_post_meta( $post_id, '_wp_jd_clig' );
|
844 |
-
}
|
845 |
-
|
846 |
-
if ( false !== $short && '' !== $short ) {
|
847 |
-
update_post_meta( $post_id, '_wpt_short_url', $short );
|
848 |
-
}
|
849 |
-
}
|
850 |
-
|
851 |
/**
|
852 |
* Make a curl query.
|
853 |
*
|
579 |
$args = array(
|
580 |
'post_type' => 'attachment',
|
581 |
'numberposts' => 1,
|
582 |
+
'post_status' => 'any',
|
583 |
'post_parent' => $post_ID,
|
584 |
'post_mime_type' => 'image',
|
585 |
'order' => 'ASC',
|
783 |
return $is_writable;
|
784 |
}
|
785 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
786 |
/**
|
787 |
* Make a curl query.
|
788 |
*
|