72% anchor-highlighter

Code Review | Anchor Highlighter

WordPress plugin Anchor Highlighter scored72%from 54 tests.

About plugin

  • Plugin page: anchor-highlighter
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Apr 20, 2016
  • Latest release: Apr 20, 2016
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: luchomatic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /898 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.00MB] [CPU: ▼5.22ms] Passed 4 tests

Server-side resources used by Anchor Highlighter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0623.02 ▼21.53
Dashboard /wp-admin3.32 ▲0.0246.23 ▼2.07
Posts /wp-admin/edit.php3.37 ▲0.0250.34 ▲2.13
Add New Post /wp-admin/post-new.php5.92 ▲0.0492.58 ▲0.59
Media Library /wp-admin/upload.php3.25 ▲0.0235.74 ▲2.58
Anchor Highlighter /wp-admin/options-general.php?page=anchor-highlighter3.2531.64

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Anchor Highlighter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲18613.66 ▼0.746.39 ▲4.6640.85 ▼11.17
Dashboard /wp-admin2,211 ▲235.86 ▲0.94109.01 ▼3.6340.93 ▼6.69
Posts /wp-admin/edit.php2,100 ▲82.04 ▲0.0339.83 ▼0.7135.03 ▼1.25
Add New Post /wp-admin/post-new.php1,535 ▲2123.20 ▲5.63618.04 ▼47.9964.02 ▲9.83
Media Library /wp-admin/upload.php1,393 ▲54.27 ▲0.0499.52 ▲4.7241.89 ▼1.14
Anchor Highlighter /wp-admin/options-general.php?page=anchor-highlighter7952.0426.9421.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=anchor-highlighter
    • > Notice in wp-content/plugins/anchor-highlighter/admin/partials/anchor-highlighter-admin-display.php+27
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/anchor-highlighter/public/partials/anchor-highlighter-public-display.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/anchor-highlighter/admin/partials/anchor-highlighter-admin-display.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (Here you can see how the current selected option on the Archives widget is styled differently to the rest.)
  • Plugin Name: Please specify the plugin name on the first line ( === anchor-highlighter === )
The official readme.txt might help

anchor-highlighter/anchor-highlighter.php Passed 13 tests

The main PHP file in "Anchor Highlighter" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
93 characters long description:
Allows you to add a class to the anchors wich match the curren url so you can highlight them.

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 detected256 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12143551231
JavaScript32510125
CSS2080

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity1.71
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.16MB with 0.10MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/Screenshot-1.png162.33KB55.09KB▼ 66.07%