78% fraudlabs-pro-for-easy-digital-downloads

Code Review | FraudLabs Pro for Easy Digital Downloads

WordPress plugin FraudLabs Pro for Easy Digital Downloads scored 78% from 54 tests.

About plugin

  • Plugin page: fraudlabs-pro-for...
  • Plugin version: 2.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Nov 30, 2018
  • Latest release: Aug 17, 2023
  • Number of updates: 57
  • Update frequency: every 30.2 days
  • Top authors: fraudlabspro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,593 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by FraudLabs Pro for Easy Digital Downloads
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.70 ▼6.66
Dashboard /wp-admin3.31 ▲0.0045.64 ▼2.44
Posts /wp-admin/edit.php3.36 ▲0.0046.35 ▲1.87
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.65 ▼13.59
Media Library /wp-admin/upload.php3.23 ▲0.0034.84 ▼1.90

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

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

Browser metrics Passed 4 tests

FraudLabs Pro for Easy Digital Downloads: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.27 ▼1.044.27 ▲2.3940.19 ▼0.23
Dashboard /wp-admin2,203 ▲155.84 ▲0.95105.36 ▲2.3237.36 ▼9.51
Posts /wp-admin/edit.php2,089 ▲32.04 ▲0.0041.14 ▲4.4037.76 ▲7.85
Add New Post /wp-admin/post-new.php1,514 ▼2817.73 ▼0.66655.68 ▲24.8557.38 ▼0.41
Media Library /wp-admin/upload.php1,391 ▲64.16 ▼0.0593.78 ▼13.6540.64 ▼6.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/fraudlabs-pro-for-easy-digital-downloads/vendor/fraudlabspro/fraudlabspro-php/tests/bootstrap.php
    • > /wp-content/plugins/fraudlabs-pro-for-easy-digital-downloads/vendor/fraudlabspro/fraudlabspro-php/example.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fraudlabs-pro-for-easy-digital-downloads/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-easy-digital-downloads/vendor/fraudlabspro/fraudlabspro-php/tests/FraudValidationTest.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/fraudlabs-pro-for-easy-digital-downloads/vendor/fraudlabspro/fraudlabspro-php/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/fraudlabs-pro-for-easy-digital-downloads/vendor/fraudlabspro/fraudlabspro-php/example.php on line 6
    • > PHP Warning
      require_once(wp-content/plugins/fraudlabs-pro-for-easy-digital-downloads/vendor/fraudlabspro/fraudlabspro-php/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/fraudlabs-pro-for-easy-digital-downloads/vendor/fraudlabspro/fraudlabspro-php/example.php on line 6

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: easy digital downloads, edd, fraud prevention, easy digital downloads fraud detection, fraudlabspro...

fraudlabs-pro-for-easy-digital-downloads/init.php 92% from 13 tests

The main PHP script in "FraudLabs Pro for Easy Digital Downloads" version 2.2.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fraudlabs-pro-for-easy-digital-downloads.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin2,417 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP173663352,039
Markdown1670189
JavaScript2170101
JSON20074
CSS1107
XML1007

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.65
Average class complexity31.36
▷ Minimum class complexity1.00
▷ Maximum class complexity202.00
Average method complexity5.22
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods75
▷ Static methods56.67%
▷ Public methods6688.00%
▷ Protected methods00.00%
▷ Private methods912.00%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants18
▷ Global constants316.67%
▷ Class constants1583.33%
▷ 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
7 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png1.47KB0.52KB▼ 64.65%
assets/images/logo_200.png4.23KB2.45KB▼ 42.05%
assets/images/step-2-selected.png3.89KB1.82KB▼ 53.23%
assets/images/step-1.png4.04KB1.52KB▼ 62.47%
assets/images/step-2.png4.88KB1.81KB▼ 62.92%