83% recently-viewed-most-viewed-and-sold-products-for-woocommerce

Code Review | Recently - Viewed, Most Viewed and Sold Products for WooCommerce

WordPress plugin Recently - Viewed, Most Viewed and Sold Products for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: recently-viewed-m...
  • Plugin version: 0.9
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 25, 2023
  • Latest release: Mar 25, 2023
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: AL Imran Akash (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /335 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼4.90ms] Passed 4 tests

Server-side resources used by Recently - Viewed, Most Viewed and Sold Products for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0941.51 ▲2.42
Dashboard /wp-admin3.47 ▲0.1747.49 ▼6.62
Posts /wp-admin/edit.php3.53 ▲0.1747.93 ▼5.44
Add New Post /wp-admin/post-new.php6.02 ▲0.1393.83 ▼9.94
Media Library /wp-admin/upload.php3.34 ▲0.1143.03 ▲10.74
Settings /wp-admin/admin.php?page=recently-viewed-products-for-woocommerce3.3340.33
Shortcodes Generator /wp-admin/edit.php?post_type=shortcode3.3834.78

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 62 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
recently-viewed-products-for-woocommerce_install_time
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
recently-viewed-products-for-woocommerce_version

Browser metrics Passed 4 tests

A check of browser resources used by Recently - Viewed, Most Viewed and Sold Products for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲19213.41 ▼0.838.45 ▲6.9139.00 ▼1.23
Dashboard /wp-admin2,248 ▲685.62 ▼0.0491.01 ▲2.4575.60 ▲31.28
Posts /wp-admin/edit.php2,170 ▲672.00 ▲0.0140.57 ▼0.0435.46 ▲2.58
Add New Post /wp-admin/post-new.php1,741 ▲21322.04 ▼1.03724.12 ▲30.0162.57 ▲4.98
Media Library /wp-admin/upload.php1,460 ▲634.18 ▼0.08105.65 ▲0.0979.70 ▲33.90
Settings /wp-admin/admin.php?page=recently-viewed-products-for-woocommerce1,4003.4549.2042.88
Shortcodes Generator /wp-admin/edit.php?post_type=shortcode1,1711.9641.0932.94

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/views/settings/table.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/inc/functions.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/inc/functions.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/inc/functions.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function rvpfw_site_url() in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/views/settings/help.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/inc/functions.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Codexpert\\Plugin\\Base' not found in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/app/Settings.php:15
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/inc/functions.php on line 5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/inc/functions.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Codexpert\\Recently_Viewed_Products_For_Woocommerce\\Helper' not found in wp-content/plugins/recently-viewed-most-viewed-and-sold-products-for-woocommerce/views/rvpm-products.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% 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
Please fix the following attributes: The official readme.txt is a good inspiration

recently-viewed-most-viewed-and-sold-products-for-woocommerce/recently-viewed-products-for-woocommerce.php 69% from 13 tests

The entry point to "Recently - Viewed, Most Viewed and Sold Products for WooCommerce" version 0.9 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Git Repository: Please remove the Git repository from this plugin
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("recently-viewed-most-viewed-and-sold-products-for-woocommerce.php" instead of "recently-viewed-products-for-woocommerce.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
There were no executable files found in this plugin4,756 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP388909223,371
CSS8191,039
JavaScript6160255
JSON40090
Markdown1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity22.16
▷ Minimum class complexity1.00
▷ Maximum class complexity214.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes25
▷ Abstract classes28.00%
▷ Concrete classes2392.00%
▷ Final classes14.35%
Methods235
▷ Static methods135.53%
▷ Public methods22696.17%
▷ Protected methods20.85%
▷ Private methods72.98%
Functions18
▷ Named functions1266.67%
▷ Anonymous functions633.33%
Constants6
▷ Global constants6100.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
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/codexpert/plugin/src/assets/img/survey.png7.31KB3.08KB▼ 57.88%
assets/img/icon.png1.54KB1.04KB▼ 32.13%
vendor/codexpert/plugin/src/assets/img/checked.png18.81KB9.90KB▼ 47.36%