diff --git a/checks/class-jquery-check.php b/checks/class-jquery-check.php new file mode 100644 index 00000000..150adb99 --- /dev/null +++ b/checks/class-jquery-check.php @@ -0,0 +1,55 @@ +error[] = sprintf( + '%s: %s', + __( 'RECOMMENDED', 'theme-check' ), + sprintf( + 'JQuery is enqueued on the front end, however you may not need it, see this article for tips on switching to vanilla JavaScript.', + 'https://make.wordpress.org/themes/2021/10/04/the-performance-impact-of-using-jquery-in-wordpress-themes/' + ) + ); + } + return true; + } + + /** + * Get error messages from the checks. + * + * @return array Error message. + */ + public function getError() { + return $this->error; + } +} + +$themechecks[] = new JQuery_Check();