79% asynchronous-javascript

Code Review | Asynchronous Javascript

WordPress plugin Asynchronous Javascript scored 79% from 54 tests.

About plugin

  • Plugin page: asynchronous-java...
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 5.8.1
  • First release: Jan 18, 2013
  • Latest release: Nov 2, 2013
  • Number of updates: 38
  • Update frequency: every 7.6 days
  • Top authors: parisholley (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

700+ active / 33,560 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.76MB] [CPU: ▼177.14ms] Passed 4 tests

This is a short check of server-side resources used by Asynchronous Javascript
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0531.48 ▼7.35
Dashboard /wp-admin2.89 ▼0.1624.12 ▼20.32
Posts /wp-admin/edit.php2.89 ▼0.2122.61 ▼25.07
Add New Post /wp-admin/post-new.php2.89 ▼2.5420.58 ▼646.86
Media Library /wp-admin/upload.php2.89 ▼0.1120.41 ▼16.29
Settings /wp-admin/admin.php?page=asyncjs&tab=02.8923.66
/wp-admin/admin.php?page=asyncjs2.8924.91

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 424 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Asynchronous Javascript
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,686 ▲11615.94 ▲0.4210.78 ▲1.4749.25 ▼2.67
Dashboard /wp-admin2,994 ▲605.88 ▼0.05154.58 ▲2.86137.14 ▲13.67
Posts /wp-admin/edit.php2,785 ▲462.71 ▲0.0263.58 ▼8.7692.20 ▲0.57
Add New Post /wp-admin/post-new.php1,625 ▼5818.81 ▲0.03381.48 ▼2.95110.84 ▼1.20
Media Library /wp-admin/upload.php1,782 ▼285.01 ▼0.01140.72 ▼9.28133.83 ▲10.90
Settings /wp-admin/admin.php?page=asyncjs&tab=01,2072.5164.7896.72
/wp-admin/admin.php?page=asyncjs1,2042.3867.3093.17

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/asynchronous-javascript/lib/nhp/options/options.php+227
    Function create_function() is deprecated

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=asyncjs
    • > Deprecated in wp-content/plugins/asynchronous-javascript/lib/nhp/options/options.php+238
    Function create_function() is deprecated
    • > GET request to /wp-admin/admin.php?page=asyncjs
    • > Notice in wp-content/plugins/asynchronous-javascript/lib/nhp/options/options.php+641
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 47× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/fields/pages_select/field_pages_select.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/validation/url/validation_url.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/validation/str_replace/validation_str_replace.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/fields/radio/field_radio.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/fields/google_webfonts/field_google_webfonts.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/fields/select_hide_below/field_select_hide_below.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/validation/email/validation_email.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/validation/js/validation_js.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/fields/cats_multi_select/field_cats_multi_select.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'NHP_Options' not found in wp-content/plugins/asynchronous-javascript/lib/nhp/options/fields/text/field_text.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 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
6 plugin tags: performance, async, headjs, javascript, asynchronous...

asynchronous-javascript/asynchronous-javascript.php Passed 13 tests

The principal PHP file in "Asynchronous Javascript" v. 1.3.5 is loaded by WordPress automatically on each request
80 characters long description:
Improve page load performance by asynchronously loading javascript using head.js

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin3,294 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP479939662,152
CSS2103168901
JavaScript117025217
Markdown110024

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity7.48
▷ Minimum class complexity1.00
▷ Maximum class complexity113.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes00.00%
▷ Concrete classes46100.00%
▷ Final classes00.00%
Methods122
▷ Static methods54.10%
▷ Public methods122100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
360 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/nhp/options/img/glyphicons/glyphicons_338_forrst.png0.27KB0.29KB0.00%
lib/nhp/options/img/glyphicons/glyphicons_008_film.png0.12KB0.12KB0.00%
lib/nhp/options/img/glyphicons/glyphicons_212_down_arrow.png0.18KB0.20KB0.00%
lib/nhp/options/img/glyphicons/glyphicons_181_download_alt.png0.19KB0.22KB0.00%
lib/nhp/options/img/glyphicons/glyphicons_087_log_book.png0.21KB0.24KB0.00%