10% better-anchor-links

Code Review | Better Anchor Links

WordPress plugin Better Anchor Links scored 10% 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: 5.9.2
  • 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,103 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > 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: ▼2.48MB] [CPU: ▼346.34ms] Passed 4 tests

A check of server-side resources used by Better Anchor Links
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.89 ▼1.634.24 ▼55.28
Dashboard /wp-admin1.91 ▼1.504.01 ▼30.29
Posts /wp-admin/edit.php1.91 ▼1.735.20 ▼31.92
Add New Post /wp-admin/post-new.php1.91 ▼5.064.18 ▼1,267.87
Media Library /wp-admin/upload.php1.91 ▼1.394.28 ▼20.67
B. Anchor Links /wp-admin/options-general.php?page=better-anchor-links/admin/options.php1.914.13

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 1 new option
New WordPress options
lm_bal_options

Browser metrics Passed 4 tests

A check of browser resources used by Better Anchor Links
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,801 ▲4716.14 ▲0.506.53 ▼0.172.79 ▼0.23
Dashboard /wp-admin2,893 ▲326.13 ▼0.07120.64 ▼20.07156.00 ▼6.93
Posts /wp-admin/edit.php2,690 ▼13.24 ▲0.0167.73 ▲3.37139.60 ▼3.46
Add New Post /wp-admin/post-new.php1,670 ▼8219.95 ▼1.69389.97 ▼66.33156.76 ▼0.67
Media Library /wp-admin/upload.php1,703 ▲55.53 ▲0.01142.27 ▲1.05182.80 ▼9.35
B. Anchor Links /wp-admin/options-general.php?page=better-anchor-links/admin/options.php1,4342.3954.74152.43

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended 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
  • Zombie WordPress options were found after uninstall: 1 option
    • lm_bal_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > 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+5600
    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 | 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/better-anchor-links/admin/options.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/better-anchor-links/mwm-aal-class.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/better-anchor-links/auto-anchor-list.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Please add images for these screenshots: #1 (Admin options), #2 (Display in default wordpress template), #3 (Auto indent)
The official readme.txt might help

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

The main PHP file in "Better Anchor Links" ver. 1.7.5 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file 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 file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected470 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP47262462
CSS1028

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were 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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected