90% async-javascript

Code Review | Async JavaScript

WordPress plugin Async JavaScript scored90%from 54 tests.

About plugin

  • Plugin page: async-javascript
  • Plugin version: 2.21.08.31
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Dec 11, 2014
  • Latest release: Jun 22, 2023
  • Number of updates: 120
  • Update frequency: every 26.0 days
  • Top authors: cloughit (80.83%)futtta (20%)

Code review

54 tests

User reviews

102 reviews

Install metrics

100,000+ active /1,916,275 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.15ms] Passed 4 tests

This is a short check of server-side resources used by Async JavaScript
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.26 ▼1.08
Dashboard /wp-admin3.43 ▲0.1250.84 ▼7.88
Posts /wp-admin/edit.php3.53 ▲0.1850.32 ▼1.47
Add New Post /wp-admin/post-new.php6.00 ▲0.1297.27 ▼2.17
Media Library /wp-admin/upload.php3.34 ▲0.1241.76 ▲5.32
Async JavaScript /wp-admin/options-general.php?page=async-javascript3.3836.57

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 19 new options
New WordPress options
aj_autoptimize_method
aj_defer
aj_exclusions
aj_async
aj_enabled
aj_autoptimize_enabled
aj_jquery
aj_method
widget_recent-comments
aj_enabled_logged
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Async JavaScript
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,900 ▲15413.29 ▼1.461.84 ▲0.0143.03 ▼1.71
Dashboard /wp-admin2,284 ▲964.90 ▼0.99103.01 ▲0.1946.17 ▲0.91
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0435.80 ▼1.9534.20 ▼2.28
Add New Post /wp-admin/post-new.php1,536 ▲2223.11 ▲5.64671.82 ▲18.6850.22 ▼10.17
Media Library /wp-admin/upload.php1,395 ▲44.24 ▲0.04102.53 ▼2.9446.49 ▲1.77
Async JavaScript /wp-admin/options-general.php?page=async-javascript1,1622.5533.0447.38

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 19 options in the database
    • widget_recent-comments
    • aj_version
    • aj_async
    • aj_exclusions
    • aj_jquery
    • aj_defer
    • aj_enabled_shop
    • db_upgraded
    • aj_enabled_logged
    • widget_theysaidso_widget
    • ...

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
The SRP test was a success

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 undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: pagespeed, javascript, render blocking, performance, async

async-javascript/async-javascript.php 92% from 13 tests

The main file in "Async JavaScript" v. 2.21.08.31 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 170 characters long)

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 plugin5,453 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6215272,936
PHP111543661,971
CSS47533539
HTML1007

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity47.33
▷ Minimum class complexity26.00
▷ Maximum class complexity68.00
Average method complexity4.09
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods45
▷ Static methods920.00%
▷ Public methods4191.11%
▷ Protected methods24.44%
▷ Private methods24.44%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lib/chosen/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/lib/chosen/chosen-sprite.png0.53KB0.88KB0.00%