56% daily-menu

Code Review | Daily Menu

WordPress plugin Daily Menu scored56%from 54 tests.

About plugin

  • Plugin page: daily-menu
  • Plugin version: 0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 10, 2014
  • Latest release: Dec 8, 2015
  • Number of updates: 71
  • Update frequency: every 5.5 days
  • Top authors: dr41nU (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,032 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.36MB] [CPU: ▼5.19ms] Passed 4 tests

Analyzing server-side resources used by Daily Menu
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3939.23 ▼16.11
Dashboard /wp-admin3.69 ▲0.3950.77 ▼3.21
Posts /wp-admin/edit.php3.74 ▲0.3852.37 ▲5.15
Add New Post /wp-admin/post-new.php6.23 ▲0.3487.56 ▼4.61
Media Library /wp-admin/upload.php3.55 ▲0.3239.56 ▲3.18
Dishes /wp-admin/admin.php?page=ManageDishes3.5337.22
Daily menu /wp-admin/admin.php?page=ManageDailyMenu3.5132.03
Options /wp-admin/admin.php?page=DailyMenuOptions3.5531.32

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 191 new files
Database: 2 new tables, 13 new options
New tables
wp_dm_dish
wp_dm_menu
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
dm_db_version
widget_recent-posts
widget_dmwidget
dm_shotcode_jqueryui_css
can_compress_scripts
dm_shotcode_css
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Daily Menu
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.17 ▼1.581.68 ▼0.1441.14 ▼3.51
Dashboard /wp-admin2,237 ▲494.91 ▼0.98100.62 ▼13.3940.47 ▼4.27
Posts /wp-admin/edit.php2,120 ▲312.01 ▲0.0140.06 ▲4.0134.87 ▼2.27
Add New Post /wp-admin/post-new.php1,559 ▲4023.18 ▼0.36687.20 ▼2.4247.86 ▼3.04
Media Library /wp-admin/upload.php1,419 ▲344.18 ▼0.0298.32 ▼11.2439.35 ▼5.98
Dishes /wp-admin/admin.php?page=ManageDishes1,6894.55180.4244.10
Daily menu /wp-admin/admin.php?page=ManageDailyMenu1,2664.0577.9730.89
Options /wp-admin/admin.php?page=DailyMenuOptions1,1523.3461.7631.54

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_dm_dish
  • This plugin does not fully uninstall, leaving 10 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • dm_shotcode_jtable_css
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_dmwidget
    • can_compress_scripts
    • dm_shotcode_jqueryui_css
    • dm_shotcode_css

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=ManageDishes
    • > POST request to /wp-admin/admin-ajax.php?action=list_dishes&jtStartIndex=0&jtPageSize=20
    • > Notice in wp-content/plugins/daily-menu/controllers/DishTableControlFunctions.php+16
    Undefined index: jtSorting

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 fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/daily-menu/index.php
  • 35× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'DM_PLUGIN_DIR/models/JSONError.php' (include_path='.:/usr/share/php') in wp-content/plugins/daily-menu/controllers/DishTableControlFunctions.php on line 6
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/daily-menu/view/ManageMenus.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'DM_PLUGIN_DIR/models/Menu.php' (include_path='.:/usr/share/php') in wp-content/plugins/daily-menu/models/Dish.php on line 2
    • > PHP Warning
      require_once(DM_PLUGIN_DIR/models/Menu.php): failed to open stream: No such file or directory in wp-content/plugins/daily-menu/controllers/ListMenus.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'DM_PLUGIN_DIR/models/Type.php' (include_path='.:/usr/share/php') in wp-content/plugins/daily-menu/controllers/ListTypes.php on line 2
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/daily-menu/view/ManageDishes.php on line 4
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/daily-menu/view/ManageSettings.php on line 4
    • > PHP Warning
      require_once(DM_PLUGIN_DIR/models/Type.php): failed to open stream: No such file or directory in wp-content/plugins/daily-menu/controllers/ListTypes.php on line 2
    • > PHP Warning
      require_once(DM_PLUGIN_DIR/models/Dish.php): failed to open stream: No such file or directory in wp-content/plugins/daily-menu/models/Menu.php on line 2
    • > PHP Warning
      Use of undefined constant DM_PLUGIN_DIR - assumed 'DM_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/daily-menu/controllers/InstallController.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=DailyMenuOptions
    • > Network (severe)
    wp-content/plugins/daily-menu/js/jtable/localization/jquery.jtable.en.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Contributors: Plugin contributors field is missing
  • Screenshots: Please add images for these screenshots: #1 (Dishes management), #2 (Menus management), #3 (Daily menu)
The official readme.txt might help

daily-menu/index.php 92% from 13 tests

Analyzing the main PHP file in "Daily Menu" version 0.7
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("daily-menu.php" instead of "index.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
Good job! No executable or dangerous file extensions detected25,878 lines of code in 118 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript332,6302,87111,062
CSS4520741911,003
LESS20374971,760
PHP183487681,457
HTML18415414
PO File18195182

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity8.64
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes436.36%
▷ Concrete classes763.64%
▷ Final classes00.00%
Methods111
▷ Static methods4540.54%
▷ Public methods10998.20%
▷ Protected methods00.00%
▷ Private methods21.80%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants833.33%
▷ Class constants1666.67%
▷ Public constants16100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
54 PNG files occupy 0.26MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/jtable/themes/jqueryui-metroblue/images/ui-icons_66B3FF_0.png9.28KB4.76KB▼ 48.71%
js/jtable/themes/jqueryui-redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png0.29KB0.10KB▼ 65.41%
js/jtable/themes/jqueryui-redmond/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
js/jtable/themes/jqueryui-metroblue/images/ui-icons_d4d4d4_0.png9.28KB4.76KB▼ 48.74%
js/jtable/themes/jqueryui-metroblue/images/ui-icons_ffffff_0.png9.31KB4.76KB▼ 48.86%