84% wp-payment

Code Review | WP Payment

WordPress plugin WP Payment scored84%from 54 tests.

About plugin

  • Plugin page: wp-payment
  • Plugin version: 2.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2016
  • Latest release: Dec 13, 2022
  • Number of updates: 72
  • Update frequency: every 34.4 days
  • Top authors: amitwpdeveloper (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,477 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
Install script ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼1.01ms] Passed 4 tests

An overview of server-side resources used by WP Payment
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2340.56 ▲0.20
Dashboard /wp-admin3.54 ▲0.2449.97 ▲3.28
Posts /wp-admin/edit.php3.66 ▲0.3047.35 ▼2.99
Add New Post /wp-admin/post-new.php6.12 ▲0.2492.78 ▼4.54
Media Library /wp-admin/upload.php3.47 ▲0.2440.24 ▲4.76
General Settings /wp-admin/admin.php?page=wp-general-settings3.4333.31
Records /wp-admin/edit.php?post_type=paymentsubmission3.5134.96
Payment Settings /wp-admin/admin.php?page=wp-payment-settings3.4433.69
WP Payment /wp-admin/admin.php?page=payment3.4331.39
Email Settings /wp-admin/admin.php?page=wp-form-email-settings3.5038.62
Form Template /wp-admin/admin.php?page=wp-form-template3.4334.39

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Payment
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲19413.69 ▼1.055.88 ▲4.1941.22 ▲1.82
Dashboard /wp-admin2,255 ▲704.90 ▼0.00102.55 ▼3.5342.96 ▲0.19
Posts /wp-admin/edit.php2,134 ▲452.03 ▲0.0234.98 ▼5.6235.72 ▼0.38
Add New Post /wp-admin/post-new.php6,390 ▲4,87027.57 ▲4.54923.86 ▲240.0039.78 ▼22.53
Media Library /wp-admin/upload.php1,434 ▲464.25 ▲0.07109.90 ▲2.9246.87 ▲1.56
General Settings /wp-admin/admin.php?page=wp-general-settings1,7781.7227.3367.90
Records /wp-admin/edit.php?post_type=paymentsubmission1,0951.9831.8629.37
Payment Settings /wp-admin/admin.php?page=wp-payment-settings1,3441.7228.2936.61
WP Payment /wp-admin/admin.php?page=payment1,1241.6724.7643.01
Email Settings /wp-admin/admin.php?page=wp-form-email-settings1,9968.36163.3682.79
Form Template /wp-admin/admin.php?page=wp-form-template1,0371.7325.5538.74

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 fix the following items
  • 150× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ANetApiRequestType' not found in wp-content/plugins/wp-payment/authorize/lib/net/authorize/api/contract/v1/DecryptPaymentDataRequest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\controller\\base\\ApiOperationBase' not found in wp-content/plugins/wp-payment/authorize/lib/net/authorize/api/controller/GetCustomerPaymentProfileListController.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ANetApiResponseType' not found in wp-content/plugins/wp-payment/authorize/lib/net/authorize/api/contract/v1/GetBatchStatisticsResponse.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ANetApiRequestType' not found in wp-content/plugins/wp-payment/authorize/lib/net/authorize/api/contract/v1/AuthenticateTestRequest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ANetApiResponseType' not found in wp-content/plugins/wp-payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerProfileResponse.php:8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-payment/wp-payment.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\controller\\base\\ApiOperationBase' not found in wp-content/plugins/wp-payment/authorize/lib/net/authorize/api/controller/LogoutController.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ProfileTransAmountType' not found in wp-content/plugins/wp-payment/authorize/lib/net/authorize/api/contract/v1/ProfileTransPriorAuthCaptureType.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'AuthorizeNetRequest' not found in wp-content/plugins/wp-payment/authorize/lib/AuthorizeNetCIM.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\CustomerPaymentProfileBaseType' not found in wp-content/plugins/wp-payment/authorize/lib/net/authorize/api/contract/v1/CustomerPaymentProfileType.php:11

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

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #15 (scrrenshot-15, Elementor Widget), #16 (scrrenshot-16, Gutenbarg Block)
Please take inspiration from this readme.txt

wp-payment/wp-payment.php Passed 13 tests

"WP Payment" version 2.2.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
121 characters long description:
On site payments through Authorize.NET, PayPal Pro and Stripe with Email Notification. Use shortcode '[WP_PAYMENT_FORM]'.

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
Everything looks great! No dangerous files found in this plugin19,386 lines of code in 434 files:
LanguageFilesBlank linesComment linesLines of code
PHP2503,47410,88912,304
YAML177006,240
CSS2623470
JavaScript3290162
Markdown1360162
JSON11048

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity1.95
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity1.16
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces16
Interfaces1
Traits0
Classes260
▷ Abstract classes20.77%
▷ Concrete classes25899.23%
▷ Final classes00.00%
Methods1,504
▷ Static methods100.66%
▷ Public methods1,42094.41%
▷ Protected methods634.19%
▷ Private methods211.40%
Functions28
▷ Named functions2692.86%
▷ Anonymous functions27.14%
Constants42
▷ Global constants1842.86%
▷ Class constants2457.14%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.31MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/images/template-2.png18.17KB10.49KB▼ 42.27%
images/2checkout-logo.png19.68KB9.34KB▼ 52.54%
images/paypal.png6.96KB3.66KB▼ 47.46%
images/eb-cta-box-animate.png5.36KB2.77KB▼ 48.31%
templates/images/template-1.png12.57KB6.48KB▼ 48.47%