Categories
Server Configuration WordPress

Secure a WordPress site without using plugins — during your lunch break

Keeping a WordPress site secure is paramount. Without using plugins—we’re going DIY—here are ways to secure a WordPress site during your lunch break. The big, popular security plugins use many of these tactics and code, so why not implement them yourself? At least learn what they are. If nothing else, one less plugin running in the background frees resources, leading to faster site load times. Delete default admin user WordPress powers roughly 30% of the …

Categories
JavaScript WordPress

Inject JavaScript with WordPress data it can reference using wp_localize_script()

Say you have JavaScript files that rely on images that live in your current theme directory — or elsewhere outside of the domain root — and they’re not loading without hard-coding the URL into your code. Or, you may be developing locally and when pushing to a sandbox or production server, tired of changing the file path depending on the server. You must register the script before calling wp_localize_script() then queueing it. This allows you to …

Categories
Email JavaScript Web Development

How to compress + minify MailChimp’s mc-validate.js for faster loading and better PageSpeed Insight Scores

MailChimp has been far from cooperative with helping developers speed up website loading by simply minifying their mc-validate.js file. There’s a growing thread on Twitter started over two — yes, 2! — years ago!

Here’s what i did to stop receiving terrible grades on GT Metrix and Google’s PageSpeed Insights.

Categories
Server Configuration Web Development

Fonts blocked by CORS policy on localhost: How to fix that

I’m using MAMP Pro and have a separate Host setup for each of my website projects. This let’s me navigate to https://local.mydomain.com instead of https://localhost:8888/mywebsitedirectory. You can easily set up local.mydomain.com to be a.b.c if you wanted; this is my convention for projects. I like to separate local dev with production and sandbox/staging sites. Since i decided to serve fonts locally as web fonts instead of grabbing them from Google or TypeKit or wherever, i noticed this …

Categories
WordPress

BackWPup WordPress plugin – Error when running email backup job

Looking for an easy WordPress backup solution, i decided to give several plugins a try. One of them was BackWPup. While testing it out, i ran into an issue trying to send backups via email. It was due to the DMARC policy on my domain. Below is an email i received (in Spam) when attempting to do the email backup option. Quick trick to circumvent this issue is to set the “From” address in the …

Categories
CLI Miscellaneous

Delete Icon? icon\r files from your Mac

For the longest time these “Icon?” (or Icon\r) files kept popping up on my Mac without any rhyme or reason. I would manually delete them. Eventually i got fed up again when several popped up in my main Music folder and all its sub-directories. I googled a Terminal (bash) command to find and delete files based on name. So, here is the command i settled on for my needs. Be sure to change the directory …

Categories
CLI PHP Server Configuration

Machform PHP mail / sendmail issues on Apache and nginx

So, i decided to give Machform a spin on a project i was working on. Figured it would be quick and easy to get up and running. It was — locally — but when deploying to my sandbox/staging server, i ran into issues with sending notification emails. It was maddening. Spent a couple of days getting everything working as needed and on the same page for all three differing environments. The first problem occurred when …

Categories
Hardware Miscellaneous

How to fix a MacBook Pro keyboard and trackpad

Update: On November 2, 2018, using the DIY method, i successfully repaired the broken hardware of my MacBook Pro for $23.98 + tax. A drastic difference from the $400-500 estimate from the Mac Store. At the end of this post i have appended what i did to fix the keyboard after i had exhausted the steps originally outlined in this post. Cheers. After returning from this past weekend’s WordCamp ATL 2018 — #WCATL — i opened up …

Categories
Uncategorized

JSON-LD missing ‘}’ – Google Structured Data Testing Tool

So, you’re implementing structured data on your site, particularly using JSON-LD (the latest Google recommendation regarding structured data), but when testing the file or the code used via the Structured Data Testing Tool, you receive an error–particularly this: JSON-LD Missing ‘}’ or object member name. Fortunately, it has a pesky but quick fix. All you have to do is look for the superfluous trailing comma(s) throughout your code. For instance, in the image below, you’ll …

Categories
DNS Server Configuration

Firebase custom domain verification with Namecheap DNS

Out of the blue, i received a message that i still needed to verify my domain ownership — odd, because two weeks prior i thought i had covered my Firebase custom domain verification. I double-checked i followed the Google instructions verbatim, going so far as deleting and re-entering the records, yet after a few hours, still no luck. Enter doing the tried-and-true thing of Googling, but really hitting up good ol’ StackOverflow. It was suggested …

Categories
WordPress

WordPress FTP Error when upgrading WordPress core or plugin

You go to update a plugin or the latest security patch for WordPress, but when you click update you’re prompted for FTP credentials. It can be frustrating and annoying, but it has (typically) a simple fix. This WordPress FTP error is frustration at its peak. You’ll need access to your wp-config.php file and ssh access to your server.  Two steps: Apache server — via terminal/command line run sudo chown -Rf www-data:www-data /var/www/html (or could just be /var/www; …

Categories
CLI

brew update – Error: /usr/local must be writable!

[UPDATE – View updated solution at the bottom of the post.] So, you wanted to update homebrew with the command brew update but received a similar error below: Error: /usr/local must be writable! Simple fix is to run sudo chown -R $(whoami) /usr/local Your problem should now be fixed. If not, you might have ran into this issue that i’ve come across, too: Error: update-report should not be called directly! I fixed this by running …

Categories
WordPress

WordPress: You Changed the Site Address URL and now Blog Posts are Blank!

So you installed WordPress in a sub-directory because you want your URL to still be simple, such as installed here www.mydomain.com/wordpress-installed-here/ yet visitors will see www.mydomain.com when navigating your site, but after doing so your blog posts and pages show up as a white blank page. Not good. Luckily, there’s a simple fix! Just update your .htaccess file in the main directory of where your site is located. I’ve put example code for the .htaccess …

Categories
Server Configuration Web Development

MySQL Server Not Starting on MAMP for Mac

So if you’re like me, you do a lot of WordPress development locally and experience annoying issues. I use MAMP, personally, as do many others. One of these common headaches is the MySQL server not starting on MAMP for Mac; inexplicably stopping and whatever you try, it won’t start again. Here’s a fix that has worked all the time for me: Quit MAMP. In the Finder (or Terminal) go to Applications/MAMP/db/mysql56/ and delete the last log …