As stated in the Comments, do not access a plugin file directly. Instead, use other means that incorporate the REST API or the included Ajax functionality in WordPress. To learn how to use Ajax in your Plugin, have a look here: Ajax in Plugins
Related Posts:
- WordPress Ajax always returns a 404 error
- Ajax template: how to handle head section
- Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
- Data fetch and delete by ajax request
- Can’t use get_results() in ajax query
- Click loads template via ajax
- Display notification only once
- Access/update database with jQuery
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- admin-ajax.php responding with 0
- Page Reloads Before AJAX Request Finishes
- Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
- How to make custom total price reactive in navigation
- Sending jsPDF documents to the server
- Ajax $wpdb not returning table data
- How to prevent those PHP variables from being cached on WordPress?
- Ajax return code 400
- How to Fetch values from WP database based on selected option value by onchange using PHP?
- Trying to implement Ajax comments in WordPress, getting WP error
- How to test nonce with AJAX – Plugin development
- class click counter save number
- Any possible way to make $wpdb->get_results() return anything else than array?
- AJAX request status 200 but no actual “response”
- Button not refreshing page
- Creating a Multi-Level Associative Object Using AJAX
- Ajax – Call to undefined function get_option()
- Ajax random number always the same
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- Save Search System
- dynamic dependent select dropdown
- Change “add to cart” button color based on Woocommerce product category [closed]
- How to send Ajax request from my plugin in admin dashboard?
- How to add a do_action on refreshing of WP customizer?
- How to pass Select value from Javascript to PHP to generate select option on change
- Setting value of session with Ajax not working
- AJAX success response is not working but it’s saving my changes
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- Fancybox type popup window that’s not an iframe
- How do I Import / Upload Files with jQuery AJAX?
- WordPress Ajax Call inserting data but success response false
- admin-ajax Firing Error 400 When Logged In
- AJAX button action in foreach
- element not working in Safari [closed]
- Making an AJAX call to refresh a table
- HTML escaping data with ajax requests
- load ajax using admin-ajax.php
- Function won’t run onclick using Ajax
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- Get related product based on subcategory selected from category id with ID 142
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Incrementing PHP variable onclick to display posts by month
- How to use AJAX in WordPress in MYSQL query?
- Accessing an API with jQuery and AJAX
- Ajaxurl suddenly not defined
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Display WordPress search results based on the selected Sub-Category
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- WordPress Search Ajax + Isotope + InfiniteScroll
- duplicate posts with ajax load more wordpress
- Send an e-mail on address with the link with disliked post
- Settings API form – submit with AJAX
- Post form – AJAX won’t upload featured image – Plugin development
- Load more posts using AJAX based on posts inside WP_Query
- How to call my PHP function with AJAX ? wp_query
- Admin-ajax.php 404 error
- How can i find wrong word in search box and replace with correct word
- How to pass values from one function to the other using an array variable
- How to use wp_ajax_set_post_thumbnail?
- Update $wpdb query with AJAX
- $.ajax results in 403 forbidden
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- AJAX to add to cart multiple products woocommerce
- Cannot successfully execute AJAX script to call function.php specific function. Using XAMPP localhost to test
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- How to call a function from functions.php with ajax?
- ajax polling with admin-ajax.php
- number of posts with “Load More”
- How to send Ajax Call from frontend without using wp_localize_script in Theme
- How to load WP_Editor JS files manually (with AJAX)?
- A javascript function that simply runs a php function on the plugin
- Retrieve $_POST data to send to javascript without using localize script
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- MySQL query in WordPress with AJAX
- Run insert if no entry otherwise run update with ajax
- 500 (Internal Server Error) of external php file
- Problems with plugin that fetches data from database with ajax
- AJAX with Selectbox Plugins (Select2, Chosen, Selectize)
- Dynamic Gallery
- Execute PHP code in Javascript onclick
- Load php function with AJAX on modal window
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- notify users when changed database
- How to display inputted data in Ajax without button or click event
- how to display tables via ajax
- Remove Woocommerce product from cart with ajax/fetch
- WooCommerce Modal Fly cart on add to cart – With AJAX
- How can I use AJAX in child theme template?