10% async-js-and-css

Code Review | Async JS and CSS

WordPress plugin Async JS and CSS scored10%from 54 tests.

About plugin

  • Plugin page: async-js-and-css
  • Plugin version: 1.7.13
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-3.7.1
  • WordPress version: 6.3.1
  • First release: Aug 25, 2013
  • Latest release: Nov 18, 2013
  • Number of updates: 52
  • Update frequency: every 1.7 days
  • Top authors: dmikam (100%)

Code review

54 tests

User reviews

51 reviews

Install metrics

2,000+ active /111,838 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/async-js-and-css/functions.php+172
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▼1.82MB] [CPU: ▼55.12ms] Passed 4 tests

Analyzing server-side resources used by Async JS and CSS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.17 ▼1.305.04 ▼40.72
Dashboard /wp-admin2.19 ▼1.125.75 ▼44.32
Posts /wp-admin/edit.php2.19 ▼1.177.50 ▼43.10
Add New Post /wp-admin/post-new.php2.19 ▼3.706.42 ▼92.33
Media Library /wp-admin/upload.php2.19 ▼1.046.32 ▼28.45
Async Settings /wp-admin/options-general.php?page=asyncJSandCSS2.195.60

Server storage [IO: ▲0.04MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 12 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
ajc_async_css
widget_recent-comments
can_compress_scripts
widget_recent-posts
ajc_css_loading_method
ajc_css_minify
ajc_detect_scripts_in_wp_foot
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Async JS and CSS
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲9614.74 ▲0.343.93 ▲2.0445.41 ▲1.73
Dashboard /wp-admin2,207 ▲195.83 ▼0.0797.90 ▼9.2538.41 ▼4.27
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0133.95 ▼6.7033.59 ▼0.80
Add New Post /wp-admin/post-new.php1,538 ▲1923.37 ▲0.28675.14 ▲13.5749.31 ▼8.13
Media Library /wp-admin/upload.php1,395 ▲104.13 ▼0.07103.34 ▲8.8546.91 ▲3.36
Async Settings /wp-admin/options-general.php?page=asyncJSandCSS9411.8224.3129.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/async-js-and-css/functions.php+172
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • This plugin does not fully uninstall, leaving 12 options in the database
    • ajc_async_js
    • theysaidso_admin_options
    • ajc_detect_scripts_in_wp_foot
    • widget_theysaidso_widget
    • ajc_async_css
    • widget_recent-posts
    • widget_recent-comments
    • ajc_css_loading_method
    • db_upgraded
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=asyncJSandCSS
    • > Warning in wp-content/plugins/async-js-and-css/functions.php+172
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/async-js-and-css/asyncJSandCSS.php:14
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/async-js-and-css/functions.php on line 172
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/async-js-and-css/settings_page.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: css, performance, asynchronous, async, javascript...

async-js-and-css/asyncJSandCSS.php 92% from 13 tests

The primary PHP file in "Async JS and CSS" version 1.7.13 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("async-js-and-css.php" instead of "asyncJSandCSS.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin901 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP312443748
PO File24242153

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions39
▷ Named functions39100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin