83% most-viewed-products-for-woocommerce

Code Review | Most Viewed Products for WooCommerce

WordPress plugin Most Viewed Products for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: most-viewed-produ...
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.4
  • WordPress version: 6.3.1
  • First release: Sep 25, 2017
  • Latest release: Oct 4, 2020
  • Number of updates: 26
  • Update frequency: every 42.5 days
  • Top authors: ptechsoftware (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 4,449 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
Installer ran successfully

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

This is a short check of server-side resources used by Most Viewed Products for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.08 ▼0.89
Dashboard /wp-admin3.31 ▲0.0046.77 ▼2.93
Posts /wp-admin/edit.php3.36 ▲0.0046.50 ▲2.07
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.91 ▼14.95
Media Library /wp-admin/upload.php3.23 ▲0.0035.94 ▲5.05

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Most Viewed Products for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.31 ▼1.011.65 ▼0.2145.80 ▲6.31
Dashboard /wp-admin2,206 ▲154.85 ▼0.05103.90 ▲2.7740.63 ▼2.92
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0133.51 ▼7.7035.09 ▲5.81
Add New Post /wp-admin/post-new.php1,520 ▲123.07 ▼0.26674.12 ▲26.0556.78 ▼1.37
Media Library /wp-admin/upload.php1,391 ▲34.10 ▼0.09102.06 ▲2.4047.06 ▼0.35

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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 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
Please fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/most-viewed-products-for-woocommerce/includes/classes/class-zwcmvp-orders-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/most-viewed-products-for-woocommerce/includes/classes/class-zwcmvp-orders-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/most-viewed-products-for-woocommerce/includes/classes/class-zwcmvp-orders-table.php on line 4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

most-viewed-products-for-woocommerce/woocommerce-most-viewed-products.php 85% from 13 tests

The primary PHP file in "Most Viewed Products for WooCommerce" version 1.2.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("most-viewed-products-for-woocommerce.php" instead of "woocommerce-most-viewed-products.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin401 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP367127401

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity6.50
▷ Minimum class complexity5.00
▷ Maximum class complexity8.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin