65% clover-online-orders

Code Review | Smart Online Order for Clover

WordPress plugin Smart Online Order for Clover scored 65% from 53 tests.

About plugin

  • Plugin page: clover-online-orders
  • Plugin version: 1.4.8
  • PHP compatiblity: 5.2.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.1-5.8.1
  • WordPress version: 5.8.1
  • First release: Feb 13, 2016
  • Latest release: Sep 27, 2021
  • Number of updates: 182
  • Update frequency: every 11.3 days
  • Top authors: elbanyaoui (100%)

Code review

53 tests

User reviews

31 reviews

Install metrics

2,000+ active / 29,969 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.07MB] [CPU: ▲2,116.20ms] 50% from 4 tests

A check of server-side resources used by Smart Online Order for Clover
Please fix the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 3,014.03ms on /wp-admin/admin.php?page=moo_themes)
  • Extra CPU: The extra CPU usage must be under 200.00ms (currently 2,116.20ms on /wp-admin/admin.php?page=moo_themes)
PageMemory (MB)CPU Time (ms)
Home /4.76 ▲2.0443.04 ▲21.74
Dashboard /wp-admin5.14 ▲2.093,464.94 ▲3,419.87
Posts /wp-admin/edit.php5.21 ▲2.113,089.66 ▲3,045.30
Add New Post /wp-admin/post-new.php8.44 ▲3.013,195.66 ▲2,064.42
Media Library /wp-admin/upload.php5.03 ▲2.023,371.28 ▲3,333.35
Coupons /wp-admin/admin.php?page=moo_coupons5.264,418.43
Orders /wp-admin/admin.php?page=moo_orders5.255,755.13
Reports /wp-admin/admin.php?page=moo_reports4.943,272.71
Settings /wp-admin/admin.php?page=moo_index5.163,244.38
Items / Images / Description /wp-admin/admin.php?page=moo_items5.313,171.76
Store Interfaces /wp-admin/admin.php?page=moo_themes5.033,014.03

Server storage [IO: ▲10.04MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 257 new files
Database: 17 new tables, 5 new options
New tables
wp_moo_order_types
wp_moo_item_order
wp_moo_item_option
wp_moo_images
wp_moo_attribute
wp_moo_tax_rate
wp_moo_item
wp_moo_category
wp_moo_modifier
wp_moo_tag
...
New WordPress options
widget_moo_widget_bs
widget_moo_widget_oh
moo_onlineOrders_version
moo_settings
widget_moo_widget_categories

Browser metrics Passed 4 tests

Smart Online Order for Clover: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,253 ▲64720.41 ▲4.7819.00 ▲8.7850.82 ▲5.00
Dashboard /wp-admin3,312 ▲4598.70 ▲2.93182.98 ▲45.28130.35 ▲33.96
Posts /wp-admin/edit.php3,120 ▲4175.25 ▲2.56100.54 ▲32.13117.22 ▲18.91
Add New Post /wp-admin/post-new.php1,725 ▼12823.47 ▲4.37265.63 ▼105.24112.44 ▲1.03
Media Library /wp-admin/upload.php1,887 ▲1156.06 ▲1.06133.07 ▼13.98122.92 ▲10.15
Coupons /wp-admin/admin.php?page=moo_coupons1,7334.8890.6089.56
Orders /wp-admin/admin.php?page=moo_orders1,7124.9089.4984.65
Reports /wp-admin/admin.php?page=moo_reports495.9763.8310.59
Settings /wp-admin/admin.php?page=moo_index5,79221.46624.48109.14
Items / Images / Description /wp-admin/admin.php?page=moo_items1,7554.9189.4679.55
Store Interfaces /wp-admin/admin.php?page=moo_themes1,6314.7692.11107.08

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 5 options in the database
    • moo_onlineOrders_version
    • moo_settings
    • widget_moo_widget_categories
    • widget_moo_widget_bs
    • widget_moo_widget_oh

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=moo_coupons
    • > Notice in wp-content/plugins/clover-online-orders/admin/includes/class-moo-coupons-list.php+63
    Trying to get property 'elements' of non-object
    • > GET request to /wp-admin/admin.php?page=moo_coupons
    • > Notice in wp-content/plugins/clover-online-orders/admin/includes/class-moo-coupons-list.php+31
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/clover-online-orders/public/partials/moo-OnlineOrders-public-display.php
    • > /wp-content/plugins/clover-online-orders/admin/partials/moo-OnlineOrders-admin-display.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clover-online-orders/includes/moo-OnlineOrders-Restapi.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/clover-online-orders/includes/moo-OnlineOrders-widgets.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=moo_index
    • > Security (severe) in unknown
    security - [Report Only] Refused to frame 'https://app.hubspot.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' app.hubspot.com".
    • > GET request to /wp-admin/admin.php?page=moo_index
    • > Console-api (warning) in unknown
    https://js.usemessages.com/conversations-embed.js 0:24764 "HubSpot Conversations: You are using conversations on a non-https site! Not using https puts your visitor's data at risk, please enforce using https."

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in clover-online-orders/assets to your readme.txt
The official readme.txt is a good inspiration

clover-online-orders/moo_OnlineOrders.php 85% from 13 tests

The main PHP script in "Smart Online Order for Clover" version 1.4.8 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Name the main plugin file the same as the plugin slug ("clover-online-orders.php" instead of "moo_OnlineOrders.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin82,983 lines of code in 128 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript422,2141,37825,045
SVG160124,355
PHP312,0952,76917,608
CSS311,87341315,171
JSON650787
PO File11115
Markdown1002

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 188)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity99.25
▷ Minimum class complexity1.00
▷ Maximum class complexity424.00
Average method complexity5.67
▷ Minimum method complexity1.00
▷ Maximum method complexity188.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes00.00%
Methods589
▷ Static methods386.45%
▷ Public methods53190.15%
▷ Protected methods213.57%
▷ Private methods376.28%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

PNG files should be compressed to save space and minimize bandwidth usage
57 PNG files occupy 0.76MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/woo_73x73.png7.91KB3.46KB▼ 56.30%
public/img/check.png18.43KB6.09KB▼ 66.98%
public/themes/oTheme/images/loop.png30.96KB10.99KB▼ 64.50%
public/img/menu.png0.21KB0.14KB▼ 31.92%
public/img/business-hours.png4.14KB3.00KB▼ 27.69%