63% woorewards

Code Review | MyRewards - Loyalty Points and Rewards for WooCommerce - Reward orders, referrals, product reviews and more

WordPress plugin MyRewards - Loyalty Points and Rewards for WooCommerce - Reward orders, referrals, product reviews and more scored63%from 54 tests.

About plugin

  • Plugin page: woorewards
  • Plugin version: 5.2.7
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.1.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 24, 2017
  • Latest release: Nov 21, 2023
  • Number of updates: 280
  • Update frequency: every 7.9 days
  • Top authors: lwsdevelopers (100%)

Code review

54 tests

User reviews

58 reviews

Install metrics

5,000+ active /182,103 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: ▲4.35MB] [CPU: ▲28.63ms] Passed 4 tests

Analyzing server-side resources used by MyRewards - Loyalty Points and Rewards for WooCommerce - Reward orders, referrals, product reviews and more
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.74 ▲3.2757.95 ▲16.08
Dashboard /wp-admin8.02 ▲4.7178.30 ▲27.13
Posts /wp-admin/edit.php8.10 ▲4.7489.14 ▲42.37
Add New Post /wp-admin/post-new.php10.76 ▲4.86130.49 ▲34.01
Media Library /wp-admin/upload.php7.90 ▲4.6771.36 ▲37.29
System /wp-admin/admin.php?page=woorewards.system8.2777.17
Customers /wp-admin/admin.php?page=woorewards.customers8.2177.41
Appearance /wp-admin/admin.php?page=woorewards.appearance8.2376.60
MyRewards /wp-admin/admin.php?page=woorewards8.0671.36
Wizard /wp-admin/admin.php?page=lwswizard-woorewards8.5275.63
Pro Version /wp-admin/admin.php?page=woorewards-proversion8.1171.97
Settings /wp-admin/admin.php?page=woorewards.loyalty8.0673.69

Server storage [IO: ▲7.96MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 362 new files
Database: 2 new tables, 25 new options
New tables
wp_lws_wr_achieved_log
wp_lws_wr_historic
New WordPress options
lws_mail_subject_wr_new_reward
can_compress_scripts
widget_recent-posts
lws_woorewards_show_loading_order_and_priority
lws_woorewards_cart_content_side
lws_mail_header_wr_new_reward
lws_mail_template_wr_new_reward
lws_mail_woorewards_attribute_headerpic
lws_woorewards_version
lws_woorewards_sponsorship_short_url
...

Browser metrics Passed 4 tests

MyRewards - Loyalty Points and Rewards for WooCommerce - Reward orders, referrals, product reviews and more: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲10414.70 ▲0.451.60 ▼0.2128.55 ▼16.98
Dashboard /wp-admin2,267 ▲905.67 ▲0.0698.29 ▼0.8646.24 ▼0.18
Posts /wp-admin/edit.php2,175 ▲782.04 ▲0.0640.50 ▲3.1138.50 ▲2.26
Add New Post /wp-admin/post-new.php1,588 ▲5320.98 ▼4.03656.57 ▲58.8147.53 ▼15.89
Media Library /wp-admin/upload.php1,469 ▲694.30 ▲0.13100.00 ▲2.3947.67 ▲5.38
System /wp-admin/admin.php?page=woorewards.system1,7554.7984.25132.11
Customers /wp-admin/admin.php?page=woorewards.customers1,7354.6380.7754.95
Appearance /wp-admin/admin.php?page=woorewards.appearance2,6489.94310.2599.79
MyRewards /wp-admin/admin.php?page=woorewards1,3464.3258.3180.53
Wizard /wp-admin/admin.php?page=lwswizard-woorewards1,4674.4662.01126.68
Pro Version /wp-admin/admin.php?page=woorewards-proversion1,4974.2357.5246.01
Settings /wp-admin/admin.php?page=woorewards.loyalty1,3234.3067.0855.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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_historic
    • wp_lws_wr_achieved_log
  • This plugin does not fully uninstall, leaving 25 options in the database
    • lws_mail_title_wr_new_reward
    • can_compress_scripts
    • theysaidso_admin_options
    • lws_woorewards_redirect_to_licence
    • lws_mail_template_wr_new_reward
    • lws_woorewards_show_loading_order_and_priority
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • lws_woorewards_event_enabled_sponsorship
    • ...

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
Even though everything seems fine, this is not an exhaustive test

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/stygen.php:25
    • > 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

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 for WooCommerce - Reward orders, referrals, product reviews and more" v. 5.2.7 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.3" instead of "7.1.0")

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 plugin58,111 lines of code in 251 files:
LanguageFilesBlank linesComment linesLines of code
PHP1523,4933,29227,928
PO File95,8559,01314,456
JavaScript472,3962,29511,533
CSS375581012,667
SVG3001,330
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.49
Average class complexity31.57
▷ Minimum class complexity1.00
▷ Maximum class complexity213.00
Average method complexity3.68
▷ Minimum method complexity1.00
▷ Maximum method complexity55.00
Code structure
Namespaces25
Interfaces2
Traits1
Classes144
▷ Abstract classes149.72%
▷ Concrete classes13090.28%
▷ Final classes10.77%
Methods1,683
▷ Static methods25014.85%
▷ Public methods1,21872.37%
▷ Protected methods40323.95%
▷ Private methods623.68%
Functions103
▷ Named functions2322.33%
▷ Anonymous functions8077.67%
Constants74
▷ Global constants2432.43%
▷ Class constants5067.57%
▷ Public constants50100.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
img/anniversary.png2.83KB2.70KB▼ 4.49%
img/r-loyalty-systems.png3.86KB2.42KB▼ 37.21%
img/ls-currency.png1.56KB1.12KB▼ 28.29%
assets/lws-adminpanel/images/logo-lws.png1.41KB1.02KB▼ 27.77%
img/standard_system.png3.57KB2.08KB▼ 41.72%