PHP Code Sniffer Errors Explained

Messages output by PHP_CodeSniffer or “phpcs” are often confusing, especially when using an opinionated coding standard like the WordPress Coding Standard. Below, some of these messages are described in detail. SQL wildcards for a LIKE query should be passed in…

Logged-out Users Run Your WordPress Cron Jobs

💡 Code that works in a plugin might not behave the same in a scheduled wp-cron job. Things That Don’t Always Work in WordPress Cron Jobs get_posts() calls that return posts with unpublished statusesWorkaround: use $wpdb queries to retrieve posts…