83% mootapay-for-woocommerce

Code Review | Mootapay For Woocommerce

WordPress plugin Mootapay For Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: mootapay-for-wooc...
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 3, 2022
  • Latest release: Mar 21, 2023
  • Number of updates: 10
  • Update frequency: every 17.1 days
  • Top authors: mootapay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /332 total downloads

Benchmarks

Plugin footprint 83% 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: ▼0.60ms] Passed 4 tests

An overview of server-side resources used by Mootapay For Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1439.60 ▼3.59
Dashboard /wp-admin3.44 ▲0.1344.21 ▼3.21
Posts /wp-admin/edit.php3.55 ▲0.1946.76 ▲1.67
Add New Post /wp-admin/post-new.php6.02 ▲0.1392.05 ▲5.72
Media Library /wp-admin/upload.php3.36 ▲0.1338.03 ▲2.72

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Mootapay For Woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5814.48 ▼0.321.74 ▼0.6543.66 ▼1.90
Dashboard /wp-admin2,216 ▲284.84 ▼1.0597.80 ▼9.4540.67 ▼4.36
Posts /wp-admin/edit.php2,105 ▲162.03 ▲0.0240.53 ▲5.5937.04 ▲4.49
Add New Post /wp-admin/post-new.php1,522 ▲317.62 ▼5.53638.94 ▼52.1560.72 ▲2.35
Media Library /wp-admin/upload.php1,395 ▲44.27 ▲0.0799.54 ▼1.2546.24 ▲2.23

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
  • 156× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/mootapay-for-woocommerce/vendor/tightenco/collect/tests/Support/SupportCarbonTest.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/mootapay-for-woocommerce/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Spatie\\DataTransferObject\\DataTransferObject' not found in wp-content/plugins/mootapay-for-woocommerce/vendor/mootaco/moota-php-sdk/src/DTO/Auth/ScopesData.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Spatie\\DataTransferObject\\DataTransferObject' not found in wp-content/plugins/mootapay-for-woocommerce/vendor/mootaco/moota-php-sdk/src/DTO/User/UserUpdateData.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Spatie\\DataTransferObject\\DataTransferObject' not found in wp-content/plugins/mootapay-for-woocommerce/vendor/mootaco/moota-php-sdk/src/DTO/Mutation/MutationUpdateTaggingData.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Finder\\Finder' not found in wp-content/plugins/mootapay-for-woocommerce/vendor/spatie/data-transfer-object/.php-cs-fixer.dist.php:3
    • > PHP Fatal error
      Trait 'Illuminate\\Support\\Traits\\Macroable' not found in wp-content/plugins/mootapay-for-woocommerce/vendor/kitetail/zttp/src/Zttp.php on line 264
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/mootapay-for-woocommerce/vendor/tightenco/collect/tests/Support/SupportCollectionTest.php:16
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/mootapay-for-woocommerce/vendor/tightenco/collect/stubs/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/mootapay-for-woocommerce/vendor/tightenco/collect/stubs/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/mootapay-for-woocommerce/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

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
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (/assets/mootapay-checkout.png)
You can look at the official readme.txt

mootapay-for-woocommerce/mootapay-woocommerce.php 85% from 13 tests

The main PHP script in "Mootapay For Woocommerce" version 2.0.3 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mootapay-for-woocommerce.php" instead of "mootapay-woocommerce.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin53,856 lines of code in 418 files:
LanguageFilesBlank linesComment linesLines of code
PHP3175,9259,28946,299
Markdown281,67004,886
JSON55202,007
Bourne Shell18573245
YAML11503192
CSS260167
XML20040
Dockerfile18010
JavaScript10010

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity12.12
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces64
Interfaces25
Traits4
Classes255
▷ Abstract classes31.18%
▷ Concrete classes25298.82%
▷ Final classes3212.70%
Methods1,810
▷ Static methods42023.20%
▷ Public methods1,57687.07%
▷ Protected methods341.88%
▷ Private methods20011.05%
Functions475
▷ Named functions17035.79%
▷ Anonymous functions30564.21%
Constants294
▷ Global constants8227.89%
▷ Class constants21272.11%
▷ Public constants19290.57%

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.36MB with 0.18MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/mootapay-checkout.png133.54KB47.89KB▼ 64.13%
vendor/mootaco/moota-php-sdk/tests/Mocking/img/moota-php-sdk.png195.27KB59.72KB▼ 69.42%
vendor/tightenco/collect/collect-logo.png17.89KB16.65KB▼ 6.92%
vendor/mootaco/moota-php-sdk/tests/Mocking/img/logo-icon.png18.84KB6.58KB▼ 65.07%