84% show-random-products

Code Review | Show Random Products

WordPress plugin Show Random Products scored84%from 54 tests.

About plugin

  • Plugin page: show-random-products
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2
  • WordPress version: 6.3.1
  • First release: Aug 19, 2015
  • Latest release: Aug 19, 2015
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: alancf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,502 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.07ms] Passed 4 tests

Analyzing server-side resources used by Show Random Products
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.56 ▼0.21
Dashboard /wp-admin3.32 ▼0.0344.30 ▼13.53
Posts /wp-admin/edit.php3.37 ▲0.0151.39 ▲3.91
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.84 ▼20.61
Media Library /wp-admin/upload.php3.24 ▲0.0137.30 ▲2.06

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Show Random Products
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.67 ▲0.071.62 ▼0.0841.23 ▲3.16
Dashboard /wp-admin2,198 ▲215.64 ▲0.1099.63 ▲13.9343.01 ▼1.44
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0339.61 ▲0.1736.14 ▲2.57
Add New Post /wp-admin/post-new.php1,526 ▼323.08 ▲0.05641.86 ▼41.0558.65 ▲2.76
Media Library /wp-admin/upload.php1,394 ▼64.17 ▼0.0794.27 ▼14.0844.51 ▼0.64

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

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 take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/show-random-products/includes/widget-random.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/show-random-products/show-random-products.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (Admin screen.)
Please take inspiration from this readme.txt

show-random-products/show-random-products.php Passed 13 tests

The principal PHP file in "Show Random Products" v. 1.0.0 is loaded by WordPress automatically on each request
58 characters long description:
A widget + shortcode to show random products in your store

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin226 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP37917226

PHP code Passed 2 tests

Analyzing 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.27
Average class complexity9.33
▷ Minimum class complexity3.00
▷ Maximum class complexity14.00
Average method complexity3.78
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
There were not PNG files found in your plugin