skills/crazyswami/form-testing/SKILL.md
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.
npx skillsauth add aiskillstore/marketplace form-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive form testing for WordPress sites - validates form submissions, email delivery, and SMTP configuration.
# 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
wp_mail()The most reliable way to test email delivery:
# Send test email via WP-CLI
docker exec wordpress-container wp eval '
$to = "[email protected]";
$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";
}
}
'
# 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";
}
'
# Test contact form via curl
curl -X POST "https://site.com/contact/" \
-d "first_name=Test" \
-d "last_name=User" \
-d "[email protected]" \
-d "message=This is a test submission" \
-d "csr_contact_form=1" \
-L -v 2>&1 | grep -E "(< HTTP|Location:|contact=)"
#!/bin/bash
# Test email sending via WordPress
CONTAINER="${1:-wordpress}"
TO_EMAIL="${2:[email protected]}"
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\";
}
}
"
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("[email protected]", "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"
Check nonce verification:
wp_nonce_field()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
| 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 |
# Set up SMTP configuration
docker exec wordpress wp option update wp_mail_smtp '{
"mail": {
"from_email": "[email protected]",
"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
page-contact.phpcsr_handle_contact_form() in functions.phpcsr_contact_nonce?contact=successsingle-property.phpcsr_handle_inquiry_form() in functions.phpcsr_inquiry_nonce?inquiry=successWhen 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. ...
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.