64% imoje

Code Review | WooCommerce imoje

WordPress plugin WooCommerce imoje scored64%from 54 tests.

About plugin

  • Plugin page: imoje
  • Plugin version: 3.3.3
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 24, 2021
  • Latest release: Nov 15, 2023
  • Number of updates: 51
  • Update frequency: every 17.8 days
  • Top authors: imoje (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /8,731 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.93MB] [CPU: ▼57.23ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce imoje
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.41 ▼35.53
Dashboard /wp-admin2.09 ▼1.265.32 ▼56.12
Posts /wp-admin/edit.php2.09 ▼1.275.93 ▼37.91
Add New Post /wp-admin/post-new.php2.09 ▼3.806.94 ▼99.36
Media Library /wp-admin/upload.php2.09 ▼1.145.42 ▼28.30

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 92 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce imoje
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6814.32 ▼0.061.82 ▲0.1436.21 ▼7.85
Dashboard /wp-admin2,195 ▲205.62 ▲0.0387.69 ▼27.5139.17 ▼11.84
Posts /wp-admin/edit.php2,100 ▲31.96 ▼0.0737.60 ▼1.2238.33 ▲4.00
Add New Post /wp-admin/post-new.php1,529 ▼723.45 ▲0.41659.01 ▼57.6958.58 ▲3.39
Media Library /wp-admin/upload.php1,403 ▼04.17 ▼0.0196.75 ▼6.4543.28 ▲1.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/imoje/woocommerce-imoje.php+22
    include_once(wp-content/plugins/imoje/includes/libs/Payment-core/vendor/autoload.php): failed to open stream: No such file or directory
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 40× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/imoje/includes/libs/payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Uri\\Retrievers\\AbstractRetriever' not found in wp-content/plugins/imoje/includes/libs/payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/imoje/includes/libs/payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Exception\\RuntimeException' not found in wp-content/plugins/imoje/includes/libs/payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidConfigException.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Exception\\InvalidArgumentException' not found in wp-content/plugins/imoje/includes/libs/payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSourceUriException.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/imoje/includes/class.WCGatewayImoje.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\BaseConstraint' not found in wp-content/plugins/imoje/includes/libs/payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/imoje/includes/libs/payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/imoje/includes/class.WCGatewayImojePbl.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'JsonSchema\\Constraints\\TypeCheck\\TypeCheckInterface' not found in wp-content/plugins/imoje/includes/libs/payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/LooseTypeCheck.php:5

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 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
8 plugin tags: payment gateway, payments, payment, checkout, online payments...

imoje/woocommerce-imoje.php 92% from 13 tests

The main file in "WooCommerce imoje" v. 3.3.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("imoje.php" instead of "woocommerce-imoje.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/imoje/includes/libs/payment-core/vendor/bin/validate-json.bat
7,885 lines of code in 84 files:
LanguageFilesBlank linesComment linesLines of code
PHP731,7062,8226,858
JSON5310467
PO File1100200251
Markdown2730249
SVG20155
DOS Batch1005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity13.98
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces11
Interfaces7
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
Methods329
▷ Static methods7623.10%
▷ Public methods25577.51%
▷ Protected methods4012.16%
▷ Private methods3410.33%
Functions17
▷ Named functions1164.71%
▷ Anonymous functions635.29%
Constants86
▷ Global constants22.33%
▷ Class constants8497.67%
▷ Public constants84100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/pbl.png0.66KB0.97KB0.00%
resources/images/paylater.png4.69KB2.25KB▼ 52.12%
resources/images/cards.png2.15KB1.70KB▼ 20.84%