89% post-hierarchy-menu

Code Review | Post Hierarchy Menu

WordPress plugin Post Hierarchy Menu scored89%from 54 tests.

About plugin

  • Plugin page: post-hierarchy-menu
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3
  • WordPress version: 6.3.1
  • First release: Sep 12, 2015
  • Latest release: Sep 13, 2015
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: ijmccallum (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /994 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.46ms] Passed 4 tests

Server-side resources used by Post Hierarchy Menu
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.07 ▼4.52
Dashboard /wp-admin3.32 ▲0.0154.50 ▲6.21
Posts /wp-admin/edit.php3.37 ▲0.0148.81 ▲0.57
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.23 ▲0.18
Media Library /wp-admin/upload.php3.24 ▲0.0135.39 ▼2.08

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_wpb_widget
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Post Hierarchy Menu
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲3213.17 ▼1.181.65 ▼0.3139.14 ▼8.69
Dashboard /wp-admin2,206 ▲155.85 ▲0.81109.22 ▲0.5138.50 ▼6.73
Posts /wp-admin/edit.php2,089 ▼01.97 ▼0.0639.64 ▼2.0635.62 ▲0.39
Add New Post /wp-admin/post-new.php1,533 ▲1923.14 ▲5.52653.08 ▼58.7162.01 ▲2.35
Media Library /wp-admin/upload.php1,388 ▼04.20 ▲0.0198.24 ▼9.5143.59 ▼3.31

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_wpb_widget
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (admin.png: The hierarchical post types.), #2 (front-end.png: The result.)
The official readme.txt is a good inspiration

post-hierarchy-menu/post-hierarchy-menu.php 85% from 13 tests

"Post Hierarchy Menu" version 0.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • 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
  • Domain Path: The domain path folder was not found ("/languages")

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
No dangerous file extensions were detected220 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP248114193
Markdown115027

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin.png15.98KB7.08KB▼ 55.71%
assets/front-end.png30.21KB12.21KB▼ 59.58%