84% maakapay-invoice-payer-for-woocommerce

Code Review | Maakapay Invoice Payer for Woocommerce

WordPress plugin Maakapay Invoice Payer for Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: maakapay-invoice-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0
  • WordPress version: 6.3.1
  • First release: Sep 25, 2021
  • Latest release: Jun 21, 2022
  • Number of updates: 7
  • Update frequency: every 38.4 days
  • Top authors: maakapay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /331 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Analyzing server-side resources used by Maakapay Invoice Payer for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.71 ▼9.35
Dashboard /wp-admin3.31 ▼0.0844.31 ▼453.09
Posts /wp-admin/edit.php3.36 ▲0.0045.17 ▼4.66
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.71 ▲3.73
Media Library /wp-admin/upload.php3.23 ▲0.0034.64 ▼1.72

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Maakapay Invoice Payer for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.67 ▼0.711.89 ▲0.1146.48 ▲5.72
Dashboard /wp-admin2,203 ▲125.83 ▲0.9396.63 ▼5.3238.34 ▼2.47
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0239.19 ▼1.6035.09 ▲0.76
Add New Post /wp-admin/post-new.php1,533 ▲1423.15 ▼0.05591.59 ▼103.3448.40 ▼4.35
Media Library /wp-admin/upload.php1,382 ▼64.21 ▲0.0194.38 ▼14.9041.18 ▲0.41

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • 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 no errors were found, this is by no means 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
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/public/partials/maakapay-invoice-payer-for-woocommerce-public-payment-decline.php:15
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/admin/partials/maakapay-invoice-payer-for-woocommerce-admin-transaction-detail.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/public/partials/maakapay-invoice-payer-for-woocommerce-public-payment-form.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/admin/partials/maakapay-invoice-payer-for-woocommerce-admin-settings.php:35
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/admin/partials/maakapay-invoice-payer-for-woocommerce-admin-display.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/public/partials/maakapay-invoice-payer-for-woocommerce-public-payment-cancel.php:15
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/admin/partials/maakapay-invoice-payer-for-woocommerce-admin-display.php on line 15
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/admin/partials/maakapay-invoice-payer-for-woocommerce-admin-display.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/admin/partials/maakapay-invoice-payer-for-woocommerce-admin-transaction-detail.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/maakapay-invoice-payer-for-woocommerce/public/partials/maakapay-invoice-payer-for-woocommerce-public-payment-success.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: nabil bank payment gateway, nabil bank, payment gateway, npr payment gateway, maakapay...

maakapay-invoice-payer-for-woocommerce/maakapay-invoice-payer-for-woocommerce.php 92% from 13 tests

"Maakapay Invoice Payer for Woocommerce" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,585 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP174476561,329
CSS51613119
JavaScript46513118
SVG10019

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity13.38
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity3.48
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods40
▷ Static methods37.50%
▷ Public methods3587.50%
▷ Protected methods00.00%
▷ Private methods512.50%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.23MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/flags@2x.png170.28KB68.04KB▼ 60.04%
public/img/flags.png69.20KB23.42KB▼ 66.16%