Questions tagged [admin-ajax]

62 questions
19
votes
8 answers

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.com/wp-admin/admin-ajax.php' } $.ajax({ …
user3137766
5
votes
3 answers

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 description. The problem is that this popup has…
Meng
  • 51
  • 1
  • 1
  • 2
3
votes
2 answers

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 .htaccess (placed in wp-admin directory) achieve these…
ishchat
  • 31
  • 3
3
votes
1 answer

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 attachments pages in both grid and list views.…
James
  • 702
  • 2
  • 15
  • 39
2
votes
1 answer

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 is the most visited page in the last few months.…
Skinz
  • 21
  • 3
2
votes
1 answer

Wordpress Forbidden You don't have permission to access /wp-admin/admin-ajax.php on this server

I have a portfolio when I click on the filter button it gives me this error : You don't have permission to access /wp-admin/admin-ajax.php on this server.
Mohammed
  • 23
  • 1
  • 7
2
votes
0 answers

Optimizing wp media library, using wp hooks

My apologies If I am not clear, but I will try my best to explain my problem. After upgrading wordpress to 4.7.3. I am facing a super slow wordpress media library load(i.e. wp-admin/upload.php). It takes like 5 minutes to load the images first…
SD433
  • 143
  • 11
2
votes
1 answer

Cross-Origin Request Blocked. Wordpress Plugin Not Working

We have a Wordpress website, hosted by GoDaddy. Before we went "live" we had it located at staging.coiski.com (wordpress was installed in a folder called /staging), and then when we went "live" we moved it to coiski.com using the following…
Jon Zmikly
  • 23
  • 1
  • 3
2
votes
0 answers

WP-PostRating Ajax not working

I have WP-PostRating Plugins for rating system, but onclick="rate_post();" onkeypress="rate_post(); function not working. I think PostRating JS conflict with other JS, ERROR LOG [15-May-2016 09:10:34 UTC] WordPress database error Table…
Nida
  • 21
  • 1
2
votes
1 answer

wp_localize_script $data parameters in array

I'm trying to develop my first Wordpress plugin, and to do this I want to use wp_localize_script to post forms data without refreshing page. The problem is I don't understand well how to setup the $data parameter in the wp_localize_script. More…
BBFUNK01
  • 21
  • 1
  • 2
2
votes
0 answers

Set Woocommerce woocommerce_get_refreshed_fragments call admin-ajax.php run after page loads

I optimzed my site with cahce and it speeds to about 2 sec load time. The problem is that even that everything is done loading, but there are is 2 ajax call to admin-ajax.php with a action called woocommerce_get_refreshed_fragments that slows the…
BenB
  • 2,747
  • 3
  • 29
  • 54
1
vote
1 answer

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 want (later on) is: If you press a button, a counter will…
mickna
  • 43
  • 1
  • 5
1
vote
0 answers

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 = "webmaster@example.com"; $password = "password!"; $url =…
AviG
  • 362
  • 2
  • 14
1
vote
0 answers

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 and then save them in database on minutely…
1
vote
1 answer

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 debugging my view count is being added. Any help…
Matt
  • 71
  • 1
  • 2
  • 7
1
2 3 4 5