84% paymennt-card-payment

Code Review | Paymennt

WordPress plugin Paymennt scored84%from 54 tests.

About plugin

  • Plugin page: paymennt-card-pay...
  • Plugin version: 3.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.0
  • WordPress version: 6.3.1
  • First release: Jun 15, 2022
  • Latest release: Oct 12, 2022
  • Number of updates: 12
  • Update frequency: every 9.9 days
  • Top authors: paymennt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /580 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Paymennt
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0148.94 ▲9.68
Dashboard /wp-admin3.31 ▲0.0147.03 ▼6.96
Posts /wp-admin/edit.php3.36 ▲0.0150.72 ▼0.93
Add New Post /wp-admin/post-new.php5.89 ▲0.0187.83 ▼12.33
Media Library /wp-admin/upload.php3.23 ▲0.0134.59 ▼3.42

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Paymennt
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.29 ▼0.061.76 ▲0.1845.87 ▲0.86
Dashboard /wp-admin2,195 ▲185.62 ▼0.0091.65 ▲2.5238.72 ▼1.37
Posts /wp-admin/edit.php2,100 ▲32.01 ▲0.0140.78 ▲3.9337.84 ▲4.56
Add New Post /wp-admin/post-new.php1,526 ▼023.11 ▼0.55657.02 ▼36.9353.27 ▼0.31
Media Library /wp-admin/upload.php1,400 ▲34.31 ▲0.1194.35 ▼14.0743.51 ▼2.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

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)
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Paymennt_Card_Parent' not found in wp-content/plugins/paymennt-card-payment/includes/lib/class-pmnt-utils.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/paymennt-card-payment/includes/lib/class-pmnt-parent.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/paymennt-card-payment/includes/lib/class-pmnt-parent.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/paymennt-card-payment/includes/lib/class-pmnt-parent.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymennt_Card_Parent' not found in wp-content/plugins/paymennt-card-payment/includes/lib/class-pmnt-order.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymennt_Card_Parent' not found in wp-content/plugins/paymennt-card-payment/includes/lib/class-pmnt-config.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymennt_Card_Parent' not found in wp-content/plugins/paymennt-card-payment/includes/lib/class-pmnt-payment-service.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/paymennt-card-payment/woocommerce-paymennt.php:12

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: payment, woocommerce, credit card, payment request

paymennt-card-payment/woocommerce-paymennt.php 92% from 13 tests

The primary PHP file in "Paymennt" version 3.0.6 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("paymennt-card-payment.php" instead of "woocommerce-paymennt.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin3,334 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PHP698911,7933,095
JavaScript1142119
JSON30099
CSS14019
Markdown1102

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 problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.51
▷ Minimum class complexity1.00
▷ Maximum class complexity71.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes61
▷ Abstract classes58.20%
▷ Concrete classes5691.80%
▷ Final classes11.79%
Methods215
▷ Static methods209.30%
▷ Public methods19389.77%
▷ Protected methods52.33%
▷ Private methods177.91%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants22
▷ Global constants14.55%
▷ Class constants2195.45%
▷ 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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/mc-visa-network-logos.png5.76KB2.62KB▼ 54.48%