My PHPCS & WPCS Setup Notes

Recently I’d SSD upgrade on my mac, the first thing I need to do for Setting Dev Environment was to Install Homebrew, Laravel Valet and PHPCS for Better Code Practices and the Editor. Following items were scattered, just curating them for future reference.

If you are Mac user, you will need to install Homebrew & Laravel Valet, linking to official Docs.

PHPCS and WPCS can be installed on any OS. Steps are almost same, Following are steps for Configuring PHPCS and WPCS for Mac and Windows.

1. Installing PHPCS
1.a Official Documentation

1.b Installing via Composer
composer global require "squizlabs/php_codesniffer=*"

2. Verify phpcs version
phpcs --version

3. Check Installed Coding Standards
phpcs -i

4. Installing WordPress Coding Standards
composer global require "wp-coding-standards/wpcs"

5. Configure PHPCS to use WPCS
phpcs --config-set installed_paths ~/.composer/vendor/wp-coding-standards/wpcs

6. Using PHP CS with WordPress
6.1 using WPCS on specific file – hello.php
phpcs --standard=WordPress /path/to/hello.php

6.2 using WPCS on specific Plugin / Theme
phpcs --standard=WordPress /path/to/wp-content/themes/theme-name/

7. PHPCS for Laravel Apps –
7.1 Refer Official Document

7.2 Install LaravelCS
composer global require pragmarx/laravelcs

8. Configuring PHPCS with Sublime – Official Doc

8.1 Must have Sublime Package Controller

8.2 Install SublimeLinter then SublimeLinter-phpcs.

8.3 Go to Linter Settings, Create User Config. Update your phpcs path in the following My GIST

8.4 Restart Sublime, Before Testing phpcs code

If you are on Windows, Point Number 5 becomes
phpcs --config-set installed_paths C:/Users/abhishek/AppData/Roaming/Composer/vendor/wp-coding-standards/wpcs

Make sure you update your system username. If you find any issue setting it up, feel free to Tweet me.

My New Project: Good Finds

While people are still posting about Ten Year Challenge Pics, I’m taking baby steps with the trend. For those who know me from my college days, I use to Post Tips and Tricks on my blogspot blog which started of curiosity of sharing good finds.

In 2009, I took my first job and had a slowdown in blogging career. Finding new stuff, sharing that free and crazy stuff with friends holds rare pleasure. Over the years, I saw many cool tools, blogging about them remained in the draft.

So In 2019, I’ve created a list on Github of such crazy things for Bloggers, Marketers and Developers. Here’s the link to Good Finds on GitHub.

If you have any cool tool, feel free to Send Pull Request or share in Comment.

Free Resources for your next blog post title

When it comes to writing down an article or a blog post, Title is the most crucial part of the piece you are writing. Here are some free tools to generate and analyse Post Title.

SEMrush Title Generator
Let the Apple fall on Newton’s head for some crazy Ideas. Just hit some of your keywords for the title Ideas. SEMrush title generator is a new addition in SEMrush tool based on their topic research tool. It will surely get some unique titles for you.

CoSchedule Headline Analyzer
You know your blog post is the solution for what your audience is looking. So mostly your title will be Solution to their problem, how are you going to standout the title if the same solution is available across the web. You might have to understand the sentiments of your reader. Headline analyser checks for Emotional quotient and powerful words. More the merrier.

If you use any other free tools, Please do drop in a comment.

Happy Blogging 🙂