94% custom-js

Code Review | Custom JS

WordPress plugin Custom JS scored 94% from 54 tests.

About plugin

  • Plugin page: custom-js
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.6
  • WordPress version: 5.8.1
  • First release: Sep 20, 2016
  • Latest release: Sep 24, 2016
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: seosbg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active / 1,717 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼130.48ms] Passed 4 tests

Analyzing server-side resources used by Custom JS
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1347.49 ▲22.84
Dashboard /wp-admin3.08 ▲0.0247.15 ▲0.71
Posts /wp-admin/edit.php3.13 ▲0.0244.56 ▼3.24
Add New Post /wp-admin/post-new.php5.44 ▼0.00144.83 ▼519.76
Media Library /wp-admin/upload.php3.02 ▲0.0237.65 ▲0.39

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Custom JS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,700 ▲10415.82 ▲0.278.56 ▼0.4656.56 ▲0.42
Dashboard /wp-admin2,984 ▲515.88 ▼0.27141.37 ▼13.19143.64 ▲18.83
Posts /wp-admin/edit.php2,761 ▲222.71 ▲0.0181.71 ▲10.39101.74 ▲17.31
Add New Post /wp-admin/post-new.php1,698 ▲1518.78 ▲0.14422.85 ▲19.94126.52 ▲14.28
Media Library /wp-admin/upload.php1,772 ▼355.00 ▼0.03140.83 ▼4.61143.99 ▲19.64

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-js/custom-js.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (Admin Panel view of submitted form data.) image required
The official readme.txt might help

custom-js/custom-js.php Passed 13 tests

The main file in "Custom JS" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
64 characters long description:
Custom JS is easy to use. Custom JS add custom JS in your theme.

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 plugin132 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
CSS113075
PHP1191557

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png1.58KB1.43KB▼ 9.69%
images/logo.png11.25KB4.39KB▼ 60.99%
screenshot-1.png6.06KB2.82KB▼ 53.48%