Version Description
- Bug fix: Incorrect variable type in default tab assignment.
- Bug fix: Two incorrectly named array keys in debugging.
- Bug fix: Shortened URLs shouldn't be called if using WP permalinks.
Download this release
Release Info
Developer | joedolson |
Plugin | WP to Twitter |
Version | 3.4.8 |
Comparing to | |
See all releases |
Code changes from version 3.4.7 to 3.4.8
- readme.txt +7 -1
- wp-to-twitter-manager.php +1 -1
- wp-to-twitter-shorteners.php +7 -3
- wp-to-twitter.php +4 -4
readme.txt
CHANGED
@@ -7,7 +7,7 @@ Tested up to: 5.4
|
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
Text Domain: wp-to-twitter
|
10 |
-
Stable tag: 3.4.
|
11 |
|
12 |
Posts a Twitter update when you update your WordPress blog or add a link, with your chosen URL shortening service.
|
13 |
|
@@ -63,6 +63,12 @@ Check out my <a href="https://github.com/joedolson/plugin-extensions/tree/master
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 3.4.7 =
|
67 |
|
68 |
* Bug fix: Changed rules for differentiating between new and edited posts.
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
Text Domain: wp-to-twitter
|
10 |
+
Stable tag: 3.4.8
|
11 |
|
12 |
Posts a Twitter update when you update your WordPress blog or add a link, with your chosen URL shortening service.
|
13 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 3.4.8 =
|
67 |
+
|
68 |
+
* Bug fix: Incorrect variable type in default tab assignment.
|
69 |
+
* Bug fix: Two incorrectly named array keys in debugging.
|
70 |
+
* Bug fix: Shortened URLs shouldn't be called if using WP permalinks.
|
71 |
+
|
72 |
= 3.4.7 =
|
73 |
|
74 |
* Bug fix: Changed rules for differentiating between new and edited posts.
|
wp-to-twitter-manager.php
CHANGED
@@ -217,7 +217,7 @@ function wpt_update_settings() {
|
|
217 |
<div class="metabox-holder">
|
218 |
|
219 |
<?php
|
220 |
-
$default = ( '' === get_option( 'wtt_twitter_username' ) ) ? 'connection' : 'basic';
|
221 |
$current = ( isset( $_GET['tab'] ) ) ? $_GET['tab'] : $default;
|
222 |
if ( 'connection' === $current ) {
|
223 |
if ( function_exists( 'wtt_connect_oauth' ) ) {
|
217 |
<div class="metabox-holder">
|
218 |
|
219 |
<?php
|
220 |
+
$default = ( '' === get_option( 'wtt_twitter_username', '' ) ) ? 'connection' : 'basic';
|
221 |
$current = ( isset( $_GET['tab'] ) ) ? $_GET['tab'] : $default;
|
222 |
if ( 'connection' === $current ) {
|
223 |
if ( function_exists( 'wtt_connect_oauth' ) ) {
|
wp-to-twitter-shorteners.php
CHANGED
@@ -31,9 +31,9 @@ if ( ! function_exists( 'wpt_shorten_url' ) ) {
|
|
31 |
function wpt_shorten_url( $url, $post_title, $post_ID, $testmode = false, $store_urls = true ) {
|
32 |
wpt_mail( 'Shortener running: initial link', "Url: $url, Title: $post_title, Post ID: $post_ID, Test mode: $testmode", $post_ID ); // DEBUG.
|
33 |
// filter link before sending to shortener or adding analytics.
|
34 |
-
$shortener = get_option( 'jd_shortener' );
|
35 |
-
// if the URL already exists, return it without processing.
|
36 |
-
if ( wpt_short_url( $post_ID ) && $store_urls ) {
|
37 |
$shrink = wpt_short_url( $post_ID );
|
38 |
|
39 |
return $shrink;
|
@@ -256,6 +256,10 @@ if ( ! function_exists( 'wpt_shorten_url' ) ) {
|
|
256 |
$store_urls = apply_filters( 'wpt_store_urls', true, $post_ID, $url );
|
257 |
if ( function_exists( 'wpt_shorten_url' ) && $store_urls ) {
|
258 |
$shortener = get_option( 'jd_shortener' );
|
|
|
|
|
|
|
|
|
259 |
if ( wpt_short_url( $post_ID ) !== $url && wpt_is_valid_url( $url ) ) {
|
260 |
update_post_meta( $post_ID, '_wpt_short_url', $url );
|
261 |
}
|
31 |
function wpt_shorten_url( $url, $post_title, $post_ID, $testmode = false, $store_urls = true ) {
|
32 |
wpt_mail( 'Shortener running: initial link', "Url: $url, Title: $post_title, Post ID: $post_ID, Test mode: $testmode", $post_ID ); // DEBUG.
|
33 |
// filter link before sending to shortener or adding analytics.
|
34 |
+
$shortener = (string) get_option( 'jd_shortener' );
|
35 |
+
// if the URL already exists & a shortener is enabled, return it without processing.
|
36 |
+
if ( '3' === $shortener && wpt_short_url( $post_ID ) && $store_urls ) {
|
37 |
$shrink = wpt_short_url( $post_ID );
|
38 |
|
39 |
return $shrink;
|
256 |
$store_urls = apply_filters( 'wpt_store_urls', true, $post_ID, $url );
|
257 |
if ( function_exists( 'wpt_shorten_url' ) && $store_urls ) {
|
258 |
$shortener = get_option( 'jd_shortener' );
|
259 |
+
// Don't store URLs if the not shortening is selected.
|
260 |
+
if ( '3' === $shortener ) {
|
261 |
+
return void;
|
262 |
+
}
|
263 |
if ( wpt_short_url( $post_ID ) !== $url && wpt_is_valid_url( $url ) ) {
|
264 |
update_post_meta( $post_ID, '_wpt_short_url', $url );
|
265 |
}
|
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.4.
|
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.4.
|
61 |
|
62 |
add_action( 'init', 'wpt_load_textdomain' );
|
63 |
/**
|
@@ -812,13 +812,13 @@ function wpt_tweet( $post_ID, $type = 'instant' ) {
|
|
812 |
return false;
|
813 |
}
|
814 |
}
|
815 |
-
wpt_mail( '4b: Post action is edit', 'This event was a post edit action, not a post publication.' . "\n" . 'Modified Date: ' . $post_info['
|
816 |
if ( '1' === (string) $post_type_settings[ $post_type ]['post-edited-update'] ) {
|
817 |
$nptext = stripcslashes( $post_type_settings[ $post_type ]['post-edited-text'] );
|
818 |
$oldpost = true;
|
819 |
}
|
820 |
} else {
|
821 |
-
wpt_mail( '4c: Post action is publish', 'This event was a post publish action.' . "\n" . 'Modified Date: ' . $post_info['
|
822 |
if ( '1' === (string) $post_type_settings[ $post_type ]['post-published-update'] ) {
|
823 |
$nptext = stripcslashes( $post_type_settings[ $post_type ]['post-published-text'] );
|
824 |
$newpost = true;
|
17 |
* License: GPL-2.0+
|
18 |
* License URI: http://www.gnu.org/license/gpl-2.0.txt
|
19 |
* Domain Path: lang
|
20 |
+
* Version: 3.4.8
|
21 |
*/
|
22 |
|
23 |
/*
|
57 |
require_once( plugin_dir_path( __FILE__ ) . 'wpt-rate-limiting.php' );
|
58 |
|
59 |
global $wpt_version;
|
60 |
+
$wpt_version = '3.4.8';
|
61 |
|
62 |
add_action( 'init', 'wpt_load_textdomain' );
|
63 |
/**
|
812 |
return false;
|
813 |
}
|
814 |
}
|
815 |
+
wpt_mail( '4b: Post action is edit', 'This event was a post edit action, not a post publication.' . "\n" . 'Modified Date: ' . $post_info['postModified'] . "\n\n" . 'Publication date:' . $post_info['postDate'], $post_ID ); // DEBUG.
|
816 |
if ( '1' === (string) $post_type_settings[ $post_type ]['post-edited-update'] ) {
|
817 |
$nptext = stripcslashes( $post_type_settings[ $post_type ]['post-edited-text'] );
|
818 |
$oldpost = true;
|
819 |
}
|
820 |
} else {
|
821 |
+
wpt_mail( '4c: Post action is publish', 'This event was a post publish action.' . "\n" . 'Modified Date: ' . $post_info['postModified'] . "\n\n" . 'Publication date:' . $post_info['postDate'], $post_ID ); // DEBUG.
|
822 |
if ( '1' === (string) $post_type_settings[ $post_type ]['post-published-update'] ) {
|
823 |
$nptext = stripcslashes( $post_type_settings[ $post_type ]['post-published-text'] );
|
824 |
$newpost = true;
|