84% product-watcher

Code Review | Product Watcher - Display Realtime Product Viewer Count to Your Customers

WordPress plugin Product Watcher - Display Realtime Product Viewer Count to Your Customers scored84%from 54 tests.

About plugin

  • Plugin page: product-watcher
  • Plugin version: 1.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: May 31, 2021
  • Latest release: Jun 18, 2022
  • Number of updates: 10
  • Update frequency: every 38.8 days
  • Top authors: mehedimi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,267 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.79MB] [CPU: ▼1.08ms] Passed 4 tests

Analyzing server-side resources used by Product Watcher - Display Realtime Product Viewer Count to Your Customers
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.26 ▲0.8045.87 ▲6.83
Dashboard /wp-admin4.09 ▲0.7849.71 ▲5.36
Posts /wp-admin/edit.php4.20 ▲0.8450.42 ▲4.13
Add New Post /wp-admin/post-new.php6.71 ▲0.8286.11 ▼17.96
Media Library /wp-admin/upload.php4.01 ▲0.7838.16 ▲4.17

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

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

Browser metrics Passed 4 tests

Product Watcher - Display Realtime Product Viewer Count to Your Customers: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲9113.20 ▼1.171.71 ▼0.1643.06 ▼2.52
Dashboard /wp-admin2,237 ▲555.86 ▲0.9698.75 ▼11.4841.85 ▼3.58
Posts /wp-admin/edit.php2,126 ▲372.00 ▼0.0238.78 ▲2.2933.87 ▲0.86
Add New Post /wp-admin/post-new.php1,572 ▲4323.33 ▲0.25682.06 ▲12.5364.11 ▲20.46
Media Library /wp-admin/upload.php1,422 ▲344.21 ▲0.0199.01 ▼0.4844.11 ▼2.64

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 212× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Rakit\\Validation\\Rule' not found in wp-content/plugins/product-watcher/vendor/rakit/validation/src/Rules/Same.php:7
    • > PHP Notice
      Constant SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE already defined in wp-content/plugins/product-watcher/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 62
    • > PHP Fatal error
      Uncaught Error: Class 'Mehedi\\ProductWatcher\\Rest\\RestController' not found in wp-content/plugins/product-watcher/includes/Rest/Auth.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_XSalsa20' not found in wp-content/plugins/product-watcher/vendor/paragonie/sodium_compat/namespaced/Core/Xsalsa20.php:4
    • > PHP Notice
      Constant SODIUM_CRYPTO_AEAD_AES256GCM_NSECBYTES already defined in wp-content/plugins/product-watcher/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_Util' not found in wp-content/plugins/product-watcher/vendor/paragonie/sodium_compat/src/File.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Rakit\\Validation\\Rule' not found in wp-content/plugins/product-watcher/vendor/rakit/validation/src/Rules/Alpha.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_HChaCha20' not found in wp-content/plugins/product-watcher/vendor/paragonie/sodium_compat/namespaced/Core/HChaCha20.php:4
    • > PHP Notice
      Constant SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES already defined in wp-content/plugins/product-watcher/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_XChaCha20' not found in wp-content/plugins/product-watcher/vendor/paragonie/sodium_compat/namespaced/Core/XChaCha20.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: product, product viewer, woocommerce, realtime visitor, realtime

product-watcher/product-watcher.php 92% from 13 tests

The principal PHP file in "Product Watcher - Display Realtime Product Viewer Count to Your Customers" v. 1.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("4.4" instead of "5.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin29,180 lines of code in 245 files:
LanguageFilesBlank linesComment linesLines of code
PHP2113,93613,40326,929
Markdown761901,386
JSON900692
XML5174697
make19426
YAML12025
Bourne Shell37117
JavaScript6026
CSS1001
INI1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity11.17
▷ Minimum class complexity1.00
▷ Maximum class complexity330.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces25
Interfaces6
Traits8
Classes176
▷ Abstract classes2413.64%
▷ Concrete classes15286.36%
▷ Final classes10.66%
Methods1,078
▷ Static methods52048.24%
▷ Public methods95488.50%
▷ Protected methods807.42%
▷ Private methods444.08%
Functions160
▷ Named functions15093.75%
▷ Anonymous functions106.25%
Constants315
▷ Global constants41.27%
▷ Class constants31198.73%
▷ Public constants311100.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
There were not PNG files found in your plugin