77% atr-advanced-menu

Code Review | ATR advanced menu

WordPress plugin ATR advanced menu scored77%from 54 tests.

About plugin

  • Plugin page: atr-advanced-menu
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.4-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 8, 2016
  • Latest release: Dec 17, 2022
  • Number of updates: 46
  • Update frequency: every 49.8 days
  • Top authors: yehudaT (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,951 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.05MB] [CPU: ▼5.01ms] Passed 4 tests

Analyzing server-side resources used by ATR advanced menu
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.49 ▼1.84
Dashboard /wp-admin3.36 ▲0.0649.65 ▲0.17
Posts /wp-admin/edit.php3.48 ▲0.1353.57 ▲3.44
Add New Post /wp-admin/post-new.php5.95 ▲0.0682.01 ▼19.83
Media Library /wp-admin/upload.php3.27 ▲0.0433.09 ▲1.48
Atr Advanced Menu Options /wp-admin/themes.php?page=atr_advanced_menu3.2734.98

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 39 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
atr_advanced_menu_display_options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for ATR advanced menu
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲23514.89 ▲0.492.07 ▲0.0643.92 ▼6.74
Dashboard /wp-admin2,351 ▲1666.50 ▲0.62144.53 ▲44.2841.72 ▼3.51
Posts /wp-admin/edit.php2,254 ▲1653.42 ▲1.4049.57 ▲11.0730.87 ▼5.97
Add New Post /wp-admin/post-new.php1,521 ▼1317.66 ▼5.48612.18 ▲6.8335.17 ▼31.44
Media Library /wp-admin/upload.php1,390 ▲84.28 ▲0.1186.81 ▼11.0141.11 ▼4.22
Atr Advanced Menu Options /wp-admin/themes.php?page=atr_advanced_menu1,0783.1838.0627.47

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 does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • atr_advanced_menu_display_options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 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
Please fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/atr-advanced-menu/public/partials/atr-am-public-display.php
    • > /wp-content/plugins/atr-advanced-menu/admin/partials/atr-am-admin-display.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/atr-advanced-menu/admin/walkers-edit/class-atr-am-walker-edit.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/atr-advanced-menu/includes/walkers/class-atr-am-walker.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Screenshot #3 (Description of third screenshot named screenshot-3) image missing
The official readme.txt might help

atr-advanced-menu/atr-am.php 77% from 13 tests

This is the main PHP file of "ATR advanced menu" version 1.0.4, 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:
  • Description: Please keep the plugin description shorter than 140 characters (currently 242 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("atr-advanced-menu.php" instead of "atr-am.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("3.9" instead of "2.6.4")

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
Success! There were no dangerous files found in this plugin3,255 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51877761,510
PHP183319831,095
CSS59292496
PO File14570154

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity11.08
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods54
▷ Static methods35.56%
▷ Public methods4888.89%
▷ Protected methods00.00%
▷ Private methods611.11%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/walkers-edit/img/189-tree_1.png0.18KB0.16KB▼ 13.44%
admin/walkers-edit/img/189-tree.png0.27KB0.19KB▼ 31.54%
admin/walkers-edit/img/dialog_warning.png1.23KB1.25KB0.00%