79% add-admin-javascript

Code Review | Add Admin JavaScript

WordPress plugin Add Admin JavaScript scored79%from 54 tests.

About plugin

  • Plugin page: add-admin-javascript
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7
  • WordPress version: 6.3.1
  • First release: Dec 5, 2011
  • Latest release: May 8, 2021
  • Number of updates: 20
  • Update frequency: every 172.9 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active /36,149 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼6.79ms] Passed 4 tests

Analyzing server-side resources used by Add Admin JavaScript
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1943.09 ▲6.94
Dashboard /wp-admin3.50 ▲0.1648.25 ▼10.28
Posts /wp-admin/edit.php3.61 ▲0.2643.32 ▼5.95
Add New Post /wp-admin/post-new.php6.08 ▲0.2084.56 ▼11.73
Media Library /wp-admin/upload.php3.42 ▲0.2035.14 ▲0.81
Admin JavaScript /wp-admin/options-general.php?page=add-admin-javascript/add-admin-javascript.php3.4232.57

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Add Admin JavaScript
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.28 ▼0.961.71 ▼0.1743.63 ▲2.44
Dashboard /wp-admin2,210 ▲194.86 ▼0.05104.67 ▼1.8542.21 ▲1.43
Posts /wp-admin/edit.php2,093 ▲72.00 ▼0.0536.40 ▼2.1329.81 ▼5.06
Add New Post /wp-admin/post-new.php1,545 ▲1218.61 ▼4.42659.29 ▼1.2846.88 ▼4.67
Media Library /wp-admin/upload.php1,392 ▲104.19 ▼0.0596.68 ▼1.0243.14 ▲1.05
Admin JavaScript /wp-admin/options-general.php?page=add-admin-javascript/add-admin-javascript.php1,1633.7586.9149.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/add-admin-javascript/tests/phpunit/bootstrap.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/add-admin-javascript/tests/phpunit/bootstrap.php on line 19
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/add-admin-javascript/tests/phpunit/bootstrap.php on line 19

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: javascript, admin theme, script, coffee2code, js...

add-admin-javascript/add-admin-javascript.php Passed 13 tests

This is the main PHP file of "Add Admin JavaScript" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
115 characters long description:
Interface for easily defining additional JavaScript (inline and/or by URL) to be added to all administration pages.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,790 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP63946671,424
Markdown3560331
Bourne Shell16221
XML10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity48.75
▷ Minimum class complexity3.00
▷ Maximum class complexity140.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes133.33%
Methods133
▷ Static methods86.02%
▷ Public methods12090.23%
▷ Protected methods139.77%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
c2c_minilogo.png3.49KB1.91KB▼ 45.43%