WP Social Bookmarking Light - Version 2.0.2

Version Description

  • Added: iframe option to twitter #52
Download this release

Release Info

Developer utahvich
Plugin Icon wp plugin WP Social Bookmarking Light
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://gumroad.com/l/rWLrL
4
  Tags: social, bookmarks, bookmarking, Hatena, Twitter, Facebook, Tumblr, Google Bookmark, Delicious, Digg, reddit, LinkedIn, Instapaper, StumbleUpon, mixi, gree, atode, toread, line, pocket, Pinterest
5
  Requires at least: 4.0.0
6
  Tested up to: 4.7
7
- Stable tag: 2.0.1
8
 
9
  This plugin inserts social share links at the top or bottom of each post.
10
 
@@ -49,6 +49,9 @@ This is the list of used social sites:
49
 
50
  == Changelog ==
51
 
 
 
 
52
  = 2.0.1 =
53
  * Fixed: for PHP 5.3 [#50](https://github.com/utahta/WP-Social-Bookmarking-Light/pull/50)
54
  * Note: We don't intend to actively support on PHP 5.5 or lower, but if you get some problems, please report it. We will fix it.
4
  Tags: social, bookmarks, bookmarking, Hatena, Twitter, Facebook, Tumblr, Google Bookmark, Delicious, Digg, reddit, LinkedIn, Instapaper, StumbleUpon, mixi, gree, atode, toread, line, pocket, Pinterest
5
  Requires at least: 4.0.0
6
  Tested up to: 4.7
7
+ Stable tag: 2.0.2
8
 
9
  This plugin inserts social share links at the top or bottom of each post.
10
 
49
 
50
  == Changelog ==
51
 
52
+ = 2.0.2 =
53
+ * Added: iframe option to twitter [#52](https://github.com/utahta/WP-Social-Bookmarking-Light/pull/52)
54
+
55
  = 2.0.1 =
56
  * Fixed: for PHP 5.3 [#50](https://github.com/utahta/WP-Social-Bookmarking-Light/pull/50)
57
  * Note: We don't intend to actively support on PHP 5.5 or lower, but if you get some problems, please report it. We will fix it.
src/WpSocialBookmarkingLight/Option.php CHANGED
@@ -78,6 +78,7 @@ class Option implements OptionInterface
78
  'related' => $data['twitter_related'],
79
  'hashtags' => $data['twitter_hashtags'],
80
  'dnt' => $data['twitter_dnt'] == 'true',
 
81
  ),
82
  'hatena_button' => array(
83
  'layout' => $data['hatena_button_layout']
@@ -200,7 +201,8 @@ CSS;
200
  'size' => "",
201
  'related' => "",
202
  'hashtags' => "",
203
- "dnt" => false
 
204
  ),
205
  "hatena_button" => array('layout' => 'simple-balloon'),
206
  'facebook' => array(
78
  'related' => $data['twitter_related'],
79
  'hashtags' => $data['twitter_hashtags'],
80
  'dnt' => $data['twitter_dnt'] == 'true',
81
+ 'version' => $data['twitter_version'],
82
  ),
83
  'hatena_button' => array(
84
  'layout' => $data['hatena_button_layout']
201
  'size' => "",
202
  'related' => "",
203
  'hashtags' => "",
204
+ "dnt" => false,
205
+ 'version' => "html"
206
  ),
207
  "hatena_button" => array('layout' => 'simple-balloon'),
208
  'facebook' => array(
src/WpSocialBookmarkingLight/Resources/views/Admin/page.html.twig CHANGED
@@ -250,6 +250,15 @@
250
  </select>
251
  </td>
252
  </tr>
 
 
 
 
 
 
 
 
 
253
  </table>
254
  </div>
255
 
250
  </select>
251
  </td>
252
  </tr>
253
+ <tr>
254
+ <th scope="row">Version:</th>
255
+ <td>
256
+ <select name='twitter_version'>
257
+ <option value='html' {{ option.twitter.version == 'html' ? 'selected' : '' }}>html</option>
258
+ <option value='iframe' {{ option.twitter.version == 'iframe' ? 'selected' : '' }}>iframe</option>
259
+ </select>
260
+ </td>
261
+ </tr>
262
  </table>
263
  </div>
264
 
src/WpSocialBookmarkingLight/Service.php CHANGED
@@ -187,25 +187,41 @@ class Service
187
  $twitter = $options['twitter'];
188
  $data_url = $this->url;
189
  $data_text = $this->title;
190
- $data_via = $twitter['via'] !== '' ? ' data-via="' . $twitter['via'] . '"' : '';
191
- $data_size = $twitter['size'] === 'large' ? ' data-size="large"' : '';
192
- $data_related = $twitter['related'] !== '' ? ' data-related="' . $twitter['related'] . '"' : '';
193
- $data_hashtags = $twitter['hashtags'] !== '' ? ' data-hashtags="' . $twitter['hashtags'] . '"' : '';
194
- $data_dnt = $twitter['dnt'] ? ' data-dnt="true"' : '';
195
- $data_lang = $twitter['lang'] !== '' ? ' data-lang="' . $twitter['lang'] . '"' : '';
196
 
197
- return $this->linkRaw(
198
- '<a href="https://twitter.com/share" class="twitter-share-button"'
199
- . ' data-url="' . $data_url . '"'
200
- . ' data-text="' . $data_text . '"'
201
- . $data_via
202
- . $data_size
203
- . $data_related
204
- . $data_hashtags
205
- . $data_dnt
206
- . $data_lang
207
- . '>Tweet</a>'
208
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  }
210
 
211
  /**
187
  $twitter = $options['twitter'];
188
  $data_url = $this->url;
189
  $data_text = $this->title;
 
 
 
 
 
 
190
 
191
+ if ($twitter['version'] === 'iframe') {
192
+ // if you want to change width length, please edit wsbl_twitter style at Settings
193
+ return $this->linkRaw(
194
+ '<iframe '
195
+ . 'src="https://platform.twitter.com/widgets/tweet_button.html?'
196
+ . 'url='.$data_url
197
+ . '&text='.$data_text
198
+ . ($twitter['via'] !== '' ? '&via='.$twitter['via'] : '')
199
+ . ($twitter['size'] === 'large' ? '&size=l' : '')
200
+ . ($twitter['related'] !== '' ? '&related='.$twitter['related'] : '')
201
+ . ($twitter['hashtags'] !== '' ? '&hashtags='.$twitter['hashtags'] : '')
202
+ . ($twitter['dnt'] ? '&dnt=true' : '')
203
+ . ($twitter['lang'] !== '' ? '&lang='.$twitter['lang'] : '')
204
+ . '"'
205
+ . ' width="140"'
206
+ . ' height="28"'
207
+ . ' title="Tweet"'
208
+ . ' style="border: 0; overflow: hidden;"'
209
+ . '></iframe>'
210
+ );
211
+ } else {
212
+ return $this->linkRaw(
213
+ '<a href="https://twitter.com/share" class="twitter-share-button"'
214
+ . ' data-url="' . $data_url . '"'
215
+ . ' data-text="' . $data_text . '"'
216
+ . ($twitter['via'] !== '' ? ' data-via="' . $twitter['via'] . '"' : '')
217
+ . ($twitter['size'] === 'large' ? ' data-size="large"' : '')
218
+ . ($twitter['related'] !== '' ? ' data-related="' . $twitter['related'] . '"' : '')
219
+ . ($twitter['hashtags'] !== '' ? ' data-hashtags="' . $twitter['hashtags'] . '"' : '')
220
+ . ($twitter['dnt'] ? ' data-dnt="true"' : '')
221
+ . ($twitter['lang'] !== '' ? ' data-lang="' . $twitter['lang'] . '"' : '')
222
+ . '>Tweet</a>'
223
+ );
224
+ }
225
  }
226
 
227
  /**
src/WpSocialBookmarkingLight/Tests/BuilderTest.php CHANGED
@@ -111,12 +111,13 @@ class BuilderTest extends TestCase
111
  $stub->method('getAll')->willReturn([
112
  "hatena_button" => ['layout' => 'simple-balloon'],
113
  "twitter" => [
114
- 'via' => "",
115
- 'lang' => "",
116
- 'size' => "",
117
- 'related' => "",
118
- 'hashtags' => "",
119
- "dnt" => false
 
120
  ],
121
  'facebook' => [
122
  'locale' => 'en_US',
111
  $stub->method('getAll')->willReturn([
112
  "hatena_button" => ['layout' => 'simple-balloon'],
113
  "twitter" => [
114
+ 'via' => "a",
115
+ 'lang' => "ja",
116
+ 'size' => "large",
117
+ 'related' => "b",
118
+ 'hashtags' => "c",
119
+ "dnt" => true,
120
+ "version" => "iframe"
121
  ],
122
  'facebook' => [
123
  'locale' => 'en_US',
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit13f22a2498eb845285f819f3bb77e2f6::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit4449dff69f882aebbd49ab4f69fa1770::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit13f22a2498eb845285f819f3bb77e2f6
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit13f22a2498eb845285f819f3bb77e2f6
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit13f22a2498eb845285f819f3bb77e2f6', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit13f22a2498eb845285f819f3bb77e2f6', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit13f22a2498eb845285f819f3bb77e2f6::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit4449dff69f882aebbd49ab4f69fa1770
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit4449dff69f882aebbd49ab4f69fa1770', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit4449dff69f882aebbd49ab4f69fa1770', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit4449dff69f882aebbd49ab4f69fa1770::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit13f22a2498eb845285f819f3bb77e2f6
8
  {
9
  public static $fallbackDirsPsr4 = array (
10
  0 => __DIR__ . '/../..' . '/src',
@@ -23,8 +23,8 @@ class ComposerStaticInit13f22a2498eb845285f819f3bb77e2f6
23
  public static function getInitializer(ClassLoader $loader)
24
  {
25
  return \Closure::bind(function () use ($loader) {
26
- $loader->fallbackDirsPsr4 = ComposerStaticInit13f22a2498eb845285f819f3bb77e2f6::$fallbackDirsPsr4;
27
- $loader->prefixesPsr0 = ComposerStaticInit13f22a2498eb845285f819f3bb77e2f6::$prefixesPsr0;
28
 
29
  }, null, ClassLoader::class);
30
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit4449dff69f882aebbd49ab4f69fa1770
8
  {
9
  public static $fallbackDirsPsr4 = array (
10
  0 => __DIR__ . '/../..' . '/src',
23
  public static function getInitializer(ClassLoader $loader)
24
  {
25
  return \Closure::bind(function () use ($loader) {
26
+ $loader->fallbackDirsPsr4 = ComposerStaticInit4449dff69f882aebbd49ab4f69fa1770::$fallbackDirsPsr4;
27
+ $loader->prefixesPsr0 = ComposerStaticInit4449dff69f882aebbd49ab4f69fa1770::$prefixesPsr0;
28
 
29
  }, null, ClassLoader::class);
30
  }
wp-social-bookmarking-light.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://github.com/utahta/WP-Social-Bookmarking-Light
5
  Description: This plugin inserts social share links at the top or bottom of each post.
6
  Author: utahta
7
  Author URI: https://github.com/utahta/WP-Social-Bookmarking-Light
8
- Version: 2.0.1
9
  */
10
  /*
11
  Copyright 2010 utahta (email : labs.ninxit@gmail.com)
5
  Description: This plugin inserts social share links at the top or bottom of each post.
6
  Author: utahta
7
  Author URI: https://github.com/utahta/WP-Social-Bookmarking-Light
8
+ Version: 2.0.2
9
  */
10
  /*
11
  Copyright 2010 utahta (email : labs.ninxit@gmail.com)