73% multibanco-e-ou-payshop-by-lusopay

Code Review | Multibanco / MB Way / Transferência Simplificada / Payshop (by LUSOPAY) for WooCommerce

WordPress plugin Multibanco / MB Way / Transferência Simplificada / Payshop (by LUSOPAY) for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: multibanco-e-ou-p...
  • Plugin version: 3.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 23, 2015
  • Latest release: Oct 4, 2023
  • Number of updates: 138
  • Update frequency: every 22.6 days
  • Top authors: lusopay (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active /9,303 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: ▼1.92MB] [CPU: ▼49.69ms] Passed 4 tests

Server-side resources used by Multibanco / MB Way / Transferência Simplificada / Payshop (by LUSOPAY) for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.395.29 ▼29.81
Dashboard /wp-admin2.09 ▼1.215.90 ▼42.57
Posts /wp-admin/edit.php2.09 ▼1.265.81 ▼38.35
Add New Post /wp-admin/post-new.php2.09 ▼3.795.69 ▼87.02
Media Library /wp-admin/upload.php2.09 ▼1.146.82 ▼30.80

Server storage [IO: ▲0.28MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Multibanco / MB Way / Transferência Simplificada / Payshop (by LUSOPAY) for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4214.36 ▲0.001.66 ▲0.0342.70 ▲3.85
Dashboard /wp-admin2,206 ▲255.73 ▲0.0880.76 ▼21.0239.98 ▼2.77
Posts /wp-admin/edit.php2,115 ▲152.02 ▲0.0535.04 ▼4.0538.17 ▲1.77
Add New Post /wp-admin/post-new.php1,535 ▲123.00 ▲4.77636.03 ▲1.4256.01 ▼7.34
Media Library /wp-admin/upload.php1,408 ▲114.29 ▲0.0696.39 ▼36.7940.51 ▼12.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/multibanco-e-ou-payshop-by-lusopay/multibanco-e-ou-payshop-by-lusopay.php+40
    in_array() expects parameter 2 to be array, bool given
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/multibanco-e-ou-payshop-by-lusopay/includes/views/html-admin-page-mbway.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order_Lusopay' not found in wp-content/plugins/multibanco-e-ou-payshop-by-lusopay/includes/views/order-meta-box.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Integration' not found in wp-content/plugins/multibanco-e-ou-payshop-by-lusopay/includes/class-wc-lusopay-integration.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/multibanco-e-ou-payshop-by-lusopay/includes/views/html-admin-page-pisp.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/multibanco-e-ou-payshop-by-lusopay/includes/views/html-admin-page-mb-ps.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

multibanco-e-ou-payshop-by-lusopay/multibanco-e-ou-payshop-by-lusopay.php 85% from 13 tests

The entry point to "Multibanco / MB Way / Transferência Simplificada / Payshop (by LUSOPAY) for WooCommerce" version 3.0.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 340 characters long)

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 plugin3,755 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP117761,2643,166
PO File1177266570
JavaScript172419

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity56.86
▷ Minimum class complexity8.00
▷ Maximum class complexity108.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods168
▷ Static methods10.60%
▷ Public methods16598.21%
▷ Protected methods00.00%
▷ Private methods31.79%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
imagens/MB.png8.32KB3.89KB▼ 53.26%
imagens/multibanco_icon.png2.50KB0.72KB▼ 71.29%
imagens/pisp_icon.png1.32KB1.20KB▼ 9.06%
imagens/payshop_icon.png3.64KB1.89KB▼ 48.11%