77% woocommerce-my-downloads-shortcode

Code Review | My Downloads Shortcode for WooCommerce

WordPress plugin My Downloads Shortcode for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: woocommerce-my-do...
  • Plugin version: 1.8.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.8
  • WordPress version: 6.3.1
  • First release: Jan 2, 2014
  • Latest release: Jul 13, 2021
  • Number of updates: 11
  • Update frequency: every 250.0 days
  • Top authors: mattpramschufer (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

300+ active /7,839 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.97ms] Passed 4 tests

An overview of server-side resources used by My Downloads Shortcode for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0233.61 ▼6.69
Dashboard /wp-admin3.33 ▲0.0339.26 ▼6.86
Posts /wp-admin/edit.php3.38 ▲0.0345.20 ▼0.78
Add New Post /wp-admin/post-new.php5.91 ▲0.0276.74 ▼9.53
Media Library /wp-admin/upload.php3.25 ▲0.0234.01 ▲2.06
My Downloads for WooCommerce /wp-admin/options-general.php?page=wcmd_options3.2429.60

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Downloads Shortcode for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.28 ▼1.111.66 ▼0.5540.95 ▼4.31
Dashboard /wp-admin2,210 ▲285.89 ▲0.03110.16 ▼12.8544.28 ▲2.17
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0639.03 ▲2.6535.97 ▲3.63
Add New Post /wp-admin/post-new.php1,536 ▲2223.51 ▲5.92641.93 ▼21.4051.44 ▼10.18
Media Library /wp-admin/upload.php1,392 ▲44.25 ▲0.0297.03 ▲1.4140.15 ▼2.63
My Downloads for WooCommerce /wp-admin/options-general.php?page=wcmd_options9542.1427.6454.85

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 detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

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)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/my-downloads.php
    • > /wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/button.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: no_downloads in wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/button.php on line 11
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/my-downloads.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/woocommerce-my-downloads-shortcode/woocommerce-my-downloads.php:29
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/button.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/options.php:63
    • > PHP Notice
      Undefined variable: no_downloads in wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/my-downloads.php on line 53
    • > PHP Notice
      Undefined variable: downloads in wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/button.php on line 1
    • > PHP Notice
      Undefined variable: downloads in wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/my-downloads.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: downloads, shortcode, woocommerce

woocommerce-my-downloads-shortcode/woocommerce-my-downloads.php 69% from 13 tests

This is the main PHP file of "My Downloads Shortcode for WooCommerce" version 1.8.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-my-downloads-shortcode.php" instead of "woocommerce-my-downloads.php")
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Requires at least: Required version must match the one declared in readme.txt ("3.8" instead of "2.6")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin261 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP47432261

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods6100.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon.png3.72KB3.68KB▼ 0.92%