PHP で全角半角を考慮して 文字列を同じ長さに切りそろえる / Cut the character string to the same length in PHP considering full-width and half-width characters.

問題なく動く模様

cPanel > MultiPHPマネージャー で PHP のバージョンを変更

cPanel > MultiPHPマネージャー で PHP のバージョンを PHP 7.4 (ea-php74) にしたところ

下記のエラーが表示され WordPress が動作しなくなった。
お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。
Deprecated: Directive ‘allow_url_include’ is deprecated in Unknown on line 0

Directory tree:

ftp 設定で /public_html 以下にしかアクセスすることができないようにしてあったこともあり、

/ に作られているとは思っても見なかった。

Google reCAPTCHA v3 を設置してみるメモ

利用開始の為の設定

https://developers.google.com/recaptcha/

利用するウェブサイトのアドレス登録等と使用する2個のキーを取得する

  • ウェブサイトのフォームに埋め込むキー
  • サーバー側で使用する秘密キー

下記のウェブサイトを参考に設置します

https://jpn.itlibra.com/article?id=20882

ウェブフォーム

ウェブフォームが表示されたら “grecaptcha.ready()” が実行されて
フォーム要素に token (ここでは、”g-recaptcha-response”) に値が埋め込まれるようにする

サーバー側 PHP

フォームに埋め込まれた token “g-recaptcha-response” を受信し
“file_get_contents()” でリクエストを送信して結果を受け取る
“score” 値でロボットかどうか判定する
“googleRecaptchaV3()” をリクエスト処理の中で呼び出す

指定したウィジェットを WordPress の管理画面に配置し、その中で Youtube ビデオの縦横比を保つ / Placing specific widgets to WordPress Admin Screen and keep the Youtube video aspect ratio within

/wp-content/themes/my-theme/functions.php: