84% popular-products-for-woocommerce

Code Review | Popular Products for WooCommerce

WordPress plugin Popular Products for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: popular-products-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 12, 2021
  • Latest release: Mar 22, 2022
  • Number of updates: 7
  • Update frequency: every 31.7 days
  • Top authors: arrony200 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,428 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.00MB] [CPU: ▼1.32ms] Passed 4 tests

A check of server-side resources used by Popular Products for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.67 ▼2.12
Dashboard /wp-admin3.31 ▲0.0051.24 ▲2.31
Posts /wp-admin/edit.php3.36 ▲0.0050.02 ▼1.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.16 ▼1.25
Media Library /wp-admin/upload.php3.23 ▲0.0040.63 ▼0.08

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Popular Products for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.27 ▼0.161.69 ▲0.1645.03 ▼0.32
Dashboard /wp-admin2,195 ▲155.60 ▼0.0196.76 ▲5.2041.33 ▲1.08
Posts /wp-admin/edit.php2,097 ▼62.04 ▲0.0434.51 ▼4.1936.55 ▼2.48
Add New Post /wp-admin/post-new.php1,526 ▼222.93 ▲0.27672.49 ▲24.5153.87 ▲0.46
Media Library /wp-admin/upload.php1,397 ▲34.11 ▼0.15109.30 ▲9.0547.90 ▲3.80

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/popular-products-for-woocommerce/includes/actions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/popular-products-for-woocommerce/includes/helper-function.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/popular-products-for-woocommerce/includes/popular-products-widget.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: popular product, popular products, most viewed products, products, most viewed product

popular-products-for-woocommerce/wc-popular-products.php 92% from 13 tests

This is the main PHP file of "Popular Products for WooCommerce" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("popular-products-for-woocommerce.php" instead of "wc-popular-products.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin236 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP42826200
CSS10036

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.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
No PNG files were detected