83% paymaya-checkout-for-woocommerce

Code Review | Maya Business Plugin

WordPress plugin Maya Business Plugin scored83%from 54 tests.

About plugin

  • Plugin page: paymaya-checkout-...
  • Plugin version: 1.1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Oct 5, 2020
  • Latest release: Nov 6, 2023
  • Number of updates: 18
  • Update frequency: every 62.8 days
  • Top authors: paymayapg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /5,793 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.34ms] Passed 4 tests

An overview of server-side resources used by Maya Business Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.27 ▼0.79
Dashboard /wp-admin3.32 ▲0.0250.93 ▼1.69
Posts /wp-admin/edit.php3.38 ▲0.0250.49 ▼1.32
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.64 ▼13.54
Media Library /wp-admin/upload.php3.25 ▲0.0233.56 ▼0.48

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Maya Business Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3514.06 ▼0.651.75 ▲0.0643.87 ▼1.35
Dashboard /wp-admin2,199 ▲225.51 ▼0.1384.35 ▼16.2337.88 ▼6.74
Posts /wp-admin/edit.php2,107 ▲72.01 ▲0.0139.44 ▲2.7436.96 ▲3.08
Add New Post /wp-admin/post-new.php1,533 ▲723.71 ▲0.48670.18 ▼34.7257.97 ▼1.17
Media Library /wp-admin/upload.php1,407 ▲74.19 ▲0.0298.26 ▼19.0641.79 ▼6.62

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/paymaya-checkout-for-woocommerce/views/manual-capture.php:11
    • > PHP Notice
      Undefined variable: authorizationType in wp-content/plugins/paymaya-checkout-for-woocommerce/views/manual-capture.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/paymaya-checkout-for-woocommerce/paymaya-top-level-hooks.php:107

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Contributors: Contributors not specified
Please take inspiration from this readme.txt

paymaya-checkout-for-woocommerce/wc-paymaya-payment-gateway.php 85% from 13 tests

"Maya Business Plugin" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("paymaya-checkout-for-woocommerce.php" instead of "wc-paymaya-payment-gateway.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "5.3.2")

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
There were no executable files found in this plugin1,486 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP53281911,343
JavaScript11410122
Markdown17021

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity53.67
▷ Minimum class complexity7.00
▷ Maximum class complexity146.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods2985.29%
▷ Protected methods00.00%
▷ Private methods514.71%
Functions19
▷ Named functions736.84%
▷ Anonymous functions1263.16%
Constants23
▷ Global constants23100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected