Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

Commit b351bb2

Browse files
Merge pull request #41 from twitter/conversation-option-fix
Fix Tweet conversation option and add support for Wordpress 5.2
2 parents 5b7e8bc + 53b1482 commit b351bb2

File tree

10 files changed

+24
-21
lines changed

10 files changed

+24
-21
lines changed

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ php:
1717
- 7.0
1818
# aliased to a recent 5.6.x version
1919
- 5.6
20-
# aliased to a recent 5.5.x version
21-
- 5.5
22-
# aliased to a recent 5.4.x version
23-
- 5.4
2420

2521
# WordPress comes from the Git mirror, where 'master' mirrors svn 'trunk' and
2622
# x.y mirrors the latest from the x.y branch
2723
env:
24+
# WordPress 5.2
25+
- WP_VERSION=5.2
2826
# WordPress 5.1
2927
- WP_VERSION=5.1
3028
# WordPress 5.0

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
The Twitter plugin for WordPress optimizes your website for a Twitter audience through easy to use sharing buttons, embedded Tweets, embedded timelines, auto-generated markup indexed by Twitter, and Follow buttons to help grow your Twitter audience. All features are deeply integrated with WordPress APIs to make building your webpages and administrative features as easy as possible with the extensibility you expect from WordPress.
44

5-
The Twitter plugin for WordPress requires PHP 5.4 or greater to take advantage of [traits](http://php.net/manual/language.oop5.traits.php), [late static bindings](http://php.net/manual/language.oop5.late-static-bindings.php) for extensibility, [namespaces](http://php.net/manual/language.namespaces.rationale.php), and Twitter libraries. Embedded Tweets require a server capable of communicating with Twitter's servers over TLS/SSL; the [cURL library](http://php.net/manual/book.curl.php) typically works best.
5+
The Twitter plugin for WordPress requires PHP 5.6 or greater to take advantage of [traits](http://php.net/manual/language.oop5.traits.php), [late static bindings](http://php.net/manual/language.oop5.late-static-bindings.php) for extensibility, [namespaces](http://php.net/manual/language.namespaces.rationale.php), and Twitter libraries. Embedded Tweets require a server capable of communicating with Twitter's servers over TLS/SSL; the [cURL library](http://php.net/manual/book.curl.php) typically works best.
66

7-
Current version: `2.0.4`
7+
Current version: `2.0.5`
88

99
[![Build Status](https://travis-ci.org/twitter/wordpress.svg)](https://travis-ci.org/twitter/wordpress)
1010

compatibility-notice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Twitter_CompatibilityNotice {
3838
*
3939
* @type string
4040
*/
41-
const MIN_PHP_VERSION = '5.4';
41+
const MIN_PHP_VERSION = '5.6';
4242

4343
/**
4444
* Release dates of PHP versions greater than the WordPress minimum requirement and less than the plugin minimum requirement

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"keywords": ["twitter","wordpress","plugin"],
88
"require": {
9-
"php": ">=5.4.0"
9+
"php": ">=5.6.0"
1010
},
1111
"authors": [
1212
{

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<testsuites>
1010
<!-- Default test suite to run all tests -->
1111
<testsuite>
12-
<directory phpVersion="5.4.0" suffix=".php">tests/phpunit</directory>
12+
<directory phpVersion="5.6.0" suffix=".php">tests/phpunit</directory>
1313
</testsuite>
1414
</testsuites>
1515
</phpunit>

readme.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
Contributors: Twitter, niallkennedy, sobkowicz
33
Tags: twitter, embedded tweet, embedded timeline, twitter profile, twitter list, twitter moment, twitter video, periscope, twitter cards, tweet button, follow button, twitter analytics, twitter ads
44
Requires at least: 4.7
5-
Tested up to: 5.1
6-
Stable tag: 2.0.4
5+
Tested up to: 5.2
6+
Stable tag: 2.0.5
77
License: MIT
88
License URI: https://opensource.org/licenses/MIT
99

10-
Official Twitter and Periscope plugin for WordPress. Embed content and grow your audience. Requires PHP 5.4 or greater.
10+
Official Twitter and Periscope plugin for WordPress. Embed content and grow your audience. Requires PHP 5.6 or greater.
1111

1212
== Description ==
1313

1414
Embed Twitter content, improve sharing on Twitter, convert your web audience into Twitter or Periscope subscribers, and easily track visits to your website from Twitter advertising.
1515

16-
Requires PHP version 5.4 or greater.
16+
Requires PHP version 5.6 or greater.
1717

1818
= Embed Twitter content =
1919
Embed Twitter content by pasting a URL, customizing a shortcode, or in a widget area.
@@ -69,6 +69,10 @@ Shortcode improvements for ajax-loaded posts. Remove photo, gallery, and product
6969
Display admin notice if current PHP version does not meet minimum requirements. Do not display Tweet button in auto-generated excerpt.
7070

7171
== Changelog ==
72+
= 2.0.5 =
73+
* Add support for WordPress 5.2
74+
* Fix conversation option to properly set hide_thread oEmbed param
75+
7276
= 2.0.4 =
7377
* Add support for WordPress 5.1
7478
* Remove documentation on video widget, grid widget, and search timeline widget which have been deprecated.

src/Twitter/Widgets/Embeds/Tweet.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ public static function fromArray($options)
265265
if (isset($options['cards']) && ( false === $options['cards'] || 'false' === $options['cards'] || 0 == $options['cards'] )) {
266266
$tweet->hideCards();
267267
}
268+
268269
if (isset($options['conversation']) && ( false === $options['conversation'] || 'false' === $options['conversation'] || 0 == $options['conversation'] )) {
269270
$tweet->hideParentTweet();
270271
}
@@ -333,7 +334,7 @@ public function toOEmbedParameterArray()
333334
$oembed['hide_media'] = false;
334335
}
335336
if (false === $this->conversation) {
336-
$oembed['hide_thread'] = false;
337+
$oembed['hide_thread'] = true;
337338
}
338339
if (static::ALIGN_NONE !== $this->align) {
339340
$oembed['align'] = $this->align;

src/Twitter/WordPress/PluginLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class PluginLoader
4141
*
4242
* @type string
4343
*/
44-
const VERSION = '2.0.4';
44+
const VERSION = '2.0.5';
4545

4646
/**
4747
* Unique domain of the plugin's translated text

tests/phpunit/Widgets/Embeds/Tweet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public function testToOEmbedParameterArray()
310310
$this->assertArrayHasKey('hide_media', $parameters, 'Cards override not returned');
311311
$this->assertFalse($parameters['hide_media'], 'Failed to return false bool for cards override');
312312
$this->assertArrayHasKey('hide_thread', $parameters, 'Parent Tweet override not returned');
313-
$this->assertFalse($parameters['hide_thread'], 'Failed to return false bool for conversation override');
313+
$this->assertTrue($parameters['hide_thread'], 'Failed to return true bool for conversation override');
314314
$this->assertArrayHasKey('align', $parameters, 'Align value not returned');
315315
$this->assertEquals(\Twitter\Widgets\Embeds\Tweet::ALIGN_LEFT, $parameters['align'], 'Align value not returned as expected');
316316
$this->assertArrayHasKey('theme', $parameters, 'Theme value not returned');

twitter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
*/
2525
/**
2626
* @package twitter
27-
* @version 2.0.4
27+
* @version 2.0.5
2828
*/
2929
/*
3030
Plugin Name: Twitter
3131
Plugin URI: https://wordpress.org/plugins/twitter/
32-
Description: Official Twitter plugin for WordPress. Embed Twitter content and grow your audience on Twitter. Requires PHP 5.4 or greater.
33-
Version: 2.0.4
32+
Description: Official Twitter plugin for WordPress. Embed Twitter content and grow your audience on Twitter. Requires PHP 5.6 or greater.
33+
Version: 2.0.5
3434
Author: Twitter
3535
Author URI: https://dev.twitter.com/
3636
License: MIT
@@ -49,8 +49,8 @@
4949
exit( 'Hi there! I am a WordPress plugin requiring functions included with WordPress. I am not meant to be addressed directly.' );
5050
}
5151

52-
// plugin requires PHP 5.4 or greater
53-
if ( version_compare( PHP_VERSION, '5.4.0', '<' ) ) {
52+
// plugin requires PHP 5.6 or greater
53+
if ( version_compare( PHP_VERSION, '5.6.0', '<' ) ) {
5454
if ( ! class_exists( 'Twitter_CompatibilityNotice' ) ) {
5555
require_once( dirname( __FILE__ ) . '/compatibility-notice.php' );
5656
}

0 commit comments

Comments
 (0)