78% fraudlabs-pro-for-wp-e-commerce

Code Review | FraudLabs Pro for WP e-Commerce

WordPress plugin FraudLabs Pro for WP e-Commerce scored78%from 54 tests.

About plugin

  • Plugin page: fraudlabs-pro-for...
  • Plugin version: 1.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Jul 15, 2014
  • Latest release: Sep 5, 2023
  • Number of updates: 68
  • Update frequency: every 49.1 days
  • Top authors: fraudlabspro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,521 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼3.26ms] Passed 4 tests

A check of server-side resources used by FraudLabs Pro for WP e-Commerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2242.86 ▲4.74
Dashboard /wp-admin3.52 ▲0.2150.72 ▼2.18
Posts /wp-admin/edit.php3.63 ▲0.2746.53 ▼1.14
Add New Post /wp-admin/post-new.php6.12 ▲0.2382.34 ▼10.34
Media Library /wp-admin/upload.php3.44 ▲0.2138.30 ▲0.62
FraudLabs Pro /wp-admin/options-general.php?page=fraudlabs-pro3.4131.23

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 27 new files
Database: 1 new table, 13 new options
New tables
wp_wpsc_fraudlabspro
New WordPress options
fraudlabspro_test_ip
fraudlabspro_notification_on_reject
theysaidso_admin_options
can_compress_scripts
fraudlabspro_api_key
fraudlabspro_enabled
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
fraudlabspro_debug_log_enabled
...

Browser metrics Passed 4 tests

A check of browser resources used by FraudLabs Pro for WP e-Commerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲3813.67 ▼0.723.98 ▲2.1540.91 ▼2.96
Dashboard /wp-admin2,212 ▲275.85 ▼0.0195.56 ▼0.9641.30 ▲3.59
Posts /wp-admin/edit.php2,095 ▲62.04 ▼0.0035.93 ▲0.1236.64 ▲0.72
Add New Post /wp-admin/post-new.php1,535 ▲123.37 ▲0.31618.53 ▼47.0463.29 ▲11.93
Media Library /wp-admin/upload.php1,394 ▲34.20 ▲0.0294.18 ▲0.4240.39 ▼1.62
FraudLabs Pro /wp-admin/options-general.php?page=fraudlabs-pro8992.0724.9630.91

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 9 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • fraudlabspro_notification_on_approve
    • fraudlabspro_notification_on_review
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • fraudlabspro_notification_on_reject

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/vendor/fraudlabspro/fraudlabspro-php/tests/bootstrap.php
    • > /wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/vendor/fraudlabspro/fraudlabspro-php/example.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/vendor/fraudlabspro/fraudlabspro-php/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/vendor/fraudlabspro/fraudlabspro-php/example.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/fraudlabspro-wp-ecommerce.php:26
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/fraudlabspro-wp-ecommerce.php on line 24
    • > PHP Warning
      require_once(wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/vendor/fraudlabspro/fraudlabspro-php/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/vendor/fraudlabspro/fraudlabspro-php/example.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/vendor/fraudlabspro/fraudlabspro-php/tests/SmsVerificationTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fraudlabs-pro-for-wp-e-commerce/vendor/fraudlabspro/fraudlabspro-php/tests/FraudValidationTest.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: fraud prevention, wpec, fraud detection, wp-e-commerce, wpsc...

fraudlabs-pro-for-wp-e-commerce/fraudlabspro-wp-ecommerce.php 85% from 13 tests

The main PHP script in "FraudLabs Pro for WP e-Commerce" version 1.6.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 148 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fraudlabs-pro-for-wp-e-commerce.php" instead of "fraudlabspro-wp-ecommerce.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
No dangerous file extensions were detected1,870 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP172733031,530
Markdown1670189
JSON20074
JavaScript29070
XML1007

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity26.40
▷ Minimum class complexity1.00
▷ Maximum class complexity128.00
Average method complexity5.10
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods63
▷ Static methods34.76%
▷ Public methods5688.89%
▷ Protected methods00.00%
▷ Private methods711.11%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants17
▷ Global constants211.76%
▷ Class constants1588.24%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin