Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5531

JW555 on "Admin-ajax.php being Called from Admin Pages Causing DB Connection Issues"

$
0
0

Manoranjan Padhy, the idea of this community site for the free program Wordpress is that you post your solutions HERE and not use this site to get traffic.

What is worse is that the solutions you post do not work and when people complain on your site you tell them to use option 2, if you know it does not work why waste their time telling them to do it in the first place.

What you are posting there has been shared in parts here so I hope you do not mind me posting what you put there, back on here:

Solution for the WordPress Heartbeat API

Omit the HTML tags you may find in the code e.g
`

1.)Completely disable Heartbeat API (DOES NOT WORK)
1 <br />
2 add_action( 'init', 'stop_heartbeat', 1 );<br />
3 function stop_heartbeat() {<br />
4 wp_deregister_script('heartbeat');<br />

2.) Disabling Heartbeat API except the post.php and post-new.php i.e autosave option of WordPress (SUGGESTED)
1 <br />
2 add_action( 'init', 'stop_heartbeat', 1 );<br />
3 function stop_heartbeat() {<br />
4 global $pagenow;<br />
5 if ( $pagenow != 'post.php' && $pagenow != 'post-new.php' )<br />
6 wp_deregister_script('heartbeat');<br />
7 }<br />

3.) Disabling Heartbeat API on dashboard.
1 <br />
2 add_action( 'init', 'stop_heartbeat', 1 );<br />
3 function stop_heartbeat() {<br />
4 global $pagenow;<br />
5 if ( $pagenow == 'index.php' )<br />
6 wp_deregister_script('heartbeat');<br />
7 }<br />

4.) Changing the pulse of Heartbeat API
1 <br />
2 function wptuts_heartbeat_settings( $settings ) {<br />
3 $settings['interval'] = 60; //Anything between 15-60<br />
4 return $settings;<br />
5 }<br />
6 add_filter( 'heartbeat_settings', 'wptuts_heartbeat_settings' );<br />
`


Viewing all articles
Browse latest Browse all 5531

Trending Articles