84% wc-innocard-loyalty-integration

Code Review | Innocard Loyalty Integration for WooCommerce

WordPress plugin Innocard Loyalty Integration for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: wc-innocard-loyal...
  • Plugin version: 6.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: Mar 21, 2023
  • Latest release: Sep 21, 2023
  • Number of updates: 16
  • Update frequency: every 11.5 days
  • Top authors: loyaltyag (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,248 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.11MB] [CPU: ▼7.15ms] Passed 4 tests

This is a short check of server-side resources used by Innocard Loyalty Integration for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1343.29 ▲2.55
Dashboard /wp-admin3.42 ▲0.0854.08 ▼12.30
Posts /wp-admin/edit.php3.54 ▲0.1851.03 ▼2.83
Add New Post /wp-admin/post-new.php6.01 ▲0.1287.97 ▼16.03
Media Library /wp-admin/upload.php3.35 ▲0.1242.37 ▲2.91

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Innocard Loyalty Integration for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14014.43 ▲0.052.14 ▲0.3043.58 ▼0.20
Dashboard /wp-admin2,303 ▲1235.57 ▼0.0391.24 ▼0.8575.78 ▲30.49
Posts /wp-admin/edit.php2,202 ▲1021.97 ▲0.0139.12 ▼2.3337.47 ▲2.54
Add New Post /wp-admin/post-new.php1,630 ▲10422.99 ▼0.49783.90 ▲160.3358.46 ▲6.37
Media Library /wp-admin/upload.php1,496 ▲964.15 ▼0.09115.83 ▲6.7876.36 ▲32.44

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'WC_INNOCARD_PLUGIN_DIRincludes/WC_Innocard_Admin_Settings.php' (include_path='.:/usr/share/php') in wp-content/plugins/wc-innocard-loyalty-integration/includes/admin.php on line 3
    • > PHP Warning
      require_once(WC_INNOCARD_PLUGIN_DIRincludes/WC_Innocard_Admin_Settings.php): failed to open stream: No such file or directory in wp-content/plugins/wc-innocard-loyalty-integration/includes/admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-innocard-loyalty-integration/includes/api.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WC() in wp-content/plugins/wc-innocard-loyalty-integration/includes/checkout_form_fields.php:3
    • > PHP Warning
      require(WC_INNOCARD_PLUGIN_DIR/includes/checkout_form_fields.php): failed to open stream: No such file or directory in wp-content/plugins/wc-innocard-loyalty-integration/templates/form.php on line 2
    • > PHP Fatal error
      require(): Failed opening required 'WC_INNOCARD_PLUGIN_DIR/includes/checkout_form_fields.php' (include_path='.:/usr/share/php') in wp-content/plugins/wc-innocard-loyalty-integration/templates/form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-innocard-loyalty-integration/includes/i18n.php:6
    • > PHP Warning
      Use of undefined constant WC_INNOCARD_PLUGIN_DIR - assumed 'WC_INNOCARD_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-innocard-loyalty-integration/includes/admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wc-innocard-loyalty-integration/templates/admin/views/labels.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wc-innocard-loyalty-integration/templates/admin/views/settings.php:1

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 errors were detected

Optimizations

Plugin configuration 93% 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
5 plugin tags: woocommerce, integration, innocard, fidelity, loyalty

wc-innocard-loyalty-integration/wc-innocard-integration.php 85% from 13 tests

"Innocard Loyalty Integration for WooCommerce" version 6.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-innocard-loyalty-integration.php" instead of "wc-innocard-integration.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,319 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP202821521,071
JavaScript15216152
Markdown125059
CSS22034
SVG1003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity5.67
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2589.29%
▷ Protected methods00.00%
▷ Private methods310.71%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.19MB with 0.13MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/loyalty512.png99.45KB24.34KB▼ 75.53%
assets/screenshot-3.png22.51KB7.52KB▼ 66.60%
assets/screenshot-2.png45.42KB15.12KB▼ 66.71%
assets/screenshot-1.png25.76KB8.91KB▼ 65.43%