82% weekly-menu

Code Review | Weekly Menu

WordPress plugin Weekly Menu scored 82% from 54 tests.

About plugin

  • Plugin page: weekly-menu
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.0
  • WordPress version: 5.8.1
  • First release: Aug 1, 2017
  • Latest release: Aug 1, 2017
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: piumaz (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 971 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.23MB] [CPU: ▼152.02ms] Passed 4 tests

A check of server-side resources used by Weekly Menu
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.1233.46 ▼0.58
Dashboard /wp-admin3.17 ▲0.1251.33 ▲5.21
Posts /wp-admin/edit.php3.28 ▲0.1746.16 ▲0.70
Add New Post /wp-admin/post-new.php4.15 ▼1.2856.83 ▼599.85
Media Library /wp-admin/upload.php3.11 ▲0.1132.41 ▼8.36
Settings /wp-admin/edit.php?post_type=pmz-weekly-menu&page=settings3.0928.20
Add New /wp-admin/post-new.php?post_type=pmz-weekly-menu3.0535.89
All Weekly Menus /wp-admin/edit.php?post_type=pmz-weekly-menu3.1632.94

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 24 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Weekly Menu
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,847 ▲25116.46 ▲1.0014.03 ▲4.4153.76 ▲7.58
Dashboard /wp-admin3,014 ▲806.00 ▲0.08146.78 ▼1.53104.17 ▼0.69
Posts /wp-admin/edit.php2,783 ▲442.71 ▼0.0274.60 ▲9.8686.61 ▼0.06
Add New Post /wp-admin/post-new.php1,530 ▼5118.56 ▲0.93427.72 ▲2.57121.47 ▲8.88
Media Library /wp-admin/upload.php1,851 ▲445.04 ▲0.03152.97 ▼5.35109.73 ▼8.29
Settings /wp-admin/edit.php?post_type=pmz-weekly-menu&page=settings1,2762.3355.4270.70
Add New /wp-admin/post-new.php?post_type=pmz-weekly-menu3,0609.17218.47140.57
All Weekly Menus /wp-admin/edit.php?post_type=pmz-weekly-menu1,4622.6366.7167.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pmz-weekly-menu&page=settings
    • > Notice in wp-content/plugins/weekly-menu/admin/partials/pmz-weekly-menu-admin-display.php+56
    Undefined variable: id
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+104
    Trying to access array offset on value of type bool
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pmz-weekly-menu&page=settings
    • > Notice in wp-content/plugins/weekly-menu/admin/partials/pmz-weekly-menu-admin-display.php+56
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: monday_breakfast
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: monday_lunch
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: monday_snack
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: monday_dinner
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: tuesday_breakfast
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: tuesday_lunch
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: tuesday_snack
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: tuesday_dinner
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: wednesday_breakfast
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: wednesday_lunch
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: wednesday_snack
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: wednesday_dinner
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: thursday_breakfast
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: thursday_lunch
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: thursday_snack
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: thursday_dinner
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: friday_breakfast
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: friday_lunch
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: friday_snack
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: friday_dinner
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: saturday_breakfast
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: saturday_lunch
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: saturday_snack
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: saturday_dinner
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: sunday_breakfast
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: sunday_lunch
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: sunday_snack
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Notice in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+153
    Undefined index: sunday_dinner
    • > GET request to /wp-admin/post-new.php?post_type=pmz-weekly-menu
    • > Warning in wp-content/plugins/weekly-menu/admin/class-pmz-weekly-menu-admin.php+104
    Invalid argument supplied for foreach()

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/weekly-menu/public/partials/pmz-weekly-menu-public-display.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/weekly-menu/public/partials/content-pmz-weekly-menu.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/weekly-menu/public/partials/single-pmz-weekly-menu.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/weekly-menu/admin/partials/pmz-weekly-menu-admin-display.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Donate link: Invalid URI found ("")
The official readme.txt might help

weekly-menu/pmz-weekly-menu.php 85% from 13 tests

The primary PHP file in "Weekly Menu" version 1.0.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("weekly-menu.php" instead of "pmz-weekly-menu.php")
  • 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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin515 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP14226595475
CSS23825
JavaScript2115415

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.43
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods35
▷ Static methods514.29%
▷ Public methods3085.71%
▷ Protected methods00.00%
▷ Private methods514.29%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin