I am validating plugin to make it compatible with WPCS. a function which contains gettext placeholder returning error when i run phpcs command. Source code and screenshot of error...
I am building a plugin that I hope to eventually put on Envato CodeCanyon. Currently I am creating functions of the form mypluginname_action. This is quickly becoming silly as...
I’m working on implementing WordPress coding standards on a theme which has several custom post-types, each of which have underscores in their handles. The theme uses the custom post-type...
I am a real fan of the Allman (BSD) coding indent style. However, when i review the top rated plugins on WordPress, i am finding them using the K&R...
Trying to set up PHP_CodeSniffer with the WordPress Codings Standards. I’m running PHP v8.0.3 and phpcs v3.5.8. (in March 2021). WPCS is installed via git clone -b master https://github.com/WordPress/WordPress-Coding-Standards.git...
In my WordPress workflow I use Gulp and have a task that runs my PHP files through PHPCS using the WordPress coding standards tests (https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards). While writing my comments.php...
I noticed that WordPress files use UNIX end-of-line and UTF-8 without BOM. Is this a standard that should be used? Is there anything else to pay attention to? I...
Background I’m building a project that according to the specifications need to follow the WordPress Coding Standards. I am using phpcs to scan my code. If I try to...
How do you escape these two examples? wc_price() wraps the already escaped $product_price in p and span tags with currency symbol. $product_price = $product->get_price(); <p><?php echo wc_price( esc_html( $product_price...
I am considering different starter themes such as _s and roots. Roots looks very good, especially its sass fork. Anyway, there’s one thing that concerns me. It seems like...