78% add-custom-css-and-js

Code Review | Add Custom CSS and JS

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

About plugin

  • Plugin page: add-custom-css-an...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0
  • WordPress version: 5.9.2
  • First release: Mar 6, 2016
  • Latest release: Dec 30, 2018
  • Number of updates: 4
  • Update frequency: every 257.3 days
  • Top authors: mainsufian (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active / 1,976 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.23MB] [CPU: ▼330.77ms] Passed 4 tests

Analyzing server-side resources used by Add Custom CSS and JS
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0551.31 ▲0.67
Dashboard /wp-admin3.11 ▼0.3016.62 ▼16.95
Posts /wp-admin/edit.php3.11 ▼0.5316.20 ▼18.78
Add New Post /wp-admin/post-new.php3.11 ▼3.8916.81 ▼1,280.75
Media Library /wp-admin/upload.php3.11 ▼0.1917.15 ▼6.58
Custom JS CSS /wp-admin/options-general.php?page=custom_js_css3.1116.86

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Add Custom CSS and JS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,782 ▲3815.88 ▲0.186.48 ▲0.652.29 ▲0.30
Dashboard /wp-admin2,901 ▲436.13 ▼0.03115.62 ▼22.17153.80 ▼0.35
Posts /wp-admin/edit.php2,666 ▼223.24 ▲0.0065.39 ▲4.00138.28 ▲2.17
Add New Post /wp-admin/post-new.php1,718 ▲5720.87 ▲4.32441.37 ▲47.01158.68 ▲3.70
Media Library /wp-admin/upload.php1,711 ▲105.57 ▲0.06156.95 ▲20.95185.40 ▲1.13
Custom JS CSS /wp-admin/options-general.php?page=custom_js_css1,0652.4953.99123.61

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
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5600
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=custom_js_css
    • > User deprecated in wp-includes/functions.php+5600
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=custom_js_css
    • > Warning in wp-content/plugins/add-custom-css-and-js/include/config_page_js.php+5
    Use of undefined constant basedir - assumed 'basedir' (this will throw an Error in a future version of PHP)

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=custom_js_css
    • > Network (severe)
    wp-content/uploads/add-custom-css-and-js/cs_for_admin.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=custom_js_css
    • > Network (severe)
    wp-content/uploads/add-custom-css-and-js/js_for_admin.js?ver=5.9.2 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

add-custom-css-and-js/custom_css_js.php 92% from 13 tests

The principal PHP file in "Add Custom CSS and JS" v. 1.0.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("add-custom-css-and-js.php" instead of "custom_css_js.php")

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
Success! There were no dangerous files found in this plugin220 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2533220

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.41
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected