72% qreatmenu-restaurant-qr-menu-for-woocommerce

Code Review | Qreatmenu - Restaurant QR Menu for WooCommerce

WordPress plugin Qreatmenu - Restaurant QR Menu for WooCommerce scored72%from 54 tests.

About plugin

  • Plugin page: qreatmenu-restaur...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Sep 22, 2020
  • Latest release: Sep 22, 2020
  • Number of updates: 2
  • Update frequency: every 27.5 days
  • Top authors: alidemirci (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /601 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼6.26ms] Passed 4 tests

This is a short check of server-side resources used by Qreatmenu - Restaurant QR Menu for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.63 ▼2.37
Dashboard /wp-admin3.40 ▲0.1052.39 ▼2.78
Posts /wp-admin/edit.php3.51 ▲0.1650.97 ▼1.49
Add New Post /wp-admin/post-new.php6.00 ▲0.1188.81 ▼18.40
Media Library /wp-admin/upload.php3.32 ▲0.1038.65 ▲2.35
QR Menu /wp-admin/admin.php?page=qr-menu3.2735.35

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 8 new options
New WordPress options
woocommerce_shop_page_display
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
recovery_mode_email_last_sent
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Qreatmenu - Restaurant QR Menu for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15613.88 ▼0.348.60 ▲6.8539.11 ▼1.31
Dashboard /wp-admin2,215 ▲355.73 ▲0.0696.28 ▼3.3240.83 ▼4.57
Posts /wp-admin/edit.php2,123 ▲232.08 ▲0.0643.05 ▲5.3838.37 ▲1.19
Add New Post /wp-admin/post-new.php1,545 ▲1723.18 ▲0.01588.93 ▼74.0062.36 ▲5.44
Media Library /wp-admin/upload.php1,420 ▲204.29 ▲0.07102.28 ▼4.0146.17 ▼1.70
QR Menu /wp-admin/admin.php?page=qr-menu8201.367.9629.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • woocommerce_shop_page_display
    • recovery_mode_email_last_sent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=qr-menu
    • > Error in wp-content/plugins/qreatmenu-restaurant-qr-menu-for-woocommerce/admin/class-qreat-woocommerce-qr-menu-admin.php+202
    Uncaught Error: Call to undefined function wc_get_page_permalink() in wp-content/plugins/qreatmenu-restaurant-qr-menu-for-woocommerce/admin/class-qreat-woocommerce-qr-menu-admin.php:202
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): Qreat_Woocommerce_Qr_Menu_Admin->amc_register_qr_menu_subpage_callback()
    #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/admin.php(259): do_action()
    #4 {main}
    thrown

SRP 50% 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 fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/qreatmenu-restaurant-qr-menu-for-woocommerce/admin/partials/qreat-woocommerce-qr-menu-admin-display.php
    • > /wp-content/plugins/qreatmenu-restaurant-qr-menu-for-woocommerce/public/partials/qreat-woocommerce-qr-menu-public-display.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=qr-menu
    • > Network (severe)
    wp-content/plugins/qreatmenu-restaurant-qr-menu-for-woocommerce/admin/img/step-2.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=qr-menu
    • > Network (severe)
    wp-content/plugins/qreatmenu-restaurant-qr-menu-for-woocommerce/admin/img/step-1.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=qr-menu
    • > Network (severe)
    wp-content/plugins/qreatmenu-restaurant-qr-menu-for-woocommerce/admin/img/step-3.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=qr-menu
    • > Network (severe)
    wp-content/plugins/qreatmenu-restaurant-qr-menu-for-woocommerce/admin/img/step-4.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: restaurant menu, woocommerce, restaurant, qr, qr menu...

qreatmenu-restaurant-qr-menu-for-woocommerce/qreat-woocommerce-qr-menu.php 85% from 13 tests

The main file in "Qreatmenu - Restaurant QR Menu for WooCommerce" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("qreatmenu-restaurant-qr-menu-for-woocommerce.php" instead of "qreat-woocommerce-qr-menu.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected2,044 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31011561,265
CSS210213388
PHP12192557324
PO File1222560
SVG1007

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.27
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.22MB with 0.15MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/Step-2.png61.43KB20.58KB▼ 66.49%
admin/img/Step-1.png50.90KB15.89KB▼ 68.78%
admin/img/Step-4.png46.27KB17.75KB▼ 61.64%
admin/img/Step-3.png68.38KB21.30KB▼ 68.85%