10% better-anchor-links

Code Review | Better Anchor Links

WordPress plugin Better Anchor Links scored10%from 54 tests.

About plugin

  • Plugin page: better-anchor-links
  • Plugin version: 1.7.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Jul 14, 2011
  • Latest release: Feb 2, 2015
  • Number of updates: 83
  • Update frequency: every 15.7 days
  • Top authors: elpresidento (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active /41,779 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/better-anchor-links/auto-anchor-list.php+30
    Methods with the same name as their class will not be constructors in a future version of PHP; mwm_aalLoader has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼51.53ms] Passed 4 tests

An overview of server-side resources used by Better Anchor Links
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.85 ▼35.09
Dashboard /wp-admin2.10 ▼1.205.47 ▼38.67
Posts /wp-admin/edit.php2.10 ▼1.266.72 ▼41.90
Add New Post /wp-admin/post-new.php2.10 ▼3.795.98 ▼90.45
Media Library /wp-admin/upload.php2.10 ▼1.135.83 ▼29.56
B. Anchor Links /wp-admin/options-general.php?page=better-anchor-links/admin/options.php2.106.11

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
lm_bal_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Better Anchor Links
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6014.48 ▲0.021.80 ▲0.1844.85 ▲3.56
Dashboard /wp-admin2,210 ▲274.84 ▼0.13104.27 ▼5.6539.36 ▼1.11
Posts /wp-admin/edit.php2,090 ▲11.97 ▼0.0735.11 ▼2.8633.03 ▼5.12
Add New Post /wp-admin/post-new.php1,546 ▲418.46 ▲0.25629.00 ▼26.8952.00 ▼1.31
Media Library /wp-admin/upload.php1,386 ▲14.16 ▼0.0199.44 ▼6.2746.10 ▲1.24
B. Anchor Links /wp-admin/options-general.php?page=better-anchor-links/admin/options.php1,1022.0326.1932.32

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/better-anchor-links/auto-anchor-list.php+30
    Methods with the same name as their class will not be constructors in a future version of PHP; mwm_aalLoader has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • lm_bal_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=better-anchor-links/admin/options.php
    • > Deprecated in wp-content/plugins/better-anchor-links/auto-anchor-list.php+30
    Methods with the same name as their class will not be constructors in a future version of PHP; mwm_aalLoader has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=better-anchor-links/admin/options.php
    • > Deprecated in wp-content/plugins/better-anchor-links/admin/admin.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; mwm_aalAdminPanel has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=better-anchor-links/admin/options.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=better-anchor-links/admin/options.php
    • > Notice in wp-content/plugins/better-anchor-links/admin/options.php+4
    Undefined index: page_options

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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/better-anchor-links/admin/options.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/better-anchor-links/auto-anchor-list.php:46
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/better-anchor-links/mwm-aal-class.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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: Please add images for these screenshots: #1 (Admin options), #2 (Display in default wordpress template), #3 (Auto indent)
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
Please take inspiration from this readme.txt

better-anchor-links/auto-anchor-list.php 92% from 13 tests

The main file in "Better Anchor Links" v. 1.7.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("better-anchor-links.php" instead of "auto-anchor-list.php")

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
There were no executable files found in this plugin470 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP47262462
CSS1028

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity21.33
▷ Minimum class complexity2.00
▷ Maximum class complexity49.00
Average method complexity3.77
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin