93% sales-count-product-for-woocommerce

Code Review | Sales Count Product for WooCommerce

WordPress plugin Sales Count Product for WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: sales-count-produ...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: May 14, 2021
  • Latest release: Sep 23, 2021
  • Number of updates: 6
  • Update frequency: every 22.2 days
  • Top authors: elegantapps27 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 144 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

Server-side resources used by Sales Count Product for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.1247.68 ▲20.31
Dashboard /wp-admin3.06 ▲0.0046.49 ▼5.76
Posts /wp-admin/edit.php3.11 ▲0.0051.91 ▲3.61
Add New Post /wp-admin/post-new.php5.42 ▼0.0297.09 ▼568.22
Media Library /wp-admin/upload.php3.00 ▲0.0033.68 ▼7.62
Essential Kit /wp-admin/admin.php?page=scpfw_kit2.7425.94
Sales Count Product settings /wp-admin/admin.php?page=sales-count-product-settings2.7424.32

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Sales Count Product for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,778 ▲18216.20 ▲0.6010.67 ▼0.0250.46 ▼0.81
Dashboard /wp-admin2,973 ▲395.91 ▼0.05148.38 ▼13.91129.91 ▲5.64
Posts /wp-admin/edit.php2,739 ▲32.71 ▲0.0074.09 ▲8.0097.01 ▼6.85
Add New Post /wp-admin/post-new.php1,683 ▼2,02418.77 ▼0.26412.08 ▼81.76118.78 ▼0.20
Media Library /wp-admin/upload.php1,810 ▲35.03 ▼0.02165.67 ▼0.53118.66 ▼18.27
Essential Kit /wp-admin/admin.php?page=scpfw_kit280.900.069.75
Sales Count Product settings /wp-admin/admin.php?page=sales-count-product-settings280.900.0710.98

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=scpfw_kit
    • > Network (severe)
    wp-admin/admin.php?page=scpfw_kit - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=sales-count-product-settings
    • > Network (severe)
    wp-admin/admin.php?page=sales-count-product-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

sales-count-product-for-woocommerce/Sales_count_poduct_main.php 92% from 13 tests

Analyzing the main PHP file in "Sales Count Product for WooCommerce" version 1.0
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sales-count-product-for-woocommerce.php" instead of "Sales_count_poduct_main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin991 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP57610608
JavaScript258146336
CSS20047

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity12.20
▷ Minimum class complexity3.00
▷ Maximum class complexity23.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods29
▷ Static methods413.79%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/star.png39.75KB10.35KB▼ 73.95%