10% kount-fraud-prevention

Code Review | Kount Fraud Prevention

WordPress plugin Kount Fraud Prevention scored 10% from 54 tests.

About plugin

  • Plugin page: kount-fraud-preve...
  • Plugin version: 1.0.18
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 9, 2021
  • Latest release: Sep 6, 2023
  • Number of updates: 55
  • Update frequency: every 14.0 days
  • Top authors: toddfunke (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 2,376 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > User error in wp-content/plugins/kount-fraud-prevention/includes/class-kount-activator.php+57
    Please install WooCommerce before using this plugin

Server metrics [RAM: ▲0.17MB] [CPU: ▼0.18ms] Passed 4 tests

Analyzing server-side resources used by Kount Fraud Prevention
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1837.50 ▼2.86
Dashboard /wp-admin3.48 ▲0.1847.00 ▼0.00
Posts /wp-admin/edit.php3.53 ▲0.1750.54 ▲1.54
Add New Post /wp-admin/post-new.php6.02 ▲0.1497.69 ▲0.60
Media Library /wp-admin/upload.php3.40 ▲0.1737.54 ▲1.69

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 187 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Kount Fraud Prevention
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲8913.31 ▼1.374.40 ▲2.4740.30 ▼7.19
Dashboard /wp-admin2,222 ▲314.88 ▼0.02108.49 ▲5.7439.41 ▼2.32
Posts /wp-admin/edit.php2,105 ▲162.03 ▲0.0340.40 ▲4.9435.68 ▲1.43
Add New Post /wp-admin/post-new.php1,528 ▲717.87 ▼5.20677.62 ▼15.5656.64 ▲7.25
Media Library /wp-admin/upload.php1,407 ▲224.25 ▲0.0698.40 ▼3.3047.27 ▲1.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/kount-fraud-prevention/public/partials/kount-public-display.php
  • 104× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/kount-fraud-prevention/services/kfpwoo-post-auth.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/kount-fraud-prevention/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/kount-fraud-prevention/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/kount-fraud-prevention/vendor/psr/log/Psr/Log/Test/TestLogger.php:57
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/kount-fraud-prevention/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/kount-fraud-prevention/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/kount-fraud-prevention/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/kount-fraud-prevention/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/kount-fraud-prevention/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\BufferHandler' not found in wp-content/plugins/kount-fraud-prevention/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php:36

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: kount, fraud prevention, chargeback, woocommerce

kount-fraud-prevention/kount.php 77% from 13 tests

The primary PHP file in "Kount Fraud Prevention" version 1.0.18 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 176 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("kount-fraud-prevention.php" instead of "kount.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
There were no executable files found in this plugin11,815 lines of code in 176 files:
LanguageFilesBlank linesComment linesLines of code
PHP1602,6546,98810,552
Markdown41780583
JSON400264
JavaScript341109197
CSS21814143
PO File1292974
SVG2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity9.58
▷ Minimum class complexity1.00
▷ Maximum class complexity98.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces13
Interfaces9
Traits5
Classes135
▷ Abstract classes85.93%
▷ Concrete classes12794.07%
▷ Final classes21.57%
Methods846
▷ Static methods647.57%
▷ Public methods60571.51%
▷ Protected methods15618.44%
▷ Private methods8510.05%
Functions28
▷ Named functions725.00%
▷ Anonymous functions2175.00%
Constants63
▷ Global constants711.11%
▷ Class constants5688.89%
▷ Public constants3664.29%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected