84% wp-add-custom-css-and-javascript

Code Review | WP Add Custom Css and Javascript

WordPress plugin WP Add Custom Css and Javascript scored84%from 54 tests.

About plugin

  • Plugin page: wp-add-custom-css...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.9.3
  • WordPress version: 6.3.1
  • First release: Mar 14, 2019
  • Latest release: Mar 22, 2022
  • Number of updates: 4
  • Update frequency: every 276.3 days
  • Top authors: d3logics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /738 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.09MB] [CPU: ▼10.81ms] Passed 4 tests

An overview of server-side resources used by WP Add Custom Css and Javascript
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.21 ▼7.50
Dashboard /wp-admin3.40 ▲0.0647.98 ▼18.13
Posts /wp-admin/edit.php3.45 ▲0.1048.96 ▼2.41
Add New Post /wp-admin/post-new.php5.98 ▲0.1086.97 ▼15.20
Media Library /wp-admin/upload.php3.33 ▲0.1038.48 ▼0.68
Custom JS /wp-admin/admin.php?page=d3_custom_js3.3033.65
Custom CSS /wp-admin/admin.php?page=d3_custom_css3.3034.66

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Add Custom Css and Javascript
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲3014.28 ▼0.081.65 ▼0.5943.82 ▲0.74
Dashboard /wp-admin2,218 ▲435.62 ▼0.2083.67 ▼36.2038.64 ▼6.85
Posts /wp-admin/edit.php2,123 ▲231.96 ▼0.0739.19 ▲0.9134.99 ▼0.00
Add New Post /wp-admin/post-new.php1,545 ▲1723.44 ▲0.37709.79 ▲34.8354.27 ▲3.17
Media Library /wp-admin/upload.php1,426 ▲234.18 ▼0.0596.79 ▼20.4641.48 ▼6.14
Custom JS /wp-admin/admin.php?page=d3_custom_js1,0772.3554.7045.27
Custom CSS /wp-admin/admin.php?page=d3_custom_css1,0742.5249.9738.21

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-add-custom-css-and-javascript/wp-add-custom-css-js.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/wp-add-custom-css-and-javascript/minify/src/CSS.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/wp-add-custom-css-and-javascript/minify/src/JS.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-add-custom-css-and-javascript/plugin-credit.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: css js wp custom css, wp add custom css and javascript, wp custom js, custom js, custom css

wp-add-custom-css-and-javascript/wp-add-custom-css-js.php 85% from 13 tests

The main PHP file in "WP Add Custom Css and Javascript" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-add-custom-css-and-javascript.php" instead of "wp-add-custom-css-js.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin10,833 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript111,0621,0409,604
PHP7278811902
CSS44725327

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.32
Average class complexity14.40
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods1435.90%
▷ Protected methods2564.10%
▷ Private methods00.00%
Functions18
▷ Named functions1477.78%
▷ Anonymous functions422.22%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/potent-logo.png7.60KB5.27KB▼ 30.74%
images/D3-logics-Website-Design-development-jaipur-rajasthan-india.png44.12KB14.02KB▼ 68.22%