83% zoodpay

Code Review | Zoodpay Buy Now Pay Later For WooCommerce

WordPress plugin Zoodpay Buy Now Pay Later For WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: zoodpay
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0+
  • WordPress version: 6.3.1
  • First release: Mar 12, 2021
  • Latest release: Jul 7, 2022
  • Number of updates: 16
  • Update frequency: every 30.1 days
  • Top authors: zoodpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /925 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.28ms] Passed 4 tests

An overview of server-side resources used by Zoodpay Buy Now Pay Later For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1146.23 ▼1.28
Dashboard /wp-admin3.41 ▲0.1148.07 ▼1.98
Posts /wp-admin/edit.php3.53 ▲0.1749.44 ▼0.12
Add New Post /wp-admin/post-new.php6.00 ▲0.1194.88 ▲2.27
Media Library /wp-admin/upload.php3.34 ▲0.1040.64 ▲5.58

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Zoodpay Buy Now Pay Later For WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4214.14 ▼0.131.58 ▼0.1444.79 ▼3.37
Dashboard /wp-admin2,209 ▲295.65 ▼0.0184.14 ▼13.0043.97 ▼1.24
Posts /wp-admin/edit.php2,115 ▲152.01 ▲0.0438.89 ▲2.8533.71 ▼9.39
Add New Post /wp-admin/post-new.php1,535 ▲923.28 ▼0.14608.01 ▼83.0255.20 ▼0.16
Media Library /wp-admin/upload.php1,411 ▲114.21 ▲0.0298.14 ▼9.9244.87 ▼2.09

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/zoodpay/ZD_add_setting_page.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/zoodpay/zoodpay.php:21

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Requires php: Invalid version format
  • Tested up to: Invalid version format
You can look at the official readme.txt

zoodpay/zoodpay.php 92% from 13 tests

The main file in "Zoodpay Buy Now Pay Later For WooCommerce" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.4" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected2,166 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP2699671,344
PO File5253270565
Markdown41480209
CSS13331
JavaScript23017

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity83.00
▷ Minimum class complexity83.00
▷ Maximum class complexity83.00
Average method complexity5.32
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
6 PNG files occupy 0.46MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assest/img/pg.png6.39KB1.42KB▼ 77.77%
doc-assets/wp_wc_setting.png145.32KB50.30KB▼ 65.39%
assest/img/success.png1.16KB0.26KB▼ 77.48%
doc-assets/wp_admin.png26.75KB9.43KB▼ 64.74%
doc-assets/wp_fill_information.png103.64KB37.38KB▼ 63.93%