Skip to content

Fix 355: Add missing nonce to form field and fees drag-and-drop reorder AJAX requests#502

Merged
sorinmarta merged 4 commits into
masterfrom
fix-355
May 11, 2026
Merged

Fix 355: Add missing nonce to form field and fees drag-and-drop reorder AJAX requests#502
sorinmarta merged 4 commits into
masterfrom
fix-355

Conversation

@claude
Copy link
Copy Markdown

@claude claude Bot commented Apr 30, 2026

Summary

  • Adds the missing nonce parameter to the wpbdp-formfields-reorder AJAX call in assets/js/admin.js (line 253)
  • Adds the missing nonce parameter to the wpbdp-admin-fees-reorder AJAX call in assets/js/admin.js (line 496)
  • The nonce value is sourced from wpbdp_global.nonce, which is already localized to the page via wp_localize_script in includes/class-assets.php
  • The PHP handlers use check_ajax_referer( 'wpbdp_ajax', 'nonce', false ) which silently rejected the requests without the nonce

Fixes Strategy11/business-directory-premium#355

Test plan

  • Go to Directory > Directory Content > Form Fields, drag a field to a new position, refresh — order should persist
  • Go to the Plans (fees) reorder page, drag a plan to a new position, refresh — order should persist
  • Open browser DevTools > Network and confirm the AJAX POST now includes nonce and returns {"success":true,...}

github-actions Bot and others added 2 commits April 30, 2026 06:31
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sorinmarta sorinmarta added the run analysis Runs phpcs and phpunit label May 11, 2026
@sorinmarta sorinmarta requested a review from Copilot May 11, 2026 06:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes admin drag-and-drop reordering for Form Fields and Fees by adding the missing nonce parameter to the related AJAX POST requests, aligning the JS payload with the PHP handlers’ check_ajax_referer( 'wpbdp_ajax', 'nonce', false ) checks (fixes Strategy11/business-directory-premium#355).

Changes:

  • Add nonce: wpbdp_global.nonce to the wpbdp-formfields-reorder AJAX request.
  • Add nonce: wpbdp_global.nonce to the wpbdp-admin-fees-reorder AJAX request.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread assets/js/admin.js
@sorinmarta sorinmarta merged commit e781485 into master May 11, 2026
4 checks passed
@sorinmarta sorinmarta deleted the fix-355 branch May 11, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run analysis Runs phpcs and phpunit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants