83% lunar-payments-for-woocommerce

Code Review | Lunar Online Payments for WooCommerce

WordPress plugin Lunar Online Payments for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: lunar-payments-fo...
  • Plugin version: 4.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Feb 23, 2022
  • Latest release: Nov 6, 2023
  • Number of updates: 78
  • Update frequency: every 8.2 days
  • Top authors: lunarlbt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /3,821 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼1.69ms] Passed 4 tests

A check of server-side resources used by Lunar Online Payments for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1642.45 ▲1.05
Dashboard /wp-admin3.57 ▲0.2768.70 ▲17.16
Posts /wp-admin/edit.php3.61 ▲0.2544.29 ▼2.89
Add New Post /wp-admin/post-new.php6.08 ▲0.1993.12 ▼2.53
Media Library /wp-admin/upload.php3.42 ▲0.1933.19 ▼2.37

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Lunar Online Payments for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3114.28 ▼0.031.93 ▲0.1945.57 ▼1.09
Dashboard /wp-admin2,198 ▲245.58 ▼0.0287.49 ▼8.6041.11 ▼3.39
Posts /wp-admin/edit.php2,103 ▲61.94 ▼0.0236.13 ▼3.0135.15 ▼0.00
Add New Post /wp-admin/post-new.php1,529 ▼1023.57 ▲0.41688.12 ▼73.7064.84 ▲6.31
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.06100.06 ▼2.2943.59 ▼4.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 33× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Tests\\BaseTest' not found in wp-content/plugins/lunar-payments-for-woocommerce/vendor/paylike/php-api/tests/CurrenciesTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Exception\\ApiException' not found in wp-content/plugins/lunar-payments-for-woocommerce/vendor/paylike/php-api/src/Exception/InvalidRequest.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lunar-payments-for-woocommerce/templates/receipt.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lunar-payments-for-woocommerce/templates/receipt-mobilepay.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'Paylike\\HttpClient\\HttpClientInterface' not found in wp-content/plugins/lunar-payments-for-woocommerce/vendor/paylike/php-api/src/HttpClient/CurlClient.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Endpoint\\Endpoint' not found in wp-content/plugins/lunar-payments-for-woocommerce/vendor/paylike/php-api/src/Endpoint/Merchant/Lines.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Lunar\\Tests\\BaseTest' not found in wp-content/plugins/lunar-payments-for-woocommerce/vendor/lunar/payments-api-sdk/tests/PaymentsTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Endpoint\\Endpoint' not found in wp-content/plugins/lunar-payments-for-woocommerce/vendor/paylike/php-api/src/Endpoint/Merchants.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Lunar\\Exception\\ApiException' not found in wp-content/plugins/lunar-payments-for-woocommerce/vendor/lunar/payments-api-sdk/src/Exception/ApiConnection.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Endpoint\\Endpoint' not found in wp-content/plugins/lunar-payments-for-woocommerce/vendor/paylike/php-api/src/Endpoint/Merchant/Apps.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: lunar, multisite, gateway, woocommerce, credit card

lunar-payments-for-woocommerce/lunar-payments-for-woocommerce.php 85% from 13 tests

The primary PHP file in "Lunar Online Payments for WooCommerce" version 4.0.6 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 149 characters long)
  • Requires at least: The required version number must match the one declared in readme.txt ("4.4" instead of "3.0")

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 plugin10,677 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
PHP781,4662,4878,660
PO File3317421998
JavaScript39250596
Markdown3710224
JSON300153
XML32037
YAML1105
SVG4004

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity12.85
▷ Minimum class complexity1.00
▷ Maximum class complexity126.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces18
Interfaces2
Traits3
Classes57
▷ Abstract classes47.02%
▷ Concrete classes5392.98%
▷ Final classes00.00%
Methods421
▷ Static methods307.13%
▷ Public methods32978.15%
▷ Protected methods255.94%
▷ Private methods6715.91%
Functions16
▷ Named functions1168.75%
▷ Anonymous functions531.25%
Constants14
▷ Global constants964.29%
▷ Class constants535.71%
▷ Public constants5100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.56MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-4.png28.57KB9.38KB▼ 67.18%
assets/images/paylike.png6.17KB3.30KB▼ 46.51%
assets/screenshot-1.png83.02KB26.01KB▼ 68.67%
assets/screenshot-3.png69.82KB21.37KB▼ 69.39%
assets/icon-128x128.png6.29KB2.98KB▼ 52.56%