83% add-javascript-attributes

Code Review | Add JavaScript attributes

WordPress plugin Add JavaScript attributes scored 83% from 54 tests.

About plugin

  • Plugin page: add-javascript-at...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.7
  • WordPress version: 6.3.1
  • First release: Mar 20, 2017
  • Latest release: Mar 20, 2017
  • Number of updates: 4
  • Update frequency: every 6.2 days
  • Top authors: ifourkuldeep1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 688 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

An overview of server-side resources used by Add JavaScript attributes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.71 ▼1.92
Dashboard /wp-admin3.31 ▲0.0145.03 ▼2.52
Posts /wp-admin/edit.php3.36 ▲0.0143.67 ▼6.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.71 ▼12.31
Media Library /wp-admin/upload.php3.24 ▲0.0136.81 ▲1.80

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Add JavaScript attributes: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.23 ▼1.151.74 ▲0.0042.25 ▼6.78
Dashboard /wp-admin2,222 ▲345.79 ▼0.10104.21 ▲4.4854.36 ▲8.80
Posts /wp-admin/edit.php2,105 ▲161.99 ▼0.0233.62 ▼8.9435.92 ▲0.12
Add New Post /wp-admin/post-new.php1,527 ▼217.73 ▼0.46656.11 ▲17.8649.01 ▼7.64
Media Library /wp-admin/upload.php1,404 ▲164.23 ▲0.02108.84 ▲8.1247.26 ▲4.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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-javascript-attributes/add-javascript-attributes.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Front-end of JavaScript attribute added.), #2 (Admin side JavaScript attributes added.)
The official readme.txt might help

add-javascript-attributes/add-javascript-attributes.php 92% from 13 tests

Analyzing the main PHP file in "Add JavaScript attributes" version 1.0
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin98 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1111098

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.06
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png11.51KB5.73KB▼ 50.21%
(invalid) assets/banner-772x250.png27.44KB0.00KB▼ 100.00%
assets/icon-256x256.png34.22KB16.54KB▼ 51.66%