68% payplus-payment-gateway

Code Review | PayPlus Payment Gateway

WordPress plugin PayPlus Payment Gateway scored68%from 54 tests.

About plugin

  • Plugin page: payplus-payment-g...
  • Plugin version: 6.5.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 3, 2021
  • Latest release: Nov 26, 2023
  • Number of updates: 739
  • Update frequency: every 1.4 days
  • Top authors: payplus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active /26,153 total downloads

Benchmarks

Plugin footprint 65% 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.00MB] [CPU: ▼4.18ms] Passed 4 tests

Analyzing server-side resources used by PayPlus Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.82 ▼7.19
Dashboard /wp-admin3.31 ▲0.0046.63 ▼6.84
Posts /wp-admin/edit.php3.36 ▲0.0046.70 ▲1.65
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.58 ▼2.30
Media Library /wp-admin/upload.php3.23 ▲0.0032.54 ▼0.40

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 46 new files
Database: 1 new table, 6 new options
New tables
wp_payplus_payment_session
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

PayPlus Payment Gateway: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.25 ▼0.101.65 ▲0.0137.72 ▼7.34
Dashboard /wp-admin2,198 ▲215.60 ▼0.0491.65 ▼6.0940.97 ▼6.12
Posts /wp-admin/edit.php2,097 ▼31.95 ▲0.0139.56 ▼0.0735.02 ▼4.50
Add New Post /wp-admin/post-new.php1,529 ▼023.32 ▲0.30635.95 ▲30.9253.07 ▼16.12
Media Library /wp-admin/upload.php1,394 ▼64.17 ▲0.0196.39 ▼1.4040.79 ▼1.35

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_payplus_payment_session
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/payplus-payment-gateway/payplus-payment-gateway.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/payplus-payment-gateway/includes/elementor/widgets/express_checkout.php:3
    • > PHP Warning
      Use of undefined constant PAYPLUS_PLUGIN_DIR - assumed 'PAYPLUS_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/payplus-payment-gateway/includes/wc_payplus_express_checkout.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/payplus-payment-gateway/includes/wc_payplus_express_checkout.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/payplus-payment-gateway/includes/wc_payplus_express_checkout.php:14

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 90% 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
Attributes that need to be fixed: The official readme.txt is a good inspiration

payplus-payment-gateway/payplus-payment-gateway.php 85% from 13 tests

Analyzing the main PHP file in "PayPlus Payment Gateway" version 6.5.4
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 227 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin9,134 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP89178155,890
JavaScript8253651,786
PO File2388512846
CSS6615328
Sass1240186
SVG100098

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity78.00
▷ Minimum class complexity1.00
▷ Maximum class complexity409.00
Average method complexity6.92
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods171
▷ Static methods42.34%
▷ Public methods16898.25%
▷ Protected methods10.58%
▷ Private methods21.17%
Functions12
▷ Named functions975.00%
▷ Anonymous functions325.00%
Constants20
▷ Global constants20100.00%
▷ Class constants00.00%
▷ Public constants00.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
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/multipass.png13.79KB2.42KB▼ 82.44%
assets/images/google-pay.png1.34KB0.94KB▼ 29.66%
assets/images/max.png0.95KB0.56KB▼ 40.76%
assets/images/bit.png0.90KB0.63KB▼ 29.86%
assets/images/apple-pay.png0.67KB0.53KB▼ 20.75%