78% memberpay

Code Review | MemberPay - Integrate Midtrans Payment Gateway for MemberPress

WordPress plugin MemberPay - Integrate Midtrans Payment Gateway for MemberPress scored78%from 54 tests.

About plugin

  • Plugin page: memberpay
  • Plugin version: 1.3.5
  • PHP compatiblity: 8.1.9+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 23, 2022
  • Latest release: Mar 21, 2023
  • Number of updates: 22
  • Update frequency: every 4.0 days
  • Top authors: artarejamedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,640 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.97ms] Passed 4 tests

Server-side resources used by MemberPay - Integrate Midtrans Payment Gateway for MemberPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.99 ▼2.90
Dashboard /wp-admin3.31 ▲0.0048.38 ▼2.21
Posts /wp-admin/edit.php3.36 ▲0.0049.91 ▼5.01
Add New Post /wp-admin/post-new.php5.89 ▲0.00101.73 ▼1.77
Media Library /wp-admin/upload.php3.23 ▲0.0038.26 ▲8.25

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 154 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by MemberPay - Integrate Midtrans Payment Gateway for MemberPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.22 ▼0.131.66 ▼0.6141.68 ▼2.51
Dashboard /wp-admin2,198 ▲185.61 ▼0.0492.23 ▼4.5443.69 ▼2.45
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0343.22 ▲4.9240.40 ▼0.44
Add New Post /wp-admin/post-new.php1,526 ▼022.78 ▼0.91657.34 ▼0.1857.36 ▲4.15
Media Library /wp-admin/upload.php1,403 ▲64.20 ▲0.02103.83 ▼0.4847.30 ▲5.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 10× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/core-api/transaction-manipulation.php
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/snap-redirect/checkout-process.php
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/core-api/checkout-process.php
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/snap/index.php
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/core-api/tokenization-process.php
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/snap/checkout-process.php
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/snap-redirect/index.php
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/notification-handler.php
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/core-api/checkout.php
    • > /wp-content/plugins/memberpay/vendor/midtrans-php-master/examples/snap/checkout-process-simple-version.php
  • 107× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/memberpay/vendor/xendit-php-master/examples/CardsExample.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Xendit\\TestCase' not found in wp-content/plugins/memberpay/vendor/xendit-php-master/tests/Xendit/DisbursementsTest.php:26
    • > PHP Fatal error
      Trait 'Xendit\\ApiOperations\\Request' not found in wp-content/plugins/memberpay/vendor/xendit-php-master/src/PaymentChannels.php on line 25
    • > PHP Warning
      require(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/memberpay/vendor/xendit-php-master/examples/RecurringExample.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Xendit\\TestCase' not found in wp-content/plugins/memberpay/vendor/xendit-php-master/tests/Xendit/PromotionTest.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/memberpay/vendor/midtrans-php-master/tests/integration/IntegrationTest.php:7
    • > PHP Warning
      require_once(wp-content/plugins/memberpay/vendor/midtrans-php-master/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/memberpay/vendor/midtrans-php-master/test_bootstrap.php on line 6
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/memberpay/vendor/xendit-php-master/examples/CardsReverseExample.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/memberpay/vendor/midtrans-php-master/tests/MidtransCoreApiTest.php:5
    • > PHP Warning
      require(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/memberpay/vendor/xendit-php-master/examples/TransactionExample.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: midtrans, payment, billing, membership, subscription...

memberpay/memberpay.php 92% from 13 tests

The main PHP script in "MemberPay - Integrate Midtrans Payment Gateway for MemberPress" version 1.3.5 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Requires PHP: The required version number did not match the one declared in readme.txt ("8.1.11" instead of "8.1.9")

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 detected11,029 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP1242,1594,6178,798
Markdown459701,928
JSON310125
JavaScript2361070
YAML49364
XML20044

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity2.48
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity1.27
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces7
Interfaces3
Traits5
Classes73
▷ Abstract classes11.37%
▷ Concrete classes7298.63%
▷ Final classes00.00%
Methods429
▷ Static methods16338.00%
▷ Public methods40594.41%
▷ Protected methods71.63%
▷ Private methods173.96%
Functions40
▷ Named functions3485.00%
▷ Anonymous functions615.00%
Constants59
▷ Global constants711.86%
▷ Class constants5288.14%
▷ Public constants52100.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
No PNG files were detected