83% simple-css-for-widgets

Code Review | Simple CSS for widgets

WordPress plugin Simple CSS for widgets scored 83% from 54 tests.

About plugin

  • Plugin page: simple-css-for-wi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5
  • WordPress version: 6.3.1
  • First release: Dec 12, 2012
  • Latest release: Dec 12, 2012
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: Gagan Goraya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active / 37,409 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.79ms] Passed 4 tests

Server-side resources used by Simple CSS for widgets
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0135.40 ▼10.65
Dashboard /wp-admin3.31 ▲0.0154.01 ▲7.55
Posts /wp-admin/edit.php3.36 ▲0.0150.05 ▲1.70
Add New Post /wp-admin/post-new.php5.89 ▲0.0196.15 ▼0.56
Media Library /wp-admin/upload.php3.23 ▲0.0035.48 ▼1.64

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple CSS for widgets
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.131.71 ▼0.9440.24 ▼4.92
Dashboard /wp-admin2,203 ▲184.84 ▼1.02107.04 ▲6.9141.94 ▲1.37
Posts /wp-admin/edit.php2,089 ▲182.04 ▲0.0039.86 ▲3.3434.23 ▲0.53
Add New Post /wp-admin/post-new.php1,542 ▲2218.46 ▼4.84603.41 ▼30.6750.60 ▼0.09
Media Library /wp-admin/upload.php1,388 ▲34.17 ▼0.0493.93 ▼10.3240.45 ▼3.83

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-css-for-widgets/simplecsswidgets.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === simple-css-for-widgets === )
  • Screenshots: Please add an image for screenshot #1 (Adds a custom "CSS class" text field where you can specify any CSS class for a particular widget.)
The official readme.txt is a good inspiration

simple-css-for-widgets/simplecsswidgets.php 85% from 13 tests

The main PHP file in "Simple CSS for widgets" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-css-for-widgets.php" instead of "simplecsswidgets.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 517 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected78 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1343278

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png7.74KB4.00KB▼ 48.28%
assets/screenshot-1.png7.74KB4.00KB▼ 48.28%