89% products-purchase-limit-for-woocommerce

Code Review | Products Purchase Limit for WooCommerce

WordPress plugin Products Purchase Limit for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: products-purchase...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.1
  • WordPress version: 6.3.1
  • First release: Dec 7, 2016
  • Latest release: Jun 18, 2019
  • Number of updates: 6
  • Update frequency: every 152.8 days
  • Top authors: yogeshpant (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,782 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.44ms] Passed 4 tests

A check of server-side resources used by Products Purchase Limit for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.52 ▲0.07
Dashboard /wp-admin3.32 ▲0.0253.04 ▲0.17
Posts /wp-admin/edit.php3.37 ▲0.0149.83 ▼3.88
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.38 ▼2.17
Media Library /wp-admin/upload.php3.24 ▲0.0134.47 ▼7.79

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Products Purchase Limit for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.85 ▲0.281.76 ▲0.0546.89 ▲3.25
Dashboard /wp-admin2,215 ▲125.81 ▼0.06104.18 ▼8.6636.59 ▼0.95
Posts /wp-admin/edit.php2,103 ▲32.02 ▼0.0237.56 ▲0.9436.14 ▼2.25
Add New Post /wp-admin/post-new.php1,545 ▼023.09 ▲0.11638.34 ▼60.0168.22 ▲5.14
Media Library /wp-admin/upload.php1,400 ▲64.29 ▲0.1599.44 ▼11.9649.78 ▲0.70

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (The main interface) image not found
The official readme.txt might help

products-purchase-limit-for-woocommerce/products-limit.php 92% from 13 tests

"Products Purchase Limit for WooCommerce" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("products-purchase-limit-for-woocommerce.php" instead of "products-limit.php")

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
Everything looks great! No dangerous files found in this plugin79 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP154079

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png85.55KB25.11KB▼ 70.65%