84% wpb-woocommerce-show-sales-numbers

Code Review | WPB Show Product Sales Number for WooCommerce

WordPress plugin WPB Show Product Sales Number for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: wpb-woocommerce-s...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.4
  • WordPress version: 6.3.1
  • First release: Feb 27, 2016
  • Latest release: Mar 11, 2020
  • Number of updates: 9
  • Update frequency: every 163.8 days
  • Top authors: wpbean (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /4,946 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.15MB] [CPU: ▼3.93ms] Passed 4 tests

Analyzing server-side resources used by WPB Show Product Sales Number for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1141.81 ▼7.28
Dashboard /wp-admin3.52 ▲0.2252.35 ▲0.89
Posts /wp-admin/edit.php3.57 ▲0.2257.16 ▲3.93
Add New Post /wp-admin/post-new.php6.02 ▲0.1389.89 ▼13.27
Media Library /wp-admin/upload.php3.36 ▲0.1340.18 ▲5.47
WooCommerce Show Sales /wp-admin/options-general.php?page=wpb-woocommerce-show-sales-numbers3.3638.05

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
general_settings
widget_recent-posts
db_upgraded
theysaidso_admin_options
style_settings
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for WPB Show Product Sales Number for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲18814.85 ▲0.481.71 ▲0.0639.93 ▼4.85
Dashboard /wp-admin2,356 ▲1766.35 ▲0.71119.22 ▲29.2843.17 ▼3.21
Posts /wp-admin/edit.php2,284 ▲1873.58 ▲1.5757.20 ▲18.5036.10 ▲0.04
Add New Post /wp-admin/post-new.php1,541 ▲1323.29 ▲0.01646.76 ▼23.3036.57 ▼13.40
Media Library /wp-admin/upload.php1,421 ▲214.29 ▲0.0979.88 ▼37.4246.13 ▼2.54
WooCommerce Show Sales /wp-admin/options-general.php?page=wpb-woocommerce-show-sales-numbers1,3123.3661.2127.18

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 did not uninstall successfully, leaving 8 options in the database
    • style_settings
    • general_settings
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpb-woocommerce-show-sales-numbers/inc/wpb-scripts.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: show sales, wpbean, woocommerce, total sales, wpb show product sales number for woocommerce...

wpb-woocommerce-show-sales-numbers/main.php 85% from 13 tests

"WPB Show Product Sales Number for WooCommerce" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wpb-woocommerce-show-sales-numbers.php" instead of "main.php")
  • Requires at least: Required version must match the one declared in readme.txt ("4.0" instead of "3.0")

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
Good job! No executable or dangerous file extensions detected582 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP6192232569
CSS10013

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity26.00
▷ Minimum class complexity3.00
▷ Maximum class complexity49.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin