77% show-active-purchases-for-woocommerce

Code Review | Show Active Purchases for WooCommerce

WordPress plugin Show Active Purchases for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: show-active-purch...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.4-4.9.4
  • WordPress version: 6.3.1
  • First release: Mar 2, 2018
  • Latest release: Mar 6, 2018
  • Number of updates: 11
  • Update frequency: every 0.6 days
  • Top authors: fuji9 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /615 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼0.18ms] Passed 4 tests

This is a short check of server-side resources used by Show Active Purchases for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2342.76 ▲2.50
Dashboard /wp-admin3.58 ▲0.2853.45 ▲3.31
Posts /wp-admin/edit.php3.63 ▲0.2752.98 ▲4.72
Add New Post /wp-admin/post-new.php6.09 ▲0.2185.45 ▼11.25
Media Library /wp-admin/upload.php3.42 ▲0.1937.25 ▲4.96
Show Active Purchases for WooCommerce /wp-admin/options-general.php?page=sap-for-woocommerce-admin3.4137.22

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 43 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
sapfw_basic
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Show Active Purchases for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,070 ▲32415.40 ▲1.035.51 ▲3.6442.19 ▼3.99
Dashboard /wp-admin2,371 ▲1836.64 ▲0.76133.97 ▲18.8143.12 ▼2.22
Posts /wp-admin/edit.php2,277 ▲1883.59 ▲1.5457.88 ▲20.1334.28 ▼2.34
Add New Post /wp-admin/post-new.php1,533 ▼117.63 ▼5.43644.53 ▼37.8035.80 ▼24.40
Media Library /wp-admin/upload.php1,413 ▲224.40 ▲0.2384.58 ▼19.1942.25 ▼0.71
Show Active Purchases for WooCommerce /wp-admin/options-general.php?page=sap-for-woocommerce-admin1,0273.4549.0727.02

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

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/show-active-purchases-for-woocommerce/public/partials/sap-for-woocommerce-public-display.php
    • > /wp-content/plugins/show-active-purchases-for-woocommerce/admin/partials/sap-for-woocommerce-admin-display.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/show-active-purchases-for-woocommerce/vendor/tareq1988/wordpress-settings-api-class/example/procedural-example.php:270
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/show-active-purchases-for-woocommerce/vendor/tareq1988/wordpress-settings-api-class/src/class.settings-api.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'WeDevs_Settings_API' not found in wp-content/plugins/show-active-purchases-for-woocommerce/includes/class-sap-for-woocommerce-settings.php:27

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 undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Requires php: Invalid version format
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

show-active-purchases-for-woocommerce/sap-for-woocommerce.php 85% from 13 tests

"Show Active Purchases for WooCommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("show-active-purchases-for-woocommerce.php" instead of "sap-for-woocommerce.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 plugin1,613 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP243739481,485
JSON30075
Markdown121047
JavaScript24546
CSS2080

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity10.77
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods93
▷ Static methods66.45%
▷ Public methods8490.32%
▷ Protected methods00.00%
▷ Private methods99.68%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
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
1 PNG file occupies 0.38MB with 0.27MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/tareq1988/wordpress-settings-api-class/screenshot-1.png389.59KB115.93KB▼ 70.24%