68% add-custom-css-and-js

Code Review | Add Custom CSS and JS

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

About plugin

  • Plugin page: add-custom-css-an...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 6, 2016
  • Latest release: Feb 21, 2023
  • Number of updates: 5
  • Update frequency: every 508.6 days
  • Top authors: mainsufian (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,241 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.95MB] [CPU: ▼37.04ms] Passed 4 tests

Analyzing server-side resources used by Add Custom CSS and JS
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.07 ▼4.83
Dashboard /wp-admin2.99 ▼0.3119.29 ▼33.45
Posts /wp-admin/edit.php3.00 ▼0.3628.03 ▼24.24
Add New Post /wp-admin/post-new.php2.99 ▼2.8919.07 ▼80.19
Media Library /wp-admin/upload.php2.99 ▼0.2325.92 ▼10.27
Custom JS CSS /wp-admin/options-general.php?page=custom_js_css3.0019.39

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Add Custom CSS and JS
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9513.34 ▼0.944.38 ▲2.2341.97 ▼6.82
Dashboard /wp-admin2,211 ▲204.86 ▼0.04111.70 ▼2.8941.61 ▼3.60
Posts /wp-admin/edit.php2,097 ▲82.00 ▲0.0341.70 ▲0.1634.91 ▼2.79
Add New Post /wp-admin/post-new.php1,525 ▼823.22 ▲0.03662.10 ▲11.9954.81 ▲1.69
Media Library /wp-admin/upload.php1,399 ▲84.17 ▼0.01105.70 ▲7.1444.26 ▼0.43
Custom JS CSS /wp-admin/options-general.php?page=custom_js_css8432.1427.0841.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

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+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > 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=6.3.1 - 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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid url: "#"
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
You can look at the official readme.txt

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

"Add Custom CSS and JS" version 1.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important 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 | A short review of files and their extensions; it is not recommended to include executable files
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

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected