84% magee-restaurant

Code Review | Magee Restaurant

WordPress plugin Magee Restaurant scored 84% from 54 tests.

About plugin

  • Plugin page: magee-restaurant
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 5.9.2
  • First release: Oct 14, 2016
  • Latest release: Oct 14, 2016
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: magictheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,874 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.66MB] [CPU: ▼289.61ms] Passed 4 tests

A check of server-side resources used by Magee Restaurant
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.19 ▲0.6761.41 ▲10.78
Dashboard /wp-admin4.05 ▲0.6437.03 ▲3.46
Posts /wp-admin/edit.php4.34 ▲0.7043.54 ▲5.04
Add New Post /wp-admin/post-new.php7.58 ▲0.6197.89 ▼1,171.37
Media Library /wp-admin/upload.php3.99 ▲0.7028.36 ▲4.44
Add New Menu /wp-admin/post-new.php?post_type=magee-restaurant4.2044.79
Install Plugins /wp-admin/themes.php?page=magee-restaurant-install-plugins4.0027.26
Settings /wp-admin/edit.php?post_type=magee-restaurant&page=mgrt-setting3.9726.49
Restaurant Menus /wp-admin/edit.php?post_type=magee-restaurant4.0427.96

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 56 new files
Database: no new tables, 16 new options
New WordPress options
mgrt_ct_specific_position_x
mgrt_thumbnail_image_display
mgrt_ct_tab_title
mgrt_ct_show_type_product
mgrt_ct_show_404_page
mgrt_ct_show_type_page
mgrt_thumbnail_width
mgrt_ct_specific_position_y
mgrt_ct_show_type_post
mgrt_thumbnail_height
...

Browser metrics Passed 4 tests

An overview of browser requirements for Magee Restaurant
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,995 ▲27316.93 ▲1.299.36 ▲3.4718.83 ▲15.94
Dashboard /wp-admin2,993 ▲1327.05 ▲0.88115.30 ▼24.71169.95 ▲11.24
Posts /wp-admin/edit.php2,802 ▲1453.24 ▼0.0069.47 ▲6.11177.96 ▲33.38
Add New Post /wp-admin/post-new.php1,741 ▲8022.43 ▲6.42410.83 ▼35.95169.57 ▲8.28
Media Library /wp-admin/upload.php1,806 ▲1056.06 ▲0.55116.01 ▼21.98199.48 ▲16.30
Add New Menu /wp-admin/post-new.php?post_type=magee-restaurant2,5144.6480.01172.36
Install Plugins /wp-admin/themes.php?page=magee-restaurant-install-plugins1,3173.1458.11125.24
Settings /wp-admin/edit.php?post_type=magee-restaurant&page=mgrt-setting1,2933.1170.28143.14
Restaurant Menus /wp-admin/edit.php?post_type=magee-restaurant1,4553.4965.04148.47

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
The following items require your attention
  • The uninstall procedure has failed, leaving 16 options in the database
    • mgrt_ct_horizontal_position
    • mgrt_thumbnail_style
    • mgrt_thumbnail_height
    • mgrt_primary_color
    • mgrt_thumbnail_image_display
    • mgrt_ct_specific_position_x
    • mgrt_thumbnail_width
    • mgrt_ct_show_type_page
    • mgrt_ct_display_cart
    • mgrt_ct_tab_title
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/magee-restaurant/inc/class-tgm-plugin-activation.php:2130

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: slider, product slider, woocommerce slider, shortcode, restaurant...

magee-restaurant/magee-restaurant.php 92% from 13 tests

The principal PHP file in "Magee Restaurant" v. 1.0.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 507 characters long)

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
Everything looks great! No dangerous files found in this plugin4,451 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP67381,6932,920
CSS316328827
JavaScript420899704

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity39.55
▷ Minimum class complexity1.00
▷ Maximum class complexity207.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods118
▷ Static methods75.93%
▷ Public methods9580.51%
▷ Protected methods2319.49%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
28 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/prettyPhoto/dark_square/btnPrevious.png1.41KB1.19KB▼ 15.74%
assets/images/prettyPhoto/light_rounded/sprite.png4.00KB2.56KB▼ 36.16%
assets/images/prettyPhoto/light_square/btnPrevious.png1.41KB1.19KB▼ 15.74%
assets/images/prettyPhoto/default/sprite_prev.png1.34KB0.38KB▼ 71.73%
assets/images/prettyPhoto/dark_rounded/btnPrevious.png1.41KB1.19KB▼ 15.74%