10% css-injector

Code Review | Custom CSS Injector

WordPress plugin Custom CSS Injector scored10%from 54 tests.

About plugin

  • Plugin page: css-injector
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Aug 30, 2017
  • Latest release: Sep 4, 2017
  • Number of updates: 15
  • Update frequency: every 0.8 days
  • Top authors: 77solutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,800 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/css-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: ▼8.89ms] Passed 4 tests

An overview of server-side resources used by Custom CSS Injector
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.34 ▼6.50
Dashboard /wp-admin3.42 ▲0.1148.74 ▼2.51
Posts /wp-admin/edit.php3.51 ▲0.1646.90 ▼4.36
Add New Post /wp-admin/post-new.php6.13 ▲0.2483.50 ▼22.20
Media Library /wp-admin/upload.php3.37 ▲0.1435.49 ▼0.77
Site Area /wp-admin/admin.php?page=css-injector&tab=site_area3.3433.49
Admin Area /wp-admin/admin.php?page=css-injector3.3432.75
Registration Page /wp-admin/admin.php?page=css-injector&tab=registration_page3.3432.09
CSS Injector /wp-admin/options-general.php?page=css-injector-redirect3.2532.06
Login Page /wp-admin/admin.php?page=css-injector&tab=login_page3.3433.60
Lost Password Page /wp-admin/admin.php?page=css-injector&tab=lost_password_page3.3532.63

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 57 new files
Database: no new tables, 36 new options
New WordPress options
css-injector-register_css_head_code_safe
css-injector-dashboard_css_foot_code
css-injector-site_css_head_code_safe
css-injector-recovery_css_foot_enabled
css-injector-login_css_foot_enabled
css-injector-dashboard_css_foot_code_safe
css-injector-recovery_css_head_code_safe
css-injector-recovery_css_head_code
css-injector-dashboard_css_head_enabled
css-injector-login_css_head_enabled
...

Browser metrics Passed 4 tests

Checking browser requirements for Custom CSS Injector
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲8314.10 ▼0.191.74 ▼0.2343.48 ▼4.78
Dashboard /wp-admin2,235 ▲585.57 ▼0.0788.41 ▼12.8587.21 ▲41.56
Posts /wp-admin/edit.php2,158 ▲582.03 ▲0.0935.64 ▼3.0637.68 ▲0.37
Add New Post /wp-admin/post-new.php1,574 ▲4523.13 ▼0.25700.27 ▲62.8355.75 ▲5.87
Media Library /wp-admin/upload.php1,443 ▲434.44 ▲0.26105.83 ▼0.0577.66 ▲31.93
Site Area /wp-admin/admin.php?page=css-injector&tab=site_area9501.7228.2532.15
Admin Area /wp-admin/admin.php?page=css-injector9441.7728.0029.60
Registration Page /wp-admin/admin.php?page=css-injector&tab=registration_page9471.7726.1128.97
CSS Injector /wp-admin/options-general.php?page=css-injector-redirect9471.7328.0330.48
Login Page /wp-admin/admin.php?page=css-injector&tab=login_page9441.7227.0830.20
Lost Password Page /wp-admin/admin.php?page=css-injector&tab=lost_password_page9471.7230.3727.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/css-injector/uninstall.php+36
    Undefined variable: _plugin
  • The plugin did not uninstall correctly, leaving 57 files (1.43MB) in the plugin directory
    • (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/WP77_load.php
    • (new file) _core/1.0.0L/assets/fonts/77/1.0.0/77.ttf
    • (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/admin_page.php
    • (new file) _core/1.0.0L/assets/fonts/77/1.0.0/77.eot
    • (new file) _core/1.0.0L/assets/css/font-awesome/4.7.0/font-awesome.min.css
    • (new file) _core/1.0.0L/assets/css/font-awesome/4.7.0/font-awesome.css
    • ...
  • This plugin did not uninstall successfully, leaving 37 options in the database
    • css-injector-recovery_css_head_code
    • css-injector-login_css_foot_code_safe
    • can_compress_scripts
    • css-injector-site_css_head_code
    • widget_recent-posts
    • css-injector-register_css_head_code_safe
    • widget_recent-comments
    • css-injector-dashboard_css_foot_code
    • css-injector-login_css_head_code
    • css-injector-dashboard_css_head_code_safe
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/css-injector/_plugin/tabs/admin_area.index.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to a member function Call() on null in wp-content/plugins/css-injector/_plugin/tabs/site_area.index.php:29
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/css-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/css-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/css-injector/_plugin/tabs/login_page.index.php:29
    • > PHP Fatal error
      Uncaught Error: Call to a member function Call() on null in wp-content/plugins/css-injector/_plugin/tabs/admin_area.index.php:29
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/css-injector/_plugin/tabs/lost_password_page.index.php on line 29
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/css-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/css-injector/_plugin/tabs/registration_page.index.php:29
    • > PHP Notice
      Undefined variable: _core in wp-content/plugins/css-injector/_plugin/tabs/registration_page.index.php on line 29

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=css-injector&tab=lost_password_page
    • > 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

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt might help

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

The principal PHP file in "Custom CSS Injector" v. 1.0.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("css-injector.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected9,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

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • 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

PNG files should be compressed to save space and 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_medium_default.png0.66KB0.49KB▼ 25.37%
_core/1.0.0L/assets/img/icon_small_default.png0.43KB0.30KB▼ 31.53%