72% smart-menupad

Code Review | Smart Menupad

WordPress plugin Smart Menupad scored72%from 54 tests.

About plugin

  • Plugin page: smart-menupad
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: Jan 19, 2022
  • Latest release: Jul 25, 2022
  • Number of updates: 11
  • Update frequency: every 17.1 days
  • Top authors: tawtheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,392 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.17MB] [CPU: ▼11.90ms] Passed 4 tests

Server-side resources used by Smart Menupad
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1438.76 ▼6.57
Dashboard /wp-admin3.48 ▲0.1351.56 ▼13.90
Posts /wp-admin/edit.php3.58 ▲0.2251.89 ▲3.12
Add New Post /wp-admin/post-new.php6.17 ▲0.2877.42 ▼27.26
Media Library /wp-admin/upload.php3.42 ▲0.1934.70 ▲0.13
Smart Menu Pad /wp-admin/admin.php?page=smp-menu-list3.3233.34
SMP Connect /wp-admin/admin.php?page=smp-connect3.3433.22
SMP ShortCode /wp-admin/admin.php?page=smp-shortcode3.3230.88

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 29 new files
Database: 1 new table, 7 new options
New tables
wp_smp_quick_menu
New WordPress options
smp_db_version
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Smart Menupad: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7914.56 ▲0.392.08 ▲0.2145.62 ▲3.14
Dashboard /wp-admin2,217 ▲405.62 ▲0.0690.29 ▼12.1075.28 ▲30.60
Posts /wp-admin/edit.php2,128 ▲282.02 ▲0.0338.87 ▲0.9234.20 ▼2.84
Add New Post /wp-admin/post-new.php1,548 ▲1722.85 ▼0.21711.79 ▲106.7960.51 ▼0.32
Media Library /wp-admin/upload.php1,422 ▲194.28 ▲0.0599.66 ▼2.3074.36 ▲31.50
Smart Menu Pad /wp-admin/admin.php?page=smp-menu-list8792.1731.9256.32
SMP Connect /wp-admin/admin.php?page=smp-connect8852.1330.3628.13
SMP ShortCode /wp-admin/admin.php?page=smp-shortcode8762.1428.0830.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=smp-shortcode
    • > Warning in wp-content/plugins/smart-menupad/includes/SMPShortcode.php+36
    Invalid argument supplied for foreach()

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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/smart-menupad/includes/SMPInit.php
  • 30× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/smart-menupad/templates/admin/smp_connect.php:3
    • > PHP Notice
      Undefined variable: heading_color in wp-content/plugins/smart-menupad/templates/front/view/smp_list.php on line 6
    • > PHP Notice
      Undefined variable: layout_column in wp-content/plugins/smart-menupad/templates/front/view/smp_grid.php on line 4
    • > PHP Notice
      Trying to get property 'image_border' of non-object in wp-content/plugins/smart-menupad/templates/front/view/smp_list.php on line 15
    • > PHP Notice
      Undefined variable: button_text_hover_color in wp-content/plugins/smart-menupad/templates/front/view/smp_list.php on line 13
    • > PHP Notice
      Undefined variable: description_color in wp-content/plugins/smart-menupad/templates/front/view/smp_list.php on line 7
    • > PHP Notice
      Undefined variable: one_shortcode_data in wp-content/plugins/smart-menupad/templates/front/view/smp_list.php on line 26
    • > PHP Notice
      Undefined variable: button_bg_color in wp-content/plugins/smart-menupad/templates/front/view/smp_list.php on line 10
    • > PHP Notice
      Undefined variable: price_color in wp-content/plugins/smart-menupad/templates/front/view/smp_list.php on line 8
    • > PHP Notice
      Undefined variable: one_shortcode_data in wp-content/plugins/smart-menupad/templates/front/view/smp_list.php on line 46

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: online menu ordering system, restaurant ordering, restaurant menu, online restaurant menu, online ordering system for restaurants...

smart-menupad/smart-menupad.php Passed 13 tests

The principal PHP file in "Smart Menupad" v. 1.1.0 is loaded by WordPress automatically on each request
13 characters long description:
SMART MENUPAD

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,845 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP15131931,174
CSS2414561
JavaScript2156110

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.25
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods1957.58%
▷ Protected methods1236.36%
▷ Private methods26.06%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 2.73MB with 1.69MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/menu-3.png477.62KB160.82KB▼ 66.33%
assets/img/food-default-image.png19.77KB7.41KB▼ 62.53%
assets/img/menu-1.png395.82KB148.44KB▼ 62.50%
assets/img/icon.png12.45KB5.71KB▼ 54.08%
assets/img/menu-4.png415.12KB148.68KB▼ 64.18%