72% fraudify

Code Review | Fraudify

WordPress plugin Fraudify scored72%from 54 tests.

About plugin

  • Plugin page: fraudify
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.6
  • WordPress version: 6.3.1
  • First release: Oct 7, 2016
  • Latest release: Nov 4, 2016
  • Number of updates: 30
  • Update frequency: every 1.0 days
  • Top authors: ltomazeli (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /957 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.13ms] Passed 4 tests

A check of server-side resources used by Fraudify
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0640.04 ▲0.94
Dashboard /wp-admin3.37 ▲0.0247.36 ▼9.78
Posts /wp-admin/edit.php3.49 ▲0.1346.99 ▲2.88
Add New Post /wp-admin/post-new.php5.95 ▲0.0685.88 ▼20.20
Media Library /wp-admin/upload.php3.29 ▲0.0635.02 ▲0.51
Fraudify /wp-admin/options-general.php?page=fraudify_for_stripe3.2428.46

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 60 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Fraudify
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.31 ▼0.3314.65 ▲12.9643.80 ▲2.62
Dashboard /wp-admin2,205 ▲315.62 ▼0.0392.56 ▲3.2039.88 ▼1.06
Posts /wp-admin/edit.php2,110 ▲101.99 ▼0.0238.55 ▲1.9234.22 ▲3.00
Add New Post /wp-admin/post-new.php1,532 ▼522.17 ▲4.25676.15 ▲75.7461.93 ▼9.63
Media Library /wp-admin/upload.php1,407 ▲44.28 ▲0.1098.38 ▼5.2342.50 ▼2.48
Fraudify /wp-admin/options-general.php?page=fraudify_for_stripe8191.9624.8826.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=fraudify_for_stripe
    • > Notice in wp-content/plugins/fraudify/fraudify.php+426
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/fraudify/riskified_php_sdk/sample/update_merchant_settings.php
    • > /wp-content/plugins/fraudify/riskified_php_sdk/sample/order_marketplace_create.php
    • > /wp-content/plugins/fraudify/riskified_php_sdk/sample/upload_historical.php
    • > /wp-content/plugins/fraudify/riskified_php_sdk/sample/order_simple_submit.php
  • 42× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Riskified\\OrderWebhook\\Exception\\PropertyException' not found in wp-content/plugins/fraudify/riskified_php_sdk/src/Riskified/OrderWebhook/Exception/MissingPropertyException.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fraudify/fraudify.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'Riskified\\OrderWebhook\\Model\\AbstractModel' not found in wp-content/plugins/fraudify/riskified_php_sdk/src/Riskified/OrderWebhook/Model/PaymentDetails.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Riskified\\Common\\Exception\\BaseException' not found in wp-content/plugins/fraudify/riskified_php_sdk/src/Riskified/OrderWebhook/Exception/CurlException.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Riskified\\OrderWebhook\\Model\\AbstractModel' not found in wp-content/plugins/fraudify/riskified_php_sdk/src/Riskified/OrderWebhook/Model/DiscountCode.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Riskified\\OrderWebhook\\Transport\\AbstractTransport' not found in wp-content/plugins/fraudify/riskified_php_sdk/src/Riskified/OrderWebhook/Transport/CurlTransport.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Riskified\\OrderWebhook\\Exception\\PropertyException' not found in wp-content/plugins/fraudify/riskified_php_sdk/src/Riskified/OrderWebhook/Exception/FormatMismatchPropertyException.php:22
    • > PHP Fatal error
      Uncaught Riskified\\OrderWebhook\\Exception\\UnsuccessfulActionException: Http Status Code: 401, Error was: {"error":{"message":"Failed verifying request: 'X-RISKIFIED-HMAC-SHA256' header is either missing or incorrect"}} in wp-content/plugins/fraudify/riskified_php_sdk/src/Riskified/OrderWebhook/Transport/CurlTransport.php:77
    • > PHP Fatal error
      Uncaught Error: Class 'Riskified\\OrderWebhook\\Model\\AbstractModel' not found in wp-content/plugins/fraudify/riskified_php_sdk/src/Riskified/OrderWebhook/Model/Address.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Riskified\\OrderWebhook\\Model\\AbstractModel' not found in wp-content/plugins/fraudify/riskified_php_sdk/src/Riskified/OrderWebhook/Model/LineItem.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === fraudify === )
Please take inspiration from this readme.txt

fraudify/fraudify.php Passed 13 tests

"Fraudify" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
82 characters long description:
This plugin enables your ecommerce to do fraud detection using Riskfied and Stripe

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,730 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP544101,3211,700
Markdown219028
Bourne Shell13152

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity2.33
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods63
▷ Static methods23.17%
▷ Public methods3352.38%
▷ Protected methods2234.92%
▷ Private methods812.70%
Functions29
▷ Named functions2896.55%
▷ Anonymous functions13.45%
Constants12
▷ Global constants00.00%
▷ Class constants12100.00%
▷ Public constants12100.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