83% j2t-reward-points-for-woocommerce

Code Review | J2T Points and Rewards for WooCommerce

WordPress plugin J2T Points and Rewards for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: j2t-reward-points...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.9
  • WordPress version: 6.3.1
  • First release: Jan 28, 2022
  • Latest release: Jan 31, 2022
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: j2tdesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /579 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.41MB] [CPU: ▼7.37ms] Passed 4 tests

Analyzing server-side resources used by J2T Points and Rewards for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4339.95 ▼0.62
Dashboard /wp-admin3.76 ▲0.4548.34 ▲0.34
Posts /wp-admin/edit.php3.81 ▲0.4546.98 ▼3.58
Add New Post /wp-admin/post-new.php6.27 ▲0.3983.34 ▼22.45
Media Library /wp-admin/upload.php3.62 ▲0.3934.04 ▼2.83

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by J2T Points and Rewards for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.19 ▼1.201.75 ▼0.2944.05 ▼5.13
Dashboard /wp-admin2,206 ▲155.91 ▲1.03114.51 ▲9.7443.29 ▼0.17
Posts /wp-admin/edit.php2,086 ▼32.01 ▼0.0534.52 ▼9.6333.34 ▼3.65
Add New Post /wp-admin/post-new.php1,524 ▼1823.11 ▲4.77673.28 ▼17.3558.26 ▲1.38
Media Library /wp-admin/upload.php1,391 ▼04.19 ▼0.0897.91 ▼8.6844.88 ▼0.99

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 17× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: referral_min_order in wp-content/plugins/j2t-reward-points-for-woocommerce/templates/frontend/wc-account-referral.php on line 39
    • > PHP Notice
      Undefined variable: referral_point_value in wp-content/plugins/j2t-reward-points-for-woocommerce/templates/frontend/wc-account-referral.php on line 21
    • > PHP Notice
      Undefined variable: referral_point_value in wp-content/plugins/j2t-reward-points-for-woocommerce/templates/frontend/wc-account-referral.php on line 13
    • > PHP Notice
      Undefined variable: referral_child_point_value in wp-content/plugins/j2t-reward-points-for-woocommerce/templates/frontend/wc-account-referral.php on line 34
    • > PHP Notice
      Undefined variable: referral_child_point_value in wp-content/plugins/j2t-reward-points-for-woocommerce/templates/frontend/wc-account-referral.php on line 30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/j2t-reward-points-for-woocommerce/RewardEmails.php:14
    • > PHP Notice
      Undefined variable: referral_child_point_value in wp-content/plugins/j2t-reward-points-for-woocommerce/templates/frontend/wc-account-referral.php on line 26
    • > PHP Notice
      Undefined variable: referrer_registration_points in wp-content/plugins/j2t-reward-points-for-woocommerce/templates/frontend/wc-account-referral.php on line 8
    • > PHP Notice
      Undefined variable: referral_registration_points in wp-content/plugins/j2t-reward-points-for-woocommerce/templates/frontend/wc-account-referral.php on line 3
    • > PHP Notice
      Undefined variable: referral_permanent in wp-content/plugins/j2t-reward-points-for-woocommerce/templates/frontend/wc-account-referral.php on line 46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: The official readme.txt might help

j2t-reward-points-for-woocommerce/j2t-rewardpoints-woocommerce.php 85% from 13 tests

The primary PHP file in "J2T Points and Rewards for WooCommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("j2t-reward-points-for-woocommerce.php" instead of "j2t-rewardpoints-woocommerce.php")
  • Description: The description should be shorter than 140 characters (currently 174 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected21,224 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JSON30017,502
PHP125583153,128
JavaScript66670342
PO File18792206
CSS29136
Markdown17010
Sass1010

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity42.57
▷ Minimum class complexity1.00
▷ Maximum class complexity231.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods154
▷ Static methods10366.88%
▷ Public methods14996.75%
▷ Protected methods21.30%
▷ Private methods31.95%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants14.55%
▷ Class constants2195.45%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/rewardpoints.png4.69KB0.46KB▼ 90.24%