73% maakapay-invoice-payer

Code Review | Maakapay Invoice Payer

WordPress plugin Maakapay Invoice Payer scored 73% from 54 tests.

About plugin

  • Plugin page: maakapay-invoice-...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.8
  • WordPress version: 5.8.1
  • First release: Sep 19, 2021
  • Latest release: Sep 27, 2021
  • Number of updates: 9
  • Update frequency: every 1.1 days
  • Top authors: maakapay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 94 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼143.15ms] Passed 4 tests

A check of server-side resources used by Maakapay Invoice Payer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2236.26 ▲11.54
Dashboard /wp-admin3.17 ▲0.1253.88 ▲3.35
Posts /wp-admin/edit.php3.29 ▲0.1849.35 ▼1.82
Add New Post /wp-admin/post-new.php5.54 ▲0.11102.23 ▼564.94
Media Library /wp-admin/upload.php3.12 ▲0.1138.03 ▼9.17
Dashboard /wp-admin/admin.php?page=maakapay-dashboard3.1333.77
Settings /wp-admin/admin.php?page=maakapay-settings3.1131.84

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 38 new files
Database: 1 new table, 5 new options
New tables
wp_maakapay_transactions_logs
New WordPress options
maakapay_test
maakapay_live
maakapay_admin_mail
maakapay_mode
maakapay_accepting_currencies

Browser metrics Passed 4 tests

Checking browser requirements for Maakapay Invoice Payer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,746 ▲10916.36 ▲0.8511.49 ▼0.8550.55 ▼0.46
Dashboard /wp-admin3,010 ▲796.13 ▲0.01152.07 ▲0.57122.49 ▲0.93
Posts /wp-admin/edit.php2,779 ▲432.74 ▲0.0368.28 ▲3.0790.74 ▼4.33
Add New Post /wp-admin/post-new.php1,646 ▲5521.56 ▲2.75301.68 ▼97.15108.20 ▼23.65
Media Library /wp-admin/upload.php1,850 ▲435.10 ▲0.07158.63 ▲1.29130.27 ▼4.14
Dashboard /wp-admin/admin.php?page=maakapay-dashboard1,2502.3664.5974.84
Settings /wp-admin/admin.php?page=maakapay-settings1,2592.3861.9080.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_maakapay_transactions_logs
  • This plugin does not fully uninstall, leaving 5 options in the database
    • maakapay_live
    • maakapay_admin_mail
    • maakapay_test
    • maakapay_mode
    • maakapay_accepting_currencies

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/maakapay-invoice-payer/admin/partials/maakapay-admin-transaction-detail.php:20
    • > 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/admin/partials/maakapay-wordpress-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/admin/partials/maakapay-wordpress-admin-display.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maakapay-invoice-payer/admin/partials/maakapay-admin-settings.php:35
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/maakapay-invoice-payer/admin/partials/maakapay-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/public/partials/maakapay-public-payment-decline.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/maakapay-invoice-payer/public/partials/maakapay-public-payment-cancel.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/maakapay-invoice-payer/public/partials/maakapay-public-payment-success.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/maakapay-invoice-payer/public/partials/maakapay-public-payment-form.php:15
    • > 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/admin/partials/maakapay-wordpress-admin-display.php on line 15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === maakapay-invoice-payer === )
The official readme.txt is a good inspiration

maakapay-invoice-payer/maakapay-wordpress.php 85% from 13 tests

The principal PHP file in "Maakapay Invoice Payer" v. 1.0.2 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("maakapay-invoice-payer.php" instead of "maakapay-wordpress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,541 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP174316561,290
CSS51614119
JavaScript46513113
SVG10019

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.88
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.38
▷ 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.png69.20KB23.42KB▼ 66.16%
public/img/flags@2x.png170.28KB68.04KB▼ 60.04%