74% better-payment

Code Review | Better Payment - Instant Payments Through PayPal & Stripe

WordPress plugin Better Payment - Instant Payments Through PayPal & Stripe scored74%from 54 tests.

About plugin

  • Plugin page: better-payment
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 26, 2021
  • Latest release: Nov 13, 2023
  • Number of updates: 11
  • Update frequency: every 68.6 days
  • Top authors: wpdevteam (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /12,136 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.39MB] [CPU: ▼4.17ms] Passed 4 tests

Analyzing server-side resources used by Better Payment - Instant Payments Through PayPal & Stripe
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3938.11 ▼3.43
Dashboard /wp-admin3.74 ▲0.4349.07 ▼5.68
Posts /wp-admin/edit.php3.79 ▲0.4353.96 ▲5.99
Add New Post /wp-admin/post-new.php6.28 ▲0.3988.08 ▼11.80
Media Library /wp-admin/upload.php3.60 ▲0.3737.24 ▲4.24
Better Payment /wp-admin/admin.php?page=better-payment-setup-wizard3.7236.38

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 111 new files
Database: 1 new table, 8 new options
New tables
wp_better_payment
New WordPress options
better_payment_setup_wizard
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
better_payment_version

Browser metrics Passed 4 tests

Better Payment - Instant Payments Through PayPal & Stripe: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,938 ▲19113.53 ▼0.8711.97 ▲10.1239.30 ▲1.32
Dashboard /wp-admin2,201 ▲245.56 ▼0.0294.49 ▼10.8440.84 ▼3.81
Posts /wp-admin/edit.php2,118 ▲181.96 ▼0.0636.16 ▼1.1338.46 ▲4.63
Add New Post /wp-admin/post-new.php1,387 ▼14420.96 ▼1.97591.73 ▼94.7538.38 ▼27.53
Media Library /wp-admin/upload.php1,412 ▲154.22 ▼0.0699.83 ▲1.6841.55 ▼2.47
Better Payment /wp-admin/admin.php?page=better-payment-setup-wizard1,3501.8529.8958.78

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_better_payment
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • better_payment_setup_wizard
    • widget_recent-posts
    • theysaidso_admin_options
    • better_payment_version
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 17× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Better_Payment\\Lite\\Classes\\Better_Payment_Helper' not found in wp-content/plugins/better-payment/includes/Admin/views/elementor/layouts/layout-2.php:7
    • > PHP Notice
      Undefined variable: better_payment_helper_obj in wp-content/plugins/better-payment/includes/Admin/views/partials/layout-repeater-vars.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to a member function titleToSnake() on null in wp-content/plugins/better-payment/includes/Admin/views/partials/layout-repeater-vars.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/better-payment/includes/Admin/views/partials/go-premium.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_allowed_html() in wp-content/plugins/better-payment/includes/Admin/views/partials/layout-vars.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'ElementorPro\\Modules\\Forms\\Classes\\Action_Base' not found in wp-content/plugins/better-payment/includes/Admin/Elementor/Form_Actions/Better_Payment_Stripe_Integration.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/better-payment/includes/Admin/views/partials/custom-dropdown.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/better-payment/includes/Admin/views/elementor/layouts/layout-1-legacy.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Better_Payment\\Lite\\Classes\\Better_Payment_Helper' not found in wp-content/plugins/better-payment/includes/Admin/views/elementor/layouts/layout-3.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/better-payment/includes/Admin/views/template-email-notification.php:83

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: checkout, better payment, paypal payment, elementor payment, stripe donation...

better-payment/better-payment.php 85% from 13 tests

The main PHP file in "Better Payment - Instant Payments Through PayPal & Stripe" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin21,278 lines of code in 102 files:
LanguageFilesBlank linesComment linesLines of code
PHP571,5481,6489,609
JavaScript159698515,994
CSS17824755,318
SVG1142351
JSON2006

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity24.86
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity4.23
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces10
Interfaces0
Traits4
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes13.12%
Methods254
▷ Static methods6124.02%
▷ Public methods24194.88%
▷ Protected methods72.76%
▷ Private methods62.36%
Functions10
▷ Named functions440.00%
▷ Anonymous functions660.00%
Constants14
▷ Global constants1178.57%
▷ Class constants321.43%
▷ Public constants3100.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
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/paypal.png1.09KB0.75KB▼ 31.07%
assets/img/better-payment-icon-white-small.png0.49KB0.77KB0.00%
assets/vendor/jquery-ui/css/images/ui-icons_444444_256x240.png4.27KB4.11KB▼ 3.78%