90% hide-drafts-in-menus

Code Review | Hide Drafts in Menus

WordPress plugin Hide Drafts in Menus scored90%from 54 tests.

About plugin

  • Plugin page: hide-drafts-in-menus
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 10, 2016
  • Latest release: Nov 1, 2023
  • Number of updates: 24
  • Update frequency: every 107.0 days
  • Top authors: room34 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /8,484 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: ▼11.31ms] Passed 4 tests

Server-side resources used by Hide Drafts in Menus
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.09 ▼5.07
Dashboard /wp-admin3.32 ▼0.0345.45 ▼17.13
Posts /wp-admin/edit.php3.38 ▲0.0149.10 ▼3.18
Add New Post /wp-admin/post-new.php5.91 ▲0.0179.49 ▼19.84
Media Library /wp-admin/upload.php3.25 ▲0.0133.69 ▼2.53

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Hide Drafts in Menus
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.23 ▼0.121.65 ▼0.0841.84 ▼0.69
Dashboard /wp-admin2,198 ▲185.61 ▼0.0388.41 ▲1.0842.19 ▲2.76
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0137.86 ▲1.3434.94 ▲0.40
Add New Post /wp-admin/post-new.php1,526 ▼023.43 ▲0.51605.58 ▲4.1548.12 ▲1.18
Media Library /wp-admin/upload.php1,400 ▼34.17 ▲0.0092.80 ▼9.7143.18 ▲1.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
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 errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: pages, unpublished, drafts, menus

hide-drafts-in-menus/hide-drafts-in-menus.php 92% from 13 tests

"Hide Drafts in Menus" version 1.5.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, 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 not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin65 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1214065

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.56
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 functions480.00%
▷ Anonymous functions120.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