10% js-injector

Code Review | JS Injector

WordPress plugin JS Injector scored 10% from 54 tests.

About plugin

  • Plugin page: js-injector
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Sep 5, 2017
  • Latest release: Sep 5, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: 77solutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 965 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/js-injector/_core/1.0.0L/libraries/CSSTidy/1.5.5/class.csstidy_optimise.php+913
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲0.12MB] [CPU: ▼4.15ms] Passed 4 tests

An overview of server-side resources used by JS Injector
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.69 ▼8.23
Dashboard /wp-admin3.42 ▲0.1156.54 ▲1.06
Posts /wp-admin/edit.php3.51 ▲0.1652.25 ▼8.15
Add New Post /wp-admin/post-new.php6.13 ▲0.24103.44 ▲3.02
Media Library /wp-admin/upload.php3.35 ▲0.1341.18 ▼1.27
JS Injector /wp-admin/options-general.php?page=js-injector-redirect3.2534.88
Login Page /wp-admin/admin.php?page=js-injector&tab=login_page3.3437.25
Registration Page /wp-admin/admin.php?page=js-injector&tab=registration_page3.3432.24
Site Area /wp-admin/admin.php?page=js-injector&tab=site_area3.3432.85
Lost Password Page /wp-admin/admin.php?page=js-injector&tab=lost_password_page3.3434.03
Admin Area /wp-admin/admin.php?page=js-injector3.2832.79

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 57 new files
Database: no new tables, 36 new options
New WordPress options
js-injector-register_js_foot_code_safe
widget_recent-comments
widget_theysaidso_widget
js-injector-register_js_head_code_safe
js-injector-recovery_js_head_code_safe
js-injector-register_js_foot_enabled
js-injector-site_js_head_code_safe
js-injector-login_js_foot_code_safe
js-injector-recovery_js_foot_code
js-injector-login_js_foot_enabled
...

Browser metrics Passed 4 tests

A check of browser resources used by JS Injector
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲10914.41 ▲0.151.80 ▼0.0651.86 ▲1.09
Dashboard /wp-admin2,246 ▲614.99 ▼0.87125.20 ▼16.4294.72 ▲42.83
Posts /wp-admin/edit.php2,148 ▲522.04 ▲0.0343.82 ▼5.0540.04 ▲0.43
Add New Post /wp-admin/post-new.php1,715 ▲18122.50 ▼1.00853.01 ▲134.1968.10 ▲7.91
Media Library /wp-admin/upload.php1,440 ▲494.17 ▼0.03124.27 ▲1.3481.72 ▲26.59
JS Injector /wp-admin/options-general.php?page=js-injector-redirect9391.8130.3244.58
Login Page /wp-admin/admin.php?page=js-injector&tab=login_page9401.7540.2135.86
Registration Page /wp-admin/admin.php?page=js-injector&tab=registration_page9361.7534.2641.96
Site Area /wp-admin/admin.php?page=js-injector&tab=site_area9411.8232.7436.49
Lost Password Page /wp-admin/admin.php?page=js-injector&tab=lost_password_page9361.7933.2637.85
Admin Area /wp-admin/admin.php?page=js-injector9391.7933.8934.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/js-injector/uninstall.php+36
    Undefined variable: _plugin
  • Incomplete uninstall procedure, leaving 57 files (1.43MB) in the plugin directory
    • (new file) _core/1.0.0L/WP77_load.php
    • (new file) _core/1.0.0L/assets/fonts/77/1.0.0/77.eot
    • (new file) _core/1.0.0L/assets/fonts/77/1.0.0/77.svg
    • (new file) _core/1.0.0L/assets/css/77/1.0.0/77.min.css
    • (new file) _core/1.0.0L/assets/css/font-awesome/4.7.0/font-awesome.css
    • (new file) _core/1.0.0L/assets/css/font-awesome/4.7.0/font-awesome.min.css
    • (new file) _core/1.0.0L/admin_page.php
    • (new file) _core/1.0.0L/assets/fonts/77/1.0.0/77.woff
    • (new file) _core/1.0.0L/assets/css/77/1.0.0/77.css
    • (new file) _core/1.0.0L/assets/fonts/77/1.0.0/77.ttf
    • ...
  • Zombie WordPress options were found after uninstall: 37 options
    • js-injector-recovery_js_head_enabled
    • js-injector-register_js_head_code_safe
    • js-injector-login_js_head_enabled
    • widget_recent-posts
    • theysaidso_admin_options
    • js-injector-login_js_foot_enabled
    • js-injector-recovery_js_foot_enabled
    • js-injector-register_js_foot_code
    • js-injector-recovery_js_foot_code
    • js-injector-dashboard_js_head_code
    • ...

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/js-injector/_plugin/tabs/registration_page.index.php on line 29
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/js-injector/_plugin/tabs/site_area.index.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to a member function Call() on null in wp-content/plugins/js-injector/_plugin/tabs/site_area.index.php:29
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/js-injector/_plugin/tabs/admin_area.index.php on line 29
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/js-injector/_plugin/tabs/login_page.index.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to a member function Call() on null in wp-content/plugins/js-injector/_plugin/tabs/registration_page.index.php:29
    • > PHP Fatal error
      Uncaught Error: Call to a member function Call() on null in wp-content/plugins/js-injector/_plugin/tabs/admin_area.index.php:29
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/js-injector/_plugin/tabs/lost_password_page.index.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to a member function Call() on null in wp-content/plugins/js-injector/_plugin/tabs/lost_password_page.index.php:29
    • > PHP Fatal error
      Uncaught Error: Call to a member function Call() on null in wp-content/plugins/js-injector/_plugin/tabs/login_page.index.php:29

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=js-injector
    • > Network (severe)
    http://%20altspan%20class%3Dfa%20fa-fw%20fa-code/spanimg%20src= - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

js-injector/index.php 92% from 13 tests

The principal PHP file in "JS Injector" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("js-injector.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin9,273 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP371,6283,8244,108
SVG2002,683
CSS419132,438
JavaScript224044

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 151)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity26.88
▷ Minimum class complexity1.00
▷ Maximum class complexity255.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity151.00
Code structure
Namespaces1
Interfaces2
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes2086.96%
Methods219
▷ Static methods12356.16%
▷ Public methods21799.09%
▷ Protected methods00.00%
▷ Private methods20.91%
Functions19
▷ Named functions315.79%
▷ Anonymous functions1684.21%
Constants9
▷ Global constants9100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
_core/1.0.0L/assets/img/icon_small_default.png0.43KB0.30KB▼ 31.53%
_core/1.0.0L/assets/img/icon_medium_default.png0.66KB0.49KB▼ 25.37%