10% xcid-beans-rewards-for-woocommerce

Code Review | XCID - Beans rewards for Woocommerce

WordPress plugin XCID - Beans rewards for Woocommerce scored10%from 54 tests.

About plugin

  • Plugin page: xcid-beans-reward...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Feb 1, 2016
  • Latest release: Feb 1, 2016
  • Number of updates: 7
  • Update frequency: every 0.4 days
  • Top authors: XciD (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,004 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Error in wp-content/plugins/xcid-beans-rewards-for-woocommerce/xcid-beans.php+821
    Uncaught Error: Call to undefined function wc_create_page() in wp-content/plugins/xcid-beans-rewards-for-woocommerce/xcid-beans.php:821
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): XC_Bean::install()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▼0.01MB] [CPU: ▼10.51ms] Passed 4 tests

Server-side resources used by XCID - Beans rewards for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.41 ▼0.54
Dashboard /wp-admin3.31 ▼0.0444.26 ▼14.35
Posts /wp-admin/edit.php3.36 ▲0.0043.22 ▼3.60
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.00 ▼23.23
Media Library /wp-admin/upload.php3.23 ▲0.0032.99 ▼0.84

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by XCID - Beans rewards for Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.31 ▼0.331.75 ▼0.1644.06 ▲3.54
Dashboard /wp-admin2,195 ▲155.51 ▼0.1280.52 ▼8.7137.45 ▼6.82
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0536.68 ▼1.5833.60 ▼4.86
Add New Post /wp-admin/post-new.php1,526 ▼1023.67 ▲5.35703.93 ▲90.5473.38 ▲8.94
Media Library /wp-admin/upload.php1,400 ▼04.12 ▼0.0794.99 ▼0.7744.09 ▲1.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/reward-program.php
    • > /wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/beans.php
    • > /wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/cart-message.php
  • 23× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: history in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/reward-program.php on line 12
    • > PHP Notice
      Undefined variable: button_action in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/cart-message.php on line 9
    • > PHP Notice
      Undefined variable: beans_name in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/beans.php on line 1
    • > PHP Notice
      Undefined variable: balance in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/reward-program-balance.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/register-form.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/product-message.php:3
    • > PHP Notice
      Undefined variable: balance in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/reward-program.php on line 8
    • > PHP Notice
      Undefined variable: beans in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/beans.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/reward-program-balance.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/xcid-beans-rewards-for-woocommerce/templates/reward-program-rules.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
You can take inspiration from this readme.txt

xcid-beans-rewards-for-woocommerce/xcid-beans.php 92% from 13 tests

The entry point to "XCID - Beans rewards for Woocommerce" version 1.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("xcid-beans-rewards-for-woocommerce.php" instead of "xcid-beans.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,759 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP19243273978
CSS14840479
PO File15356146
JavaScript32126140
JSON10016

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity26.00
▷ Minimum class complexity3.00
▷ Maximum class complexity74.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods61
▷ Static methods46.56%
▷ Public methods4777.05%
▷ Protected methods11.64%
▷ Private methods1321.31%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected