78% store-credit-for-woocommerce

Code Review | Store credit / Gift cards for woocommerce

WordPress plugin Store credit / Gift cards for woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: store-credit-for-...
  • Plugin version: 1.0.42
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4.0
  • WordPress version: 6.3.1
  • First release: Dec 28, 2022
  • Latest release: Nov 21, 2023
  • Number of updates: 42
  • Update frequency: every 7.8 days
  • Top authors: rajeshsingh520 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

80+ active /2,951 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.41ms] Passed 4 tests

Analyzing server-side resources used by Store credit / Gift cards for woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.15 ▼0.92
Dashboard /wp-admin3.31 ▲0.0147.24 ▼3.83
Posts /wp-admin/edit.php3.36 ▲0.0147.69 ▼3.70
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.18 ▲2.81
Media Library /wp-admin/upload.php3.24 ▲0.0138.97 ▲7.81

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Store credit / Gift cards for woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3414.70 ▲0.491.91 ▲0.0138.06 ▼7.64
Dashboard /wp-admin2,198 ▲245.61 ▲0.0888.32 ▼11.9941.23 ▼4.65
Posts /wp-admin/edit.php2,110 ▲71.97 ▼0.0440.82 ▲2.8134.81 ▼4.16
Add New Post /wp-admin/post-new.php1,532 ▲623.13 ▼0.16592.15 ▼81.6160.13 ▲2.75
Media Library /wp-admin/upload.php1,403 ▲64.27 ▲0.1898.15 ▼6.7743.52 ▼2.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/store-credit-for-woocommerce/public/partials/email/email-content.php
    • > /wp-content/plugins/store-credit-for-woocommerce/includes/pisol.class.form.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/store-credit-for-woocommerce/admin/setting.php:73
    • > PHP Notice
      Undefined variable: top_desc in wp-content/plugins/store-credit-for-woocommerce/public/partials/email/email-content.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/store-credit-for-woocommerce/public/class-reminder-email.php:153
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/store-credit-for-woocommerce/public/class-email.php:169
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/store-credit-for-woocommerce/public/class-disable-other-fields.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function woocommerce_wp_text_input() in wp-content/plugins/store-credit-for-woocommerce/admin/partials/data-panel.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/store-credit-for-woocommerce/public/class-my-account.php:18
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/store-credit-for-woocommerce/admin/plugins.php:95
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/store-credit-for-woocommerce/public/class-reminder-email-scheduler.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/store-credit-for-woocommerce/public/partials/store-credit.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #10, #11, #12, #13, #14, #16, #17, #19, #2, #20, #3, #4, #6, #7, #9 in store-credit-for-woocommerce/assets to your readme.txt
You can look at the official readme.txt

store-credit-for-woocommerce/store-credit-for-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "Store credit / Gift cards for woocommerce" version 1.0.42
18 characters long description:
Offer store credit

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
Everything looks great! No dangerous files found in this plugin14,300 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
CSS32,103299,674
PHP418756982,759
SVG2221,621
JavaScript2330236
XML10010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity13.04
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes00.00%
Methods208
▷ Static methods4722.60%
▷ Public methods19191.83%
▷ Protected methods104.81%
▷ Private methods73.37%
Functions10
▷ Named functions550.00%
▷ Anonymous functions550.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin