78% main-menu-html-site-map

Code Review | Main Menu HTML Sitemap

WordPress plugin Main Menu HTML Sitemap scored78%from 54 tests.

About plugin

  • Plugin page: main-menu-html-si...
  • Plugin version: 2.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: May 7, 2020
  • Latest release: Aug 14, 2023
  • Number of updates: 12
  • Update frequency: every 99.5 days
  • Top authors: apsaraaruna (100%)Otto42 (16.67%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,297 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.13MB] [CPU: ▼3.70ms] Passed 4 tests

Server-side resources used by Main Menu HTML Sitemap
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1235.58 ▲0.50
Dashboard /wp-admin3.43 ▲0.1342.94 ▼3.86
Posts /wp-admin/edit.php3.55 ▲0.1944.05 ▼0.58
Add New Post /wp-admin/post-new.php6.03 ▲0.1490.02 ▼4.87
Media Library /wp-admin/upload.php3.36 ▲0.1234.38 ▼5.50
Main menu Sitemap /wp-admin/options-general.php?page=mmh_sitemap3.3040.95

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
mmh_sitemap_display_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Main Menu HTML Sitemap
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲9413.44 ▼1.027.49 ▲5.6139.27 ▲0.58
Dashboard /wp-admin2,206 ▲325.59 ▲0.0891.55 ▲3.6640.33 ▼2.12
Posts /wp-admin/edit.php2,111 ▲112.00 ▲0.0240.42 ▲5.5435.22 ▲0.77
Add New Post /wp-admin/post-new.php1,542 ▲1418.30 ▼4.71604.69 ▼79.7865.81 ▲13.96
Media Library /wp-admin/upload.php1,411 ▲144.19 ▼0.0397.67 ▼4.4241.61 ▼3.52
Main menu Sitemap /wp-admin/options-general.php?page=mmh_sitemap8912.0527.0530.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • mmh_sitemap_display_options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=mmh_sitemap
    • > Notice in wp-content/plugins/main-menu-html-site-map/admin/class-mmh-sitemap-settings.php+385
    Undefined index: sitemap-blog
    • > GET request to /wp-admin/options-general.php?page=mmh_sitemap
    • > Notice in wp-content/plugins/main-menu-html-site-map/admin/class-mmh-sitemap-settings.php+475
    Undefined index: exclude_menu_items
    • > GET request to /wp-admin/options-general.php?page=mmh_sitemap
    • > Notice in wp-content/plugins/main-menu-html-site-map/admin/class-mmh-sitemap-settings.php+488
    Undefined index: exclude_post_cat

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/main-menu-html-site-map/public/partials/mmh-sitemap-public-display.php
    • > /wp-content/plugins/main-menu-html-site-map/admin/partials/mmh-sitemap-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention: The official readme.txt might help

main-menu-html-site-map/main-menu-html-sitemap.php 85% from 13 tests

Analyzing the main PHP file in "Main Menu HTML Sitemap" version 2.0.2
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("main-menu-html-site-map.php" instead of "main-menu-html-sitemap.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
Good job! No executable or dangerous file extensions detected608 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13280697570
JavaScript2126132
CSS2086

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.62
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods50
▷ Static methods24.00%
▷ Public methods4488.00%
▷ Protected methods00.00%
▷ Private methods612.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin