84% menu-item-duplicator

Code Review | Menu Item Duplicator

WordPress plugin Menu Item Duplicator scored 84% from 54 tests.

About plugin

  • Plugin page: menu-item-duplicator
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.0
  • WordPress version: 6.3.1
  • First release: Oct 15, 2018
  • Latest release: Apr 7, 2023
  • Number of updates: 17
  • Update frequency: every 96.2 days
  • Top authors: mathieuhays (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

2,000+ active / 9,994 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.52ms] Passed 4 tests

An overview of server-side resources used by Menu Item Duplicator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.96 ▼13.48
Dashboard /wp-admin3.31 ▲0.0041.41 ▼6.54
Posts /wp-admin/edit.php3.36 ▲0.0043.67 ▲0.38
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.08 ▲1.57
Media Library /wp-admin/upload.php3.23 ▲0.0036.68 ▲5.29

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Menu Item Duplicator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼1.151.61 ▼0.3939.08 ▼11.86
Dashboard /wp-admin2,209 ▲215.88 ▲0.02108.00 ▲1.8341.56 ▲1.34
Posts /wp-admin/edit.php2,092 ▼02.01 ▼0.0436.46 ▼14.8433.38 ▼1.08
Add New Post /wp-admin/post-new.php1,533 ▼923.43 ▲5.07607.34 ▲9.0062.92 ▼0.64
Media Library /wp-admin/upload.php1,391 ▲64.19 ▲0.0199.02 ▲0.9243.32 ▼1.79

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/menu-item-duplicator/menu-item-duplicator.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: duplicate, navigation, menu

menu-item-duplicator/menu-item-duplicator.php Passed 13 tests

The main PHP script in "Menu Item Duplicator" version 1.0.2 is automatically included on every request by WordPress
63 characters long description:
Enable duplication of menu items (also duplicates sub-elements)

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 detected173 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23715109
PHP2111341
PO File13523

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin