I don’t see any is_admin
conditional statement which is why you should include it in your snippet so we can properly assess what you are attempting to do outside of the obvious question.
Either way a nonce should be mandatory. That function that receives and processes your AJAX request/response should also verify your nonce to ensure the request is a valid and secure request – even IF the request is originating from the back-end, it still could be insecure or an attempt to exploit the system.
Also look at:
Related Posts:
- Reduce nonce lifespan
- When is it useful to use wp_verify_nonce
- How to get the wpnonce value?
- How can I create a plugin installation link?
- Security checking in meta_box save is reluctant?
- wp_create_nonce function doesn’t work inside a plugin?
- Nonce failing on form submission
- How to add a WordPress Nonce for this form to avoid CSRF
- Nonce failing with second argument
- Unable to update plugins or log out
- wp_verify_nonce fails always
- Changing the “Plugin Activated” Message Default
- Is there a StackExchange-like voting plugin for WordPress? [closed]
- How can I prevent a plugin from updating unless it’s minimum PHP version is met?
- What characters are allowed as a shortcode tag and how should they be sanitized?
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Notify Admins about Plugin Merge
- Additional, optional fee on Woocommerce Checkout [closed]
- Why does including a file in theme’s functions.php not work?
- While using WordPress Multisite is it possible to display data to main site from subsites?
- disable active plugins for specific theme
- Get category ID in “archive-product.php”
- Make the css of the widget overwrite theme css
- How to set all external links to a certain domain to “nofollow”?
- wp_mail() is not working in localhost
- Flickr plugin that will display photos from multiple group pools? [closed]
- Generate JWT Token without username and password
- WordPress web page struggling with performance
- Making menu link open in new tab?
- ReOrder Post Within Categories plugin with featured image
- How to initialize something in unit test before the init hook being called?
- add_filter comment_edit_redirect not working
- Global matrix for shortcodes/content for every page
- Plugin to restrict access to pages in wp-admin
- How to add class in plugin only for network site?
- How to write a plugin to add users to a mail list
- Use the page title in the plugin
- Two text domains in one plugin
- Cron job not firing
- See which user installed a plugin?
- Plugin or method to delete uploads not in media library?
- Add woocommerce variation images in gallery?
- Add a CSS class based on categroy id to archive pages
- Add button gutenberg help
- How to add media field to WP_Widget form function?
- Post category with counts been display like a menu
- DOMAIN_CURRENT_SITE constant being regularly overridden [closed]
- Plugin Repository commit doesn’t show up in activity
- Troubleshooting Plugins.php HTTP install path vs. a HTTPS for a single Plug-In
- How do I write an inventory list plugin that creates dynamic details pages?
- Save values from a pre_post_update
- How to let user store a file in plugin directory but not have it get deleted on update?
- How to grab facebook page feed?
- Finding the screen id of a page generated with add_menu_page
- plugin active error
- (WordPress 5.8.3) Function.php or a plugin for better performance? [duplicate]
- How to translate wordpress error message
- Override a Plugin Function
- wp_localize_script not passing the data
- How to downgrade plugin?
- More gentle way to hook WordPress custom url
- Adding Gallery to Footer of Homepage
- How to enable WPML in BuddyPress Multilingual Plugin in a single website? [closed]
- How can I replace content on site generated from plugin without changing plugin
- Editable select options in quick edit OR in plugin settings
- Send Array from JS to php file then insert it in wp database through a plugin
- Offer Download Links for Product Images
- TranslatePress | secondary language category/sub-category not working correctly “`/%category%/%postname%/“`
- How to override Plugin javascript function : $(‘body’).on(‘change’,’.class’)
- Connect / Login WordPress Hosted Website or Blog with NodeJs
- Copy/paste local images not working in WordPress
- Need to know if my approach to designing a geneaology plug-in for wordpress makes sense
- Live Streaming with WordPress?
- insert data from textbox to database
- How to change the WordPress Plugin Watson Assistant Chatbot BOX Size?
- White Screen of Death
- Creating one user access account for all the multiple sites
- How to access custom post meta data from JavaScript
- How to fix blog article view and share #’s?
- Is it possible to “include” another wordpress post/page?
- WordPress SSO SAML
- Modify Plugin shortcode function code
- Attachments plugin cannot click media library button [closed]
- Is there any hook to change media html in post? [duplicate]
- Creating a user ‘add custom field’ section
- WordPress Settings – Custom Button actions
- Javascript not working
- Conditional required fields for WordPress Contact Form 7
- Links on FAQ page aren’t working
- How to show post attachment image
- How can I make the Twitter Tools plugin hyperlink every link?
- County Finder form/plugin?
- WordPress shortcode plugin not working
- FacetWP: Plugin breaks button/modal functionality inside searchable content area
- Undefined property: stdClass::$ AND Trying to get property ‘name’ of non-object Error in plugin
- get_option returning a different value from what’s saved
- How to import data from another website using an API link?
- FacetWP custom display based on post type [closed]
- Creating a Table Row by Row
- Getting 504 Gateway Timeout Error on AWS Server! [closed]