68% foodlist

Code Review | Foodlist

WordPress plugin Foodlist scored68%from 54 tests.

About plugin

  • Plugin page: foodlist
  • Plugin version: 1.13
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Oct 24, 2013
  • Latest release: Nov 12, 2016
  • Number of updates: 19
  • Update frequency: every 58.7 days
  • Top authors: v-media (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

40+ active /5,698 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.91MB] [CPU: ▲3.44ms] Passed 4 tests

An overview of server-side resources used by Foodlist
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6139.73 ▲0.89
Dashboard /wp-admin4.34 ▲1.0456.75 ▲7.54
Posts /wp-admin/edit.php4.41 ▲1.0552.36 ▲5.00
Add New Post /wp-admin/post-new.php6.89 ▲1.00101.95 ▲1.36
Media Library /wp-admin/upload.php4.20 ▲0.9742.52 ▲6.49
Menu Tags /wp-admin/admin.php?page=foodlist-menu-tags4.1939.60
Add New /wp-admin/post-new.php?post_type=fl-menu-item4.4162.88
Section Manager /wp-admin/admin.php?page=foodlist-section-manager4.3753.71
Add New /wp-admin/post-new.php?post_type=fl-menu4.3852.99
All Menu Sections /wp-admin/edit.php?post_type=fl-menu-section4.3845.54
All Menu Items /wp-admin/edit.php?post_type=fl-menu-item4.4451.05
Menu Manager /wp-admin/admin.php?page=foodlist-menu-manager4.2444.69
Settings /wp-admin/admin.php?page=foodlist-settings4.1837.85
Dashboard /wp-admin/admin.php?page=foodlist-dashboard4.1739.23
All Menus /wp-admin/edit.php?post_type=fl-menu4.3745.16

Server storage [IO: ▲0.82MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 187 new files
Database: 1 new table, 9 new options
New tables
wp_foodlist_menu_tagmeta
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
foodlist_demo_data_ids
widget_recent-comments
foodlist_first_start
foodlist
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Foodlist: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,980 ▲24513.33 ▼1.361.56 ▼0.1437.02 ▼6.90
Dashboard /wp-admin2,375 ▲1875.06 ▼0.79108.65 ▲6.1641.35 ▼1.15
Posts /wp-admin/edit.php2,261 ▲1692.33 ▲0.3048.06 ▲6.8531.03 ▼3.76
Add New Post /wp-admin/post-new.php1,705 ▲18218.22 ▼4.58615.89 ▼24.1333.29 ▼21.11
Media Library /wp-admin/upload.php1,784 ▲3994.76 ▲0.57100.06 ▼1.2945.24 ▼1.74
Menu Tags /wp-admin/admin.php?page=foodlist-menu-tags1,6604.3361.9531.81
Add New /wp-admin/post-new.php?post_type=fl-menu-item2,0485.2193.9636.04
Section Manager /wp-admin/admin.php?page=foodlist-section-manager1,9924.8267.9031.06
Add New /wp-admin/post-new.php?post_type=fl-menu1,9905.2483.1233.52
All Menu Sections /wp-admin/edit.php?post_type=fl-menu-section2,1162.3339.1231.10
All Menu Items /wp-admin/edit.php?post_type=fl-menu-item2,6402.3445.2732.79
Menu Manager /wp-admin/admin.php?page=foodlist-menu-manager1,5324.5665.0027.77
Settings /wp-admin/admin.php?page=foodlist-settings2,6185.74122.7567.82
Dashboard /wp-admin/admin.php?page=foodlist-dashboard1,2324.3359.7428.41
All Menus /wp-admin/edit.php?post_type=fl-menu1,8012.3239.4429.77

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_foodlist_menu_tagmeta
  • This plugin does not fully uninstall, leaving 9 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • foodlist
    • widget_recent-posts
    • foodlist_first_start
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • foodlist_demo_data_ids

Smoke tests 50% 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
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=foodlist-dashboard
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=foodlist-menu-tags
    • > Notice in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Admin/Table/TagListTableList.php+301
    compact(): Undefined variable: search

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
Please take a closer look at the following
  • 81× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Artprima\\WordPress\\API\\Wrapper\\Generic\\CustomPost' not found in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/PostType/MenuSectionPostType.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Artprima\\Text\\Shortcode' not found in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/Shortcode/Internal/MenuSectionIdShortcode.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Artprima\\WordPress\\API\\Wrapper\\Generic\\CustomPost' not found in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/PostType/MenuItemPostType.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Foodlist\\Project\\WordPress\\Plugin\\Foodlist\\Generic\\Post\\BasePost' not found in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/Post/MenuPost.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Artprima\\Text\\Shortcode' not found in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/Shortcode/Internal/MenuIdShortcode.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foodlist/meta.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Foodlist\\Project\\WordPress\\Plugin\\Foodlist\\Controller\\BaseController' not found in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Controller/Shortcode/MenuShortcodeController.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Artprima\\WordPress\\API\\Wrapper\\Admin\\Metabox\\PostMetabox' not found in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Admin/Metabox/MenuSection/ItemsMetabox.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Foodlist\\Project\\WordPress\\Plugin\\Foodlist\\Controller\\BaseController' not found in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Controller/Page/TagPageController.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Artprima\\Text\\Shortcode' not found in wp-content/plugins/foodlist/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/Shortcode/Internal/MenuItemIdShortcode.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
7 plugin tags: caf menu, restaurant, eatery, list, restaurant menu...

foodlist/plugin.php 92% from 13 tests

"Foodlist" version 1.13's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("foodlist.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin10,977 lines of code in 161 files:
LanguageFilesBlank linesComment linesLines of code
PHP1041,3041,7795,624
JavaScript476496773,449
PO File2378472969
CSS415826782
Markdown124059
Bourne Shell119050
JSON20044

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.08
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces30
Interfaces2
Traits0
Classes99
▷ Abstract classes66.06%
▷ Concrete classes9393.94%
▷ Final classes00.00%
Methods454
▷ Static methods91.98%
▷ Public methods41491.19%
▷ Protected methods81.76%
▷ Private methods327.05%
Functions14
▷ Named functions857.14%
▷ Anonymous functions642.86%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/food-grey.png10.84KB5.16KB▼ 52.40%
assets/images/icons/healthy.png0.76KB0.99KB0.00%
assets/images/icons/star.png0.55KB0.38KB▼ 31.79%
assets/images/food-grey_34x34.png1.74KB1.50KB▼ 13.59%
assets/images/icons/trophy.png0.83KB0.75KB▼ 9.46%