A blog about DevOps, PHP, WordPress and more!

At some point recently (February 2018), Instagram broke their oEmbed implementation which causes JavaScript errors and embeds that overlap each other. Use the snippet below to mitigate this issue and hopefully Instagram will fix it in the future. The snippet makes sure only one

It’s pretty common on Heroku to have a staging app and a production app, with a Pipeline to promote changes from staging to production.

Typically if you use a pipeline, you write git push heroku master to push the latest master branch to your staging app and then promote it to production through the Heroku web UI.

But sometimes you may wish to temporarily test a different branch than master on your staging app. To do this, run:

git push heroku your-feature-branch:master

Where your-feature-branch is the name of the branch you want to deploy.

Remember that you shouldn’t promote this version to production. What you do is to merge the branch with master first after you’ve tested it and run git push heroku master to deploy the master branch to staging again before you finally promote your changes to production.

SELECT wp_users.ID, wp_users.user_nicename, COUNT(*) as count FROM wp_posts, wp_users WHERE wp_posts.post_type='post' AND wp_posts.post_status='publish' AND wp_posts.post_author = wp_users.ID GROUP BY post_author ORDER BY count DESC LIMIT 5 ;

If you are using the WordPress Stream plugin and have a reverse proxy like Varnish in front of it, you might be seeing the IP of your Varnish machines rather than the client IP. This snippet lets you set the proper IP address that Varnish or other reverse proxies forward.