78% zota-for-woocommerce

Code Review | Zota for WooCommerce

WordPress plugin Zota for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: zota-for-woocommerce
  • Plugin version: 1.2.8
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Mar 17, 2021
  • Latest release: Nov 2, 2023
  • Number of updates: 22
  • Update frequency: every 44.5 days
  • Top authors: zotadevs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,459 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.39MB] [CPU: ▲3.26ms] Passed 4 tests

An overview of server-side resources used by Zota for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3744.08 ▲6.10
Dashboard /wp-admin3.74 ▲0.4345.31 ▲0.88
Posts /wp-admin/edit.php3.79 ▲0.4346.56 ▲1.67
Add New Post /wp-admin/post-new.php6.26 ▲0.3794.73 ▲7.75
Media Library /wp-admin/upload.php3.60 ▲0.3736.71 ▲4.38

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 123 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Zota for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.69 ▲1.531.49 ▼2.8937.70 ▼4.14
Dashboard /wp-admin2,195 ▲255.60 ▼0.0784.69 ▼12.7737.11 ▼2.09
Posts /wp-admin/edit.php2,100 ▲32.02 ▲0.0633.92 ▼3.1635.17 ▼2.39
Add New Post /wp-admin/post-new.php1,526 ▼223.66 ▲0.38652.90 ▲36.8655.25 ▼6.78
Media Library /wp-admin/upload.php1,397 ▼04.18 ▼0.0895.63 ▼7.9042.19 ▼0.05

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 6× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/examples/deposit.php
    • > /wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/examples/deposit-cc.php
    • > /wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/examples/orders-report.php
    • > /wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/examples/order-status.php
    • > /wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/examples/payout.php
    • > /wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/examples/merchant-redirect.php
  • 53× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/tests/Zotapay/Exception/InvalidSignatureExceptionTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/tests/Zotapay/Log/DefaultLogHandlerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/tests/Zotapay/DepositApiResponseTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Zotapay\\HttpClient\\HttpClientInterface' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/lib/HttpClient/CurlClient.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/tests/Zotapay/HttpClient/CurlClientTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/tests/Zotapay/PayoutTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Zotapay\\AbstractOrder' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/lib/DepositOrder.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/tests/Zotapay/PayoutOrderTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/tests/Zotapay/DepositCCTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zota-for-woocommerce/vendor/zotapay/php-sdk/tests/Zotapay/OrderStatusApiResponseTest.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Contributors: The plugin contributors field is not present
Please take inspiration from this readme.txt

zota-for-woocommerce/zota-for-woocommerce.php 92% from 13 tests

The primary PHP file in "Zota for WooCommerce" version 1.2.8 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected7,081 lines of code in 112 files:
LanguageFilesBlank linesComment linesLines of code
PHP971,6153,5676,371
JavaScript26870277
YAML4311169
JSON300131
Markdown226068
CSS24033
XML24032

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity5.92
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces8
Interfaces4
Traits1
Classes68
▷ Abstract classes34.41%
▷ Concrete classes6595.59%
▷ Final classes2741.54%
Methods413
▷ Static methods8320.10%
▷ Public methods39094.43%
▷ Protected methods20.48%
▷ Private methods215.08%
Functions16
▷ Named functions1381.25%
▷ Anonymous functions318.75%
Constants25
▷ Global constants936.00%
▷ Class constants1664.00%
▷ Public constants1275.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/img/logo.png10.33KB4.57KB▼ 55.72%
dist/img/icon.png4.29KB2.70KB▼ 37.14%