Version Description
Download this release
Release Info
Developer | poporon |
Plugin | Pz-LinkCard |
Version | 2.1.4 |
Comparing to | |
See all releases |
Code changes from version 2.1.3.1 to 2.1.4
- js/mce-pz-lkc.js +2 -2
- lib/pz-linkcard-cacheman-list.php +2 -0
- pz-linkcard.php +28 -29
- readme.txt +7 -1
js/mce-pz-lkc.js
CHANGED
@@ -2,12 +2,12 @@
|
|
2 |
tinymce.create('tinymce.plugins.pzlinkcard', {
|
3 |
init: function(ed, url){
|
4 |
ed.addButton('pz_linkcard',{
|
5 |
-
title: '
|
6 |
image: url + '/button.png',
|
7 |
cmd: 'insert_pz_linkcard'
|
8 |
});
|
9 |
ed.addCommand('insert_pz_linkcard', function() {
|
10 |
-
var insert_tag = window.prompt('
|
11 |
if (insert_tag !== null) {
|
12 |
ed.execCommand('mceInsertContent', 0, '[blogcard url="' + insert_tag + '"]');
|
13 |
}
|
2 |
tinymce.create('tinymce.plugins.pzlinkcard', {
|
3 |
init: function(ed, url){
|
4 |
ed.addButton('pz_linkcard',{
|
5 |
+
title: 'Insert Pz-LinkCard',
|
6 |
image: url + '/button.png',
|
7 |
cmd: 'insert_pz_linkcard'
|
8 |
});
|
9 |
ed.addCommand('insert_pz_linkcard', function() {
|
10 |
+
var insert_tag = window.prompt('Input URL', 'http://');
|
11 |
if (insert_tag !== null) {
|
12 |
ed.execCommand('mceInsertContent', 0, '[blogcard url="' + insert_tag + '"]');
|
13 |
}
|
lib/pz-linkcard-cacheman-list.php
CHANGED
@@ -42,6 +42,7 @@ $link_type = strtolower($link_type);
|
|
42 |
switch ($link_type) {
|
43 |
case 'all':
|
44 |
$where = "";
|
|
|
45 |
case 'internal':
|
46 |
$where = "url LIKE '".get_bloginfo('url')."%'";
|
47 |
break;
|
@@ -60,6 +61,7 @@ default:
|
|
60 |
$where = "alive_result = '404'";
|
61 |
} else {
|
62 |
$link_type = 'all';
|
|
|
63 |
}
|
64 |
}
|
65 |
|
42 |
switch ($link_type) {
|
43 |
case 'all':
|
44 |
$where = "";
|
45 |
+
break;
|
46 |
case 'internal':
|
47 |
$where = "url LIKE '".get_bloginfo('url')."%'";
|
48 |
break;
|
61 |
$where = "alive_result = '404'";
|
62 |
} else {
|
63 |
$link_type = 'all';
|
64 |
+
$where = "";
|
65 |
}
|
66 |
}
|
67 |
|
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: 2.1.
|
7 |
Author: poporon
|
8 |
Author URI: http://poporon.poponet.jp
|
9 |
License: GPLv2 or later
|
@@ -155,7 +155,7 @@ class Pz_LinkCard {
|
|
155 |
'invalid-time' => null,
|
156 |
'plugin-link' => null,
|
157 |
'plugin-name' => 'Pz-LinkCard',
|
158 |
-
'plugin-version' => '2.1.
|
159 |
'plugin-url' => 'https://popozure.info/pz-linkcard',
|
160 |
'pz-hbc-options' => null,
|
161 |
'debug-time' => null
|
@@ -352,7 +352,7 @@ class Pz_LinkCard {
|
|
352 |
// キャッシュやリンク先からリンクカードのHTMLを生成
|
353 |
function pz_GetHTML( $atts, $content = null ) {
|
354 |
if ($this->options['debug-time']) {
|
355 |
-
echo '<!-- Pz-LkC [
|
356 |
}
|
357 |
|
358 |
// モバイルチェック
|
@@ -803,34 +803,33 @@ class Pz_LinkCard {
|
|
803 |
return $url;
|
804 |
}
|
805 |
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
if (!isset($array_url['path']) || $array_url['path'] == '/') {
|
823 |
-
$url = rtrim($url, '/');
|
824 |
-
}
|
825 |
-
break;
|
826 |
-
case '2': // 常に最後のスラッシュを除外する
|
827 |
$url = rtrim($url, '/');
|
828 |
-
break;
|
829 |
-
}
|
830 |
-
if ($this->options['debug-time']) {
|
831 |
-
echo '<!-- Pz-LkC [URL4='.$url.'] /-->'.PHP_EOL;
|
832 |
}
|
|
|
|
|
|
|
|
|
833 |
}
|
|
|
|
|
|
|
|
|
834 |
return $url;
|
835 |
}
|
836 |
|
@@ -1333,7 +1332,7 @@ class Pz_LinkCard {
|
|
1333 |
// 文字コード判定
|
1334 |
$charset = null;
|
1335 |
if ($html <> '') {
|
1336 |
-
if (preg_match('/charset\s*=\s*"*([^>\/\s]*)
|
1337 |
$m[1] = trim(trim($m[1]), '\'\"');
|
1338 |
$charset = $m[1];
|
1339 |
} else {
|
3 |
Plugin Name: Pz-LinkCard
|
4 |
Plugin URI: http://poporon.poponet.jp/pz-linkcard
|
5 |
Description: リンクをカード形式で表示します。
|
6 |
+
Version: 2.1.4
|
7 |
Author: poporon
|
8 |
Author URI: http://poporon.poponet.jp
|
9 |
License: GPLv2 or later
|
155 |
'invalid-time' => null,
|
156 |
'plugin-link' => null,
|
157 |
'plugin-name' => 'Pz-LinkCard',
|
158 |
+
'plugin-version' => '2.1.4',
|
159 |
'plugin-url' => 'https://popozure.info/pz-linkcard',
|
160 |
'pz-hbc-options' => null,
|
161 |
'debug-time' => null
|
352 |
// キャッシュやリンク先からリンクカードのHTMLを生成
|
353 |
function pz_GetHTML( $atts, $content = null ) {
|
354 |
if ($this->options['debug-time']) {
|
355 |
+
echo '<!-- Pz-LkC [GetHTML] /-->'.PHP_EOL;
|
356 |
}
|
357 |
|
358 |
// モバイルチェック
|
803 |
return $url;
|
804 |
}
|
805 |
|
806 |
+
$url1 = html_entity_decode($url);
|
807 |
+
if ($this->options['debug-time']) {
|
808 |
+
echo '<!-- Pz-LkC [URL1='.$url.'] /-->'.PHP_EOL;
|
809 |
+
}
|
810 |
+
$url2 = preg_replace('/^[\s \'\"‘’“”″]*(.*?)[\s \'\"‘’“”″]*$/u', '\1', $url); // 色んな打ち間違え対応
|
811 |
+
if ($this->options['debug-time']) {
|
812 |
+
echo '<!-- Pz-LkC [URL2='.$url.'] /-->'.PHP_EOL;
|
813 |
+
}
|
814 |
+
$url = esc_url($url); // プロトコル除外など
|
815 |
+
if ($this->options['debug-time']) {
|
816 |
+
echo '<!-- Pz-LkC [URL3='.$url.'] /-->'.PHP_EOL;
|
817 |
+
}
|
818 |
+
switch (isset($this->options['trail-slash']) ? $this->options['trail-slash'] : null) {
|
819 |
+
case '1': // URLがドメイン名だけの場合、最後のスラッシュを除外する
|
820 |
+
$array_url = parse_url($url);
|
821 |
+
if (!isset($array_url['path']) || $array_url['path'] == '/') {
|
|
|
|
|
|
|
|
|
|
|
822 |
$url = rtrim($url, '/');
|
|
|
|
|
|
|
|
|
823 |
}
|
824 |
+
break;
|
825 |
+
case '2': // 常に最後のスラッシュを除外する
|
826 |
+
$url = rtrim($url, '/');
|
827 |
+
break;
|
828 |
}
|
829 |
+
if ($this->options['debug-time']) {
|
830 |
+
echo '<!-- Pz-LkC [URL4='.$url.'] /-->'.PHP_EOL;
|
831 |
+
}
|
832 |
+
|
833 |
return $url;
|
834 |
}
|
835 |
|
1332 |
// 文字コード判定
|
1333 |
$charset = null;
|
1334 |
if ($html <> '') {
|
1335 |
+
if (preg_match('/charset\s*=\s*"*([^>\/\s"]*).*<\/head/si', $html, $m)) {
|
1336 |
$m[1] = trim(trim($m[1]), '\'\"');
|
1337 |
$charset = $m[1];
|
1338 |
} else {
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: poporon
|
3 |
Tags: post, internal link, external link, blogcard, linkcard
|
4 |
Requires at least: 4.3
|
5 |
-
Tested up to: 4.9.
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -163,6 +163,12 @@ A7.
|
|
163 |
5. "Write shortcode and url"
|
164 |
|
165 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
Ver2.1.3.1
|
167 |
* WordPress 4.9.6 での動作確認。
|
168 |
Compatible with WordPress 4.9.6
|
2 |
Contributors: poporon
|
3 |
Tags: post, internal link, external link, blogcard, linkcard
|
4 |
Requires at least: 4.3
|
5 |
+
Tested up to: 4.9.7
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
163 |
5. "Write shortcode and url"
|
164 |
|
165 |
== Changelog ==
|
166 |
+
Ver2.1.4
|
167 |
+
* CHARSETを判断できないパターンがあったため修正しました。
|
168 |
+
Fixed: There was a pattern which can not judge CHARSET, so I fixed it.
|
169 |
+
* カード管理で「すべて」を選んだときに内部リンクが表示されていたのを修正しました。
|
170 |
+
Fixed: Fixed a bug in card management.
|
171 |
+
|
172 |
Ver2.1.3.1
|
173 |
* WordPress 4.9.6 での動作確認。
|
174 |
Compatible with WordPress 4.9.6
|