Pz-LinkCard - Version 1.7.6

Version Description

Download this release

Release Info

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

Code changes from version 1.7.7 to 1.7.6

Files changed (3) hide show
  1. lib/pz-linkcard-cacheman.php +12 -22
  2. pz-linkcard.php +3 -6
  3. readme.txt +0 -5
lib/pz-linkcard-cacheman.php CHANGED
@@ -228,32 +228,22 @@ if (strpos($sql, '--') || strpos($sql, 'UPDATE') || strpos($sql, 'UNION') ) { //
228
  $domain_list = $wpdb->get_results($sql); // テーブルデータ
229
 
230
  // SUB(CASE WHEN ... END) で一気に取れないぽい?
231
- $count_all = 0;
232
- $count_internal = 0;
233
- $count_external = 0;
234
- $count_modify = 0;
235
- $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name");
236
- if (isset($result) && isset($result->count)) {
237
- $count_all = $result->count;
238
- }
239
  $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name WHERE url LIKE '".get_bloginfo('url')."%'");
240
- if (isset($result) && isset($result->count)) {
241
- $count_internal = $result->count;
242
- }
243
  $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name WHERE url NOT LIKE '".get_bloginfo('url')."%'");
244
- if (isset($result) && isset($result->count)) {
245
- $count_external = $result->count;
246
- }
247
  $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name WHERE alive_result <> result_code");
248
- if (isset($result) && isset($result->count)) {
249
- $count_modify = $result->count;
250
- }
251
  ?>
 
252
  <ul class='subsubsub'>
253
- <li class="all"><a href="?page=pz-linkcard-cache&link_type=all&orderby=regist&order=desc" <?php if ($link_type == 'all') echo 'class="current"'; ?>><?php _e('All', $this->text_domain); ?> <span class="count">(<?php echo $count_all; ?>)</span></a> |</li>
254
- <li class="all"><a href="?page=pz-linkcard-cache&link_type=internal&orderby=regist&order=desc" <?php if ($link_type == 'internal') echo 'class="current"'; ?>><?php _e('Internal', $this->text_domain); ?> <span class="count">(<?php echo $count_internal; ?>)</span></a> |</li>
255
- <li class="all"><a href="?page=pz-linkcard-cache&link_type=external&orderby=regist&order=desc" <?php if ($link_type == 'external') echo 'class="current"'; ?>><?php _e('External', $this->text_domain); ?> <span class="count">(<?php echo $count_external; ?>)</span></a> |</li>
256
- <li class="all"><a href="?page=pz-linkcard-cache&link_type=modify&orderby=regist&order=desc" <?php if ($link_type == 'modify') echo 'class="current"'; ?>><?php _e('Modify', $this->text_domain); ?> <span class="count">(<?php echo $count_modify; ?>)</span></a></li>
257
  </ul>
258
 
259
  <form id="posts-filter" action="" method="post">
@@ -379,7 +369,7 @@ foreach ($data_all as $data) {
379
  $sns_count = $data->sns_hatena;
380
  echo ' <td style="font-size: 60%;">'.(($sns_count >= 0) ? $sns_count : '-').'</td>';
381
 
382
- echo ' <td>'.$data->regist.'</td>';
383
  echo ' <td style="word-break: break-all;"><a href="'.get_permalink($data->post_id).'" target="_blank" title="'.get_the_title($data->post_id).'">'.$data->post_id.'</td>';
384
  echo ' <td>'.$data->result_code.($data->result_code <> $data->alive_result ? '<br><span style="color:#f00;">('.$data->alive_result.')</span>' : '').'</td>';
385
  echo '</tr>';
228
  $domain_list = $wpdb->get_results($sql); // テーブルデータ
229
 
230
  // SUB(CASE WHEN ... END) で一気に取れないぽい?
231
+ $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name");
232
+ $count_all = $result->count;
 
 
 
 
 
 
233
  $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name WHERE url LIKE '".get_bloginfo('url')."%'");
234
+ $count_internal = $result->count;
 
 
235
  $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name WHERE url NOT LIKE '".get_bloginfo('url')."%'");
236
+ $count_external = $result->count;
 
 
237
  $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name WHERE alive_result <> result_code");
238
+ $count_modify = $result->count;
239
+
 
240
  ?>
241
+
242
  <ul class='subsubsub'>
243
+ <li class="all"><a href="?page=pz-linkcard-cache&link_type=all&orderby=regist&order=desc" <?php if ($link_type == 'all') echo 'class="current"'; ?>><?php _e('All', $this->text_domain); ?> <span class="count">(<?php echo $count_all; ?>)</span></a> |</li>
244
+ <li class="all"><a href="?page=pz-linkcard-cache&link_type=internal&orderby=regist&order=desc" <?php if ($link_type == 'internal') echo 'class="current"'; ?>><?php _e('Internal', $this->text_domain); ?> <span class="count">(<?php echo $count_internal; ?>)</span></a> |</li>
245
+ <li class="all"><a href="?page=pz-linkcard-cache&link_type=external&orderby=regist&order=desc" <?php if ($link_type == 'external') echo 'class="current"'; ?>><?php _e('External', $this->text_domain); ?> <span class="count">(<?php echo $count_external; ?>)</span></a> |</li>
246
+ <li class="all"><a href="?page=pz-linkcard-cache&link_type=modify&orderby=regist&order=desc" <?php if ($link_type == 'modify') echo 'class="current"'; ?>><?php _e('Modify', $this->text_domain); ?> <span class="count">(<?php echo $count_modify; ?>)</span></a></li>
247
  </ul>
248
 
249
  <form id="posts-filter" action="" method="post">
369
  $sns_count = $data->sns_hatena;
370
  echo ' <td style="font-size: 60%;">'.(($sns_count >= 0) ? $sns_count : '-').'</td>';
371
 
372
+ echo ' <td>'.$data->regist.'<br>'.date('Y-m-d H:i:s', $data->alive_time).'</td>';
373
  echo ' <td style="word-break: break-all;"><a href="'.get_permalink($data->post_id).'" target="_blank" title="'.get_the_title($data->post_id).'">'.$data->post_id.'</td>';
374
  echo ' <td>'.$data->result_code.($data->result_code <> $data->alive_result ? '<br><span style="color:#f00;">('.$data->alive_result.')</span>' : '').'</td>';
375
  echo '</tr>';
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.7.7
7
  Author: poporon
8
  Author URI: http://poporon.poponet.jp
9
  License: GPLv2 or later
@@ -122,7 +122,7 @@ class Pz_LinkCard {
122
  'presence' => null,
123
  'plugin-link' => null,
124
  'plugin-name' => 'Pz-LinkCard',
125
- 'plugin-version' => '1.7.7',
126
  'plugin-url' => 'http://poporon.poponet.jp/pz-linkcard',
127
  'pz-hbc-options' => null,
128
  'debug-time' => null
@@ -872,10 +872,7 @@ class Pz_LinkCard {
872
  }
873
  }
874
  $thumbnail_id = get_post_thumbnail_id( $post_id ); // サムネイル
875
- $attach = wp_get_attachment_image_src( $thumbnail_id , true );
876
- if (isset($attach) && count($attach) && isset($attach[0])) {
877
- $thumbnail = $attach[0];
878
- }
879
  } else {
880
  // カテゴリページ等は内部取得できないので外部取得する
881
  $data = $this->pz_GetCURL( $data );
3
  Plugin Name: Pz-LinkCard
4
  Plugin URI: http://poporon.poponet.jp/pz-linkcard
5
  Description: リンクをカード形式で表示します。
6
+ Version: 1.7.6
7
  Author: poporon
8
  Author URI: http://poporon.poponet.jp
9
  License: GPLv2 or later
122
  'presence' => null,
123
  'plugin-link' => null,
124
  'plugin-name' => 'Pz-LinkCard',
125
+ 'plugin-version' => '1.7.6',
126
  'plugin-url' => 'http://poporon.poponet.jp/pz-linkcard',
127
  'pz-hbc-options' => null,
128
  'debug-time' => null
872
  }
873
  }
874
  $thumbnail_id = get_post_thumbnail_id( $post_id ); // サムネイル
875
+ $thumbnail = wp_get_attachment_image_src( $thumbnail_id , true )[0];
 
 
 
876
  } else {
877
  // カテゴリページ等は内部取得できないので外部取得する
878
  $data = $this->pz_GetCURL( $data );
readme.txt CHANGED
@@ -155,11 +155,6 @@ A5.
155
 
156
  == Changelog ==
157
 
158
- = 1.7.7
159
- * Fixed: Fixed a bug
160
-
161
- * アイキャッチ画像が設定されていないテーマの場合にエラーが発生してしまうのを修正。(Thanks enomoto、sato)
162
-
163
  = 1.7.6
164
  * Added: Add tips at settings screen
165
  * Added: Tiny format 'Stitch'.
155
 
156
  == Changelog ==
157
 
 
 
 
 
 
158
  = 1.7.6
159
  * Added: Add tips at settings screen
160
  * Added: Tiny format 'Stitch'.