58% woorewards

Code Review | MyRewards - Loyalty Points and Rewards Program for WooCommerce

WordPress plugin MyRewards - Loyalty Points and Rewards Program for WooCommerce scored 58% from 54 tests.

About plugin

  • Plugin page: woorewards
  • Plugin version: 4.9.0
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-5.9
  • WordPress version: 5.9.2
  • First release: Oct 24, 2017
  • Latest release: Mar 22, 2022
  • Number of updates: 201
  • Update frequency: every 8.0 days
  • Top authors: lwsdevelopers (100%)

Code review

54 tests

User reviews

48 reviews

Install metrics

5,000+ active / 97,123 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲3.25MB] [CPU: ▼278.37ms] Passed 4 tests

Analyzing server-side resources used by MyRewards - Loyalty Points and Rewards Program for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.89 ▲2.3767.56 ▲17.53
Dashboard /wp-admin7.00 ▲3.5954.45 ▲23.34
Posts /wp-admin/edit.php7.22 ▲3.5858.49 ▲21.18
Add New Post /wp-admin/post-new.php10.45 ▲3.48112.27 ▼1,170.32
Media Library /wp-admin/upload.php6.88 ▲3.5843.31 ▲18.13
System /wp-admin/admin.php?page=woorewards.system7.0948.52
MyRewards /wp-admin/admin.php?page=woorewards7.0249.87
Features /wp-admin/admin.php?page=woorewards.settings7.2250.17
Appearance /wp-admin/admin.php?page=woorewards.appearance7.1852.00
Wizard /wp-admin/admin.php?page=lwswizard-woorewards7.4449.76
Points and Rewards /wp-admin/admin.php?page=woorewards.loyalty7.0552.74
Pro Version /wp-admin/admin.php?page=woorewards-proversion7.0747.71
Customers /wp-admin/admin.php?page=woorewards.customers7.1849.83

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 310 new files
Database: 2 new tables, 13 new options
New tables
wp_lws_wr_achieved_log
wp_lws_wr_historic
New WordPress options
lws_mail_woorewards_attribute_footer
lws_woorewards_redirect_to_licence
lws_mail_template_wr_new_reward
lws_woorewards_cart_content_side
lws_woorewards_version
lws_woorewards_install_version
lws_woorewards_ignore_woocommerce_disable_coupons
lws_mail_title_wr_new_reward
lws_woorewards_points_distribution_status
woocommerce_enable_coupons
...

Browser metrics Passed 4 tests

MyRewards - Loyalty Points and Rewards Program for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,858 ▲10015.71 ▼0.245.66 ▼0.242.14 ▼0.12
Dashboard /wp-admin2,989 ▲1356.21 ▼0.06116.91 ▼18.33169.78 ▲10.69
Posts /wp-admin/edit.php2,780 ▲863.40 ▲0.0463.08 ▼1.72154.78 ▲12.06
Add New Post /wp-admin/post-new.php1,722 ▲3222.64 ▲2.20396.00 ▼51.62156.42 ▲2.04
Media Library /wp-admin/upload.php1,796 ▲985.61 ▲0.08151.87 ▲8.13200.05 ▲18.35
System /wp-admin/admin.php?page=woorewards.system1,6815.9996.08136.95
MyRewards /wp-admin/admin.php?page=woorewards1,8866.3495.38116.28
Features /wp-admin/admin.php?page=woorewards.settings2,1756.82108.19115.26
Appearance /wp-admin/admin.php?page=woorewards.appearance3,52914.63265.24163.47
Wizard /wp-admin/admin.php?page=lwswizard-woorewards1,8746.2086.25123.77
Points and Rewards /wp-admin/admin.php?page=woorewards.loyalty1,6226.1287.89121.41
Pro Version /wp-admin/admin.php?page=woorewards-proversion1,7686.0081.92100.43
Customers /wp-admin/admin.php?page=woorewards.customers2,0516.9995.95124.15

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/woorewards/uninstall.php+3
    include_once(wp-content/plugins/woorewards/modules/woorewards-pro/uninstall.php): failed to open stream: No such file or directory
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_lws_wr_achieved_log
    • wp_lws_wr_historic
  • This plugin does not fully uninstall, leaving 13 options in the database
    • lws_woorewards_version
    • lws_mail_header_wr_new_reward
    • lws_woorewards_redirect_to_licence
    • lws_mail_title_wr_new_reward
    • lws_woorewards_cart_content_side
    • lws_mail_woorewards_attribute_headerpic
    • woocommerce_enable_coupons
    • lws_mail_template_wr_new_reward
    • lws_woorewards_install_version
    • lws_mail_woorewards_attribute_footer
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=lwswizard-woorewards
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'LWS\\Adminpanel\\Pages\\Field' not found in wp-content/plugins/woorewards/assets/lws-adminpanel/include/pages/field/themer.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'LWS\\Adminpanel\\Pages\\Field' not found in wp-content/plugins/woorewards/assets/lws-adminpanel/include/pages/field/stygen.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: You are using too many tags: 26 tag instead of maximum 10
The official readme.txt might help

woorewards/woorewards.php 85% from 13 tests

The principal PHP file in "MyRewards - Loyalty Points and Rewards Program for WooCommerce" v. 4.9.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.3" instead of "3.7.0")
  • 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 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin51,617 lines of code in 220 files:
LanguageFilesBlank linesComment linesLines of code
PHP1202,8632,72522,076
PO File115,7308,67014,629
JavaScript452,3962,29511,531
CSS384421192,289
SVG300895
JSON100134
XML20063

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity33.46
▷ Minimum class complexity1.00
▷ Maximum class complexity170.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces21
Interfaces2
Traits0
Classes112
▷ Abstract classes1311.61%
▷ Concrete classes9988.39%
▷ Final classes11.01%
Methods1,375
▷ Static methods17812.95%
▷ Public methods98271.42%
▷ Protected methods35225.60%
▷ Private methods412.98%
Functions75
▷ Named functions2330.67%
▷ Anonymous functions5269.33%
Constants64
▷ Global constants2437.50%
▷ Class constants4062.50%
▷ Public constants40100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
28 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lws-adminpanel/images/lws-favicon.png0.53KB0.37KB▼ 30.71%
img/sponsorship.png1.51KB1.38KB▼ 8.48%
img/leveling_system.png2.38KB1.78KB▼ 25.08%
img/r-wizard.png5.38KB3.04KB▼ 43.48%
assets/lws-adminpanel/images/damier.png0.18KB0.12KB▼ 33.33%