84% page-menu

Code Review | PageMenu

WordPress plugin PageMenu scored 84% from 54 tests.

About plugin

  • Plugin page: page-menu
  • Plugin version: 5.1.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-5.4.1
  • WordPress version: 6.3.1
  • First release: Mar 29, 2014
  • Latest release: May 31, 2020
  • Number of updates: 35
  • Update frequency: every 64.4 days
  • Top authors: aniketan (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

2,000+ active / 26,773 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.80ms] Passed 4 tests

Server-side resources used by PageMenu
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.52 ▼3.69
Dashboard /wp-admin3.34 ▲0.0447.20 ▼1.20
Posts /wp-admin/edit.php3.40 ▲0.0464.74 ▲12.64
Add New Post /wp-admin/post-new.php5.94 ▲0.0593.61 ▼10.40
Media Library /wp-admin/upload.php3.27 ▲0.0437.05 ▲0.11

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

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

Browser metrics Passed 4 tests

PageMenu: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,861 ▲11514.74 ▲0.092.22 ▲0.3052.66 ▲2.57
Dashboard /wp-admin2,203 ▲185.79 ▼0.06109.08 ▼12.2244.14 ▼2.73
Posts /wp-admin/edit.php2,089 ▼31.99 ▲0.0341.25 ▼5.9136.70 ▼3.94
Add New Post /wp-admin/post-new.php6,497 ▲4,97820.51 ▼2.89994.81 ▲243.9358.72 ▼1.43
Media Library /wp-admin/upload.php1,385 ▼04.22 ▲0.04107.73 ▼27.5948.47 ▼13.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 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 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 fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/page-menu/walker.class.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/page-menu/meta-template.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/page-menu/pagemenu.php:272

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Choose Menu with the metabox) image required
The official readme.txt is a good inspiration

page-menu/pagemenu.php 92% from 13 tests

The primary PHP file in "PageMenu" version 5.1.4 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("page-menu.php" instead of "pagemenu.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin390 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP316815390

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity19.33
▷ Minimum class complexity15.00
▷ Maximum class complexity28.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png12.34KB5.71KB▼ 53.68%