62% payment-forms-for-paystack

Code Review | Payment Forms for Paystack

WordPress plugin Payment Forms for Paystack scored62%from 54 tests.

About plugin

  • Plugin page: payment-forms-for...
  • Plugin version: 3.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.9
  • WordPress version: 6.3.1
  • First release: Sep 19, 2016
  • Latest release: Feb 8, 2022
  • Number of updates: 219
  • Update frequency: every 9.0 days
  • Top authors: kendysond (78.54%)paystack (21.92%)

Code review

54 tests

User reviews

8 reviews

Install metrics

5,000+ active /93,939 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.11MB] [CPU: ▼16.37ms] Passed 4 tests

This is a short check of server-side resources used by Payment Forms for Paystack
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.08 ▲0.6246.84 ▲10.04
Dashboard /wp-admin3.92 ▲0.5752.38 ▼7.47
Posts /wp-admin/edit.php3.97 ▲0.6247.51 ▼1.54
Add New Post /wp-admin/post-new.php3.70 ▼2.1837.80 ▼66.52
Media Library /wp-admin/upload.php3.78 ▲0.5546.67 ▲10.19
All Forms /wp-admin/edit.php?post_type=paystack_form3.8835.90
Add New /wp-admin/post-new.php?post_type=paystack_form3.7034.43

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 58 new files
Database: 1 new table, 8 new options
New tables
wp_paystack_forms_payments
New WordPress options
plugin_error
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
kkd_db_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payment Forms for Paystack
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,938 ▲19213.71 ▼1.019.47 ▲7.6342.11 ▼2.40
Dashboard /wp-admin2,227 ▲465.52 ▼0.1586.03 ▼16.3679.59 ▲36.00
Posts /wp-admin/edit.php2,132 ▲321.99 ▼0.0334.79 ▲0.3631.18 ▼0.57
Add New Post /wp-admin/post-new.php1,708 ▲18021.80 ▼1.45713.50 ▲40.6856.29 ▲0.03
Media Library /wp-admin/upload.php1,423 ▲234.18 ▼0.0595.32 ▼1.2472.57 ▲28.88
Settings /wp-admin/class-paystack-forms-admin.php260.420.0713.84
All Forms /wp-admin/edit.php?post_type=paystack_form1,1121.9431.3930.62
Add New /wp-admin/post-new.php?post_type=paystack_form2,1593.0563.3382.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_paystack_forms_payments
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • plugin_error
    • can_compress_scripts
    • kkd_db_version

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
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=paystack_form
    • > Notice in wp-content/plugins/payment-forms-for-paystack/admin/class-paystack-forms-admin.php+683
    Undefined index: eventmeta_noncename
    • > GET request to /wp-admin/post-new.php?post_type=paystack_form
    • > Notice in wp-content/plugins/payment-forms-for-paystack/admin/class-paystack-forms-admin.php+304
    Undefined index: action

SRP 50% 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 take a closer look at the following
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/payment-forms-for-paystack/public/class-paystack-forms-public-for-old-themes.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/payment-forms-for-paystack/includes/paystack-invoice.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/payment-forms-for-paystack/public/class-paystack-forms-public-for-old-themes.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/payment-forms-for-paystack/public/class-paystack-forms-public.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/image.php' (include_path='.:/usr/share/php') in wp-content/plugins/payment-forms-for-paystack/public/class-paystack-forms-public.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/payment-forms-for-paystack/public/class-paystack-forms-public.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-load.php): failed to open stream: No such file or directory in wp-content/plugins/payment-forms-for-paystack/includes/paystack-invoice.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-load.php' (include_path='.:/usr/share/php') in wp-content/plugins/payment-forms-for-paystack/includes/paystack-invoice.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/image.php' (include_path='.:/usr/share/php') in wp-content/plugins/payment-forms-for-paystack/public/class-paystack-forms-public-for-old-themes.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/payment-forms-for-paystack/admin/class-paystack-forms-admin.php:778

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/class-paystack-forms-admin.php
    • > Network (severe)
    wp-admin/class-paystack-forms-admin.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

payment-forms-for-paystack/paystack-forms.php 92% from 13 tests

"Payment Forms for Paystack" version 3.4.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("payment-forms-for-paystack.php" instead of "paystack-forms.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected9,246 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP137135005,962
CSS43221292,005
JavaScript55937743
SVG100520
Markdown110016

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.75
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods79
▷ Static methods67.59%
▷ Public methods6784.81%
▷ Protected methods00.00%
▷ Private methods1215.19%
Functions63
▷ Named functions63100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants21100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
banner-772x250.png21.08KB7.58KB▼ 64.05%
images/cardlogos.png15.23KB5.55KB▼ 63.58%
images/logo.png0.25KB0.31KB0.00%
icon.png13.06KB7.82KB▼ 40.15%
images/logos@2x.png42.85KB8.20KB▼ 80.86%