78% wp-custom-cssjs

Code Review | Custom CSS/JS

WordPress plugin Custom CSS/JS scored 78% from 54 tests.

About plugin

  • Plugin page: wp-custom-cssjs
  • Plugin version: 1.4.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.4
  • WordPress version: 5.8.1
  • First release: Jun 17, 2015
  • Latest release: Jun 18, 2020
  • Number of updates: 38
  • Update frequency: every 48.1 days
  • Top authors: johnibom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active / 8,941 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼1.08MB] [CPU: ▼190.58ms] Passed 4 tests

An overview of server-side resources used by Custom CSS/JS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.52 ▼0.2016.09 ▼4.98
Dashboard /wp-admin2.57 ▼0.4821.93 ▼22.65
Posts /wp-admin/edit.php2.57 ▼0.5416.62 ▼20.96
Add New Post /wp-admin/post-new.php2.57 ▼2.8615.53 ▼696.81
Media Library /wp-admin/upload.php2.57 ▼0.4415.72 ▼21.88
Custom CSS/JS /wp-admin/themes.php?page=wp_custom_css_js2.5716.23

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Custom CSS/JS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11216.00 ▲0.2710.71 ▲0.1447.04 ▲4.36
Dashboard /wp-admin2,978 ▲475.92 ▼0.03139.89 ▼16.48103.74 ▲6.03
Posts /wp-admin/edit.php2,744 ▲52.72 ▲0.0261.83 ▼2.3683.19 ▼11.76
Add New Post /wp-admin/post-new.php1,686 ▲1418.83 ▲0.06371.08 ▲12.05111.59 ▼1.40
Media Library /wp-admin/upload.php1,812 ▲55.03 ▼0.02140.45 ▼2.90114.13 ▼16.93
Custom CSS/JS /wp-admin/themes.php?page=wp_custom_css_js1,2692.0651.3474.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp-custom-cssjs/index.php+88
    Trying to access array offset on value of type bool

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=wp_custom_css_js
    • > Notice in wp-content/plugins/wp-custom-cssjs/admin-settings.php+71
    Trying to access array offset on value of type bool

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-custom-cssjs/index.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-custom-cssjs/admin-settings.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: js, custom, jquery, javascript, css...

wp-custom-cssjs/index.php 85% from 13 tests

"Custom CSS/JS" version 1.4.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-custom-cssjs.php" instead of "index.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 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
No dangerous file extensions were detected206 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21420206

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin