Pz-LinkCard - Version 2.4.0

Version Description

Download this release

Release Info

Developer poporon
Plugin Icon 128x128 Pz-LinkCard
Version 2.4.0
Comparing to
See all releases

Code changes from version 2.3.1 to 2.4.0

Files changed (2) hide show
  1. pz-linkcard.php +8 -6
  2. readme.txt +13 -1
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.3.1
7
  Author: poporon
8
  Author URI: http://poporon.poponet.jp
9
  License: GPLv2 or later
@@ -177,7 +177,7 @@ class Pz_LinkCard {
177
  'invalid-time' => null,
178
  'plugin-link' => null,
179
  'plugin-name' => 'Pz-LinkCard',
180
- 'plugin-version' => '2.3.1',
181
  'plugin-url' => 'https://popozure.info/pz-linkcard',
182
  'pz-hbc-options' => null,
183
  'debug-time' => null
@@ -346,9 +346,11 @@ class Pz_LinkCard {
346
  echo '<!-- Pz-LkC ['.html_entity_decode(print_r($atts, true)).'] /-->'.PHP_EOL;
347
  }
348
  if (!$this->options['flg-invalid']) {
349
- if (!preg_match('/\/wp-admin\/admin-ajax.php/i', $_SERVER["REQUEST_URI"])) {
 
 
350
  $this->options['flg-invalid'] = '1';
351
- $this->options['invalid-url'] = (!$_SERVER["HTTPS"] ? "http://" : "https://").$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
352
  $this->options['invalid-time'] = $this->now;
353
  $result = update_option('Pz_LinkCard_options', $this->options);
354
  }
@@ -899,7 +901,7 @@ class Pz_LinkCard {
899
  $link_type = 0; // 外部サイト
900
  }
901
  // サブディレクトリ型マルチサイト対応
902
- if ($this->options['flg-subdir'] && is_multisite() && !is_subdomain_install() && is_main_site) {
903
  $this_blog_id = get_current_blog_id();
904
  $blog_id = 0;
905
  do {
@@ -968,7 +970,7 @@ class Pz_LinkCard {
968
  if (isset($this->options['sns-tw']) && !is_null($this->options['sns-tw'])) {
969
  $count_before = isset($data['sns_twitter']) ? $data['sns_twitter'] : -1;
970
  if ($sns_renew || $count_before < 0) {
971
- // $result = wp_remote_get( 'http://urls.api.twitter.com/1/urls/count.json?url=' .rawurlencode($data['url']), $opt );
972
  $result = wp_remote_get( 'https://jsoon.digitiminimi.com/twitter/count.json?url=' .rawurlencode($data['url']), $opt );
973
  if (isset($result) && !is_wp_error($result) && $result['response']['code'] == 200) {
974
  $count = intval(json_decode($result['body'])->count);
3
  Plugin Name: Pz-LinkCard
4
  Plugin URI: http://poporon.poponet.jp/pz-linkcard
5
  Description: リンクをカード形式で表示します。
6
+ Version: 2.4.0
7
  Author: poporon
8
  Author URI: http://poporon.poponet.jp
9
  License: GPLv2 or later
177
  'invalid-time' => null,
178
  'plugin-link' => null,
179
  'plugin-name' => 'Pz-LinkCard',
180
+ 'plugin-version' => '2.4.0',
181
  'plugin-url' => 'https://popozure.info/pz-linkcard',
182
  'pz-hbc-options' => null,
183
  'debug-time' => null
346
  echo '<!-- Pz-LkC ['.html_entity_decode(print_r($atts, true)).'] /-->'.PHP_EOL;
347
  }
348
  if (!$this->options['flg-invalid']) {
349
+ $url_now = get_permalink();
350
+ $post_id = url_to_postid($url_now );
351
+ if ($post_id) {
352
  $this->options['flg-invalid'] = '1';
353
+ $this->options['invalid-url'] = $url_now;
354
  $this->options['invalid-time'] = $this->now;
355
  $result = update_option('Pz_LinkCard_options', $this->options);
356
  }
901
  $link_type = 0; // 外部サイト
902
  }
903
  // サブディレクトリ型マルチサイト対応
904
+ if ($this->options['flg-subdir'] && function_exists('is_multisite') && is_multisite() && function_exists('is_subdomain_install') && !is_subdomain_install() && function_exists('is_main_site') && is_main_site()) {
905
  $this_blog_id = get_current_blog_id();
906
  $blog_id = 0;
907
  do {
970
  if (isset($this->options['sns-tw']) && !is_null($this->options['sns-tw'])) {
971
  $count_before = isset($data['sns_twitter']) ? $data['sns_twitter'] : -1;
972
  if ($sns_renew || $count_before < 0) {
973
+ //$result = wp_remote_get( 'http://urls.api.twitter.com/1/urls/count.json?url=' .rawurlencode($data['url']), $opt );
974
  $result = wp_remote_get( 'https://jsoon.digitiminimi.com/twitter/count.json?url=' .rawurlencode($data['url']), $opt );
975
  if (isset($result) && !is_wp_error($result) && $result['response']['code'] == 200) {
976
  $count = intval(json_decode($result['body'])->count);
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: 5.3
6
  Stable tag: trunk
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -163,6 +163,18 @@ A7.
163
  5. "Write shortcode and url"
164
 
165
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
166
  Ver2.3.1
167
  * WordPress 5.3 での動作確認。
168
  Compatible with WordPress 5.3.
2
  Contributors: poporon
3
  Tags: post, internal link, external link, blogcard, linkcard
4
  Requires at least: 4.3
5
+ Tested up to: 5.5.3
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.4.0
167
+ * WordPress 5.4.2 での動作確認。
168
+ Compatible with WordPress 5.4.2.
169
+ * WordPress 5.5 での動作確認。
170
+ Compatible with WordPress 5.5.
171
+ * WordPress 5.5.3 での動作確認。
172
+ Compatible with WordPress 5.5.3.
173
+ * 記事では無いページでURL無効のエラーが出てしまうのを抑制。
174
+ Fixed: Suppressed incorrect error display.
175
+ * サブディレクトリ型マルチサイトの判定においてエラーが出てしまうのを抑制。
176
+ Fixed: Suppressed incorrect error display.
177
+
178
  Ver2.3.1
179
  * WordPress 5.3 での動作確認。
180
  Compatible with WordPress 5.3.