84% menu-item-types-button

Code Review | Menu Item Types — Button

WordPress plugin Menu Item Types — Button scored84%from 54 tests.

About plugin

  • Plugin page: menu-item-types-b...
  • Plugin version: 1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1
  • WordPress version: 6.3.1
  • First release: Dec 20, 2021
  • Latest release: Dec 4, 2022
  • Number of updates: 8
  • Update frequency: every 43.6 days
  • Top authors: maxpertici (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,780 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by Menu Item Types — Button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.57 ▼9.80
Dashboard /wp-admin3.31 ▲0.0046.24 ▼4.89
Posts /wp-admin/edit.php3.36 ▲0.0047.22 ▼2.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.52 ▼6.93
Media Library /wp-admin/upload.php3.23 ▲0.0037.28 ▲0.16

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Menu Item Types — Button
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.20 ▼0.151.65 ▼0.0643.58 ▼0.41
Dashboard /wp-admin2,198 ▲245.56 ▼0.0788.66 ▼6.6542.20 ▲3.07
Posts /wp-admin/edit.php2,097 ▼32.02 ▲0.0634.92 ▼0.7234.69 ▼3.25
Add New Post /wp-admin/post-new.php1,526 ▼223.53 ▲0.46620.60 ▼34.5465.84 ▲6.55
Media Library /wp-admin/upload.php1,400 ▼04.24 ▼0.0098.26 ▼14.3944.13 ▲0.90

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_field() in wp-content/plugins/menu-item-types-button/render/button.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

menu-item-types-button/menu-item-types-button.php 92% from 13 tests

This is the main PHP file of "Menu Item Types — Button" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin130 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP34440125
SVG1005

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin