84% z-credit-webcheckout-for-woo

Code Review | Z-Credit Checkout - WooCommerce Payment Gateway

WordPress plugin Z-Credit Checkout - WooCommerce Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: z-credit-webcheck...
  • Plugin version: 3.7.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 10, 2020
  • Latest release: Nov 14, 2023
  • Number of updates: 55
  • Update frequency: every 20.0 days
  • Top authors: moranium (100%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active /2,647 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.00MB] [CPU: ▼5.36ms] Passed 4 tests

Analyzing server-side resources used by Z-Credit Checkout - WooCommerce Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.57 ▲2.37
Dashboard /wp-admin3.32 ▼0.0346.41 ▼15.15
Posts /wp-admin/edit.php3.37 ▲0.0154.45 ▲9.40
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.60 ▼7.65
Media Library /wp-admin/upload.php3.24 ▲0.0133.40 ▼1.00

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

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

Browser metrics Passed 4 tests

Z-Credit Checkout - WooCommerce Payment Gateway: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲2214.23 ▼0.031.72 ▼0.0344.78 ▲1.43
Dashboard /wp-admin2,202 ▲275.67 ▼0.0590.51 ▼18.3838.91 ▼2.69
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0644.10 ▲6.5235.53 ▼2.02
Add New Post /wp-admin/post-new.php1,530 ▲423.32 ▲0.23702.92 ▲3.8751.21 ▼15.69
Media Library /wp-admin/upload.php1,401 ▼24.35 ▲0.16100.51 ▼14.5642.05 ▼8.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • 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
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/z-credit-webcheckout-for-woo/woocommerce-zcredit-checkout.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

z-credit-webcheckout-for-woo/woocommerce-zcredit-checkout.php 92% from 13 tests

The principal PHP file in "Z-Credit Checkout - WooCommerce Payment Gateway" v. 3.7.5 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("z-credit-webcheckout-for-woo.php" instead of "woocommerce-zcredit-checkout.php")

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
Success! There were no dangerous files found in this plugin1,622 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP21831611,118
PO File1108141244
JavaScript12626184
CSS212076

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity69.00
▷ Minimum class complexity32.00
▷ Maximum class complexity106.00
Average method complexity5.86
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods28
▷ Static methods517.86%
▷ Public methods1967.86%
▷ Protected methods13.57%
▷ Private methods828.57%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.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.01MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Logo.png5.61KB2.61KB▼ 53.44%
images/payment_icon.png6.24KB2.55KB▼ 59.18%
images/splash_bg.png0.94KB0.11KB▼ 88.19%
images/pattern.png0.99KB0.10KB▼ 89.59%