Questions tagged [heartbeat-api]

Communication between browser and WordPress per AJAX in fixed intervals.

Filter by
Sorted by
Tagged with
0 votes
1 answer
183 views

Content including hooks inside wp-settings.php are being called twice in WordPress

I found that init hook is being called twice and then I try to trace and find out wp-settings.php is also being called twice. I originally want to post a question to find out why. And after some code ...
0 votes
0 answers
57 views

Disabled Heartbeat but i think it's still working. Is there a plugin or script to check it?

I just disabled Heartbeat with the plugin Heartbeat control and also adding this script in function.php of my child-theme add_action( 'init', 'stop_heartbeat', 1 ); function stop_heartbeat() { ...
  • 1
0 votes
2 answers
275 views

Wordpress Heartbeat API cannot parse data

I want to use WP-API heartbeat to open a connection to two displays and have them reflect what the other is saying with each send and tick. It used to work when the heartbeat API came out in 3.6 - ...
  • 299
3 votes
2 answers
450 views

How to link Wordpress heartbeat to ajax form

I have a form that $_POSTs an input value, and user's ID that saves the data to the database: // frontend form <form id="form"> <input type="radio" name="location" id="name1" value="1"&...
  • 299
3 votes
0 answers
78 views

How can change heartbeat hasFocus option to false

After I check heartbeat.js file I found that by default WordPress set heartbeat hasFocuse option to true, I want to change this option to false what can I do? What am I trying to achieve? I have a ...
  • 31
1 vote
1 answer
665 views

How can check if heartbeat is disabled?

I want a code to check if the heartbeat is disabled from a WordPress site or not.
  • 77
2 votes
1 answer
591 views

Why is the Ajax heartbeat included in my cached frontend pages? Is it OK to get rid of it?

I recently thought I'd protect a WP site's /wp-admin folder with Apache's basic auth to provide a crude but somewhat effective additional layer of security (as a second line of defense should the WP ...
  • 512
0 votes
1 answer
85 views

Is there any way to fire heartbeat API from for website visitors?

I saw that Heartbeat API is fired when someone is logged in the Wordpress. Is there any way to fire it for website visitors?
1 vote
1 answer
353 views

Heartbeat API NOT disabling

I’m hoping this is something easy to fix although from my tests (very new to WordPress so please go easy with me if these tests are not very good!) doesn’t appear to be. I have a site hosted on ...
1 vote
0 answers
1k views

admin-ajax.php + load-scripts.php hanging for minutes

My issue is that when I do a simple Admin Dashboard change, like updating a post or page, I sometimes wait up to 10 minutes for the request to finish. I have tried restarting the process and my ...
6 votes
3 answers
2k views

Stop/Pause WordPress Heartbeat using Javascript

I use the WordPress heartbeat to check a setting on my server from the front-end. If that setting has a specific value I want to stop bothering the server. There for I want to stop/pause the heartbeat....
3 votes
1 answer
184 views

Log of Heartbeat Calls

I've read that Heartbeat can slow a WP site down and I'm assuming if our admins/store managers have a lot of admin windows/tabs open, this will exacerbate the issue. If yes, is there a condition to ...
0 votes
0 answers
971 views

Bruteforce attack from 127.0.0.1?

I've got a very strange problem. Actually my server is being attacked by a brute force on wp-login.php. But when I look into the access log file I see that it's from 127.0.0.1... www.*.fr:80 127.0.0....
3 votes
0 answers
1k views

CPU usage: AJAX and Heartbeat API on admin pages

My (shared) web host recently sent me this: "Our server monitoring systems keep indicating high server load persistently maintained by your website (...). Most of the hits are to the /www/www/wp-...
6 votes
1 answer
2k views

Heartbeat API long polling

I recently noticed that in Heartbeat API js client there was added option for speed of ticks called "long polling" with 0 interval. I pretty much understand what they try to achieve but I'm confused ...
1 vote
1 answer
312 views

Heartbeat API: How to access data already enqueued?

I'm having problems when trying to access data that I've queued using the Heartbeat API. I'm queuing data using wp.heartbeat.enqueue(). For example: var data = { my_key: 'value' }; wp.heartbeat....
  • 3,007
4 votes
2 answers
1k views

How to check if new posts have been published since page load?

My aim is to use the Heartbeat API to check if new posts have been published since the blog's homepage was loaded. If new posts have been published, I will display a link at the top of the screen "16 ...
  • 3,007
15 votes
1 answer
621 views

Are WordPress Heartbeat API 'beats' staggered or do they occur simultaneously for all users?

The WordPress Heartbeat API uses admin-ajax.php to run AJAX calls. If User X leaves their browser open, many calls will be made to the server, with each call happening when there is a 'beat'. Now if ...
  • 3,007
2 votes
1 answer
1k views

Why does Wordpress Heartbeat login not refresh the nonces?

Here's an interesting experiment: Go to wordpress plugins listing page, notice the activate, deactivate links all have a nonce part in the request. In a second tab, log out of the site, and go back ...
  • 432
4 votes
2 answers
730 views

Heartbeat API oEmbed

By default running content through the_content filter automatically checks for oEmbed content. However when returning data through heartbeat_received the filter for oEmbed doesn't seem to work. For ...
  • 542
16 votes
4 answers
17k views

How to disable the "Post Lock/Edit Lock"?

I want to disable this just for one Post Type, as it doesn't really matters if there's another user editing it (the main content editing area is Ajaxified and non-admins can only see that). I looked ...
  • 21.8k
3 votes
2 answers
3k views

How to create notification on frontend using heartbeat api for multiple custom post types

How can I get correct action hook on publish_posts for multiple custom types ? I have a following problem, I can use this hook for posts or single custom post_type, but I don't know correct hook for ...