Giter Club home page Giter Club logo

wp-simple-spreadsheet-fetcher-for-google's People

Contributors

naogify avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wp-simple-spreadsheet-fetcher-for-google's Issues

Multiple Charts cause error

If having multiple charts on same page an error saying that props already exists happens and any additional charts are not drawn

CSRF

概要

CSRFの脆弱性が存在します。

再現手順

POSTツールでログイン状態のクッキーとともに /wp-admin/plugins.php?page=wsgsf_settings に POST
api_key=任意の文字列

期待する動作

無関係のページ等から更新されないこと

スクリーンショット

202001052349
202001052350

発生した環境

  • WP v5.3.2
  • Chrome v79.0.3945.88
  • WP Simple Spreadsheet Fetcher for Google v0.3.6

補足

add_submenu_page は権限のチェックはありますが送信元のチェック等はありません。

form に token を埋め込み更新前にチェックするようにします。

$html .= '<form id="wp2s2fg_api_spreadsheetId_form" action="' . htmlspecialchars( $_SERVER["PHP_SELF"] . '?' . $_SERVER["QUERY_STRING"] ) . '" method="POST" >';
$html .= '<div class="wp2s2fg_api_spreadsheetId_form_label">' . __( "API Key : ", 'wp-simple-spreadsheet-fetcher-for-google' ) .'</div><input type="text" name="api_key" placeholder="API-Key" value="' . esc_html( $api_key ) . '" required />';
$html .= '<br>';
$html .= '<input type="submit" value="Set Configuration Info" />';
$html .= '</form >';

public function render_settings() {
if ( isset( $_POST['api_key'] )) {
wp2s2fg_set_api_key( sanitize_text_field( $_POST['api_key'] ) );
}

もしくはSettings APIを使用します。
https://developer.wordpress.org/plugins/settings/settings-api/
https://nskw-style.com/2014/wordpress/settings-api.html

フェッチャーアイテムの「範囲(range)」は「セル(cell)」の方がよいのでは?

有用なプラグインです。ありがとうございます。
遊んでいてちょっととまどった点。アドバンスドフェッチャーは単一の値を取得しますが、「範囲」となっていて少し動作に戸惑いました。「セル」で良いのでは?
実際範囲を指定してもコードでは最初のセルのみを使用していますね。

build/get-value-query.php

$data = '<p class="wp2s2fg_fetcher-advanced_number">' . esc_html( $values[0][0] ) . '</p>';

fetcher-advanced のフォントサイズが小さい

該当箇所は小さなフォントで表示されますが、私の環境では小さすぎるかな。
spread1

以下のスタイルが当たっているためですが、いっそ、削除してもいいのでは?

style.css 
.wp2s2fg_fetcher-advanced_price{
	font-size: 0.8rem;
}

.wp2s2fg_fetcher-advanced_number_container{
	font-size: 1.1rem;
}

spread2

ただ削除すると「/」とベースラインが合いませんがこれは <p><span> の違いから。
spread3
<span> で統一すれば解決する?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.