78% custom-css-and-javascript

Code Review | Custom CSS and JavaScript

WordPress plugin Custom CSS and JavaScript scored78%from 54 tests.

About plugin

  • Plugin page: custom-css-and-ja...
  • Plugin version: 2.0.15
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3.0
  • WordPress version: 6.3.1
  • First release: Dec 18, 2015
  • Latest release: Aug 29, 2023
  • Number of updates: 65
  • Update frequency: every 43.3 days
  • Top authors: hearken (84.62%)annaqq (10.77%)aspengrovestudios (7.69%)

Code review

54 tests

User reviews

55 reviews

Install metrics

10,000+ active /135,457 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▲3.33ms] 75% from 4 tests

Server-side resources used by Custom CSS and JavaScript
It is recommended to improve the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 554.73ms on /wp-admin/themes.php?page=hm_custom_js)
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0650.35 ▲9.69
Dashboard /wp-admin3.35 ▲0.0553.61 ▲5.82
Posts /wp-admin/edit.php3.40 ▲0.0448.99 ▲2.77
Add New Post /wp-admin/post-new.php5.93 ▲0.0598.27 ▲3.86
Media Library /wp-admin/upload.php3.27 ▲0.0532.47 ▲0.86
Custom JavaScript /wp-admin/themes.php?page=hm_custom_js3.30554.73
Custom CSS /wp-admin/themes.php?page=hm_custom_css3.2989.25

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 63 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
hm_custom_css_js_first_activate
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Custom CSS and JavaScript
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲10214.38 ▲0.012.08 ▼0.2242.07 ▼7.91
Dashboard /wp-admin2,217 ▲325.83 ▼0.05153.70 ▲36.0359.42 ▲10.57
Posts /wp-admin/edit.php2,100 ▲81.97 ▼0.0848.53 ▲8.0135.34 ▲1.18
Add New Post /wp-admin/post-new.php1,548 ▲3423.27 ▲5.39653.31 ▼42.0668.02 ▲2.29
Media Library /wp-admin/upload.php1,399 ▲204.22 ▲0.0796.49 ▼7.6144.99 ▼9.09
Custom JavaScript /wp-admin/themes.php?page=hm_custom_js1,7492.5756.86181.44
Custom CSS /wp-admin/themes.php?page=hm_custom_css1,7462.5756.92105.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • hm_custom_css_js_first_activate
    • widget_recent-comments

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)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=hm_custom_css
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/ai-image-generator-lab): failed to open dir: No such file or directory
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=hm_custom_css
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/wp-layouts): failed to open dir: No such file or directory
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=hm_custom_css
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/product-sales-report-for-woocommerce): failed to open dir: No such file or directory
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=hm_custom_css
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/export-order-items-for-woocommerce): failed to open dir: No such file or directory
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=hm_custom_css
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/shortcodes-for-divi): failed to open dir: No such file or directory

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
The following issues need your attention
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/custom-css-and-javascript/minify/src/CSS.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/custom-css-and-javascript/minify/src/JS.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-css-and-javascript/custom-css-and-javascript.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: custom styles, stylesheet, custom javascript, custom js, custom stylesheet...

custom-css-and-javascript/custom-css-and-javascript.php Passed 13 tests

The primary PHP file in "Custom CSS and JavaScript" version 2.0.15 is used by WordPress to initiate all plugin functionality
65 characters long description:
Easily add custom CSS and JavaScript code to your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected13,331 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript121,0701,0479,639
CSS967481,268
PHP103308341,136
Sass11233471,134
SVG501154

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity13.83
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods42
▷ Static methods37.14%
▷ Public methods1740.48%
▷ Protected methods2559.52%
▷ Private methods00.00%
Functions21
▷ Named functions1780.95%
▷ Anonymous functions419.05%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 compressed PNG files occupy 0.03MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/wp_zone_logo.png2.01KB2.14KB0.00%
images/ai-image-lab-images.png27.39KB28.86KB0.00%