84% download-count-for-woocommerce

Code Review | Download Count for WooCommerce

WordPress plugin Download Count for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: download-count-fo...
  • Plugin version: 1.18
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 20, 2020
  • Latest release: Oct 28, 2023
  • Number of updates: 45
  • Update frequency: every 24.5 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,730 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼0.81ms] Passed 4 tests

Server-side resources used by Download Count for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1439.87 ▲2.72
Dashboard /wp-admin3.44 ▲0.1349.58 ▲4.36
Posts /wp-admin/edit.php3.55 ▲0.1944.28 ▼3.58
Add New Post /wp-admin/post-new.php6.02 ▲0.1384.51 ▼6.08
Media Library /wp-admin/upload.php3.36 ▲0.1334.69 ▲3.72

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Download Count for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.36 ▼0.201.83 ▲0.1643.37 ▲0.18
Dashboard /wp-admin2,198 ▲215.61 ▲0.0094.67 ▲7.6844.26 ▲4.11
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0035.67 ▲1.3033.41 ▼3.02
Add New Post /wp-admin/post-new.php1,526 ▼023.40 ▼0.12699.65 ▼5.3359.91 ▲4.90
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.0594.86 ▼8.7543.37 ▼1.26

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-screen.php): failed to open stream: No such file or directory in wp-content/plugins/download-count-for-woocommerce/lib/class-tt-downloadcountwoo-list-table.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/download-count-for-woocommerce/lib/class-downloadcountwoo.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/download-count-for-woocommerce/lib/class-downloadcountwoo.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/download-count-for-woocommerce/lib/class-downloadcountwooadmin.php:36
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/download-count-for-woocommerce/lib/class-tt-downloadcountwoo-list-table.php on line 26
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-screen.php' (include_path='.:/usr/share/php') in wp-content/plugins/download-count-for-woocommerce/lib/class-tt-downloadcountwoo-list-table.php on line 26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
4 plugin tags: download, product, woocommerce, count

download-count-for-woocommerce/downloadcountwoo.php 85% from 13 tests

The main PHP file in "Download Count for WooCommerce" ver. 1.18 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("download-count-for-woocommerce.php" instead of "downloadcountwoo.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.6" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin667 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5137366667

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity25.67
▷ Minimum class complexity21.00
▷ Maximum class complexity30.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods2586.21%
▷ Protected methods00.00%
▷ Private methods413.79%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin