10% menu-badge

Code Review | Menu Badger

WordPress plugin Menu Badger scored 10% from 54 tests.

About plugin

  • Plugin page: menu-badge
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6
  • WordPress version: 5.9.2
  • First release: Jul 30, 2016
  • Latest release: Nov 16, 2016
  • Number of updates: 22
  • Update frequency: every 5.0 days
  • Top authors: squidstack (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active / 2,588 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/menu-badge/menu-badger.php+35
    Use of undefined constant customImage - assumed 'customImage' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼2.50MB] [CPU: ▼340.40ms] Passed 4 tests

A check of server-side resources used by Menu Badger
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.87 ▼1.644.30 ▼47.45
Dashboard /wp-admin1.89 ▼1.523.84 ▼29.38
Posts /wp-admin/edit.php1.89 ▼1.754.83 ▼31.13
Add New Post /wp-admin/post-new.php1.89 ▼5.083.49 ▼1,253.64
Media Library /wp-admin/upload.php1.89 ▼1.403.59 ▼19.89

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Menu Badger
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,088 ▲36618.05 ▲2.279.00 ▲1.712.26 ▼0.12
Dashboard /wp-admin3,110 ▲2498.19 ▲1.98141.90 ▲6.00168.34 ▲4.90
Posts /wp-admin/edit.php2,937 ▲2464.68 ▲1.4481.17 ▲13.73159.71 ▲4.16
Add New Post /wp-admin/post-new.php1,680 ▲1916.46 ▲0.47395.39 ▼22.14201.23 ▲47.55
Media Library /wp-admin/upload.php1,722 ▲245.69 ▲0.15109.73 ▼29.47197.90 ▲12.15

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
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

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 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 to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === menu-badge === )
The official readme.txt might help

menu-badge/menu-badger.php 85% from 13 tests

"Menu Badger" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("menu-badge.php" instead of "menu-badger.php")
  • 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 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected323 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP36430186
JavaScript43137112
CSS23025

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.13
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
11 PNG files occupy 0.16MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/badges/new-green.png22.61KB8.29KB▼ 63.33%
img/new-red-ico.png3.57KB0.99KB▼ 72.12%
img/badges/apple-number-2.png5.49KB3.03KB▼ 44.84%
img/badges/apple-number-3.png3.91KB2.49KB▼ 36.33%
img/badges/new-red.png22.48KB7.62KB▼ 66.11%