74% wcf-loyalty-points-and-rewards-for-woocommerce

Code Review | WCF Loyalty Points and Rewards Plugin For WooCommerce

WordPress plugin WCF Loyalty Points and Rewards Plugin For WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: wcf-loyalty-point...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Aug 27, 2022
  • Latest release: Oct 6, 2022
  • Number of updates: 4
  • Update frequency: every 12.8 days
  • Top authors: wecode123 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /722 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.29ms] Passed 4 tests

This is a short check of server-side resources used by WCF Loyalty Points and Rewards Plugin For WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.89 ▼6.99
Dashboard /wp-admin3.33 ▲0.0251.92 ▼2.96
Posts /wp-admin/edit.php3.38 ▲0.0248.96 ▼3.64
Add New Post /wp-admin/post-new.php5.93 ▲0.0496.01 ▼11.58
Media Library /wp-admin/upload.php3.25 ▲0.0239.34 ▲1.45
/wp-admin/admin.php?page=wcf-loyalty-rewards-log3.2836.51

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WCF Loyalty Points and Rewards Plugin For WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.33 ▼0.041.02 ▼0.5741.55 ▲0.37
Dashboard /wp-admin2,204 ▲305.51 ▼0.1888.54 ▲2.9832.09 ▼7.54
Posts /wp-admin/edit.php2,106 ▲62.03 ▲0.0640.80 ▲0.6034.37 ▼4.73
Add New Post /wp-admin/post-new.php1,695 ▲15824.77 ▲6.39604.25 ▼31.5460.50 ▼1.18
Media Library /wp-admin/upload.php1,471 ▲684.28 ▲0.0998.21 ▼9.0739.45 ▼6.28
/wp-admin/admin.php?page=wcf-loyalty-rewards-log1,0512.0425.5425.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_wcf_loyalty_points_logs
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wcf-loyalty-points-and-rewards-for-woocommerce/wcf-loyalty-points-and-rewards-index.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/wcf-loyalty-points-and-rewards-for-woocommerce/wcf-loyalty-rewards-point.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wcf-loyalty-points-and-rewards-for-woocommerce/wcf-loyalty-points-and-rewards.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wcf-loyalty-points-and-rewards-for-woocommerce/function.php:6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: loyalty rewards, woocommerce reward plugins, reward system for woocommerce

wcf-loyalty-points-and-rewards-for-woocommerce/wcf-loyalty-points-and-rewards.php 85% from 13 tests

"WCF Loyalty Points and Rewards Plugin For WooCommerce" version 1.0.0'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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wcf-loyalty-points-and-rewards-for-woocommerce.php" instead of "wcf-loyalty-points-and-rewards.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected656 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP67752605
CSS27650
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.50
▷ Minimum class complexity3.00
▷ Maximum class complexity14.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.15MB with 0.11MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/fonts/wcf_fomo_icon.png27.60KB8.33KB▼ 69.81%
asset/fonts/wcf rewards.png124.62KB34.67KB▼ 72.18%