77% wp-css-and-js-code

Code Review | WP CSS, Javascript and HTML

WordPress plugin WP CSS, Javascript and HTML scored77%from 54 tests.

About plugin

  • Plugin page: wp-css-and-js-code
  • Plugin version: 2.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.0
  • WordPress version: 6.3.1
  • First release: May 23, 2019
  • Latest release: Jul 28, 2022
  • Number of updates: 102
  • Update frequency: every 11.4 days
  • Top authors: jundellagbo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /950 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.66ms] Passed 4 tests

This is a short check of server-side resources used by WP CSS, Javascript and HTML
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0636.80 ▼2.08
Dashboard /wp-admin3.37 ▲0.0644.62 ▼0.90
Posts /wp-admin/edit.php3.42 ▲0.0649.13 ▲1.72
Add New Post /wp-admin/post-new.php5.95 ▲0.0685.14 ▼15.33
Media Library /wp-admin/upload.php3.29 ▲0.0635.63 ▼0.33

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 585 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP CSS, Javascript and HTML
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲14817.99 ▲3.681.84 ▲0.1044.32 ▼7.33
Dashboard /wp-admin2,267 ▲799.45 ▲3.55133.71 ▲33.4640.24 ▼2.29
Posts /wp-admin/edit.php2,147 ▲585.50 ▲3.4751.26 ▲9.8335.18 ▲0.09
Add New Post /wp-admin/post-new.php6,498 ▲4,95321.88 ▲3.70944.73 ▲344.9938.76 ▼20.78
Media Library /wp-admin/upload.php1,446 ▲588.24 ▲4.05109.44 ▲13.0839.73 ▼4.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-css-and-js-code/wp-css-js-code.php
    • > /wp-content/plugins/wp-css-and-js-code/admin.php
    • > /wp-content/plugins/wp-css-and-js-code/inject.php
    • > /wp-content/plugins/wp-css-and-js-code/templates/feature-off.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WPCSSJSCODE_POSTMETA_GET() in wp-content/plugins/wp-css-and-js-code/templates/globalcssjs.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/wp-css-and-js-code/templates/cssjs.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3 in wp-css-and-js-code/assets to your readme.txt
  • Requires php: Invalid plugin version format
You can take inspiration from this readme.txt

wp-css-and-js-code/wp-css-js-code.php 85% from 13 tests

This is the main PHP file of "WP CSS, Javascript and HTML" version 2.3.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-css-and-js-code.php" instead of "wp-css-js-code.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
Success! There were no dangerous files found in this plugin116,793 lines of code in 573 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript30312,13520,84188,755
HTML1823,8421123,050
CSS724942852,756
Markdown577101,648
PHP78764508
JSON10047
SVG10019
Bourne Shell1015
YAML1005

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/codemirror/doc/yinyang.png4.52KB2.03KB▼ 55.19%
libs/codemirror/doc/logo.png9.09KB4.10KB▼ 54.95%
images/button-PayPal-donate.png22.75KB7.37KB▼ 67.62%