Plugin Directory

Changeset 3053854


Ignore:
Timestamp:
03/18/2024 07:13:29 PM (22 months ago)
Author:
poporon
Message:

2.5.3

  • WordPress 6.4.3 での動作確認。 Compatible with WordPress 6.4.3.
  • 「SSRF(サーバーサイドリクエストフォージェリ)」に対する脆弱性があったため、対策を行いました。 Fixed: SSRF vulnerability was discovered and countermeasures were taken.
  • 「XSS(クロスサイトスクリプティング)」に対する脆弱性があったため、対策を行いました。 Fixed: XSS vulnerability was discovered and countermeasures were taken.
  • 「Reflected-XSS(反射型クロスサイトスクリプティング)」に対する脆弱性があったため、対策を行いました。 Fixed: Reflected-XSS vulnerability was discovered and countermeasures were taken.
  • ソーシャルカウントの取得方法を修正しました。 Fixed: Modified "How to access the External Links" to be even more secure.
  • URLの安全性チェックを追加しました。 Fixed: Modified "URL Checks" to be even more secure.
Location:
pz-linkcard/trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • pz-linkcard/trunk/css/admin.css

    r3000517 r3053854  
    619619}
    620620.pz-lkc-develop-message {
    621     margin: 0 0 0 -16px;
    622     padding: 8px;
     621    position: sticky;
     622    z-index: 3;
     623    top: 32px;
     624    margin: 0 0 0 -20px;
     625    padding: 16px 0 0 0;
     626    height: 32px;
    623627    background-color: #00aa88 !important;
    624628    color: #ffffff !important;
  • pz-linkcard/trunk/js/admin-settings.js

    r3000517 r3053854  
    2121        }
    2222
     23        // submitをクリックしたら
     24        $('form' ).submit( function() {
     25            $('.pz-lkc-dashboard' ).hide();
     26            $('.pz-lkc-develop-message' ).hide();
     27        } );
     28
    2329        // イベント:ReadOnlyになったチェックボックスを動作させなくする
    2430        $('input:checkbox' ).on('click', checkbox_readonly );
     
    5460
    5561        $('.pz-lkc-dashboard' ).show();
    56 
    5762    } );
    5863
  • pz-linkcard/trunk/lib/pz-linkcard-settings.php

    r3051538 r3053854  
    11<?php defined('ABSPATH' ) || wp_die; ?>
     2<?php /* 開発者モード */ if (!$this->options['develop-mode'] ) { echo '<div class="pz-lkc-develop-message">'.__('Currently working in a development environment.', $this->text_domain ).'</div>'; } ?>
    23<div class="pz-lkc-dashboard wrap">
    3 
    4     <?php
    5     echo    '<h1 class="pz-lkc-header-settings">';
    6     /* 開発者モード */
    7     if  (!$this->options['develop-mode'] ) {
    8         echo '<div class="pz-lkc-develop-message">'.__('Currently working in a development environment.', $this->text_domain ).'</div>';
    9     }
    10 
    11     echo    '<span class="pz-lkc-header-settings-icon">';
    12     echo    __('&#x2699;&#xfe0f;', $this->text_domain );
    13     echo    '</span>';
    14     echo    '&nbsp;';
    15     echo    __('LinkCard Settings', $this->text_domain );
    16     echo    '&ensp;';
    17     echo    '<a href="'.$this->options['author-url'].'/pz-linkcard-manager" rel="external noopener help" target="_blank"><img src="'.$this->plugin_dir_url.'img/help.png" width="16" height="16" title="'.__('Help', $this->text_domain ).'" alt="help">';
    18     echo    '</a>';
    19     echo    '</h1>';
    20 ?>
    21 
    22 
    23     <div class="pz-lkc-clear-both">&nbsp;</div>
     4    <h1 class="pz-lkc-header-settings">
     5        <span class="pz-lkc-header-settings-icon"><?php _e('&#x2699;&#xfe0f;', $this->text_domain ); ?></span>
     6        &nbsp;
     7        <?php _e('LinkCard Settings', $this->text_domain ); ?>
     8        &ensp;
     9        <a href="<?php echo $this->options['author-url']; ?>/pz-linkcard-manager" rel="external noopener help" target="_blank"><img src="<?php echo $this->plugin_dir_url; ?>img/help.png" width="16" height="16" title="<?php _e('Help', $this->text_domain ); ?>" alt="help"></a>
     10        <div class="pz-lkc-header-goto"><a href="<?php echo $this->cacheman_url; ?>"><span class="pz-lkc-header-goto-icon"><?php echo __('&#x1f5c3;&#xfe0f;', $this->text_domain ); ?></span><span class="pz-lkc-header-goto-text"><?php echo __('Cache Manager', $this->text_domain ); ?></span></a><span class="pz-lkc-clear-both"></span></div>
     11    </h1>
     12
    2413<?php
    25 /*  <div class="pz-lkc-header-goto"><a href="<?php echo $this->cacheman_url; ?>"><span class="pz-lkc-header-goto-icon"><?php echo __('&#x1f5c3;&#xfe0f;', $this->text_domain ); ?></span><span class="pz-lkc-header-goto-text"><?php echo __('Cache Manager', $this->text_domain ); ?></span></a></div> */
    26 
    2714    // 変数の設定
    28     $action                 =   isset($_POST['action'])          ? $_POST['action']         : null ;
    29     $properties             =   isset($_POST['properties'])      ? $_POST['properties']     : null ;
    30     $tab_now                =   isset($_POST['pz-lkc-tab-now'] ) ? $_POST['pz-lkc-tab-now'] : null ;
    31 
    32     if  ($properties ) {
     15    $action     =   isset($_REQUEST['action'] )         ? esc_attr($_REQUEST['action'] )            : null;
     16    $tab_now    =   isset($_REQUEST['pz-lkc-tab-now'] ) ? esc_attr($_REQUEST['pz-lkc-tab-now'] )    : null;
     17
     18    if  (isset($_REQUEST['properties'] ) ) {
    3319        check_admin_referer('pz-lkc-settings' );
    34         switch  ($action) {
     20
     21        $properties =   $_REQUEST['properties'];
     22        switch  ($action ) {
    3523        case    'init-settings':
    3624            $result         =   $this->pz_InitializeOption();   // オプションの初期化
     
    5341        default:
    5442            // 「変更を保存」もしくは「プラグインの再起動」をクリックしたとき
     43            foreach($properties as $key => $value ) {
     44                $properties[$key]       =   stripslashes($value );
     45            }
    5546            foreach($this->defaults as $key => $value ) {           // 無いキーを生成
    5647                if  (!array_key_exists($key, $properties ) ) {
     
    5849                }
    5950            }
     51
    6052            $this->options  =   $properties;
    6153
     
    138130
    139131            <?php wp_nonce_field('pz-lkc-settings' ); ?>
    140             <input type="text" class="pz-lkc-tab-now pz-lkc-hide" name="pz-lkc-tab-now"    value="<?php echo $tab_now; ?>" />
    141             <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-error"      value="<?php echo $this->options['error-mode']; ?>" />
    142             <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-debug"      value="<?php echo $this->options['debug-mode']; ?>" />
    143             <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-admin"      value="<?php echo $this->options['admin-mode']; ?>" />
    144             <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-develop"    value="<?php echo $this->options['develop-mode']; ?>" />
    145             <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-multisite"  value="<?php echo $is_multisite; ?>" />
    146             <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-initialize" value="<?php echo $this->options['flg-initialize']; ?>" />
     132            <input type="text" class="pz-lkc-tab-now pz-lkc-hide" name="pz-lkc-tab-now"    value="<?php echo esc_attr($tab_now ); ?>" />
     133            <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-error"      value="<?php echo esc_attr($this->options['error-mode'] ); ?>" />
     134            <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-debug"      value="<?php echo esc_attr($this->options['debug-mode'] ); ?>" />
     135            <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-admin"      value="<?php echo esc_attr($this->options['admin-mode'] ); ?>" />
     136            <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-develop"    value="<?php echo esc_attr($this->options['develop-mode'] ); ?>" />
     137            <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-multisite"  value="<?php echo esc_attr($is_multisite ); ?>" />
     138            <input type="text" class="pz-lkc-display pz-lkc-hide" name="pz-lkc-initialize" value="<?php echo esc_attr($this->options['flg-initialize'] ); ?>" />
    147139
    148140            <div class="pz-lkc-tabs">
     
    193185                        <th scope="row"><?php _e('Occurrence Time', $this->text_domain ); ?></th>
    194186                        <td>
    195                             <span class="pz-lkc-admin-only"><input name="properties[error-time]" type="text" value="<?php echo $this->options['error-time']; ?>" readonly="readonly" /></span>
     187                            <span class="pz-lkc-admin-only"><input name="properties[error-time]" type="text" value="<?php echo esc_attr($this->options['error-time'] ); ?>" readonly="readonly" /></span>
    196188                            <?php echo ($this->options['error-time'] ) ? date($this->datetime_format, $this->options['error-time'] ) : null ; ?>
    197189                        </td>
     
    262254                        <th scope="row"><?php echo  __('How to', $this->text_domain ).' '.__('(', $this->text_domain ).__('Japanese Only', $this->text_domain ).__(')', $this->text_domain ); ?></th>
    263255                        <td>
    264                             <p><?php echo   esc_attr($this->options['plugin-name']).' Ver.'.esc_attr($this->options['plugin-version'] ); ?></p>
     256                            <p><?php echo   esc_attr($this->options['plugin-name'] ).' Ver.'.esc_attr($this->options['plugin-version'] ); ?></p>
    265257                            <p><a href="<?php echo  esc_attr($plugin_url ); ?>" rel="external noopener" target="_blank"><?php echo  esc_attr($plugin_url ); ?></a></p>
    266258                        </td>
     
    11031095                    <tr>
    11041096                        <th scope="row"><?php _e('Class ID to be Added (for PC)', $this->text_domain ); ?></th>
    1105                         <td><input name="properties[class-pc]"          type="text" size="40" value="<?php echo (isset($this->options['class-pc']) ? esc_attr($this->options['class-pc']) : '' ); ?>" /></td>
     1097                        <td><input name="properties[class-pc]"          type="text" size="40" value="<?php echo (isset($this->options['class-pc'] ) ? esc_attr($this->options['class-pc'] ) : '' ); ?>" /></td>
    11061098                    </tr>
    11071099                    <tr>
    11081100                        <th scope="row"><?php _e('Class ID to be Added (for Mobile)', $this->text_domain ); ?></th>
    1109                         <td><input name="properties[class-mobile]"      type="text" size="40" value="<?php echo (isset($this->options['class-mobile']) ? esc_attr($this->options['class-mobile']) : '' ); ?>" /><br>
     1101                        <td><input name="properties[class-mobile]"      type="text" size="40" value="<?php echo (isset($this->options['class-mobile'] ) ? esc_attr($this->options['class-mobile'] ) : '' ); ?>" /><br>
    11101102                    </tr>
    11111103
     
    11451137                    <tr class="pz-lkc-debug-only">
    11461138                        <th scope="row"><span class="pz-lkc-admin-text"><?php _e('Administrator Mode', $this->text_domain ); ?></span></th>
    1147                         <td><label class="pz-lkc-admin-text"><input name="properties[admin-mode]" type="checkbox" value="1" class="pz-lkc-tab-show" <?php checked($this->options['admin-mode'] ); if (!$this->options['admin-mode']) {echo 'readonly="readonly"'; }; if (!$this->options['admin-mode'] ) { echo 'ondblclick="this.readOnly=false;"'; } ?> /><?php _e('Display information that is not normally needed or open special settings.', $this->text_domain ); _e('(Deprecated)', $this->text_domain ); ?></label></td>
     1139                        <td><label class="pz-lkc-admin-text"><input name="properties[admin-mode]" type="checkbox" value="1" class="pz-lkc-tab-show" <?php checked($this->options['admin-mode'] ); if (!$this->options['admin-mode'] ) {echo 'readonly="readonly"'; }; if (!$this->options['admin-mode'] ) { echo 'ondblclick="this.readOnly=false;"'; } ?> /><?php _e('Display information that is not normally needed or open special settings.', $this->text_domain ); _e('(Deprecated)', $this->text_domain ); ?></label></td>
    11481140                    </tr>
    11491141
  • pz-linkcard/trunk/lib/pz-linkcard-style.php

    r3000517 r3053854  
    368368                $file_text = str_replace('/*EX-BGCOLOR*/',      'background-color: '.$this->options['ex-bgcolor'].';', $file_text );
    369369            }
    370             if ($this->options['ex-image']) {
    371                 if (preg_match('/https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/', $this->options['ex-image'])) {
    372                     $file_text = str_replace('/*EX-IMAGE*/',    'background-image: url("'.$this->options['ex-image'].'");', $file_text );
     370            $bg_image       =   esc_url($this->options['ex-image'] );
     371            if ($bg_image ) {
     372                if (preg_match('/https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/', $bg_image ) ) {
     373                    $file_text = str_replace('/*EX-IMAGE*/',    'background-image: url("'.$bg_image.'");', $file_text );
    373374                } else {
    374                     $file_text = str_replace('/*EX-IMAGE*/',    'background-image: '.$this->options['ex-image'].';', $file_text );
     375                    $file_text = str_replace('/*EX-IMAGE*/',    'background-image: '.$bg_image.';', $file_text );
    375376                }
    376377            }
     
    380381                $file_text = str_replace('/*IN-BGCOLOR*/',      'background-color: '.$this->options['in-bgcolor'].';', $file_text );
    381382            }
    382             if ($this->options['in-image']) {
    383                 if (preg_match('/https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/', $this->options['in-image'])) {
    384                     $file_text = str_replace('/*IN-IMAGE*/',    'background-image: url("'.$this->options['in-image'].'");', $file_text );
     383            $bg_image       =   esc_url($this->options['in-image'] );
     384            if ($bg_image ) {
     385                if (preg_match('/https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/', $bg_image)) {
     386                    $file_text = str_replace('/*IN-IMAGE*/',    'background-image: url("'.$bg_image.'");', $file_text );
    385387                } else {
    386                     $file_text = str_replace('/*IN-IMAGE*/',    'background-image: '.$this->options['in-image'].';', $file_text );
     388                    $file_text = str_replace('/*IN-IMAGE*/',    'background-image: '.$bg_image.';', $file_text );
    387389                }
    388390            }
     
    392394                $file_text = str_replace('/*TH-BGCOLOR*/',      'background-color: '.$this->options['th-bgcolor'].';', $file_text );
    393395            }
    394             if ($this->options['th-image']) {
    395                 if (preg_match('/https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/', $this->options['th-image'])) {
    396                     $file_text = str_replace('/*TH-IMAGE*/',    'background-image: url("'.$this->options['th-image'].'");', $file_text );
     396            $bg_image       =   esc_url($this->options['th-image'] );
     397            if ($bg_image ) {
     398                if (preg_match('/https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/', $bg_image)) {
     399                    $file_text = str_replace('/*TH-IMAGE*/',    'background-image: url("'.$bg_image.'");', $file_text );
    397400                } else {
    398                     $file_text = str_replace('/*TH-IMAGE*/',    'background-image: '.$this->options['th-image'].';', $file_text );
     401                    $file_text = str_replace('/*TH-IMAGE*/',    'background-image: '.$bg_image.';', $file_text );
    399402                }
    400403            }
  • pz-linkcard/trunk/pz-linkcard.php

    r3051538 r3053854  
    33/*
    44Plugin Name:    Pz-LinkCard
    5 Plugin URI:     http://poporon.poponet.jp/pz-linkcard
     5Plugin URI:     http://popozure.info/pz-linkcard
    66Description:    リンクをカード形式で表示します。
    7 Version:        2.5.2
     7Version:        2.5.3
    88Author:         Poporon
    9 Author URI:     http://poporon.poponet.jp
     9Author URI:     http://popozure.info
    1010Text Domain:    pz-linkcard
    1111Domain Path:    /language
     
    1717    protected   $defaults           =
    1818        array(
    19             'plugin-version'        =>  '2.5.2',
     19            'plugin-version'        =>  '2.5.3',
    2020            'plugin-name'           =>  'Pz-LinkCard',
    2121            'plugin-abbreviation'   =>  'Pz-LkC',
     
    561561        $class_id       =   'linkcard';
    562562        if  ($is_mobile && $this->options['class-mobile'] ) {
    563             $class_id   .=  ' '.$this->options['class-mobile'];
     563            $class_id   .=  ' '.esc_attr($this->options['class-mobile'] );
    564564        } elseif    ($this->options['class-pc'] ) {
    565             $class_id   .=  ' '.$this->options['class-pc'];
     565            $class_id   .=  ' '.esc_attr($this->options['class-pc'] );
    566566        }
    567567
     
    672672                $thumbnail_alt  =   null;
    673673                $favicon_alt    =   null;
    674                 $info           =   isset($this->options['th-info'] )       ? $this->options['th-info']         : null ;
     674                $info_text      =   isset($this->options['th-info'] )       ? $this->options['th-info']         : null ;
    675675                $sw_thumbnail   =   isset($this->options['in-thumbnail'] )  ? $this->options['in-thumbnail']    : 0 ;
    676676                $sw_favicon     =   isset($this->options['in-favicon'] )    ? $this->options['in-favicon']      : 0 ;
     
    684684                $thumbnail_alt  =   isset($this->options['in-thumbnail-alt'] )  ? $this->options['in-thumbnail-alt']    : null ;
    685685                $favicon_alt    =   isset($this->options['in-favicon-alt'] )    ? $this->options['in-favicon-alt']      : null ;
    686                 $info           =   isset($this->options['in-info'] )           ? $this->options['in-info']             : null ;
     686                $info_text      =   isset($this->options['in-info'] )           ? $this->options['in-info']             : null ;
    687687                $sw_thumbnail   =   isset($this->options['in-thumbnail'] )      ? $this->options['in-thumbnail']        : 0 ;
    688688                $sw_favicon     =   isset($this->options['in-favicon'] )        ? $this->options['in-favicon']          : 0 ;
     
    708708            $thumbnail_alt      =   isset($this->options['ex-thumbnail-alt'] )  ? $this->options['ex-thumbnail-alt']    : null ;
    709709            $favicon_alt        =   isset($this->options['ex-favicon-alt'] )    ? $this->options['ex-favicon-alt']      : null ;
    710             $info               =   isset($this->options['ex-info'] )           ? $this->options['ex-info']             : null ;
     710            $info_text          =   isset($this->options['ex-info'] )           ? $this->options['ex-info']             : null ;
    711711            $sw_thumbnail       =   isset($this->options['ex-thumbnail'] )      ? $this->options['ex-thumbnail']        : 0 ;
    712712            $sw_favicon         =   isset($this->options['ex-favicon'] )        ? $this->options['ex-favicon']          : 0 ;
    713713        }
     714
     715        // XSS対策
     716        $more_text          =   esc_attr($more_text );
     717        $info_text          =   esc_attr($info_text );
     718        $thumbnail_alt      =   esc_attr($thumbnail_alt );
     719        $favicon_alt        =   esc_attr($favicon_alt );
    714720
    715721        // ドメイン名の準備
     
    969975
    970976        // サイト情報
    971         if  ($info ) {
    972             $added_info =   $html_added_op.$info.$html_added_cl;
     977        if  ($info_text ) {
     978            $added_info =   $html_added_op.$info_text.$html_added_cl;
    973979        } else {
    974980            $added_info =   null;
     
    981987            $info_date  =   null;
    982988        }
    983         $domain_info    =   
    984                 '<div class="lkc-info">'.
    985                     $html_a_op.
    986                         $html_favicon.
    987                         '<div class="lkc-domain"'.
    988                             $title_sitename.'>'.
    989                             $disp_sitename.
    990                         '</div>'.
    991                         $added_info.
    992                     $html_a_cl.
    993                     $html_sns_info.
    994                     $html_url2.
    995                     $info_date.
    996                 '</div>';
     989        $domain_info    =   '<div class="lkc-info">'.$html_a_op.$html_favicon.'<div class="lkc-domain"'.$title_sitename.'>'.$disp_sitename.'</div>'.$added_info.$html_a_cl.$html_sns_info.$html_url2.$info_date.'</div>';
    997990
    998991        // Google AMP用 簡易タグ作成
     
    10511044        // URL指定なし
    10521045        if  (!$url ) {
     1046            return  null;
     1047        }
     1048
     1049        // URLの安全性チェック
     1050        if (!wp_http_validate_url( $url ) ) {
    10531051            return  null;
    10541052        }
     
    13241322        //  $count_before   =   isset($data['sns_twitter'] ) ? $data['sns_twitter'] : -1;
    13251323        //  if  ($sns_renew || $count_before < 0 ) {
    1326         //      $result =   wp_remote_get('https://jsoon.digitiminimi.com/twitter/count.json?url=' .$url_raw, $opt );
     1324        //      $result =   wp_safe_remote_get('https://jsoon.digitiminimi.com/twitter/count.json?url=' .$url_raw, $opt );
    13271325        //      if  (isset($result ) && !is_wp_error($result ) && $result['response']['code'] == 200 ) {
    13281326        //          $json   =   json_decode($result['body'] );
     
    13401338        //  $count_before   =   intval(isset($data['sns_facebook'] ) ? $data['sns_facebook'] : -1 );
    13411339        //  if  ($sns_renew || $count_before < 0 ) {
    1342         //      $result =   wp_remote_get('https://graph.facebook.com?fields=og_object{engagement}&id=' .$url_raw, $opt );
     1340        //      $result =   wp_safe_remote_get('https://graph.facebook.com?fields=og_object{engagement}&id=' .$url_raw, $opt );
    13431341        //      if  (isset($result ) && !is_wp_error($result ) && $result['response']['code'] == 200 ) {
    13441342        //          $json   =   json_decode($result['body'] );
     
    13561354            $count_before   =   isset($data['sns_hatena'] ) ? $data['sns_hatena'] : -1;
    13571355            if  ($sns_renew || $count_before < 0 ) {
    1358                 $result =   wp_remote_get('http://api.b.st-hatena.com/entry.count?url=' .$url_raw, $opt );
     1356                $result =   wp_safe_remote_get('http://api.b.st-hatena.com/entry.count?url=' .$url_raw, $opt );
    13591357                if  (isset($result ) && !is_wp_error($result ) && $result['response']['code'] == 200 ) {
    13601358                    $count  =   intval($result['body'] );
     
    13711369            $count_before   =   isset($data['sns_pocket'] ) ? $data['sns_pocket'] : -1;
    13721370            if  ($sns_renew || $count_before < 0 ) {
    1373                 $result =   wp_remote_get('https://widgets.getpocket.com/api/saves?url=' .$url_raw, $opt );
     1371                $result =   wp_safe_remote_get('https://widgets.getpocket.com/api/saves?url=' .$url_raw, $opt );
    13741372                if  (isset($result ) && !is_wp_error($result ) && $result['response']['code'] == 200 ) {
    13751373                    $json   =   json_decode($result['body'] );
     
    18101808        }
    18111809
     1810        // URLの安全性チェック
     1811        if (!wp_http_validate_url( $url ) ) {
     1812            return  null;
     1813        }
     1814
    18121815        // URLエンコード
    18131816        $url            =   $this->pz_EncodeURL($url ,true );
     
    18801883        } else {                                                        // cURLが使用できない場合
    18811884            // wp_remote_get 実行
    1882             $rget_data          =   wp_remote_get($url );               // wp_remote_get実行
     1885            $rget_data          =   wp_safe_remote_get($url );              // wp_remote_get実行
    18831886            $err_no             =   is_wp_error($rget_data );           // wp_remote_getエラー有無
    18841887            $err_message        =   null;                               // wp_remote_getエラーメッセージ
     
    23902393    // 管理画面のサブメニュー追加
    23912394    public function add_menu() {
    2392 //      $menu_manager   =   __('Pz LkC Cache',  $this->text_domain );
     2395        $menu_manager   =   __('Pz LkC Cache',  $this->text_domain );
    23932396        $menu_settings  =   __('Pz LinkCard',   $this->text_domain );
    2394 //      if  ($this->options['flg-alive'] && $this->options['flg-alive-count'] ) {
    2395 //          global  $wpdb;
    2396 //          $result     =   $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name WHERE alive_result < 100 OR alive_result >= 400");
    2397 //          if  (isset($result ) && isset($result->count ) ) {
    2398 //              $menu_manager   .=  '&nbsp;<span class="update-plugins"><span class="update-count lkc-menu-count">'.$result->count.'</span></span>';
    2399 //          }
    2400 //      }
    2401 //      add_management_page (__('LinkCard Cache Manager',   $this->text_domain ), $menu_manager,    'manage_options', 'pz-linkcard-cacheman',   array($this, 'page_cacheman' ) );
     2397        if  ($this->options['flg-alive'] && $this->options['flg-alive-count'] ) {
     2398            global  $wpdb;
     2399            $result     =   $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db_name WHERE alive_result < 100 OR alive_result >= 400");
     2400            if  (isset($result ) && isset($result->count ) ) {
     2401                $menu_manager   .=  '&nbsp;<span class="update-plugins"><span class="update-count lkc-menu-count">'.$result->count.'</span></span>';
     2402            }
     2403        }
     2404        add_management_page (__('LinkCard Cache Manager',   $this->text_domain ), $menu_manager,    'manage_options', 'pz-linkcard-cacheman',   array($this, 'page_cacheman' ) );
    24022405        add_options_page    (__('LinkCard Settings',        $this->text_domain ), $menu_settings,   'manage_options', 'pz-linkcard-settings',   array($this, 'page_settings' ) );
    24032406    }
     
    24182421            $links,
    24192422            array(
     2423                'manager'   =>  '<a href="'.$this->cacheman_url.'">'.__('Manager' , $this->text_domain ).'</a>',
    24202424                'settings'  =>  '<a href="'.$this->settings_url.'">'.__('Settings', $this->text_domain ).'</a>',
    24212425            )
     
    24232427    }
    24242428
    2425 //              'manager'   =>  '<a href="'.$this->cacheman_url.'">'.__('Manager' , $this->text_domain ).'</a>',
    24262429
    24272430    // プラグインを有効化
  • pz-linkcard/trunk/readme.txt

    r3051538 r3053854  
    152152== Changelog ==
    153153
     154= 2.5.3 =
     155* WordPress 6.4.3 での動作確認。
     156  Compatible with WordPress 6.4.3.
     157* 「SSRF(サーバーサイドリクエストフォージェリ)」に対する脆弱性があったため、対策を行いました。
     158  Fixed: SSRF vulnerability was discovered and countermeasures were taken.
     159* 「XSS(クロスサイトスクリプティング)」に対する脆弱性があったため、対策を行いました。
     160  Fixed: XSS vulnerability was discovered and countermeasures were taken.
     161* 「Reflected-XSS(反射型クロスサイトスクリプティング)」に対する脆弱性があったため、対策を行いました。
     162  Fixed: Reflected-XSS vulnerability was discovered and countermeasures were taken.
     163* ソーシャルカウントの取得方法を修正しました。
     164  Fixed: Modified "How to access the External Links" to be even more secure.
     165* URLの安全性チェックを追加しました。
     166  Fixed: Modified "URL Checks" to be even more secure.
     167
    154168= 2.5.2 =
    155 * 一次的に管理画面を使用できないようにしました
     169* 欠番
    156170
    157171= 2.5.1 =
Note: See TracChangeset for help on using the changeset viewer.