Version Description
- Fixed: Shares of facebook has not been able to properly get.
Added: Grant function of any class name
Thanks
DIVThanks @misoji_13)
Download this release
Release Info
Developer | poporon |
Plugin | Pz-LinkCard |
Version | 1.6.4 |
Comparing to | |
See all releases |
Code changes from version 1.6.3 to 1.6.4
- languages/pz-linkcard-ja.mo +0 -0
- languages/pz-linkcard-ja.po +26 -18
- pz-linkcard-settings.php +9 -0
- pz-linkcard.php +41 -21
- readme.txt +8 -1
languages/pz-linkcard-ja.mo
CHANGED
Binary file
|
languages/pz-linkcard-ja.po
CHANGED
@@ -4,8 +4,8 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Pz-LinkCard\n"
|
6 |
"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
|
7 |
-
"POT-Creation-Date: 2015-
|
8 |
-
"PO-Revision-Date: 2015-
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: poporon\n"
|
11 |
"Language: ja_JP\n"
|
@@ -19,7 +19,7 @@ msgstr ""
|
|
19 |
"Plural-Forms: nplurals=1; plural=0;\n"
|
20 |
"X-Poedit-SearchPath-0: ..\n"
|
21 |
|
22 |
-
#: ../pz-linkcard-cacheman.php:6 ../pz-linkcard.php:
|
23 |
msgid "LinkCard cache manager"
|
24 |
msgstr "リンクカード/DBキャッシュ管理"
|
25 |
|
@@ -210,7 +210,7 @@ msgstr "更新"
|
|
210 |
msgid "Cancel"
|
211 |
msgstr "キャンセル"
|
212 |
|
213 |
-
#: ../pz-linkcard-settings.php:4 ../pz-linkcard.php:
|
214 |
msgid "LinkCard Settings"
|
215 |
msgstr "リンクカード設定"
|
216 |
|
@@ -816,46 +816,54 @@ msgid "CSS URL"
|
|
816 |
msgstr "CSSファイルのURL"
|
817 |
|
818 |
#: ../pz-linkcard-settings.php:664
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
819 |
msgid "Use HatenaBlogCard"
|
820 |
msgstr "はてなブログカードを利用する"
|
821 |
|
822 |
-
#: ../pz-linkcard-settings.php:
|
823 |
msgid "External links will use Always HatenaBlogCard (Not recommended)"
|
824 |
msgstr "外部リンクは「はてなブログカード」を利用する(非推奨)"
|
825 |
|
826 |
-
#: ../pz-linkcard-settings.php:
|
827 |
msgid "Display link to author page"
|
828 |
msgstr "プラグイン名を表示する"
|
829 |
|
830 |
-
#: ../pz-linkcard-settings.php:
|
831 |
msgid "Plugin URL"
|
832 |
msgstr "プラグインページURL"
|
833 |
|
834 |
-
#: ../pz-linkcard-settings.php:
|
835 |
msgid "Plugin name"
|
836 |
msgstr "プラグイン名"
|
837 |
|
838 |
-
#: ../pz-linkcard-settings.php:
|
839 |
msgid "Plugin version"
|
840 |
msgstr "プラグインバージョン"
|
841 |
|
842 |
-
#: ../pz-linkcard-settings.php:
|
843 |
msgid "Saved datetime"
|
844 |
msgstr "保存した日時"
|
845 |
|
846 |
-
#: ../pz-linkcard-settings.php:
|
847 |
msgid "Display elapsed time"
|
848 |
msgstr "実行時間の表示"
|
849 |
|
850 |
-
#: ../pz-linkcard-settings.php:
|
851 |
msgid "Output the elapsed time to HTML comment."
|
852 |
msgstr "作成にかかった時間をコメントとしてHTMLへ出力する"
|
853 |
|
854 |
-
#: ../pz-linkcard-settings.php:
|
855 |
msgid "Initialize"
|
856 |
msgstr "初期化"
|
857 |
|
858 |
-
#: ../pz-linkcard-settings.php:
|
859 |
msgid "Return to the initial setting"
|
860 |
msgstr "設定を初期状態へ戻す"
|
861 |
|
@@ -867,19 +875,19 @@ msgstr "設定を元にスタイルシートを自動生成しました。"
|
|
867 |
msgid "Style sheet failed."
|
868 |
msgstr "スタイルシートの自動生成に失敗しました。"
|
869 |
|
870 |
-
#: ../pz-linkcard.php:
|
871 |
msgid "Pz LkC Cache"
|
872 |
msgstr "Pz カード管理"
|
873 |
|
874 |
-
#: ../pz-linkcard.php:
|
875 |
msgid "Pz LinkCard"
|
876 |
msgstr "Pz カード設定"
|
877 |
|
878 |
-
#: ../pz-linkcard.php:
|
879 |
msgid "Settings"
|
880 |
msgstr "設定"
|
881 |
|
882 |
-
#: ../pz-linkcard.php:
|
883 |
msgid "Manage"
|
884 |
msgstr "管理"
|
885 |
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Pz-LinkCard\n"
|
6 |
"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
|
7 |
+
"POT-Creation-Date: 2015-12-06 20:46+0900\n"
|
8 |
+
"PO-Revision-Date: 2015-12-06 20:47+0900\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: poporon\n"
|
11 |
"Language: ja_JP\n"
|
19 |
"Plural-Forms: nplurals=1; plural=0;\n"
|
20 |
"X-Poedit-SearchPath-0: ..\n"
|
21 |
|
22 |
+
#: ../pz-linkcard-cacheman.php:6 ../pz-linkcard.php:963
|
23 |
msgid "LinkCard cache manager"
|
24 |
msgstr "リンクカード/DBキャッシュ管理"
|
25 |
|
210 |
msgid "Cancel"
|
211 |
msgstr "キャンセル"
|
212 |
|
213 |
+
#: ../pz-linkcard-settings.php:4 ../pz-linkcard.php:965
|
214 |
msgid "LinkCard Settings"
|
215 |
msgstr "リンクカード設定"
|
216 |
|
816 |
msgstr "CSSファイルのURL"
|
817 |
|
818 |
#: ../pz-linkcard-settings.php:664
|
819 |
+
msgid "Class ID to be added(for PC)"
|
820 |
+
msgstr "PCのときに追加するクラス名"
|
821 |
+
|
822 |
+
#: ../pz-linkcard-settings.php:668
|
823 |
+
msgid "Class ID to be added(for Mobile)"
|
824 |
+
msgstr "モバイルのときに追加するクラス名"
|
825 |
+
|
826 |
+
#: ../pz-linkcard-settings.php:673
|
827 |
msgid "Use HatenaBlogCard"
|
828 |
msgstr "はてなブログカードを利用する"
|
829 |
|
830 |
+
#: ../pz-linkcard-settings.php:674
|
831 |
msgid "External links will use Always HatenaBlogCard (Not recommended)"
|
832 |
msgstr "外部リンクは「はてなブログカード」を利用する(非推奨)"
|
833 |
|
834 |
+
#: ../pz-linkcard-settings.php:678
|
835 |
msgid "Display link to author page"
|
836 |
msgstr "プラグイン名を表示する"
|
837 |
|
838 |
+
#: ../pz-linkcard-settings.php:682
|
839 |
msgid "Plugin URL"
|
840 |
msgstr "プラグインページURL"
|
841 |
|
842 |
+
#: ../pz-linkcard-settings.php:686
|
843 |
msgid "Plugin name"
|
844 |
msgstr "プラグイン名"
|
845 |
|
846 |
+
#: ../pz-linkcard-settings.php:690
|
847 |
msgid "Plugin version"
|
848 |
msgstr "プラグインバージョン"
|
849 |
|
850 |
+
#: ../pz-linkcard-settings.php:694
|
851 |
msgid "Saved datetime"
|
852 |
msgstr "保存した日時"
|
853 |
|
854 |
+
#: ../pz-linkcard-settings.php:699
|
855 |
msgid "Display elapsed time"
|
856 |
msgstr "実行時間の表示"
|
857 |
|
858 |
+
#: ../pz-linkcard-settings.php:700
|
859 |
msgid "Output the elapsed time to HTML comment."
|
860 |
msgstr "作成にかかった時間をコメントとしてHTMLへ出力する"
|
861 |
|
862 |
+
#: ../pz-linkcard-settings.php:706
|
863 |
msgid "Initialize"
|
864 |
msgstr "初期化"
|
865 |
|
866 |
+
#: ../pz-linkcard-settings.php:709
|
867 |
msgid "Return to the initial setting"
|
868 |
msgstr "設定を初期状態へ戻す"
|
869 |
|
875 |
msgid "Style sheet failed."
|
876 |
msgstr "スタイルシートの自動生成に失敗しました。"
|
877 |
|
878 |
+
#: ../pz-linkcard.php:963
|
879 |
msgid "Pz LkC Cache"
|
880 |
msgstr "Pz カード管理"
|
881 |
|
882 |
+
#: ../pz-linkcard.php:965
|
883 |
msgid "Pz LinkCard"
|
884 |
msgstr "Pz カード設定"
|
885 |
|
886 |
+
#: ../pz-linkcard.php:1057
|
887 |
msgid "Settings"
|
888 |
msgstr "設定"
|
889 |
|
890 |
+
#: ../pz-linkcard.php:1057
|
891 |
msgid "Manage"
|
892 |
msgstr "管理"
|
893 |
|
pz-linkcard-settings.php
CHANGED
@@ -660,6 +660,15 @@
|
|
660 |
<td><input name="properties[css-url]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['css-url']); ?>" size="80" /><br>
|
661 |
</tr>
|
662 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
663 |
<tr valign="top">
|
664 |
<th scope="row"><?php _e('Use HatenaBlogCard', $this->text_domain); ?></th>
|
665 |
<td><label><input name="properties[use-hatena]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['use-hatena']) ? $this->options['use-hatena'] : null, 1); ?> /><?php _e('External links will use Always HatenaBlogCard (Not recommended)', $this->text_domain); ?></label></td>
|
660 |
<td><input name="properties[css-url]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['css-url']); ?>" size="80" /><br>
|
661 |
</tr>
|
662 |
|
663 |
+
<tr valign="top">
|
664 |
+
<th scope="row"><?php _e('Class ID to be added(for PC)', $this->text_domain); ?></th>
|
665 |
+
<td><input name="properties[class-pc]" type="text" id="inputtext" value="<?php echo (isset($this->options['class-pc']) ? esc_attr($this->options['class-pc']) : ''); ?>" size="40" /><br>
|
666 |
+
</tr>
|
667 |
+
<tr valign="top">
|
668 |
+
<th scope="row"><?php _e('Class ID to be added(for Mobile)', $this->text_domain); ?></th>
|
669 |
+
<td><input name="properties[class-mobile]" type="text" id="inputtext" value="<?php echo (isset($this->options['class-mobile']) ? esc_attr($this->options['class-mobile']) : ''); ?>" size="40" /><br>
|
670 |
+
</tr>
|
671 |
+
|
672 |
<tr valign="top">
|
673 |
<th scope="row"><?php _e('Use HatenaBlogCard', $this->text_domain); ?></th>
|
674 |
<td><label><input name="properties[use-hatena]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['use-hatena']) ? $this->options['use-hatena'] : null, 1); ?> /><?php _e('External links will use Always HatenaBlogCard (Not recommended)', $this->text_domain); ?></label></td>
|
pz-linkcard.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Pz-LinkCard
|
4 |
Plugin URI: http://poporon.poponet.jp/pz-linkcard
|
5 |
Description: リンクをカード形式で表示します。
|
6 |
-
Version: 1.6.
|
7 |
Author: poporon
|
8 |
Author URI: http://poporon.poponet.jp
|
9 |
License: GPLv2 or later
|
@@ -52,7 +52,7 @@ class Pz_LinkCard {
|
|
52 |
'display-excerpt' => '1',
|
53 |
'trim-title' => 200,
|
54 |
'trim-count' => 250,
|
55 |
-
'trim-sitename' =>
|
56 |
'info-position' => '1',
|
57 |
'separator' => null,
|
58 |
'size-info' => '12px',
|
@@ -91,6 +91,8 @@ class Pz_LinkCard {
|
|
91 |
'css-file' => null,
|
92 |
'css-path' => null,
|
93 |
'css-url' => null,
|
|
|
|
|
94 |
'sns-position' => '2',
|
95 |
'sns-tw' => null,
|
96 |
'sns-fb' => '1',
|
@@ -100,7 +102,7 @@ class Pz_LinkCard {
|
|
100 |
'nofollow' => null,
|
101 |
'plugin-link' => null,
|
102 |
'plugin-name' => 'Pz-LinkCard',
|
103 |
-
'plugin-version' => '1.6.
|
104 |
'plugin-url' => 'http://poporon.poponet.jp/pz-linkcard',
|
105 |
'pz-hbc-options' => null,
|
106 |
'debug-time' => null
|
@@ -248,6 +250,13 @@ class Pz_LinkCard {
|
|
248 |
$error = true;
|
249 |
}
|
250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
// 自サイトチェック
|
252 |
if (preg_match('{'.home_url().'\/.*?}', $url.'/')) {
|
253 |
if (get_permalink() == $url) {
|
@@ -257,7 +266,7 @@ class Pz_LinkCard {
|
|
257 |
}
|
258 |
$target = ''; // 同ページに開く
|
259 |
if (isset($this->options['in-target'])) {
|
260 |
-
if ($this->options['in-target'] == '1' || ($this->options['in-target'] == '2' &&
|
261 |
$target = ' target="_blank"'; // 新しいページで開く
|
262 |
}
|
263 |
}
|
@@ -266,13 +275,21 @@ class Pz_LinkCard {
|
|
266 |
$link_type = 0; // 外部サイト
|
267 |
$target = ''; // 同ページに開く
|
268 |
if (isset($this->options['ex-target'])) {
|
269 |
-
if ($this->options['ex-target'] == '1' || ($this->options['ex-target'] == '2' &&
|
270 |
$target = ' target="_blank"'; // 新しいページで開く
|
271 |
}
|
272 |
}
|
273 |
$nofollow = isset($this->options['nofollow']) ? ' rel="nofollow"' : '';
|
274 |
}
|
275 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
// URLをキーにしてDBからキャッシュ取得
|
277 |
$data['id'] = null;
|
278 |
$data['url_key'] = null;
|
@@ -379,9 +396,9 @@ class Pz_LinkCard {
|
|
379 |
// 「はてなブログカード」をそのまま利用する
|
380 |
$tag = '<div class="lkc-iframe-wrap"><iframe src="http://hatenablog.com/embed?url='.$url.'" class="lkc-iframe" scrolling="no" frameborder="0"></iframe></div>';
|
381 |
if (isset($this->options['blockquote']) ? $this->options['blockquote'] : null == '1') {
|
382 |
-
$tag = '<div class="
|
383 |
} else {
|
384 |
-
$tag = '<div class="
|
385 |
}
|
386 |
return $tag;
|
387 |
|
@@ -446,14 +463,13 @@ class Pz_LinkCard {
|
|
446 |
|
447 |
$tags = null;
|
448 |
// HEADタグ
|
449 |
-
$head
|
|
|
450 |
if (preg_match('/<\s*head\s*[^>]*>(.*)<\s*\/head\s*>/si', $html, $m)) {
|
451 |
-
$head
|
|
|
452 |
}
|
453 |
|
454 |
-
$tags = null;
|
455 |
-
$tags = $this->pz_GetMeta($head);
|
456 |
-
|
457 |
// タイトル
|
458 |
if (isset( $tags['og:title'] ) && $tags['og:title'] ) {
|
459 |
$title = $tags['og:title'] ;
|
@@ -706,9 +722,9 @@ class Pz_LinkCard {
|
|
706 |
|
707 |
// 引用文扱い
|
708 |
if (isset($this->options['blockquote']) ? $this->options['blockquote'] : null == '1') {
|
709 |
-
$tag = '<div class="
|
710 |
} else {
|
711 |
-
$tag = '<div class="
|
712 |
}
|
713 |
|
714 |
// 実行時間
|
@@ -750,7 +766,7 @@ class Pz_LinkCard {
|
|
750 |
|
751 |
// // Twitter count.json 2015/11/21 非公式サービス終了に伴い停止
|
752 |
// if (isset($this->options['sns-tw']) && !is_null($this->options['sns-tw'])) {
|
753 |
-
// $count_before =
|
754 |
// if ($sns_renew || $count_before < 0) {
|
755 |
// $result = wp_remote_get( 'http://urls.api.twitter.com/1/urls/count.json?url=' .rawurlencode($data['url']), $opt );
|
756 |
// if (isset($result) && !is_wp_error($result) && $result['response']['code'] == 200) {
|
@@ -769,7 +785,7 @@ class Pz_LinkCard {
|
|
769 |
$result = wp_remote_get( 'http://graph.facebook.com/?id=' .rawurlencode($data['url']), $opt );
|
770 |
if (isset($result) && !is_wp_error($result) && $result['response']['code'] == 200) {
|
771 |
$json = json_decode($result['body']);
|
772 |
-
$count = intval(isset($json->shares) ?
|
773 |
if ($count <> $count_before) {
|
774 |
$data['sns_facebook'] = $count;
|
775 |
$update_cnt = true;
|
@@ -779,7 +795,7 @@ class Pz_LinkCard {
|
|
779 |
}
|
780 |
|
781 |
if (isset($this->options['sns-hb']) && !is_null($this->options['sns-hb'])) {
|
782 |
-
$count_before =
|
783 |
if ($sns_renew || $count_before < 0) {
|
784 |
$result = wp_remote_get( 'http://api.b.st-hatena.com/entry.count?url=' .rawurlencode($data['url']), $opt );
|
785 |
if (isset($result) && !is_wp_error($result) && $result['response']['code'] == 200) {
|
@@ -792,12 +808,16 @@ class Pz_LinkCard {
|
|
792 |
}
|
793 |
}
|
794 |
|
795 |
-
if ($update_cnt || ($now - strtotime($data['regist']) <
|
796 |
-
$nexttime = $now +
|
797 |
-
// 1h...3600 12h...43200 24h...86400 3day...259200 7day...604800
|
798 |
} else {
|
799 |
-
$nexttime = $now +
|
800 |
}
|
|
|
|
|
|
|
|
|
|
|
801 |
|
802 |
global $wpdb;
|
803 |
$wpdb->update(
|
3 |
Plugin Name: Pz-LinkCard
|
4 |
Plugin URI: http://poporon.poponet.jp/pz-linkcard
|
5 |
Description: リンクをカード形式で表示します。
|
6 |
+
Version: 1.6.4
|
7 |
Author: poporon
|
8 |
Author URI: http://poporon.poponet.jp
|
9 |
License: GPLv2 or later
|
52 |
'display-excerpt' => '1',
|
53 |
'trim-title' => 200,
|
54 |
'trim-count' => 250,
|
55 |
+
'trim-sitename' => 50,
|
56 |
'info-position' => '1',
|
57 |
'separator' => null,
|
58 |
'size-info' => '12px',
|
91 |
'css-file' => null,
|
92 |
'css-path' => null,
|
93 |
'css-url' => null,
|
94 |
+
'class-pc' => null,
|
95 |
+
'class-mobile' => null,
|
96 |
'sns-position' => '2',
|
97 |
'sns-tw' => null,
|
98 |
'sns-fb' => '1',
|
102 |
'nofollow' => null,
|
103 |
'plugin-link' => null,
|
104 |
'plugin-name' => 'Pz-LinkCard',
|
105 |
+
'plugin-version' => '1.6.4',
|
106 |
'plugin-url' => 'http://poporon.poponet.jp/pz-linkcard',
|
107 |
'pz-hbc-options' => null,
|
108 |
'debug-time' => null
|
250 |
$error = true;
|
251 |
}
|
252 |
|
253 |
+
// モバイルチェック
|
254 |
+
if (function_exists('wp_is_mobile') && wp_is_mobile()) {
|
255 |
+
$is_mobile = true;
|
256 |
+
} else {
|
257 |
+
$is_mobile = false;
|
258 |
+
}
|
259 |
+
|
260 |
// 自サイトチェック
|
261 |
if (preg_match('{'.home_url().'\/.*?}', $url.'/')) {
|
262 |
if (get_permalink() == $url) {
|
266 |
}
|
267 |
$target = ''; // 同ページに開く
|
268 |
if (isset($this->options['in-target'])) {
|
269 |
+
if ($this->options['in-target'] == '1' || ($this->options['in-target'] == '2' && !$is_mobile)) {
|
270 |
$target = ' target="_blank"'; // 新しいページで開く
|
271 |
}
|
272 |
}
|
275 |
$link_type = 0; // 外部サイト
|
276 |
$target = ''; // 同ページに開く
|
277 |
if (isset($this->options['ex-target'])) {
|
278 |
+
if ($this->options['ex-target'] == '1' || ($this->options['ex-target'] == '2' && !$is_mobile)) {
|
279 |
$target = ' target="_blank"'; // 新しいページで開く
|
280 |
}
|
281 |
}
|
282 |
$nofollow = isset($this->options['nofollow']) ? ' rel="nofollow"' : '';
|
283 |
}
|
284 |
|
285 |
+
// クラス名追加
|
286 |
+
$class_id = 'linkcard';
|
287 |
+
if ($is_mobile && isset($this->options['class-mobile']) && $this->options['class-mobile'] <> '') {
|
288 |
+
$class_id .= ' '.$this->options['class-mobile'];
|
289 |
+
} elseif (isset($this->options['class-pc']) && $this->options['class-pc'] <> '') {
|
290 |
+
$class_id .= ' '.$this->options['class-pc'];
|
291 |
+
}
|
292 |
+
|
293 |
// URLをキーにしてDBからキャッシュ取得
|
294 |
$data['id'] = null;
|
295 |
$data['url_key'] = null;
|
396 |
// 「はてなブログカード」をそのまま利用する
|
397 |
$tag = '<div class="lkc-iframe-wrap"><iframe src="http://hatenablog.com/embed?url='.$url.'" class="lkc-iframe" scrolling="no" frameborder="0"></iframe></div>';
|
398 |
if (isset($this->options['blockquote']) ? $this->options['blockquote'] : null == '1') {
|
399 |
+
$tag = '<div class="'.$class_id.'"><blockquote class="lkc-quote">'.$tag.'</blockquote></div>';
|
400 |
} else {
|
401 |
+
$tag = '<div class="'.$class_id.'">'.$tag.'</div>';
|
402 |
}
|
403 |
return $tag;
|
404 |
|
463 |
|
464 |
$tags = null;
|
465 |
// HEADタグ
|
466 |
+
$head = null;
|
467 |
+
$tags = null;
|
468 |
if (preg_match('/<\s*head\s*[^>]*>(.*)<\s*\/head\s*>/si', $html, $m)) {
|
469 |
+
$head = $m[1];
|
470 |
+
$tags = $this->pz_GetMeta($head);
|
471 |
}
|
472 |
|
|
|
|
|
|
|
473 |
// タイトル
|
474 |
if (isset( $tags['og:title'] ) && $tags['og:title'] ) {
|
475 |
$title = $tags['og:title'] ;
|
722 |
|
723 |
// 引用文扱い
|
724 |
if (isset($this->options['blockquote']) ? $this->options['blockquote'] : null == '1') {
|
725 |
+
$tag = '<div class="'.$class_id.'"><blockquote class="lkc-quote">'.$tag.'</blockquote></div>';
|
726 |
} else {
|
727 |
+
$tag = '<div class="'.$class_id.'">'.$tag.'</div>';
|
728 |
}
|
729 |
|
730 |
// 実行時間
|
766 |
|
767 |
// // Twitter count.json 2015/11/21 非公式サービス終了に伴い停止
|
768 |
// if (isset($this->options['sns-tw']) && !is_null($this->options['sns-tw'])) {
|
769 |
+
// $count_before = isset($data['sns_twitter']) ? $data['sns_twitter'] : -1;
|
770 |
// if ($sns_renew || $count_before < 0) {
|
771 |
// $result = wp_remote_get( 'http://urls.api.twitter.com/1/urls/count.json?url=' .rawurlencode($data['url']), $opt );
|
772 |
// if (isset($result) && !is_wp_error($result) && $result['response']['code'] == 200) {
|
785 |
$result = wp_remote_get( 'http://graph.facebook.com/?id=' .rawurlencode($data['url']), $opt );
|
786 |
if (isset($result) && !is_wp_error($result) && $result['response']['code'] == 200) {
|
787 |
$json = json_decode($result['body']);
|
788 |
+
$count = intval(isset($json->shares) ? $json->shares : 0);
|
789 |
if ($count <> $count_before) {
|
790 |
$data['sns_facebook'] = $count;
|
791 |
$update_cnt = true;
|
795 |
}
|
796 |
|
797 |
if (isset($this->options['sns-hb']) && !is_null($this->options['sns-hb'])) {
|
798 |
+
$count_before = isset($data['sns_hatena']) ? $data['sns_hatena'] : -1;
|
799 |
if ($sns_renew || $count_before < 0) {
|
800 |
$result = wp_remote_get( 'http://api.b.st-hatena.com/entry.count?url=' .rawurlencode($data['url']), $opt );
|
801 |
if (isset($result) && !is_wp_error($result) && $result['response']['code'] == 200) {
|
808 |
}
|
809 |
}
|
810 |
|
811 |
+
if ($update_cnt || ($now - strtotime($data['regist']) < WEEK_IN_SECONDS)) {
|
812 |
+
$nexttime = $now + DAY_IN_SECONDS + rand(0, DAY_IN_SECONDS); // 1day + 0-24h
|
|
|
813 |
} else {
|
814 |
+
$nexttime = $now + WEEK_IN_SECONDS + rand(0, DAY_IN_SECONDS); // 7days + 0-24h
|
815 |
}
|
816 |
+
// MINUTE_IN_SECONDS = 60
|
817 |
+
// HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS = 3600
|
818 |
+
// DAY_IN_SECONDS = 24 * HOUR_IN_SECONDS = 86400
|
819 |
+
// WEEK_IN_SECONDS = 7 * DAY_IN_SECONDS = 604800
|
820 |
+
// YEAR_IN_SECONDS = 365 * DAY_IN_SECONDS
|
821 |
|
822 |
global $wpdb;
|
823 |
$wpdb->update(
|
readme.txt
CHANGED
@@ -164,6 +164,13 @@ WordPressピンバックは記事中にリンクを直接記述しないと飛
|
|
164 |
|
165 |
== Changelog ==
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
= 1.6.3 =
|
168 |
* Modefied: Correspondence associated with the end Tweets number acquiring API.
|
169 |
* Bugfix
|
@@ -203,7 +210,7 @@ WordPressピンバックは記事中にリンクを直接記述しないと飛
|
|
203 |
* Added: It can be selected "Other than mobile" and "All client" in the setting of "Open new window/tab".
|
204 |
|
205 |
* 2015年11月20日までのTwitter非公式API廃止に伴い、同日以降取得しないように修正。
|
206 |
-
* 「新しいウィンドウで開く」をチェックボックスからリストに変更し、「モバイル以外(のみ新しいウィンドウで開く)」を追加。(Thanks
|
207 |
|
208 |
= 1.0.3 =
|
209 |
* キャッシュ保存時にキーが正しく設定されないことがあったのを修正。
|
164 |
|
165 |
== Changelog ==
|
166 |
|
167 |
+
= 1.6.4 =
|
168 |
+
* Fixed: Shares of facebook has not been able to properly get.
|
169 |
+
* Added: Grant function of any class name
|
170 |
+
|
171 |
+
* フェイスブックのシェア数が取得できていなかったのを修正。(Thanks 弁保社長)
|
172 |
+
* 設定画面にリンクカードのDIV要素に任意のクラス名を設定できるように追加。(Thanks @misoji_13)
|
173 |
+
|
174 |
= 1.6.3 =
|
175 |
* Modefied: Correspondence associated with the end Tweets number acquiring API.
|
176 |
* Bugfix
|
210 |
* Added: It can be selected "Other than mobile" and "All client" in the setting of "Open new window/tab".
|
211 |
|
212 |
* 2015年11月20日までのTwitter非公式API廃止に伴い、同日以降取得しないように修正。
|
213 |
+
* 「新しいウィンドウで開く」をチェックボックスからリストに変更し、「モバイル以外(のみ新しいウィンドウで開く)」を追加。(Thanks @misoji_13)
|
214 |
|
215 |
= 1.0.3 =
|
216 |
* キャッシュ保存時にキーが正しく設定されないことがあったのを修正。
|