78% bloyal

Code Review | bLoyal: Loyalty & Promotions by bLoyal

WordPress plugin bLoyal: Loyalty & Promotions by bLoyal scored78%from 54 tests.

About plugin

  • Plugin page: bloyal
  • Plugin version: 3.1.611.16
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 23, 2023
  • Latest release: Aug 28, 2023
  • Number of updates: 11
  • Update frequency: every 6.6 days
  • Top authors: connectordev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /279 total downloads

Benchmarks

Plugin footprint 83% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.36ms] Passed 4 tests

Server-side resources used by bLoyal: Loyalty & Promotions by bLoyal
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.96 ▼6.45
Dashboard /wp-admin3.31 ▲0.0045.35 ▼2.57
Posts /wp-admin/edit.php3.36 ▲0.0045.44 ▲0.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.17 ▲0.52
Media Library /wp-admin/upload.php3.23 ▲0.0035.16 ▼0.42

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for bLoyal: Loyalty & Promotions by bLoyal
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.474.21 ▲2.3844.11 ▼5.55
Dashboard /wp-admin2,203 ▲155.83 ▲0.0198.58 ▼9.6537.32 ▼2.30
Posts /wp-admin/edit.php2,086 ▼32.01 ▲0.0140.95 ▲6.6635.19 ▼5.58
Add New Post /wp-admin/post-new.php1,537 ▲418.49 ▼4.40609.24 ▼64.5347.46 ▼7.35
Media Library /wp-admin/upload.php1,391 ▲64.21 ▲0.0195.73 ▼23.1343.08 ▼3.92

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

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
  • 10× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/bloyal/app/controller/custom_tax_class_controller.php
    • > /wp-content/plugins/bloyal/app/controller/loyalty_dollar_tender_controller.php
    • > /wp-content/plugins/bloyal/app/controller/gift_card_tender_controller.php
    • > /wp-content/plugins/bloyal/app/controller/class-alertpopupcontroller.php
    • > /wp-content/plugins/bloyal/app/controller/bloyal_loyalty_dollar_payment_controller.php
    • > /wp-content/plugins/bloyal/app/controller/class-bloyalstoredpaymentmethod.php
    • > /wp-content/plugins/bloyal/app/controller/shipping_controller.php
    • > /wp-content/plugins/bloyal/app/controller/class-paymentalertcontroller.php
    • > /wp-content/plugins/bloyal/app/controller/bloyal_snippets_payment.php
    • > /wp-content/plugins/bloyal/app/controller/bloyal_payment_controller.php
  • 31× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant BLOYAL_DIR - assumed 'BLOYAL_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/bloyal/app/view/bloyal_snippets_view.php on line 4
    • > PHP Warning
      require_once(BLOYAL_DIR/app/view/bloyal_view.php): failed to open stream: No such file or directory in wp-content/plugins/bloyal/app/view/bloyal_snippets_view.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'BLOYAL_DIR/app/controller/class-alertpopupcontroller.php' (include_path='.:/usr/share/php') in wp-content/plugins/bloyal/app/controller/promotion_class_controller.php on line 3
    • > PHP Warning
      Use of undefined constant BLOYAL_DIR - assumed 'BLOYAL_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/bloyal/app/controller/bloyal_resubmit_order_controller.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/bloyal/bloyal.php:12
    • > PHP Warning
      Use of undefined constant BLOYAL_DIR - assumed 'BLOYAL_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/bloyal/app/controller/promotion_class_controller.php on line 3
    • > PHP Warning
      require_once(BLOYAL_DIR/app/controller/class-bloyalcontroller.php): failed to open stream: No such file or directory in wp-content/plugins/bloyal/app/controller/class-add-payment-methods.php on line 2
    • > PHP Warning
      Use of undefined constant BLOYAL_DIR - assumed 'BLOYAL_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/bloyal/app/controller/class-add-payment-methods.php on line 2
    • > PHP Warning
      require_once(BLOYAL_DIR/app/view/bloyal_view.php): failed to open stream: No such file or directory in wp-content/plugins/bloyal/app/controller/class-bloyalcontroller.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'BLOYAL_DIR/app/controller/class-bloyalcontroller.php' (include_path='.:/usr/share/php') in wp-content/plugins/bloyal/app/controller/bloyal_inventory_locations.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

bloyal/bloyal.php Passed 13 tests

This is the main PHP file of "bLoyal: Loyalty & Promotions by bLoyal" version 3.1.611.16, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
107 characters long description:
bLoyal provides real-time customer loyalty and omni-channel order processing to your WooCommerce web store.

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
No dangerous file extensions were detected12,617 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP2674087410,702
JavaScript5155231,751
CSS3132123
SVG20141

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity44.80
▷ Minimum class complexity1.00
▷ Maximum class complexity381.00
Average method complexity6.98
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods183
▷ Static methods21.09%
▷ Public methods17293.99%
▷ Protected methods00.00%
▷ Private methods116.01%
Functions158
▷ Named functions15799.37%
▷ Anonymous functions10.63%
Constants6
▷ Global constants6100.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
6 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/bloyal_logo_16x16.png0.57KB0.72KB0.00%
assets/images/bloyal_logo_12x12.png0.39KB0.50KB0.00%
assets/css/images/ui-icons_555555_256x240.png6.91KB4.18KB▼ 39.47%
assets/images/bloyal_logo_20x20.png0.67KB0.75KB0.00%
assets/css/images/ui-icons_777777_256x240.png6.94KB4.18KB▼ 39.78%