mikevanwinkle.com
Tips Archives • Mike Van Winkle
http://www.mikevanwinkle.com/category/tips
PHP Engineer, WordPress Expert and Swell Guy. Block hacker attacks on WordPress’ xmlrpc.php. May 13, 2015. It you’re getting a ton of POST requests to your WordPress xmlrpc.php file, here’s a quick way to block all the bad ips via iptables. In my case I’m using nginx and php-fpm, but something very similar would also work for apache. First, recognize the signature. Your access logs will look something like this:. Grep xmlrpc /var/log/nginx/access.log cut -d' ' -f1 sort uniq -c sort -rn head -n8 29200...
mikevanwinkle.com
posts Archives • Mike Van Winkle
http://www.mikevanwinkle.com/tag/posts
PHP Engineer, WordPress Expert and Swell Guy. Hide WordPress Post from All Queries. May 29, 2015. Problem: you want to create a variation of a page but you don’t want it to show up on the home page or in any archives or anything. You just need a direct link so you can share it with someone. Ids ) { global $wpdb; $ids = $wpdb- get col("SELECT post id FROM {$wpdb- prefix}postmeta WHERE meta key = 'hide post'"); wp cache set('hidden posts', $ids, 'posts'); } $query- set('post not in', $ids); return $query; }.
mikevanwinkle.com
Wordpress Archives • Mike Van Winkle
http://www.mikevanwinkle.com/category/wordpress
PHP Engineer, WordPress Expert and Swell Guy. Covert all tables from MyISAM to InnoDB. February 16, 2016. Here’s a quick one liner to convert all tables on in a specified database from MyISAM to InnoDB:. Mysql -Bse "SELECT CONCAT('ALTER TABLE ',table schema,'.',table name,' engine=InnoDB;') FROM information schema.tables WHERE engine = 'MyISAM' and table schema = 'your database name';" xargs -I {} mysql -e {}. Posted in Geek Think. Hide WordPress Post from All Queries. May 29, 2015. Caveat: This will onl...
mikevanwinkle.com
devops Archives • Mike Van Winkle
http://www.mikevanwinkle.com/tag/devops
PHP Engineer, WordPress Expert and Swell Guy. Block hacker attacks on WordPress’ xmlrpc.php. May 13, 2015. It you’re getting a ton of POST requests to your WordPress xmlrpc.php file, here’s a quick way to block all the bad ips via iptables. In my case I’m using nginx and php-fpm, but something very similar would also work for apache. First, recognize the signature. Your access logs will look something like this:. Grep xmlrpc /var/log/nginx/access.log cut -d' ' -f1 sort uniq -c sort -rn head -n8 29200...
mikevanwinkle.com
mikevanwinkle, Author at Mike Van Winkle
http://www.mikevanwinkle.com/author/mikevanwinkle
PHP Engineer, WordPress Expert and Swell Guy. Use LetsEncrypt on Shared Hosting. March 17, 2016. Here’s a neat little application that let’s you generate a free LetsEncrypt SSL. Certificate even if you only have FTP access to your site. Watch out Symantec:. PS … you will need to know how to run commands in the terminal. Posted in Geek Think. Covert all tables from MyISAM to InnoDB. February 16, 2016. Here’s a quick one liner to convert all tables on in a specified database from MyISAM to InnoDB:. Ids ) {...
mikevanwinkle.com
snippets Archives • Mike Van Winkle
http://www.mikevanwinkle.com/tag/snippets
PHP Engineer, WordPress Expert and Swell Guy. Hide WordPress Post from All Queries. May 29, 2015. Problem: you want to create a variation of a page but you don’t want it to show up on the home page or in any archives or anything. You just need a direct link so you can share it with someone. Ids ) { global $wpdb; $ids = $wpdb- get col("SELECT post id FROM {$wpdb- prefix}postmeta WHERE meta key = 'hide post'"); wp cache set('hidden posts', $ids, 'posts'); } $query- set('post not in', $ids); return $query; }.
mikevanwinkle.com
Tips Archives • Mike Van Winkle
http://www.mikevanwinkle.com/tag/tips
PHP Engineer, WordPress Expert and Swell Guy. Covert all tables from MyISAM to InnoDB. February 16, 2016. Here’s a quick one liner to convert all tables on in a specified database from MyISAM to InnoDB:. Mysql -Bse "SELECT CONCAT('ALTER TABLE ',table schema,'.',table name,' engine=InnoDB;') FROM information schema.tables WHERE engine = 'MyISAM' and table schema = 'your database name';" xargs -I {} mysql -e {}. Posted in Geek Think. Hide WordPress Post from All Queries. May 29, 2015. Caveat: This will onl...
mikevanwinkle.com
hide content Archives • Mike Van Winkle
http://www.mikevanwinkle.com/tag/hide-content
PHP Engineer, WordPress Expert and Swell Guy. Hide WordPress Post from All Queries. May 29, 2015. Problem: you want to create a variation of a page but you don’t want it to show up on the home page or in any archives or anything. You just need a direct link so you can share it with someone. Ids ) { global $wpdb; $ids = $wpdb- get col("SELECT post id FROM {$wpdb- prefix}postmeta WHERE meta key = 'hide post'"); wp cache set('hidden posts', $ids, 'posts'); } $query- set('post not in', $ids); return $query; }.
mikevanwinkle.com
Plugins Archives • Mike Van Winkle
http://www.mikevanwinkle.com/category/wordpress/plugins
PHP Engineer, WordPress Expert and Swell Guy. Quick List: Things WordPress Plugins Developers Can Do to Help Their Plugins Scale. March 5, 2014. 1) For heavy backend operations like generating reports, don’t generate the screen on the init. Hook Schedule a cron job and generate it periodically … if the administrator needs it right away, give them a refresh button. Function it will be autoloaded by default. So you should instead intiate the option using. Add option('myoption','myvalue', false);. Can occas...
SOCIAL ENGAGEMENT