84% wp-anchor-header

Code Review | WP Anchor Header

WordPress plugin WP Anchor Header scored84%from 54 tests.

About plugin

  • Plugin page: wp-anchor-header
  • Plugin version: 0.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Mar 2, 2015
  • Latest release: Mar 9, 2018
  • Number of updates: 13
  • Update frequency: every 85.3 days
  • Top authors: PerS (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

600+ active /8,619 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.14ms] Passed 4 tests

Server-side resources used by WP Anchor Header
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0234.97 ▼7.39
Dashboard /wp-admin3.32 ▲0.0243.95 ▼1.15
Posts /wp-admin/edit.php3.37 ▲0.0146.98 ▲1.26
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.11 ▼0.25
Media Library /wp-admin/upload.php3.24 ▲0.0132.13 ▲0.24

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

WP Anchor Header: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.29 ▼1.012.09 ▲0.2550.77 ▲5.84
Dashboard /wp-admin2,206 ▲155.91 ▲1.02105.77 ▼13.1939.07 ▼3.85
Posts /wp-admin/edit.php2,086 ▼02.00 ▼0.0338.98 ▲3.4335.00 ▲0.07
Add New Post /wp-admin/post-new.php1,533 ▲1623.20 ▲5.69686.08 ▲31.7158.62 ▼0.06
Media Library /wp-admin/upload.php1,388 ▼34.25 ▲0.0395.86 ▲0.5941.50 ▲0.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% 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 50% 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-anchor-header/wp-anchor-header.php:15

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)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
2 plugin tags: link, header

wp-anchor-header/wp-anchor-header.php Passed 13 tests

The main file in "WP Anchor Header" v. 0.2.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
28 characters long description:
Generates anchored headings.

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
No dangerous file extensions were detected70 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1114653
CSS11117

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin