78% demomentsomtres-restaurant

Code Review | DeMomentSomTres Restaurant

WordPress plugin DeMomentSomTres Restaurant scored78%from 54 tests.

About plugin

  • Plugin page: demomentsomtres-r...
  • Plugin version: 202105030000...
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.7.1
  • WordPress version: 6.3.1
  • First release: Jul 10, 2013
  • Latest release: May 4, 2021
  • Number of updates: 61
  • Update frequency: every 47.1 days
  • Top authors: marcqueralt (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /8,374 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.03MB] [CPU: ▼5.46ms] Passed 4 tests

Analyzing server-side resources used by DeMomentSomTres Restaurant
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5428.01 ▼13.20
Dashboard /wp-admin4.50 ▲1.2051.14 ▲1.65
Posts /wp-admin/edit.php4.55 ▲1.2049.22 ▲0.61
Add New Post /wp-admin/post-new.php7.10 ▲1.2192.14 ▼10.90
Media Library /wp-admin/upload.php4.42 ▲1.1950.28 ▲18.35
Add New /wp-admin/post-new.php?post_type=dish-list4.5858.81
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins4.5740.04
Menu Types /wp-admin/edit-tags.php?taxonomy=dish-list-type&post_type=dish-list4.4239.30
All menus /wp-admin/edit.php?post_type=dish-list4.4744.40

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for DeMomentSomTres Restaurant
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14413.26 ▼1.425.42 ▲3.4241.76 ▼10.38
Dashboard /wp-admin2,274 ▲895.98 ▲0.08101.78 ▼17.9142.33 ▼3.03
Posts /wp-admin/edit.php2,165 ▲762.19 ▲0.1836.03 ▼1.5634.55 ▲0.10
Add New Post /wp-admin/post-new.php1,576 ▲3423.40 ▲5.33666.24 ▲25.0862.50 ▲10.48
Media Library /wp-admin/upload.php1,467 ▲794.28 ▲0.0799.11 ▲4.7143.74 ▼0.50
Add New /wp-admin/post-new.php?post_type=dish-list2,9227.93174.3785.57
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins1,0232.0727.7631.30
Menu Types /wp-admin/edit-tags.php?taxonomy=dish-list-type&post_type=dish-list1,3442.3429.2933.40
All menus /wp-admin/edit.php?post_type=dish-list1,1832.0134.3035.58

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/lib/php-css-parser/tests/quickdump.php
  • 140× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\AbstractRenderer' not found in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/src/Renderer/Inline.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/glyf.php:21
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/lib/Cpdf.php on line 467
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/lib/php-css-parser/tests/Sabberworm/CSS/RuleSet/LenientParsingTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/src/FrameDecorator/TableRowGroup.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/lib/php-svg-lib/tests/Svg/StyleTest.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Glyph\\Outline' not found in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineSimple.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Group' not found in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Anchor.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/src/Positioner/ListBullet.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/demomentsomtres-restaurant/lib/dompdf/lib/php-font-lib/tests/FontLib/FontTest.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: woocommerce, menu, restaurant menu, custom post type, restaurant carte...

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

This is the main PHP file of "DeMomentSomTres Restaurant" version 202105030000..., providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "202105030000...")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected42,564 lines of code in 254 files:
LanguageFilesBlank linesComment linesLines of code
PHP1968,77816,66640,073
Markdown62550909
CSS3113460650
PO File2168197416
XML732214
JSON500135
JavaScript21087
YAML416363
HTML10017

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity35.84
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces33
Interfaces5
Traits0
Classes185
▷ Abstract classes126.49%
▷ Concrete classes17393.51%
▷ Final classes00.00%
Methods2,081
▷ Static methods934.47%
▷ Public methods1,77885.44%
▷ Protected methods20810.00%
▷ Private methods954.57%
Functions18
▷ Named functions316.67%
▷ Anonymous functions1583.33%
Constants180
▷ Global constants21.11%
▷ Class constants17898.89%
▷ Public constants178100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
mce_plugins/icon-glutenfree.png7.11KB4.44KB▼ 37.59%
mce_plugins/icon-template.png11.43KB3.91KB▼ 65.78%
mce_plugins/icon-veg.png7.56KB2.80KB▼ 63.03%
mce_plugins/icon-eco.png6.97KB1.61KB▼ 76.86%
mce_plugins/icon-price.png6.80KB2.22KB▼ 67.28%