78% easy-referral-for-woocommerce

Code Review | Easy Referral for WooCommerce

WordPress plugin Easy Referral for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: easy-referral-for...
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.2
  • WordPress version: 6.3.1
  • First release: Oct 25, 2019
  • Latest release: Nov 15, 2019
  • Number of updates: 12
  • Update frequency: every 1.8 days
  • Top authors: Karzin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /855 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.36MB] [CPU: ▼4.02ms] Passed 4 tests

A check of server-side resources used by Easy Referral for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4043.80 ▼3.62
Dashboard /wp-admin3.71 ▲0.3652.97 ▼15.88
Posts /wp-admin/edit.php3.76 ▲0.4054.90 ▲4.65
Add New Post /wp-admin/post-new.php6.23 ▲0.3499.76 ▼1.21
Media Library /wp-admin/upload.php3.57 ▲0.3441.57 ▲5.75

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 344 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Referral for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.001.69 ▼0.0640.70 ▼0.66
Dashboard /wp-admin2,192 ▲155.56 ▼0.0682.14 ▼15.8738.63 ▼2.72
Posts /wp-admin/edit.php2,097 ▼31.98 ▼0.0241.45 ▲4.6834.94 ▲1.05
Add New Post /wp-admin/post-new.php1,526 ▼1123.31 ▲0.39642.29 ▼37.6259.42 ▲4.42
Media Library /wp-admin/upload.php1,400 ▲34.15 ▼0.0495.37 ▼7.4842.52 ▼4.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/easy-referral-for-woocommerce/vendor/cmb2/cmb2/apigen/hook-docs.php
  • 143× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/easy-referral-for-woocommerce/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/easy-referral-for-woocommerce/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Hashids\\HashidsInterface' not found in wp-content/plugins/easy-referral-for-woocommerce/vendor/hashids/hashids/src/Hashids.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/easy-referral-for-woocommerce/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/easy-referral-for-woocommerce/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/easy-referral-for-woocommerce/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Cmb2Grid\\Grid\\Row' not found in wp-content/plugins/easy-referral-for-woocommerce/vendor/origgami/cmb2-grid/Grid/Group/GroupRow.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/easy-referral-for-woocommerce/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/easy-referral-for-woocommerce/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-referral-for-woocommerce/vendor/cmb2/cmb2/init.php:126

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: The official readme.txt might help

easy-referral-for-woocommerce/easy-referral-for-woocommerce.php 85% from 13 tests

The entry point to "Easy Referral for WooCommerce" version 1.0.5 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.4" instead of "3.0.0")
  • Domain Path: The domain path folder was not found ("/src/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin27,617 lines of code in 271 files:
LanguageFilesBlank linesComment linesLines of code
PHP2103,2789,01913,046
CSS161,2771,1795,758
JSON9104,178
JavaScript124696472,431
Sass16300251,379
Markdown52560757
YAML193328
PO File11121
XML15419

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.89
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces17
Interfaces2
Traits0
Classes209
▷ Abstract classes104.78%
▷ Concrete classes19995.22%
▷ Final classes00.00%
Methods919
▷ Static methods10110.99%
▷ Public methods76583.24%
▷ Protected methods13915.13%
▷ Private methods151.63%
Functions50
▷ Named functions4182.00%
▷ Anonymous functions918.00%
Constants17
▷ Global constants529.41%
▷ Class constants1270.59%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
22 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
vendor/cmb2/cmb2/apigen/theme-bootstrap/src/resources/tree-last.png0.17KB0.11KB▼ 36.05%
vendor/cmb2/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
vendor/cmb2/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%