[wp-trac] [WordPress Trac] #54435: admin-ajax.php : 404 Error

WordPress Trac noreply at wordpress.org
Sat Mar 12 01:40:10 UTC 2022


#54435: admin-ajax.php : 404 Error
--------------------------+------------------------------
 Reporter:  Mayhem30      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by here):

 I found this investigating a similar issue and it turns out this behavior
 is as designed.

 Steps to repro:
 1. Open Customizer
 2. Click X to close Customizer

 Observed: 404 error requesting admin-ajax.php
 Expected: No errors

 For my case, searching for the admin-ajax action value used in the POST
 request "customize_dismiss_autosave_or_lock" leads to the associated core
 code.

 WordPress core code that is returning the 404 can be seen here,
 https://github.com/WordPress/WordPress/blob/99bac7e17cfb5d534b33ffc3a70bff9d9b86875d
 /wp-includes/class-wp-customize-manager.php#L3693-L3695

 Sample POST payload
 {{{
 wp_customize: on
 customize_theme: example-theme
 customize_changeset_uuid: ac3050d5-df08-4c20-a8e9-88fa37974652
 nonce: 6a2eb1176f
 dismiss_autosave: false
 dismiss_lock: true
 action: customize_dismiss_autosave_or_lock
 customize_preview_nonce: b43e42ab81
 }}}


 A sample request / response body is

 {{{
 $ curl 'https://example.com/wp-admin/admin-ajax.php'
 ...
 --data-raw 'wp_customize=on&customize_theme=example-
 theme&customize_changeset_uuid=9fd9e3ff-7209-4a6b-9a2e-
 708e5e2bf5fa&nonce=993d76371b&dismiss_autosave=false&dismiss_lock=true&action=customize_dismiss_autosave_or_lock&customize_preview_nonce=c893d9add4'
 \
 ...
 < HTTP/2 404
 ...
 {"success":false,"data":"no_auto_draft_to_delete"}
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54435#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list