84% custom-cssjs

Code Review | Custom CSS/JS

WordPress plugin Custom CSS/JS scored84%from 54 tests.

About plugin

  • Plugin page: custom-cssjs
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.3
  • WordPress version: 6.3.1
  • First release: Sep 9, 2015
  • Latest release: Sep 14, 2015
  • Number of updates: 6
  • Update frequency: every 4.0 days
  • Top authors: becauseinterwebs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,044 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.74ms] Passed 4 tests

A check of server-side resources used by Custom CSS/JS
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0341.26 ▼1.77
Dashboard /wp-admin3.34 ▼0.0045.03 ▼15.82
Posts /wp-admin/edit.php3.39 ▲0.0344.66 ▼1.12
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.00 ▼0.26
Media Library /wp-admin/upload.php3.27 ▲0.0337.18 ▲2.73

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Custom CSS/JS
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲8314.75 ▲0.451.81 ▼0.1537.96 ▼13.99
Dashboard /wp-admin2,227 ▲394.85 ▼1.03104.17 ▲2.5339.03 ▼4.84
Posts /wp-admin/edit.php2,107 ▲182.05 ▲0.0639.83 ▼2.4633.11 ▼5.40
Add New Post /wp-admin/post-new.php6,322 ▲4,78521.69 ▼1.53898.48 ▲267.8580.46 ▲24.97
Media Library /wp-admin/upload.php1,406 ▲154.18 ▼0.1697.58 ▲0.1244.53 ▲5.62

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/custom-cssjs/custom-css-js.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Editing global custom CSS/JS), #2 (Editing page level custom CSS/JS)
You can take inspiration from this readme.txt

custom-cssjs/custom-css-js.php 92% from 13 tests

The entry point to "Custom CSS/JS" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("custom-cssjs.php" instead of "custom-css-js.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected185 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12930170
CSS11015

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.22MB with 0.13MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png135.43KB54.59KB▼ 59.69%
screenshot-1.png87.57KB37.11KB▼ 57.62%