67% multilevel-referral-plugin-for-woocommerce

Code Review | Multilevel Referral Affiliate Plugin for WooCommerce

WordPress plugin Multilevel Referral Affiliate Plugin for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: multilevel-referr...
  • Plugin version: 2.23
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 5, 2020
  • Latest release: Jul 6, 2023
  • Number of updates: 27
  • Update frequency: every 46.2 days
  • Top authors: prismitsystems (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /14,481 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.52MB] [CPU: ▼5.62ms] Passed 4 tests

Analyzing server-side resources used by Multilevel Referral Affiliate Plugin for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5936.91 ▼7.24
Dashboard /wp-admin3.89 ▲0.5445.97 ▼11.32
Posts /wp-admin/edit.php3.94 ▲0.5849.51 ▲5.45
Add New Post /wp-admin/post-new.php6.41 ▲0.5283.21 ▼9.38
Media Library /wp-admin/upload.php3.65 ▲0.4238.67 ▲5.62
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.0141.62

Server storage [IO: ▲8.07MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 319 new files
Database: no new tables, 9 new options
New WordPress options
fs_active_plugins
theysaidso_admin_options
fs_accounts
widget_recent-posts
db_upgraded
widget_recent-comments
fs_debug_mode
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Multilevel Referral Affiliate Plugin for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲12014.35 ▲0.001.62 ▼0.3127.78 ▼20.57
Dashboard /wp-admin2,272 ▲985.57 ▲0.0680.50 ▼34.0944.60 ▲1.64
Posts /wp-admin/edit.php2,178 ▲782.03 ▲0.0839.28 ▲1.6939.48 ▲5.71
Add New Post /wp-admin/post-new.php1,590 ▲6418.16 ▼5.48585.39 ▼75.7465.83 ▲0.91
Media Library /wp-admin/upload.php1,474 ▲744.25 ▲0.0997.95 ▼3.2545.37 ▼0.64
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0611.6925.4627.30

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_recent-comments
    • fs_active_plugins
    • can_compress_scripts
    • widget_recent-posts
    • fs_accounts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% 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 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/multilevel-referral-plugin-for-woocommerce/woocommerce-multilevel-commision.php
    • > /wp-content/plugins/multilevel-referral-plugin-for-woocommerce/views/admin/new_features.php
  • 46× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/classes/admin/table-orderwise_credits.php on line 15
    • > PHP Warning
      simplexml_load_file(): I/O warning : failed to load external entity "WMC_DIR/addons.xml" in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/views/admin/addons.php on line 1
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/classes/admin/table-withdraw_history.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/views/admin/withdraw_history.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/views/admin/email_templates.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/classes/admin/table-users.php on line 7
    • > PHP Notice
      Undefined variable: referral_users in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/views/admin/referral_list_popup.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WooCommerce_Multilevel_Referal' not found in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/classes/referral-users.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/classes/admin/table-withdraw_history.php on line 7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/multilevel-referral-plugin-for-woocommerce/classes/admin/table-orderwise_credits.php on line 15

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 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

multilevel-referral-plugin-for-woocommerce/woocommerce-multilevel-commision.php 77% from 13 tests

The primary PHP file in "Multilevel Referral Affiliate Plugin for WooCommerce" version 2.23 is used by WordPress to initiate all plugin functionality
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: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("multilevel-referral-plugin-for-woocommerce.php" instead of "woocommerce-multilevel-commision.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected58,281 lines of code in 205 files:
LanguageFilesBlank linesComment linesLines of code
PHP16310,11518,34239,907
CSS171,3941386,769
PO File92,6783,3915,996
SVG5004,310
JavaScript91511371,228
SQL17048
XML10023

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity81.35
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes66
▷ Abstract classes34.55%
▷ Concrete classes6395.45%
▷ Final classes00.00%
Methods1,533
▷ Static methods23415.26%
▷ Public methods1,13574.04%
▷ Protected methods241.57%
▷ Private methods37424.40%
Functions112
▷ Named functions10795.54%
▷ Anonymous functions54.46%
Constants154
▷ Global constants10467.53%
▷ Class constants5032.47%
▷ Public constants50100.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
35 compressed PNG files occupy 0.54MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/orgBanners/Promotional Banner - 05.png32.80KB32.14KB▼ 2.01%
images/banners/Promotional Banner - 07.png16.49KB16.09KB▼ 2.42%
images/whatsapp.png1.38KB1.17KB▼ 15.13%
images/banners/Promotional Banner - 03.png20.17KB18.99KB▼ 5.83%
images/banners/Promotional Banner - 08.png16.56KB15.71KB▼ 5.11%