66% xt-woo-points-rewards

Code Review | XT Points & Rewards for WooCommerce

WordPress plugin XT Points & Rewards for WooCommerce scored66%from 54 tests.

About plugin

  • Plugin page: xt-woo-points-rew...
  • Plugin version: 1.7.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 10, 2020
  • Latest release: Sep 13, 2023
  • Number of updates: 142
  • Update frequency: every 9.5 days
  • Top authors: xplodedthemes (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

100+ active /11,034 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲6.57MB] [CPU: ▲32.86ms] 50% from 4 tests

This is a short check of server-side resources used by XT Points & Rewards for WooCommerce
Please fix the following
  • RAM: Try to keep total memory usage under 10MB (currently 10.54MB on /wp-admin/admin.php?page=freemius)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 6.57MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /10.09 ▲6.6270.34 ▲32.55
Dashboard /wp-admin10.54 ▲7.2080.74 ▲22.81
Posts /wp-admin/edit.php10.54 ▲7.1886.06 ▲38.70
Add New Post /wp-admin/post-new.php11.20 ▲5.30135.62 ▲37.38
Media Library /wp-admin/upload.php10.55 ▲7.3174.78 ▲42.02
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius10.5464.61

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 797 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
fs_active_plugins
widget_recent-comments
xtfw_active_plugins
fs_accounts
widget_recent-posts
fs_debug_mode

Browser metrics Passed 4 tests

A check of browser resources used by XT Points & Rewards for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7614.21 ▼0.231.63 ▼0.0728.38 ▼15.36
Dashboard /wp-admin2,229 ▲515.63 ▼0.0892.85 ▼3.0546.13 ▲2.63
Posts /wp-admin/edit.php2,132 ▲322.12 ▲0.1237.63 ▲2.6635.50 ▲3.21
Add New Post /wp-admin/post-new.php1,568 ▲4018.11 ▼4.89602.66 ▼73.2974.24 ▲19.31
Media Library /wp-admin/upload.php1,428 ▲314.19 ▲0.0495.26 ▼13.2447.27 ▲0.01
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,0891.6825.5228.57

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • fs_debug_mode
    • theysaidso_admin_options
    • xtfw_active_plugins
    • fs_active_plugins
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • fs_accounts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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 0% 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
Please take a closer look at the following
  • 8× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/controls/views/generic.php
    • > /wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/modules/webfonts/class-xirki-fonts-helper.php
    • > /wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/controls/views/select.php
    • > /wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/controls/views/textarea.php
    • > /wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/controls/views/number.php
    • > /wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/controls/views/radio.php
    • > /wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/controls/views/color.php
    • > /wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/controls/views/code.php
  • 71× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/field/class-xirki-field-xirki-generic.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Output' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/modules/css/field/class-xirki-output-field-typography.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field_Radio' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/field/class-xirki-field-palette.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field_Select' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/field/class-xirki-field-select2.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/controls/php/class-xirki-control-base.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/field/class-xirki-field-dashicons.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Section' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/modules/custom-sections/sections/class-xirki-sections-default-section.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field_Xirki_Generic' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/field/class-xirki-field-text.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field_Select' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/field/class-xirki-field-dropdown-pages.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field' not found in wp-content/plugins/xt-woo-points-rewards/xt-framework/includes/customizer/xirki/field/class-xirki-field-background.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5, #6 in xt-woo-points-rewards/assets to your readme.txt
You can take inspiration from this readme.txt

xt-woo-points-rewards/xt-woo-points-rewards.php 92% from 13 tests

The entry point to "XT Points & Rewards for WooCommerce" version 1.7.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.6" instead of "3.0.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin99,510 lines of code in 643 files:
LanguageFilesBlank linesComment linesLines of code
PHP34613,13430,11954,389
JavaScript1506,5504,51224,258
JSON5008,319
Sass851,208927,090
SVG12092,786
CSS378641,375
Markdown235201,107
XML52750159
YAML17027

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity32.32
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes231
▷ Abstract classes52.16%
▷ Concrete classes22697.84%
▷ Final classes104.42%
Methods2,504
▷ Static methods38115.22%
▷ Public methods1,80672.12%
▷ Protected methods26910.74%
▷ Private methods42917.13%
Functions250
▷ Named functions16465.60%
▷ Anonymous functions8634.40%
Constants175
▷ Global constants12571.43%
▷ Class constants5028.57%
▷ Public constants50100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
53 PNG files occupy 1.10MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
xt-framework/assets/css/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png0.11KB0.14KB0.00%
xt-framework/includes/customizer/xirki/assets/images/3cr.png0.91KB0.32KB▼ 64.81%
xt-framework/includes/admin-tabs/assets/images/icon.png1.09KB0.79KB▼ 27.74%
xt-framework/dist/pricing/e366d70661d8ad2493bd6afbd779f125.png10.86KB3.99KB▼ 63.26%
admin/assets/images/icon.png7.87KB8.32KB0.00%