78% fixed-menu-anchor

Code Review | Fixed Menu Anchor

WordPress plugin Fixed Menu Anchor scored78%from 54 tests.

About plugin

  • Plugin page: fixed-menu-anchor
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.5.2
  • WordPress version: 6.3.1
  • First release: Sep 25, 2015
  • Latest release: Aug 5, 2016
  • Number of updates: 51
  • Update frequency: every 6.2 days
  • Top authors: k00ni (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /8,170 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
Install script ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼3.21ms] Passed 4 tests

Server-side resources used by Fixed Menu Anchor
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2644.38 ▲9.06
Dashboard /wp-admin3.56 ▲0.2147.10 ▼12.68
Posts /wp-admin/edit.php3.61 ▲0.2550.11 ▲1.43
Add New Post /wp-admin/post-new.php6.07 ▲0.1984.12 ▼5.10
Media Library /wp-admin/upload.php3.42 ▲0.1935.80 ▲3.50
Fixed Menu Anchor /wp-admin/themes.php?page=fixedMenuAnchor3.6932.77

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Fixed Menu Anchor
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲14213.38 ▼0.919.08 ▲7.4043.31 ▲1.90
Dashboard /wp-admin2,201 ▲215.64 ▼0.0190.31 ▲2.6040.82 ▲4.69
Posts /wp-admin/edit.php2,109 ▲91.97 ▼0.0138.57 ▲1.4735.10 ▲0.77
Add New Post /wp-admin/post-new.php1,542 ▲1418.13 ▼5.02617.22 ▼46.2566.04 ▲8.37
Media Library /wp-admin/upload.php1,406 ▲64.15 ▼0.0598.44 ▼11.7141.20 ▼1.11
Fixed Menu Anchor /wp-admin/themes.php?page=fixedMenuAnchor1,0012.1223.8848.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/themes.php?page=fixedMenuAnchor
    • > User deprecated in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/Autoloader.php+12
    The Twig_Autoloader class is deprecated since version 1.21 and will be removed in 2.0. Use Composer instead.
    • > GET request to /wp-admin/themes.php?page=fixedMenuAnchor
    • > User deprecated in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/Autoloader.php+30
    Using Twig_Autoloader is deprecated since version 1.21. Use Composer instead.

SRP 50% from 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
Please take a closer look at the following
  • 213× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Test' not found in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Filter' not found in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/TokenParser/For.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Hamcrest\\BaseMatcher' not found in wp-content/plugins/fixed-menu-anchor/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Unary' not found in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Test' not found in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_BaseNodeVisitor' not found in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Hamcrest\\TypeSafeMatcher' not found in wp-content/plugins/fixed-menu-anchor/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_TemplateInterface' not found in wp-content/plugins/fixed-menu-anchor/vendor/twig/twig/lib/Twig/Template.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === fixed-menu-anchor === )
The official readme.txt is a good inspiration

fixed-menu-anchor/fixed-menu-anchor.php 92% from 13 tests

The entry point to "Fixed Menu Anchor" version 2.3 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 183 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected14,981 lines of code in 284 files:
LanguageFilesBlank linesComment linesLines of code
PHP2733,1717,66213,925
SVG333455
JSON200189
JavaScript333121183
HTML1380169
CSS13041
XML10019

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity6.45
▷ Minimum class complexity1.00
▷ Maximum class complexity122.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces14
Interfaces25
Traits0
Classes240
▷ Abstract classes218.75%
▷ Concrete classes21991.25%
▷ Final classes00.00%
Methods1,313
▷ Static methods16112.26%
▷ Public methods1,12285.45%
▷ Protected methods16312.41%
▷ Private methods282.13%
Functions138
▷ Named functions13194.93%
▷ Anonymous functions75.07%
Constants54
▷ Global constants23.70%
▷ Class constants5296.30%
▷ Public constants52100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ignore-click-event.png17.39KB7.79KB▼ 55.23%
img/laptop.png13.80KB7.09KB▼ 48.63%
img/phone.png10.56KB4.69KB▼ 55.55%