89% free-product-sample

Code Review | Advanced Product Sample for WooCommerce

WordPress plugin Advanced Product Sample for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: free-product-sample
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Feb 10, 2022
  • Latest release: Nov 16, 2023
  • Number of updates: 26
  • Update frequency: every 25.0 days
  • Top authors: dots (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /2,163 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.26ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Product Sample for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.71 ▼2.78
Dashboard /wp-admin3.31 ▲0.0143.68 ▼5.27
Posts /wp-admin/edit.php3.37 ▲0.0045.03 ▼3.02
Add New Post /wp-admin/post-new.php5.90 ▲0.0078.12 ▼21.97
Media Library /wp-admin/upload.php3.24 ▲0.0031.56 ▼2.56

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Product Sample for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.72 ▲0.071.68 ▲0.0140.56 ▼2.82
Dashboard /wp-admin2,195 ▲155.64 ▲0.0291.83 ▼3.4539.01 ▼2.46
Posts /wp-admin/edit.php2,100 ▼32.03 ▼0.0539.43 ▼0.5736.46 ▼1.36
Add New Post /wp-admin/post-new.php1,544 ▲1825.18 ▲2.04588.90 ▼42.5755.89 ▲3.59
Media Library /wp-admin/upload.php1,397 ▼04.18 ▼0.0098.29 ▼7.1241.84 ▼0.67

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
Please fix the following items
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • fs_active_plugins
    • fs_accounts
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • fs_debug_mode
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention: You can take inspiration from this readme.txt

free-product-sample/free-product-sample.php 92% from 13 tests

The entry point to "Advanced Product Sample for WooCommerce" version 1.2.2 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "4.5")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected42,574 lines of code in 172 files:
LanguageFilesBlank linesComment linesLines of code
PHP1328,49018,17537,650
PO File41,2161,7853,395
JavaScript7112110831
CSS243355688
SVG4009
Markdown1001

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity86.50
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.72
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes00.00%
Methods1,354
▷ Static methods20114.84%
▷ Public methods94669.87%
▷ Protected methods171.26%
▷ Private methods39128.88%
Functions116
▷ Named functions11599.14%
▷ Anonymous functions10.86%
Constants150
▷ Global constants10368.67%
▷ Class constants4731.33%
▷ Public constants47100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
31 PNG files occupy 3.93MB with 1.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
admin/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
images/menu-icon.png2.02KB0.66KB▼ 67.52%
admin/images/help.png0.30KB0.32KB0.00%
admin/images/thedotstore-images/popular-plugins/hide-shipping-method-for-woocommerce.png7.13KB2.75KB▼ 61.38%