90% anchor-smooth-scroll

Code Review | Anchor smooth scroll

WordPress plugin Anchor smooth scroll scored90%from 54 tests.

About plugin

  • Plugin page: anchor-smooth-scroll
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 6, 2018
  • Latest release: May 31, 2019
  • Number of updates: 13
  • Update frequency: every 15.9 days
  • Top authors: processby (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,644 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
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼2.05ms] Passed 4 tests

This is a short check of server-side resources used by Anchor smooth scroll
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1143.03 ▼1.93
Dashboard /wp-admin3.42 ▲0.1252.60 ▲6.33
Posts /wp-admin/edit.php3.54 ▲0.1847.71 ▲0.35
Add New Post /wp-admin/post-new.php6.01 ▲0.1286.07 ▼3.37
Media Library /wp-admin/upload.php3.35 ▲0.1236.19 ▼3.23
Anchor Smooth Scroll /wp-admin/options-general.php?page=anchor-smooth-scroll-admin3.3332.38

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

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

Browser metrics Passed 4 tests

Anchor smooth scroll: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲17113.71 ▼0.849.56 ▲7.5943.55 ▲2.57
Dashboard /wp-admin2,209 ▲215.84 ▲0.9397.01 ▼4.7438.33 ▼4.82
Posts /wp-admin/edit.php2,095 ▲62.04 ▲0.0734.09 ▼2.0933.71 ▼5.74
Add New Post /wp-admin/post-new.php1,519 ▼1417.79 ▼5.24597.40 ▼72.4240.58 ▼24.46
Media Library /wp-admin/upload.php1,394 ▲94.26 ▼0.02100.29 ▼10.6443.04 ▼1.48
Anchor Smooth Scroll /wp-admin/options-general.php?page=anchor-smooth-scroll-admin9002.0724.2228.26

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 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)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Everything seems fine, however this is by no means an exhaustive test

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 on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 (The Anchor smooth scroll settings page), #2 (Insert anchor button), #3 (Adding a new anchor)
Please take inspiration from this readme.txt

anchor-smooth-scroll/anchor-smooth-scroll.php Passed 13 tests

The entry point to "Anchor smooth scroll" version 1.0.2 is a PHP file that has certain tags in its header comment area
58 characters long description:
Аdds a smooth scroll to the anchors in the WordPress menu

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected1,496 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP22280351852
JavaScript419284498
JSON31072
Markdown153070
CSS1143
SVG1001

PHP code Passed 2 tests

An overview 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.27
Average class complexity7.60
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods70
▷ Static methods710.00%
▷ Public methods6694.29%
▷ Protected methods00.00%
▷ Private methods45.71%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png12.70KB6.38KB▼ 49.76%
screenshot-1.png55.68KB31.17KB▼ 44.02%
screenshot-2.png23.10KB12.47KB▼ 45.99%