83% wployalty

Code Review | Points and Rewards for WooCommerce by WPLoyalty - Create WooCommerce Loyalty Programs, Referral Programs and Customer Rewards System

WordPress plugin Points and Rewards for WooCommerce by WPLoyalty - Create WooCommerce Loyalty Programs, Referral Programs and Customer Rewards System scored83%from 54 tests.

About plugin

  • Plugin page: wployalty
  • Plugin version: 1.2.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 11, 2023
  • Latest release: Oct 16, 2023
  • Number of updates: 24
  • Update frequency: every 7.8 days
  • Top authors: wployaltydev (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

400+ active /3,903 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by Points and Rewards for WooCommerce by WPLoyalty - Create WooCommerce Loyalty Programs, Referral Programs and Customer Rewards System
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.45 ▲1.97
Dashboard /wp-admin3.31 ▲0.0146.27 ▲2.25
Posts /wp-admin/edit.php3.36 ▲0.0142.65 ▼3.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0179.71 ▼6.85
Media Library /wp-admin/upload.php3.24 ▲0.0133.63 ▲0.98

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 252 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Points and Rewards for WooCommerce by WPLoyalty - Create WooCommerce Loyalty Programs, Referral Programs and Customer Rewards System
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.39 ▲0.041.86 ▼0.0743.73 ▼2.86
Dashboard /wp-admin2,198 ▲215.63 ▼0.0293.55 ▲4.5344.49 ▲5.21
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0236.27 ▲0.4731.22 ▼6.64
Add New Post /wp-admin/post-new.php1,526 ▼223.05 ▲0.02687.63 ▼5.0273.75 ▲18.64
Media Library /wp-admin/upload.php1,403 ▲34.18 ▼0.0193.74 ▼1.7339.45 ▼2.12

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'ParseCsv\\enums\\AbstractEnum' not found in wp-content/plugins/wployalty/vendor/parsecsv/php-parsecsv/src/enums/DatatypeEnum.php:12
    • > PHP Fatal error
      Trait 'ParseCsv\\extensions\\DatatypeTrait' not found in wp-content/plugins/wployalty/vendor/parsecsv/php-parsecsv/src/Csv.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'ParseCsv\\enums\\AbstractEnum' not found in wp-content/plugins/wployalty/vendor/parsecsv/php-parsecsv/src/enums/SortEnum.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

wployalty/wp-loyalty-rules-lite.php 77% from 13 tests

"Points and Rewards for WooCommerce by WPLoyalty - Create WooCommerce Loyalty Programs, Referral Programs and Customer Rewards System" version 1.2.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 144 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("wployalty.php" instead of "wp-loyalty-rules-lite.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin39,883 lines of code in 235 files:
LanguageFilesBlank linesComment linesLines of code
PHP1612,1784,75130,528
JavaScript453181,2603,048
CSS11363452,974
Sass234401,481
Markdown225201,348
SVG1200320
JSON100175
HTML1109

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 112)
Cyclomatic complexity
Average complexity per logical line of code0.71
Average class complexity72.98
▷ Minimum class complexity1.00
▷ Maximum class complexity376.00
Average method complexity6.90
▷ Minimum method complexity1.00
▷ Maximum method complexity112.00
Code structure
Namespaces26
Interfaces0
Traits2
Classes87
▷ Abstract classes44.60%
▷ Concrete classes8395.40%
▷ Final classes00.00%
Methods1,095
▷ Static methods999.04%
▷ Public methods94886.58%
▷ Protected methods13412.24%
▷ Private methods131.19%
Functions21
▷ Named functions523.81%
▷ Anonymous functions1676.19%
Constants52
▷ Global constants3567.31%
▷ Class constants1732.69%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 compressed PNG files occupy 0.02MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Assets/Site/image/default-level.png12.27KB11.46KB▼ 6.58%
Assets/Site/image/redeemed_points.png1.17KB1.09KB▼ 6.76%
Assets/Site/image/Hand-min.png1.19KB1.17KB▼ 1.72%
App/Apps/Launcher/V2/Assets/images/logo.png2.33KB1.76KB▼ 24.11%