79% customer-loyalty-for-woocommerce

Code Review | Customer Loyalty for WooCommerce

WordPress plugin Customer Loyalty for WooCommerce scored79%from 54 tests.

About plugin

  • Plugin page: customer-loyalty-...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9.2
  • WordPress version: 6.3.1
  • First release: Jul 10, 2019
  • Latest release: Apr 20, 2022
  • Number of updates: 12
  • Update frequency: every 84.6 days
  • Top authors: deviodigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,401 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
Install script ran successfully

Server metrics [RAM: ▼0.27MB] [CPU: ▼21.05ms] Passed 4 tests

Analyzing server-side resources used by Customer Loyalty for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.55 ▼9.25
Dashboard /wp-admin3.36 ▲0.0644.66 ▼3.85
Posts /wp-admin/edit.php3.39 ▲0.0342.06 ▼11.39
Add New Post /wp-admin/post-new.php4.69 ▼1.2041.88 ▼59.72
Media Library /wp-admin/upload.php3.32 ▲0.0935.54 ▼1.72

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
clwc_loyalty_points
recovery_mode_email_last_sent
can_compress_scripts
widget_theysaidso_widget
clwc_rewards_card

Browser metrics Passed 4 tests

A check of browser resources used by Customer Loyalty for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,650 ▼1,1363.60 ▼10.681.07 ▼1.0310.04 ▼38.32
Dashboard /wp-admin1,271 ▼9091.71 ▼3.9624.25 ▼73.3735.89 ▼10.64
Posts /wp-admin/edit.php1,113 ▼9841.68 ▼0.2910.80 ▼27.6227.95 ▼4.79
Add New Post /wp-admin/post-new.php45 ▼1,4810.42 ▼23.080.09 ▼711.0111.97 ▼42.37
Media Library /wp-admin/upload.php1,406 ▲64.23 ▲0.10106.77 ▼9.9451.54 ▲3.38

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • clwc_loyalty_points
    • clwc_rewards_card
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/customer-loyalty-for-woocommerce/public/partials/clwc-public-display.php
    • > /wp-content/plugins/customer-loyalty-for-woocommerce/admin/partials/clwc-admin-display.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/customer-loyalty-for-woocommerce/admin/clwc-admin-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/customer-loyalty-for-woocommerce/customer-loyalty-for-woocommerce.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/customer-loyalty-for-woocommerce/admin/class-clwc-osa.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/customer-loyalty-for-woocommerce/uninstall.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/customer-loyalty-for-woocommerce/admin/clwc-woocommerce-account-tab.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/customer-loyalty-for-woocommerce/includes/clwc-helper-functions.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/customer-loyalty-for-woocommerce/admin/clwc-woocommerce-endpoint-shortcode.php:292
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/customer-loyalty-for-woocommerce/admin/clwc-woocommerce-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/customer-loyalty-for-woocommerce/admin/clwc-earning-loyalty-points.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/customer-loyalty-for-woocommerce/admin/clwc-user-fields.php:48

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 Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: loyalty, gift, customer, woocommerce, rewards

customer-loyalty-for-woocommerce/customer-loyalty-for-woocommerce.php Passed 13 tests

The main PHP file in "Customer Loyalty for WooCommerce" ver. 1.3.0 adds more information about the plugin and also serves as the entry point for this plugin
89 characters long description:
Increase customer loyalty by rewarding your customers for their repeat purchase behavior.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,942 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP204891,2071,363
PO File3193212514
CSS313738
Markdown113021
JavaScript24546

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.88
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods55
▷ Static methods23.64%
▷ Public methods5090.91%
▷ Protected methods00.00%
▷ Private methods59.09%
Functions37
▷ Named functions3594.59%
▷ Anonymous functions25.41%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected