form-testing
WordPressのフォーム送信やメール配信をテストし、お問い合わせフォームの動作確認、WP Mail SMTP設定の検証、テストメール送信を行い、フォームの機能やメール配信の問題を解決するSkill。
📜 元の英語説明(参考)
Test WordPress form submissions and email delivery. Validates contact forms, checks WP Mail SMTP configuration, and sends test emails. Use when verifying form functionality or troubleshooting email delivery issues.
🇯🇵 日本人クリエイター向け解説
WordPressのフォーム送信やメール配信をテストし、お問い合わせフォームの動作確認、WP Mail SMTP設定の検証、テストメール送信を行い、フォームの機能やメール配信の問題を解決するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o form-testing.zip https://jpskill.com/download/18115.zip && unzip -o form-testing.zip && rm form-testing.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18115.zip -OutFile "$d\form-testing.zip"; Expand-Archive "$d\form-testing.zip" -DestinationPath $d -Force; ri "$d\form-testing.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
form-testing.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
form-testingフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 2
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] form-testing
フォームテストスキル
WordPressサイト向けの包括的なフォームテスト - フォーム送信、メール配信、およびSMTP構成を検証します。
クイックスタート
# WP Mail SMTP構成をテストします
/root/.claude/skills/form-testing/scripts/test-mail.sh wordpress-container
# 連絡フォームの送信をテストします
/root/.claude/skills/form-testing/scripts/test-form.sh https://site.com/contact/
# 完全なフォーム監査
/root/.claude/skills/form-testing/scripts/audit-forms.sh wordpress-container
このスキルでテストすること
1. メール配信
- WP Mail SMTPプラグインの構成
wp_mail()を介したメール送信機能- SMTPサーバー接続
- メールヘッダーとフォーマット
2. 連絡フォームの機能
- フォームフィールドの検証
- Nonce検証
- 成功/エラーリダイレクト
- メール受信
3. フォームセキュリティ
- CSRF保護 (nonces)
- 入力サニタイズ
- スパム対策 (該当する場合)
テスト方法
方法 1: WP-CLI メールテスト
メール配信をテストする最も信頼性の高い方法:
# WP-CLI経由でテストメールを送信
docker exec wordpress-container wp eval '
$to = "test@example.com";
$subject = "WordPress Test Email";
$message = "This is a test email from WordPress at " . date("Y-m-d H:i:s");
$headers = array("Content-Type: text/plain; charset=UTF-8");
$result = wp_mail($to, $subject, $message, $headers);
if ($result) {
echo "SUCCESS: Email sent to $to\n";
} else {
echo "FAILED: Could not send email\n";
global $phpmailer;
if (isset($phpmailer)) {
echo "Error: " . $phpmailer->ErrorInfo . "\n";
}
}
'
方法 2: SMTP構成の確認
# WP Mail SMTPオプションを確認
docker exec wordpress-container wp option get wp_mail_smtp --format=json | jq
# SMTPが構成されているか確認
docker exec wordpress-container wp eval '
$options = get_option("wp_mail_smtp");
if (!empty($options["smtp"]["host"])) {
echo "SMTP Host: " . $options["smtp"]["host"] . "\n";
echo "SMTP Port: " . $options["smtp"]["port"] . "\n";
echo "SMTP Auth: " . ($options["smtp"]["auth"] ? "Yes" : "No") . "\n";
echo "Encryption: " . $options["smtp"]["encryption"] . "\n";
} else {
echo "SMTP not configured - using PHP mail()\n";
}
'
方法 3: HTTPフォーム送信テスト
# curlで連絡フォームをテスト
curl -X POST "https://site.com/contact/" \
-d "first_name=Test" \
-d "last_name=User" \
-d "email=test@example.com" \
-d "message=This is a test submission" \
-d "csr_contact_form=1" \
-L -v 2>&1 | grep -E "(< HTTP|Location:|contact=)"
自動テストスクリプト
test-mail.sh
#!/bin/bash
# WordPress経由でメール送信をテスト
CONTAINER="${1:-wordpress}"
TO_EMAIL="${2:-admin@example.com}"
echo "メール配信をテスト中..."
docker exec "$CONTAINER" wp eval "
\$to = '$TO_EMAIL';
\$subject = 'Form Test - ' . date('Y-m-d H:i:s');
\$message = 'This is an automated test from the form-testing skill.\\n\\n';
\$message .= 'Site: ' . home_url() . '\\n';
\$message .= 'Time: ' . current_time('mysql') . '\\n';
\$message .= '\\nIf you receive this, email delivery is working!';
\$headers = array(
'Content-Type: text/plain; charset=UTF-8',
'From: WordPress <wordpress@' . parse_url(home_url(), PHP_URL_HOST) . '>'
);
echo 'Sending test email to: ' . \$to . \"\\n\";
\$result = wp_mail(\$to, \$subject, \$message, \$headers);
if (\$result) {
echo \"SUCCESS: Test email sent!\\n\";
echo \"Check inbox for: \$subject\\n\";
} else {
echo \"FAILED: Could not send email\\n\";
global \$phpmailer;
if (isset(\$phpmailer) && !empty(\$phpmailer->ErrorInfo)) {
echo \"PHPMailer Error: \" . \$phpmailer->ErrorInfo . \"\\n\";
}
}
"
トラブルシューティング
メールが送信されない
-
WP Mail SMTPがアクティブであることを確認:
docker exec wordpress wp plugin is-active wp-mail-smtp && echo "Active" || echo "Not active" -
SMTP設定を確認:
docker exec wordpress wp option get wp_mail_smtp --format=json -
デバッグログでテスト:
docker exec wordpress wp eval ' define("WP_DEBUG", true); define("WP_DEBUG_LOG", true); wp_mail("test@example.com", "Debug Test", "Testing"); ' -
メールログを確認 (WP Mail SMTP Proを使用している場合):
docker exec wordpress wp db query "SELECT * FROM wp_wpmailsmtp_logs ORDER BY id DESC LIMIT 5"
フォーム送信エラー
-
Nonce検証を確認:
- フォームに
wp_nonce_field()があることを確認 - ハンドラーでnonce名が一致することを確認
- フォームに
-
送信後のリダイレクトを確認:
curl -X POST "https://site.com/contact/" \ -d "form_data=here" \ -L -w "%{redirect_url}" -o /dev/null -s -
PHPエラーを確認:
docker exec wordpress tail -50 /var/www/html/wp-content/debug.log
よくある問題
| 問題 | 原因 | 解決策 |
|---|---|---|
| メールがスパムになる | SPF/DKIMがない | DNSレコードを構成する |
| "Could not instantiate mail function" | PHP mailが無効になっている | SMTPプラグインを使用する |
| フォームが空白ページを返す | PHPエラー | WP_DEBUGを有効にする |
| Nonce検証に失敗した | セッションが期限切れまたはキャッシュ | キャッシュプラグインを確認する |
| フォームフィールドが受信されない | name属性がない | 入力にnameを追加する |
WP Mail SMTP構成
推奨プロバイダー
- SMTP.com - 無料枠、信頼性が高い
- SendGrid - 1日100通のメールを無料で送信可能
- Mailgun - 開発者向け
- Amazon SES - 大量送信に最適
- Gmail SMTP - 簡単なセットアップ (個人使用)
WP-CLI経由での構成
# SMTP構成を設定
docker exec wordpress wp option update wp_mail_smtp '{
"mail": {
"from_email": "noreply@yoursite.com",
"from_name": "Your Site",
"mailer": "smtp"
},
"smtp": {
"host": "smtp.example.com",
"port": 587,
"encryption": "tls",
"auth": true,
"user": "smtp-user",
"pass": "smtp-password"
}
}' --format=json
テストされたフォームの種類
連絡フォーム (CSR Theme)
- テンプレート: `page-conta
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Form Testing Skill
Comprehensive form testing for WordPress sites - validates form submissions, email delivery, and SMTP configuration.
Quick Start
# Test WP Mail SMTP configuration
/root/.claude/skills/form-testing/scripts/test-mail.sh wordpress-container
# Test contact form submission
/root/.claude/skills/form-testing/scripts/test-form.sh https://site.com/contact/
# Full form audit
/root/.claude/skills/form-testing/scripts/audit-forms.sh wordpress-container
What This Skill Tests
1. Email Delivery
- WP Mail SMTP plugin configuration
- Email sending capability via
wp_mail() - SMTP server connectivity
- Email headers and formatting
2. Contact Form Functionality
- Form field validation
- Nonce verification
- Success/error redirects
- Email receipt
3. Form Security
- CSRF protection (nonces)
- Input sanitization
- Spam protection (if applicable)
Testing Methods
Method 1: WP-CLI Email Test
The most reliable way to test email delivery:
# Send test email via WP-CLI
docker exec wordpress-container wp eval '
$to = "test@example.com";
$subject = "WordPress Test Email";
$message = "This is a test email from WordPress at " . date("Y-m-d H:i:s");
$headers = array("Content-Type: text/plain; charset=UTF-8");
$result = wp_mail($to, $subject, $message, $headers);
if ($result) {
echo "SUCCESS: Email sent to $to\n";
} else {
echo "FAILED: Could not send email\n";
global $phpmailer;
if (isset($phpmailer)) {
echo "Error: " . $phpmailer->ErrorInfo . "\n";
}
}
'
Method 2: Check SMTP Configuration
# Check WP Mail SMTP options
docker exec wordpress-container wp option get wp_mail_smtp --format=json | jq
# Check if SMTP is configured
docker exec wordpress-container wp eval '
$options = get_option("wp_mail_smtp");
if (!empty($options["smtp"]["host"])) {
echo "SMTP Host: " . $options["smtp"]["host"] . "\n";
echo "SMTP Port: " . $options["smtp"]["port"] . "\n";
echo "SMTP Auth: " . ($options["smtp"]["auth"] ? "Yes" : "No") . "\n";
echo "Encryption: " . $options["smtp"]["encryption"] . "\n";
} else {
echo "SMTP not configured - using PHP mail()\n";
}
'
Method 3: HTTP Form Submission Test
# Test contact form via curl
curl -X POST "https://site.com/contact/" \
-d "first_name=Test" \
-d "last_name=User" \
-d "email=test@example.com" \
-d "message=This is a test submission" \
-d "csr_contact_form=1" \
-L -v 2>&1 | grep -E "(< HTTP|Location:|contact=)"
Automated Test Script
test-mail.sh
#!/bin/bash
# Test email sending via WordPress
CONTAINER="${1:-wordpress}"
TO_EMAIL="${2:-admin@example.com}"
echo "Testing email delivery..."
docker exec "$CONTAINER" wp eval "
\$to = '$TO_EMAIL';
\$subject = 'Form Test - ' . date('Y-m-d H:i:s');
\$message = 'This is an automated test from the form-testing skill.\\n\\n';
\$message .= 'Site: ' . home_url() . '\\n';
\$message .= 'Time: ' . current_time('mysql') . '\\n';
\$message .= '\\nIf you receive this, email delivery is working!';
\$headers = array(
'Content-Type: text/plain; charset=UTF-8',
'From: WordPress <wordpress@' . parse_url(home_url(), PHP_URL_HOST) . '>'
);
echo 'Sending test email to: ' . \$to . \"\\n\";
\$result = wp_mail(\$to, \$subject, \$message, \$headers);
if (\$result) {
echo \"SUCCESS: Test email sent!\\n\";
echo \"Check inbox for: \$subject\\n\";
} else {
echo \"FAILED: Could not send email\\n\";
global \$phpmailer;
if (isset(\$phpmailer) && !empty(\$phpmailer->ErrorInfo)) {
echo \"PHPMailer Error: \" . \$phpmailer->ErrorInfo . \"\\n\";
}
}
"
Troubleshooting
Email Not Sending
-
Check WP Mail SMTP is active:
docker exec wordpress wp plugin is-active wp-mail-smtp && echo "Active" || echo "Not active" -
Verify SMTP settings:
docker exec wordpress wp option get wp_mail_smtp --format=json -
Test with debug logging:
docker exec wordpress wp eval ' define("WP_DEBUG", true); define("WP_DEBUG_LOG", true); wp_mail("test@example.com", "Debug Test", "Testing"); ' -
Check email log (if using WP Mail SMTP Pro):
docker exec wordpress wp db query "SELECT * FROM wp_wpmailsmtp_logs ORDER BY id DESC LIMIT 5"
Form Submission Errors
-
Check nonce verification:
- Ensure form has
wp_nonce_field() - Verify nonce name matches in handler
- Ensure form has
-
Check redirect after submit:
curl -X POST "https://site.com/contact/" \ -d "form_data=here" \ -L -w "%{redirect_url}" -o /dev/null -s -
Check for PHP errors:
docker exec wordpress tail -50 /var/www/html/wp-content/debug.log
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| Emails go to spam | Missing SPF/DKIM | Configure DNS records |
| "Could not instantiate mail function" | PHP mail disabled | Use SMTP plugin |
| Form returns blank page | PHP error | Enable WP_DEBUG |
| Nonce verification failed | Session expired or cache | Check caching plugin |
| Form fields not received | Missing name attributes | Add name to inputs |
WP Mail SMTP Configuration
Recommended Providers
- SMTP.com - Free tier, reliable
- SendGrid - 100 emails/day free
- Mailgun - Developer-friendly
- Amazon SES - Cheapest for volume
- Gmail SMTP - Quick setup (personal use)
Configuration via WP-CLI
# Set up SMTP configuration
docker exec wordpress wp option update wp_mail_smtp '{
"mail": {
"from_email": "noreply@yoursite.com",
"from_name": "Your Site",
"mailer": "smtp"
},
"smtp": {
"host": "smtp.example.com",
"port": 587,
"encryption": "tls",
"auth": true,
"user": "smtp-user",
"pass": "smtp-password"
}
}' --format=json
Form Types Tested
Contact Form (CSR Theme)
- Template:
page-contact.php - Handler:
csr_handle_contact_form()in functions.php - Fields: first_name, last_name, email, message
- Nonce:
csr_contact_nonce - Success Redirect:
?contact=success
Property Inquiry Form (CSR Theme)
- Template:
single-property.php - Handler:
csr_handle_inquiry_form()in functions.php - Fields: name, company, email, message, property_title
- Nonce:
csr_inquiry_nonce - Success Redirect:
?inquiry=success
Audit Report Template
When running a form audit, document:
## Form Audit Report - [Site Name]
**Date**: YYYY-MM-DD
**Auditor**: Claude
### Email Delivery
- [ ] WP Mail SMTP installed and active
- [ ] SMTP credentials configured
- [ ] Test email received successfully
- [ ] SPF/DKIM records in place (check via MXToolbox)
### Contact Form
- [ ] Form displays correctly
- [ ] All fields validate properly
- [ ] Nonce verification working
- [ ] Success message shown after submit
- [ ] Email received by admin
- [ ] Reply-to header set correctly
### Security
- [ ] CSRF protection (nonces) in place
- [ ] Input sanitization (sanitize_text_field, etc.)
- [ ] Email header injection prevention
- [ ] Rate limiting (if needed)
### Recommendations
1. ...
2. ...
Related Skills
- wp-docker: WordPress container management
- visual-qa: Visual testing after form changes
- seo-optimizer: Check form pages for SEO
- white-label: Admin branding for form notifications
Sources
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (8,053 bytes)
- 📎 scripts/test-mail.sh (3,172 bytes)