How wordpress detects a plugin update

Every 12+ Hours WordPress automatically goes out and checks if a plugin needs to be updated via the WordPress Repository. There’s 3 cron jobs that WordPress runs to check on things: wp_version_check – Checks for Core Updates wp_update_plugins – Check for Plugin Updates wp_update_themes – Checks for Theme Updates A neat little plugin to view … Read more

Get Latest Plugin Version from WP API

Ok – here is a method – thanks to @Rarst for pointing me in the right direction. Include the require file if the plugins_api function is not found: if ( ! function_exists( ‘plugins_api’ ) ) { require_once( ABSPATH . ‘wp-admin/includes/plugin-install.php’ ); } Then, prepare a query to pass to plugins_api(): // set the arguments to … Read more

Send automatic mail to Admin when user/member changes/adds profile

you got the first part right about using personal_options_update but to be on the safe side add edit_user_profile_update also. and as for sending emails within WordPress the best way would be to use wp_mail, So something like this: add_action( ‘personal_options_update’, ‘notify_admin_on_update’ ); add_action( ‘edit_user_profile_update’,’notify_admin_on_update’); function notify_admin_on_update(){ global $current_user; get_currentuserinfo(); if (!current_user_can( ‘administrator’ )){// avoid sending … Read more

How do I use the ‘http_request_host_is_external’ filter

You can do this: add_filter( ‘http_request_host_is_external’, ‘__return_true’ ); However, note that this disables this security feature. If you know the host or url isn’t going to change and is always going to be that, you can be more secure by checking for that explicitly: add_filter( ‘http_request_host_is_external’, ‘allow_my_custom_host’, 10, 3 ); function allow_my_custom_host( $allow, $host, $url … Read more

How to force function to run as the last one when saving the post?

add_action has a priority parameter which is 10 by default, you can increase that to load your function late. Change add_action( ‘save_post’, ‘do_custom_save’ ); to add_action( ‘save_post’, ‘do_custom_save’, 100 ); Now the priority is to set to 100 and will load quite late and will allow other function associated to load before this function is … Read more

Update WordPress automatically on its own

Yes it is. Though perhaps not in the way you might be thinking. If you check out some of the shared hosting sites, many of them have the capability to automatically update your WordPress site. Of course, as Milo has said, it can be rather disastrous too. Especially on a site with lots of plugins … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)