Form Submission Test'; echo '

Test URL: ' . $test_url . '

'; // Check if form was submitted if ($_SERVER['REQUEST_METHOD'] === 'POST') { echo '

Form Submitted via POST

'; echo '
';
    print_r($_POST);
    echo '
'; // Check if submit_snippet is set if (isset($_POST['submit_snippet'])) { echo '

✓ submit_snippet is set

'; } else { echo '

✗ submit_snippet is NOT set

'; } // Check if nonce is set if (isset($_POST['pc_hfap_nonce'])) { echo '

✓ nonce is set

'; // Verify nonce if (wp_verify_nonce($_POST['pc_hfap_nonce'], 'pc_hfap_save_snippet')) { echo '

✓ nonce is valid

'; } else { echo '

✗ nonce is invalid

'; } } else { echo '

✗ nonce is NOT set

'; } // Check required fields echo '

Required Fields:

'; if (!empty($_POST['pc_hfap_title'])) { echo '

✓ Title: ' . esc_html($_POST['pc_hfap_title']) . '

'; } else { echo '

✗ Title is empty

'; } if (!empty($_POST['pc_hfap_location'])) { echo '

✓ Location: ' . esc_html($_POST['pc_hfap_location']) . '

'; } else { echo '

✗ Location is empty

'; } if (!empty($_POST['pc_hfap_code'])) { echo '

✓ Code length: ' . strlen($_POST['pc_hfap_code']) . ' chars

'; } else { echo '

✗ Code is empty

'; } } else { echo '

No POST request detected

'; echo '

This page is for testing form submission. Submit the form to see results.

'; echo '

Test Instructions:

'; echo '
    '; echo '
  1. Go to Headers & Footers → Add New
  2. '; echo '
  3. Fill in the form
  4. '; echo '
  5. Click "Save Snippet"
  6. '; echo '
  7. Check this page for results
  8. '; echo '
'; echo '

Or submit a test form:

'; echo '
'; echo ''; echo ''; echo ''; echo ''; wp_nonce_field('pc_hfap_save_snippet', 'pc_hfap_nonce'); echo ''; echo '
'; }