-
投稿者検索結果
-
2025年4月7日 2:50 PM #144748
返信が含まれるトピック: Snow Monkey Forms の確認画面で「無効なアクセスです。」と表示されます
ご返信ありがとうございます!
変更を入れてフォームの送信を実行したのですが、サーバーのエラーログというのはどちらで確認できますでしょうか?
契約しているサーバーはwpX Speedで、エラーログという項目には[Mon Apr 07 14:37:02.656799 2025] [fcgid:warn] [pid 19657] [client 112.69.162.153:45142] mod_fcgid: stderr: validate_referer:, referer: https://xxxxx/contact/ [Mon Apr 07 14:37:02.656829 2025] [fcgid:warn] [pid 19657] [client 112.69.162.153:45142] mod_fcgid: stderr: https://xxxxx/contact/, referer: https://xxxxx/contact/ [Mon Apr 07 14:37:02.656832 2025] [fcgid:warn] [pid 19657] [client 112.69.162.153:45142] mod_fcgid: stderr: https://xxxxx, referer: https://xxxxx/contact/ [Mon Apr 07 14:37:33.990242 2025] [fcgid:warn] [pid 4155] [client 112.69.162.153:45564] mod_fcgid: stderr: validate_referer:, referer: https://xxxxx/contact/ [Mon Apr 07 14:37:33.990325 2025] [fcgid:warn] [pid 4155] [client 112.69.162.153:45564] mod_fcgid: stderr: https://xxxxx/contact/, referer: https://xxxxx/contact/ [Mon Apr 07 14:37:33.990332 2025] [fcgid:warn] [pid 4155] [client 112.69.162.153:45564] mod_fcgid: stderr: https://xxxxx, referer: https://xxxxx/contact/ [Mon Apr 07 14:37:33.990337 2025] [fcgid:warn] [pid 4155] [client 112.69.162.153:45564] mod_fcgid: stderr: validate:, referer: https://xxxxx/contact/ [Mon Apr 07 14:37:33.990342 2025] [fcgid:warn] [pid 4155] [client 112.69.162.153:45564] mod_fcgid: stderr: 3e4bf70d0fb3a369459d9fc10870ed9b42c68c55c722ee84357086aee2563215, referer: https://xxxxx/contact/ [Mon Apr 07 14:37:33.990348 2025] [fcgid:warn] [pid 4155] [client 112.69.162.153:45564] mod_fcgid: stderr: 94bbffa23378f7774180aba9bbda4d257616fc858dc9e5e9f6a2e8c6bcd5f523, referer: https://xxxxx/contact/と記載があります。こちらのことでよろしいのでしょうか?
Snow Monkey Forms のバージョンは10.0.2になります!ご確認のほど、よろしくお願いいたします。
♥ 0Who liked: No user*****[ プライベートトピックのため非表示 ]♥ 0Who liked: No user*****[ プライベートトピックのため非表示 ]♥ 0Who liked: No user*****[ プライベートトピックのため非表示 ]♥ 0Who liked: No user*****[ プライベートトピックのため非表示 ]♥ 0Who liked: No user*****[ プライベートトピックのため非表示 ]♥ 0Who liked: No user2025年4月7日 12:07 PM #144738返信が含まれるトピック: Snow Monkey Forms の確認画面で「無効なアクセスです。」と表示されます
ぱっとみた感じではページキャッシュの問題ではなさそうなので、とりあえずは地道に検証するしか無い気がします。無効なアクセスかどうかの処理をしている部分にログ出力を仕込んで、どのような値で処理が実行されているかを確認してみてください。
下記の変更を入れてからフォームの送信を実行することで、サーバーのエラーログにログが記録されます。
plugins/snow-monkey-forms/App/Model/Csrf.phpのpublic static function validate( $posted_token ) { if ( ! $posted_token ) { return false; } if ( ! preg_match( '|^[a-z0-9]+$|', $posted_token ) ) { return false; } $cookie_token = static::saved_token(); return ! is_null( $cookie_token ) && ! is_null( $posted_token ) && hash_equals( $cookie_token, $posted_token ); }を
public static function validate( $posted_token ) { error_log( "validate:\n" ); error_log( $posted_token . "\n" ); if ( ! $posted_token ) { return false; } if ( ! preg_match( '|^[a-z0-9]+$|', $posted_token ) ) { return false; } $cookie_token = static::saved_token(); error_log( $cookie_token . "\n" ); return ! is_null( $cookie_token ) && ! is_null( $posted_token ) && hash_equals( $cookie_token, $posted_token ); }に変更。
public static function validate_referer() { // phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $referer = isset( $_SERVER['HTTP_REFERER'] ) ? wp_unslash( $_SERVER['HTTP_REFERER'] ) : false; // phpcs:enable $homeurl = untrailingslashit( home_url( '/' ) ); return 0 === strpos( $referer, $homeurl ); }を
public static function validate_referer() { error_log( "validate_referer:\n" ); // phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $referer = isset( $_SERVER['HTTP_REFERER'] ) ? wp_unslash( $_SERVER['HTTP_REFERER'] ) : false; error_log( $referer . "\n" ); // phpcs:enable $homeurl = untrailingslashit( home_url( '/' ) ); error_log( $homeurl . "\n" ); return 0 === strpos( $referer, $homeurl ); }に変更。
—
あ、あと、Snow Monkey Forms のバージョンもお願いします!
♥ 0Who liked: No user2025年4月7日 11:30 AM #144736返信が含まれるトピック: ロゴのALTタグを個別に設定したい(SEO対策)
ヘッダーのサイトロゴは内部的には
the_custom_logo()→get_custom_logo()を使っているのですが、get_custom_logo()の中にはget_custom_logo_image_attributesというフィルターフックがあるみたいなのでこれも使えそうな気がします。2025年4月7日 11:25 AM #144735返信が含まれるトピック: マイアカウント上では認証されているが、サイト上でライセンスキーが無効と表示される
*****[ プライベートトピックのため非表示 ]♥ 0Who liked: No user2025年4月7日 10:20 AM #144732返信が含まれるトピック: ロゴのALTタグを個別に設定したい(SEO対策)
補足:SEO対策として考えるのなら
上のコードそのままだとトップページのH1が「メディア上で設定した個別のALT」になってしまう<h1 class="c-site-branding__title"> <a href="https://example.com/" class="custom-logo-link" rel="home" aria-current="page"> <img width="484" height="98" src="https://example.com/wp-content/uploads/2023/05/logo-horizontal.png" class="custom-logo" alt="メディア上で設定した個別のALT"> </a> </h1>条件分岐してトップページでは、
<span class="screen-reader-text"><?php bloginfo( 'name' ); ?></span>のようにH1にサイトネームが入るようにする必要があると思います。<h1 class="c-site-branding__title"> <a href="https://example.com/" class="custom-logo-link" rel="home" aria-current="page"> <img width="484" height="98" src="https://example.com/wp-content/uploads/2023/05/logo-horizontal.png" class="custom-logo" alt="メディア上で設定した個別のALT"> <span class="screen-reader-text"><?php bloginfo( 'name' ); ?></span> </a> </h1>2025年4月6日 1:05 PM #144725返信が含まれるトピック: Snow Monkey Formsでオートコンプリート入力後、項目名が読まれない。
情報は登録されているけど自動入力しない設定になってました…。
試してみたところ、[↑][↓]で自動入力項目を選択して、[Enter]で自動入力されました。そして下の例だと名前が読み上げられました。

で、[Tab] で移動すると、住所と電話番号も同じ形で読まれました。ただ、間違ってページの適当なところをクリックしてしまい、しまったと思いすぐに [Tab] でフォーカスすると、入力項目にフォーカスがあたっているのに、ぜんぜん違う読み上げ(どこのページにいる的な)をしていました。
僕は使いこなせていないのでよくわからないのですが、操作方法によって読んだり読まなかったりというのがあるのかもしれません…。
♥ 0Who liked: No user2025年4月5日 5:51 PM #144720返信が含まれるトピック: カスタム投稿のサイドバーにカテゴリーを追加したが投稿数がデフォルトの投稿数になっている
2025年4月5日 5:39 PM #144719返信が含まれるトピック: ロゴのALTタグを個別に設定したい(SEO対策)
/** * WordPressのコア関数 the_custom_logo() が使用する * wp_get_attachment_image_attributes フィルターを利用して * サイトロゴのALT属性をカスタマイズします。 */ add_filter( 'wp_get_attachment_image_attributes', function ( $attr, $attachment ) { // カスタムロゴのIDを取得 $custom_logo_id = get_theme_mod( 'custom_logo' ); // 現在処理中の画像がサイトロゴかどうか確認 if ( $custom_logo_id && $attachment->ID === (int) $custom_logo_id ) { // メディアライブラリで設定されたALT属性を取得 $custom_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ); // カスタムALT属性が存在する場合は、それを使用 if ( ! empty( $custom_alt ) ) { $attr['alt'] = $custom_alt; } } return $attr; }, 10, 3 );こちらのコードを My Snow Monkey に追加すれば、メディアに設定した代替テキストと入れ替えることが出来ますが、SEO目的ならトップページの
H1をどうするか?もう少し考える必要がありそうです。2025年4月5日 4:58 PM #144718返信が含まれるトピック: Google Tag Managerのタグを、どこに、どう書いたらいいでしょうか?
マニュアルの通りです。
GTM-〇〇〇〇〇〇〇〇 を入力して公開をクリックすると、テーマ側で自動的に出力してくれます。
-
投稿者検索結果


