68% payment-forms-customblock

Code Review | Payment Forms CustomBlock

WordPress plugin Payment Forms CustomBlock scored68%from 54 tests.

About plugin

  • Plugin page: payment-forms-cus...
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Apr 29, 2020
  • Latest release: Aug 3, 2020
  • Number of updates: 7
  • Update frequency: every 13.7 days
  • Top authors: albertogcatalan (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /761 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.01ms] Passed 4 tests

Analyzing server-side resources used by Payment Forms CustomBlock
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.18 ▲0.44
Dashboard /wp-admin3.32 ▼0.0249.85 ▼15.31
Posts /wp-admin/edit.php3.37 ▲0.0248.71 ▼2.23
Add New Post /wp-admin/post-new.php5.90 ▲0.0292.81 ▼10.95
Media Library /wp-admin/upload.php3.24 ▲0.0240.85 ▲4.57

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 150 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Payment Forms CustomBlock: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.27 ▼1.112.10 ▲0.2442.81 ▲3.70
Dashboard /wp-admin2,222 ▲345.88 ▲0.02105.95 ▼7.0939.87 ▼5.05
Posts /wp-admin/edit.php2,105 ▲162.06 ▲0.0439.89 ▲3.4136.15 ▲1.24
Add New Post /wp-admin/post-new.php6,198 ▲4,65619.01 ▼3.77938.77 ▲313.0062.38 ▲9.95
Media Library /wp-admin/upload.php1,407 ▲164.22 ▲0.01102.65 ▼2.4465.76 ▲19.40

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

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
Good news, no errors were detected

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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/build.php
    • > /wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/update_certs.php
  • 104× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/FileLink.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/Charge.php:54
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/OrderReturn.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/IssuerFraudRecord.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/Product.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/Issuing/Card.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/CreditNote.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/Checkout/Session.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/UsageRecordSummary.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/lib/Reporting/ReportType.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Plugin contributors field is missing
You can look at the official readme.txt

payment-forms-customblock/payment-forms-customblock.php 92% from 13 tests

The entry point to "Payment Forms CustomBlock" version 1.1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Please make sure to remedy the following
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/payment-forms-customblock/stripe/vendor/stripe/stripe-php/data/ca-certificates.crt
5,730 lines of code in 142 files:
LanguageFilesBlank linesComment linesLines of code
PHP1369593,7074,906
Markdown23020687
JSON300102
JavaScript12035

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.82
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces13
Interfaces2
Traits7
Classes116
▷ Abstract classes76.03%
▷ Concrete classes10993.97%
▷ Final classes00.00%
Methods348
▷ Static methods14641.95%
▷ Public methods30788.22%
▷ Protected methods133.74%
▷ Private methods288.05%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
Constants506
▷ Global constants61.19%
▷ Class constants50098.81%
▷ Public constants500100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin