83% sticky-header-2020

Code Review | Sticky Header 2020

WordPress plugin Sticky Header 2020 scored83%from 54 tests.

About plugin

  • Plugin page: sticky-header-2020
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 21, 2019
  • Latest release: Apr 10, 2023
  • Number of updates: 10
  • Update frequency: every 123.7 days
  • Top authors: Iulia Cazan (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

700+ active /9,733 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.26MB] [CPU: ▼3.03ms] Passed 4 tests

An overview of server-side resources used by Sticky Header 2020
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2744.51 ▼1.71
Dashboard /wp-admin3.57 ▲0.2653.56 ▼3.69
Posts /wp-admin/edit.php3.68 ▲0.3251.92 ▼5.95
Add New Post /wp-admin/post-new.php6.15 ▲0.26118.96 ▲3.05
Media Library /wp-admin/upload.php3.49 ▲0.2638.73 ▼0.77
Sticky Header 2020 /wp-admin/options-general.php?page=sh2020-settings3.4636.41

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
can_compress_scripts
sh2020-plugin_actions_notices
theysaidso_admin_options
sticky-header-2020-last-update
sticky-header-2020-styles
widget_recent-comments
widget_theysaidso_widget
db_upgraded
sticky-header-2020-scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Sticky Header 2020
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲11114.63 ▼0.022.06 ▲0.1438.52 ▼2.63
Dashboard /wp-admin2,271 ▲1005.72 ▼0.0598.30 ▼2.1881.84 ▲38.11
Posts /wp-admin/edit.php2,180 ▲772.14 ▲0.1639.38 ▼5.3538.44 ▼17.87
Add New Post /wp-admin/post-new.php1,611 ▲8521.26 ▼2.19736.25 ▲10.2348.35 ▼11.70
Media Library /wp-admin/upload.php1,467 ▲674.14 ▼0.0498.95 ▼8.3083.92 ▲35.87
Sticky Header 2020 /wp-admin/options-general.php?page=sh2020-settings1,4629.25306.5371.89

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • sticky-header-2020-last-update
    • sticky-header-2020-styles
    • sticky-header-2020-scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • sh2020-plugin_actions_notices

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/sticky-header-2020/classes/class-sh2020-customize-rgba-color-control.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sticky-header-2020/class-sticky-header-2020.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/sticky-header-2020/classes/class-sh2020-customize-simple-text-control.php:12

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 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Requires at least: Version format is invalid
The official readme.txt is a good inspiration

sticky-header-2020/class-sticky-header-2020.php 77% from 13 tests

The main file in "Sticky Header 2020" v. 2.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 298 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sticky-header-2020.php" instead of "class-sticky-header-2020.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin2,088 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP41994241,611
PO File197119219
JavaScript35866147
CSS3186111

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity38.00
▷ Minimum class complexity6.00
▷ Maximum class complexity100.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods47
▷ Static methods4085.11%
▷ Public methods4697.87%
▷ Protected methods00.00%
▷ Private methods12.13%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants724.14%
▷ Class constants2275.86%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/buy-me-a-coffee.png19.75KB7.15KB▼ 63.78%
assets/images/icon-128x128.png12.84KB7.14KB▼ 44.37%
assets/js/alpha/transparency-grid.png2.58KB2.80KB0.00%