Remote upload file to server B

Try adding die(‘message’); and use that to debug where it fails. Also try and use ftp://external-server.com as opposed to just external-server.com. Also make sure you use your FTP password. And try it on active mode as opposed to passive mode. When I was trying to upload by FTP that’s what I had to do. Also … Read more

Experiences with adding Nonces to the comment form

I haven’t done this personally, but it would be pretty easy. If you are building your comment form manually, just before the end of the </form> put: <?php wp_nonce_field( ‘comment_nonce’ ) ?> Then, just hook into the pre_comment_on_post action which fires when you submit a comment: add_action( ‘pre_comment_on_post’, ‘my_verify_comment_nonce’ ); function my_verify_comment_nonce() { check_admin_referer( ‘comment_nonce’ … Read more

Deactivate plugin for a specific user group

I think the answer to this Disable plugin / plugin action via theme is good for base knowledge on how to disable plugins from code. Adapting that knowledge to your needs will leave us with this: add_action(‘admin_init’, ‘my_filter_the_plugins’); function my_filter_the_plugins() { global $current_user; if (in_array(‘media_manager’, $current_user->roles)) { deactivate_plugins( // deactivate for media_manager array( ‘/advanced-page-manager/advanced_page_manager.php’ ), … Read more

Creating 20,000 Posts or Pages using a .csv file?

Import posts from a .csv file with WP-CLI If our import.csv is tab delimited, with two columns: Planet Mars The red planet. Planet Earth Our blue planet. then we can parse it with help of this answer, where we use IFS=$’\t’ instead as tab delimiter: while IFS=$’\t’, read col1 col2; \ do \ echo “$col1|$col2”; … Read more

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