77% omise

Code Review | Opn Payments

WordPress plugin Opn Payments scored77%from 54 tests.

About plugin

  • Plugin page: omise
  • Plugin version: 5.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.4-6.4.0
  • WordPress version: 6.3.1
  • First release: Sep 21, 2016
  • Latest release: Nov 16, 2023
  • Number of updates: 135
  • Update frequency: every 20.2 days
  • Top authors: omise (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /80,114 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.01MB] [CPU: ▼3.03ms] Passed 4 tests

An overview of server-side resources used by Opn Payments
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0132.64 ▼6.23
Dashboard /wp-admin3.31 ▲0.0143.69 ▼5.66
Posts /wp-admin/edit.php3.36 ▲0.0150.11 ▲3.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0196.95 ▼3.22
Media Library /wp-admin/upload.php3.23 ▲0.0034.82 ▲3.00

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 234 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Opn Payments
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.321.94 ▲0.2340.30 ▼4.04
Dashboard /wp-admin2,192 ▲185.68 ▲0.1091.40 ▼8.0542.68 ▲0.62
Posts /wp-admin/edit.php2,100 ▲31.95 ▲0.0040.31 ▲3.6434.36 ▼0.70
Add New Post /wp-admin/post-new.php1,526 ▼023.69 ▲0.39620.31 ▼33.7948.48 ▼2.97
Media Library /wp-admin/upload.php1,400 ▼34.15 ▼0.0097.41 ▼5.0743.04 ▼0.26

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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
  • 43× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/omise/includes/gateway/class-omise-payment-creditcard.php
    • > /wp-content/plugins/omise/includes/gateway/class-omise-payment-alipayplus.php
    • > /wp-content/plugins/omise/includes/gateway/class-omise-payment-googlepay.php
    • > /wp-content/plugins/omise/includes/gateway/class-omise-payment-billpayment-tesco.php
    • > /wp-content/plugins/omise/includes/gateway/abstract-omise-payment-base-card.php
    • > /wp-content/plugins/omise/includes/classes/class-omise-customer.php
    • > /wp-content/plugins/omise/includes/gateway/class-omise-payment-internetbanking.php
    • > /wp-content/plugins/omise/includes/gateway/class-omise-payment-konbini.php
    • > /wp-content/plugins/omise/includes/gateway/class-omise-payment-touch-n-go.php
    • > /wp-content/plugins/omise/includes/class-omise-rest-webhooks-controller.php
  • 89× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'OmiseApiResource' not found in wp-content/plugins/omise/includes/libraries/omise-php/lib/omise/OmiseLink.php:3
    • > PHP Notice
      Undefined variable: viewData in wp-content/plugins/omise/templates/payment/form.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'OmiseApiResource' not found in wp-content/plugins/omise/includes/libraries/omise-php/lib/omise/OmiseCustomer.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/omise/tests/unit/includes/gateway/class-omise-payment-creditcard-test.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'OmiseApiResource' not found in wp-content/plugins/omise/includes/libraries/omise-php/lib/omise/OmiseOccurrence.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/omise/tests/unit/includes/class-omise-money-test.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/omise/tests/unit/includes/class-omise-localization-test.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/omise/tests/unit/includes/gateway/bootstrap-test-setup.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/omise/tests/unit/includes/gateway/bootstrap-test-setup.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'OmiseApiResource' not found in wp-content/plugins/omise/includes/libraries/omise-php/lib/omise/OmiseRefund.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
Please take inspiration from this readme.txt

omise/omise-woocommerce.php 77% from 13 tests

The main file in "Opn Payments" v. 5.6.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.3.1" instead of "3.3.4")
  • Main file name: Name the main plugin file the same as the plugin slug ("omise.php" instead of "omise-woocommerce.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 164 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin11,799 lines of code in 201 files:
LanguageFilesBlank linesComment linesLines of code
PHP1461,7653,2918,965
JavaScript1011637774
CSS314057662
Markdown43320652
SVG3524414
PO File1137163291
XML10027
JSON10014

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.11
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits2
Classes147
▷ Abstract classes85.44%
▷ Concrete classes13994.56%
▷ Final classes00.00%
Methods697
▷ Static methods14821.23%
▷ Public methods59385.08%
▷ Protected methods365.16%
▷ Private methods689.76%
Functions14
▷ Named functions428.57%
▷ Anonymous functions1071.43%
Constants66
▷ Global constants1319.70%
▷ Class constants5380.30%
▷ Public constants53100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
20 PNG files occupy 1.46MB with 0.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/paypay.png1.58KB1.56KB▼ 1.24%
assets/images/bbl-m.png6.93KB3.61KB▼ 47.89%
assets/screenshot-2.png417.89KB87.76KB▼ 79.00%
assets/images/touch-n-go.png11.13KB5.47KB▼ 50.91%
assets/images/ocbc-pao.png9.78KB4.69KB▼ 52.06%