84% mprm-menu-cart

Code Review | Restaurant Menu Cart

WordPress plugin Restaurant Menu Cart scored84%from 54 tests.

About plugin

  • Plugin page: mprm-menu-cart
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Dec 2, 2016
  • Latest release: Apr 11, 2023
  • Number of updates: 25
  • Update frequency: every 92.6 days
  • Top authors: MotoPress (68%)jetmonsters (36%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /9,365 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.65ms] Passed 4 tests

This is a short check of server-side resources used by Restaurant Menu Cart
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.17 ▼7.89
Dashboard /wp-admin3.34 ▲0.0351.18 ▲0.17
Posts /wp-admin/edit.php3.45 ▲0.0952.49 ▼0.44
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.89 ▼18.44
Media Library /wp-admin/upload.php3.26 ▲0.0338.19 ▲1.41

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Restaurant Menu Cart
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.20 ▼1.182.06 ▲0.2845.08 ▼2.38
Dashboard /wp-admin2,203 ▲154.85 ▼0.96103.57 ▼16.8143.01 ▼10.00
Posts /wp-admin/edit.php2,086 ▼62.15 ▲0.1435.39 ▼6.1335.77 ▼3.06
Add New Post /wp-admin/post-new.php1,514 ▼1917.58 ▼5.40735.87 ▲30.4860.75 ▲5.55
Media Library /wp-admin/upload.php1,379 ▼94.20 ▼0.0197.50 ▼6.8044.32 ▼0.82

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'mprm_menu_cart\\classes\\Core' not found in wp-content/plugins/mprm-menu-cart/classes/class-model.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'mprm_menu_cart\\classes\\Core' not found in wp-content/plugins/mprm-menu-cart/classes/class-controller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'mprm_menu_cart\\classes\\Model' not found in wp-content/plugins/mprm-menu-cart/classes/models/class-settings.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'mp_restaurant_menu\\classes\\Core' not found in wp-content/plugins/mprm-menu-cart/classes/class-core.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'mprm_menu_cart\\classes\\Model' not found in wp-content/plugins/mprm-menu-cart/classes/models/class-menu-cart.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'mp_restaurant_menu\\classes\\View' not found in wp-content/plugins/mprm-menu-cart/classes/class-view.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/mprm-menu-cart/templates/settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: restaurant, food, restaurant menu, cafe, food menu...

mprm-menu-cart/mprm-menu-cart.php Passed 13 tests

The main file in "Restaurant Menu Cart" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
68 characters long description:
Displays a shopping cart of Restaurant Menu plugin in your menu bar.

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
Good job! No executable or dangerous file extensions detected1,140 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP10216444967
LESS260126
JavaScript25124
SVG10021
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity18.78
▷ Minimum class complexity2.00
▷ Maximum class complexity87.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods74
▷ Static methods912.16%
▷ Public methods7398.65%
▷ Protected methods11.35%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin