Questions tagged [admin-ajax]
The admin-ajax tag has no usage guidance.
admin-ajax
67
questions
0
votes
0
answers
78
views
Wordpress admin-ajax.php returns 0 and 400 bad request
I have been working in a project and I hit a road block from admin-ajax.php file, when i make an ajax request it returns 400 error bad request and the admin-ajax.php response in the network tab is 0.
...
0
votes
0
answers
18
views
modify the code with wp_set_object_terms in functions.php wordpress
This piece of code works for me, but I have more than 10,000 posts in post types on my website, and by calling posts_per_page => -1
The loading speed of the site is very low and the RAM and CPU are ...
0
votes
0
answers
24
views
POST wp-admin/admin-ajax.php 400 (Bad Request)
In wp-admin I have a table that extracts data from the database (data comes from a form filled in by users) . The request to the database to delete some elements is contained in form-plugin.php (...
0
votes
1
answer
31
views
Receive AJAX Form data in Server side
How to receive AJAX Form data in Server side sent by Fetch API ?
I have below Fetch API.
const sent_urls = () => {
const formData = new FormData();
formData.append('action', 'start_parsing')...
0
votes
0
answers
30
views
wordpress not saving updates to pages with admin-ajax.php error
I'm experiencing a strage behaviour of Wordpress trying to configure pages of my site.
After a random number of updates to a page when I click save button it remains in status saving and it's not ...
0
votes
0
answers
37
views
admin ajax request giving 400 error when accessing function inside php class
I am using admin ajax request in wordpress plugin to access a function inside php class.
But, it is giving 400 bad request error:
my class file name: class.ajaxtest.php
ajaxtest_PLUGIN_URL is defined ...
0
votes
1
answer
241
views
Wordpress plugin jQuery script call to admin-ajax.php works only once
I'm writing a little wordpress plugin.
The plugin has a simple script that interacts with a datatable in the backend.
It is used to duplicate a row in the table by clicking a button, and then insert ...
-1
votes
1
answer
668
views
WordPress Admin Ajax 400 error, returning 0
I've created an AJAX request to send data to my plugin which will then submit a job application. When submitting the form the page that it is returning is blank other than a 0 and the console is ...
0
votes
0
answers
33
views
Woocommerce ajax return empty shipping packages
Am trying to get the shipping packages with ajax but its always returning empty value.
same issue while trying to call get the zones with: WC_Shipping_Zones::get_zones();
am using the same code in ...
0
votes
1
answer
118
views
Wordpress Ajax returning full html of same page
Am trying to run Ajax call in my Woocommerce checkout page, but am always getting the full html of same page return.
add_action( 'wp_enqueue_scripts', 'theme_scripts' );
function theme_scripts() {
...
0
votes
1
answer
659
views
Oxygen Builder: Making Ajax Calls from Code Block
Yeah, so this is super frustrating. It should be a simple answer for someone...
I am trying to simply figure out how to make a call to admin-ajax.php from a Code Block within Oxygen and I can't figure ...
0
votes
0
answers
223
views
Wordperss admin-ajax.php error 400 Bad Request
I can't find where this error 400 comes from?
FontOffice only avaible for logged in persons.
I'm trying to create a form to post a custom post type through Ajax.
Here is the form in front office:
<...
0
votes
2
answers
377
views
Admin-ajax return 0 and error 400 in manager part
Here I am facing a problem with the admin-ajax.php of wordpress.
Indeed my project is particular since it contains 2 parts (customer part and admin part). The first part is for the client part since (/...
5
votes
2
answers
2k
views
Protect wp-admin while whitelisting admin-ajax.php
I want to allow only my IP address to access wp-admin but at the same time don't want the calls to admin-ajax.php be blocked. So I want to whitelist admin-ajax.php. Does the following code in ....
0
votes
1
answer
1k
views
WordPress admin-ajax.php throwing 400 bad request
add_action( 'wp_footer', function () { ?>
<script type='text/javascript' id='ajax'>
const ajaxUrl = "<?php echo admin_url('admin-ajax.php'); ?>";
async function ...
0
votes
2
answers
3k
views
Wordpress admin-ajax.php 400 Failed to load
Am using this script 'WordPress CPT Ajax filtering' found here on GitHub.
Everything work as i need it apart from the 'All' filter, click this and all post disappear and i get the error below, but the ...
0
votes
0
answers
555
views
WordPress admin-ajax slow/issue
I've noticed in our hosting's snapshot that our admin ajax has been very slow.
The example http query below took over 191seconds! also this fired every couple of minutes..
/admin-ajax.php?action=...
0
votes
0
answers
42
views
run admin-ajax.php returning 400
I have looked over a few other related questions but I must be missing something.
I dont know much PHP but I am hoping someone can help tell me where iv gone wrong.
The site is saying that /wp-admin/...
0
votes
1
answer
2k
views
Wordpress AJAX request on admin-ajax.php gives error 400
I'm trying to create a Wordpress plugin that will receive a simple AJAX request and, for the moment, just post its body. My code is:
File /wp-content/plugins/prova/prova.php:
<?php
/**
* Plugin ...
1
vote
1
answer
6k
views
wordpress: AJAX: 400 bad request with admin-ajax.php
I have searched and red a lot of this issue.
However, I do not know, why this few simple lines produce a
"POST http://example.com/wp-admin/admin-ajax.php 400 (Bad Request)"
What I basically ...
0
votes
1
answer
533
views
Wordpress admin-ajax.php returns 0 and status 400 on POST, works on GET though
I have angular application embedded to Wordpress site in iframe.
Angular app is trying to trigger Wordpress action registered in the function.php file in the child-theme, code is as following:
...
0
votes
0
answers
200
views
In Wordpress, trying to add an existing image from the media library to a text widget throws 404 error
I have two Wordpress instances (same Wordpress version, both recent fresh installs) on two different domains, both hosted with Namecheap, one of them works fine (actually hosted on a subdomain like ...
1
vote
0
answers
123
views
How can I make a proxy call to this Wordpress PHP function, one time without a parameter, other time with?
So in Wordpress, I have a hook for an ajax action, that looks like this:
add_action( 'wp_ajax_myhook', __NAMESPACE__ .'\myhook' );
function myhook() {
$username = "[email protected]"...
0
votes
0
answers
512
views
Admin Ajax 413 Error - Max size is Higher
I have a plugin which performs admin ajax request on clicking send button in page. The data send some html data to PHP function. When i click send button, i receive the following error.
Failed to ...
0
votes
3
answers
3k
views
Admin Ajax causing slow wordpress site (waterfall)
Can someone help me figure out how to fix the slow admin-ajax.php problem? Sorry I'm new to wordpress.
I understand it could be related to the wpbakery (visual composer) plugin used to build the ...
0
votes
1
answer
415
views
Wordpress :: Need to Call Ajax Action by extra script.php file in root folder of Wordpress
We have requirement for run costume script (a php file) in root of wordpress
Simply we have script.php file in root of wordpress project.
when I run https://mywordpress.co/script.php simply I need ...
1
vote
0
answers
2k
views
Ajax call caching using Litespeed cache plugin in Wordpress
I have an issue with caching ajax calls,
I am using ajax calls to count my post views and because of my high traffic I am not able to hit the database directly, so I want to store post views in cache ...
1
vote
1
answer
231
views
Calling PHP function in Wordpress through admin-ajax.php not updating meta information, but receive a success message
post_views_count() is meant to update the view count of the page current postID using an ajax request so it can still work.
When called it is outputting that is has been successfully called but when ...
-1
votes
1
answer
2k
views
Admin-Ajax is slowing down my Wordpress site
I am running a Wordpress website: link
All plugins, wordpress and theme are updated to the latest version.
I am also running on Woocommerce. When disabling the Woocommerce-plugin, the site is ...
0
votes
0
answers
334
views
nopriv actions not working when not logged in
I'm redoing a client's WP/WooCommerce site and I'm having trouble with admin-ajax actions when the customer is not logged in.
I don't believe the nopriv actions are being found by the ajax call.
If ...
0
votes
0
answers
1k
views
How to get admin-ajax.php to localize and scripts to enqueue
I cant for the life of me get any scripts to enqueue within my functions.php file nor can I localize my admin-ajax.php url. I've been including any css and js in their traditional places (css in the ...
0
votes
1
answer
225
views
POST admin-ajax throwing error 400 - not finding custom functions
I am adding a function that should be called when a button is clicked, i have a js file with the following jquery code and the ajax call :
jQuery(document).ready( function() {
function ...
0
votes
1
answer
228
views
Get my class instance when i use admin ajax in my plugin development
im writing a plugin and i need to use ajax on it.
I try to use admin ajax and it work but when i use it i can store var in my class.
Example :
i got my class like
class Create_order{
public $...
0
votes
0
answers
644
views
400 (Bad Request) admin-ajax.php and WP Cost Estimation & Payment Forms Builder
I have some problems with adamin-ajax.php - Console showing something like this:
console screen
I using few Wordpress plugins. The most important is: "WP Cost Estimation & Payment Forms Builder". ...
3
votes
1
answer
730
views
WordPress Attachment Taxonomy Checkbox Group Not Saving In Grid View
I created a taxonomy and attached it to the attachments or Media.
I am using Advanced Custom Fields to add a taxonomy field which is displayed as checkbox group. It adds the fields correctly to the ...
1
vote
1
answer
1k
views
Wordpress ajax-admin.php waiting time too long
My wordpress admin dashboard is loading slowly and taking too much time to load. The wordpress homepage loading time is okay. But when I logged in, and move to admin dashboard, all activities loaded ...
1
vote
0
answers
2k
views
Ajax filter on custom post type
I created an ajax filter on custom post type filter is working fine when I select 10-12 filters but after that admin-ajax.php file gone to pending, I don't know what is the issue.
Website url : http:/...
0
votes
3
answers
382
views
Simple wordpress ajax query is not working
Do you have any idea why this simple wp ajax query is not working? It always returns fail. Console -> https://pastebin.com/TABQCjXe
jQuery(document).ready(function($) {
// This does the ajax request
...
1
vote
0
answers
74
views
jQuery Ajax (Wordpress) not passing all of my POST variables
I am creating a small web application using WordPress. I'm using Ajax to make multiple calls for a reservation system.
I have 4 steps (Get Industry's, Get Consultants in Industry, Get available times ...
27
votes
9
answers
118k
views
Wordpress admin-ajax.php 400 bad request
I have a strange and frustrating behaviour of wordpress admin-ajax.php file, when i make an ajax request it returns 400 error bad request.
(function( $ ) {
var ajaxscript = { ajax_url : 'mydomain....
5
votes
3
answers
17k
views
Wordpress "admin-ajax.php" 404 Error
I created a website for a small bed and breakfast, but I found a problem, which I don’t understand if it is depended on WordPress or the server.
This website uses a pop-up animation to show the room ...
0
votes
2
answers
1k
views
How to add/hook new function into admin-ajax.php permanent
I add function 'listing_companions_Ajax' into $core_actions_post of admin-ajax.php. But discover after WP update that function is not present anymore.
$core_actions_post = array('oembed-cache',...,'...
0
votes
1
answer
459
views
Do cached Cloudfront pages interact with the origin server?
I inherited a complex AWS system from someone and I have practically no AWS experience. I'm reading documentation and doing training, but there's one thing I can't figure out: when someone hits a page ...
0
votes
1
answer
841
views
Wordpress Ninja Forms, Access-Control-Allow-Origin and admin-ajax.php
So, I have this WP installed on Heroku and I've installed Ninja forms to it. Despite everything working OK locally, when I push it to Heroku, the form is not submited and I receive this error through ...
1
vote
2
answers
2k
views
get referrer URL in wp-admin-ajax.php
I used some X hook in function.php. I need to know which page trigger this action, need to get referrer URL and redirect to that page with success meassage.
function ...
0
votes
1
answer
470
views
Wordpress admin-ajax and user profile localization
So I've got an English-language theme that I localized to Spanish. It works perfectly fine in Spanish.
But if I change my user profile language to English - so that I can see English on the ...
0
votes
1
answer
786
views
After Ajax Response Page scroll not working - WordPress
After the ajax success i want to scroll down the page to certain position .
Unfortunately its not working .
Here is the code :
jQuery('#post').submit(function(e){
var name = jQuery("#...
2
votes
1
answer
397
views
The admin-ajax page is the most visited page on the website
I run a small blog. And recently I started having my hosting resources limited quite often. I tried to see what is causing the problem, and I find it very suspicious that the wp-admin/admin-ajax page ...
0
votes
2
answers
399
views
wordpress admin-ajax return always 0
I know that my question was asked many other times and I read all discussions about that but I don't have found the right answer.
My problem is that admin-ajax request with ajax call return always 0 ...
1
vote
2
answers
359
views
Can't use WC_Order in admin-ajax.php
I'm trying to retrieve order information within the admin-ajax.php request, but it is returning protected objects with no data. Is there a way to access this?
I'm using this:
$data = new WC_Order($...