78% easy-restaurant-menus

Code Review | Easy Restaurant Menus

WordPress plugin Easy Restaurant Menus scored78%from 54 tests.

About plugin

  • Plugin page: easy-restaurant-m...
  • Plugin version: 0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.4-5.1
  • WordPress version: 6.3.1
  • First release: Mar 7, 2019
  • Latest release: Mar 7, 2019
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: varun21 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /608 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼0.72ms] Passed 4 tests

This is a short check of server-side resources used by Easy Restaurant Menus
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0937.60 ▼0.18
Dashboard /wp-admin3.39 ▲0.0450.17 ▼7.40
Posts /wp-admin/edit.php3.50 ▲0.1445.83 ▲0.76
Add New Post /wp-admin/post-new.php6.02 ▲0.14100.01 ▲6.05
Media Library /wp-admin/upload.php3.31 ▲0.0838.11 ▲3.95
Restaurant Menus /wp-admin/edit.php?post_type=restaurantmenu3.3534.89
Add New /wp-admin/post-new.php?post_type=restaurantmenu3.3644.66

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Restaurant Menus
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8713.17 ▼1.111.74 ▲0.1543.12 ▲6.61
Dashboard /wp-admin2,236 ▲535.81 ▲0.8899.14 ▼9.8040.81 ▼2.14
Posts /wp-admin/edit.php2,119 ▲482.01 ▲0.0040.06 ▲4.3836.46 ▲5.15
Add New Post /wp-admin/post-new.php1,572 ▲5823.00 ▲5.39591.94 ▼59.1456.32 ▼5.49
Media Library /wp-admin/upload.php1,418 ▲334.24 ▲0.0295.20 ▼65.7544.02 ▼11.84
Restaurant Menus /wp-admin/edit.php?post_type=restaurantmenu1,0831.9933.2328.27
Add New /wp-admin/post-new.php?post_type=restaurantmenu1,7663.5460.7435.91

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/easy-restaurant-menus/erm.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function epv\\add_action() in wp-content/plugins/easy-restaurant-menus/admin/class-settings.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=restaurantmenu
    • > Javascript (severe) in unknown
    /wp-content/plugins/easy-restaurant-menus/admin/script.js 1:0 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: food, menus, tags restaurant

easy-restaurant-menus/erm.php 85% from 13 tests

The principal PHP file in "Easy Restaurant Menus" v. 0.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("easy-restaurant-menus.php" instead of "erm.php")

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
No dangerous file extensions were detected429 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP28750354
JavaScript2253175

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity16.50
▷ Minimum class complexity5.00
▷ Maximum class complexity28.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes2100.00%
Methods33
▷ Static methods26.06%
▷ Public methods3296.97%
▷ Protected methods00.00%
▷ Private methods13.03%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected