94% sticky-one-many

Code Review | Sticky One-Many

WordPress plugin Sticky One-Many scored 94% from 54 tests.

About plugin

  • Plugin page: sticky-one-many
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.0.2
  • WordPress version: 5.8.1
  • First release: Jan 10, 2019
  • Latest release: Jan 10, 2019
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: nriddhi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 382 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.44MB] [CPU: ▼138.59ms] Passed 4 tests

An overview of server-side resources used by Sticky One-Many
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.29 ▲0.4639.24 ▲4.01
Dashboard /wp-admin3.56 ▲0.5054.72 ▲9.67
Posts /wp-admin/edit.php3.60 ▲0.4951.19 ▲7.96
Add New Post /wp-admin/post-new.php5.82 ▲0.3889.11 ▼570.43
Media Library /wp-admin/upload.php3.44 ▲0.4438.73 ▲4.11
Sticky Options /wp-admin/themes.php?page=stickyone_many3.4737.37

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 85 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Sticky One-Many
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,086 ▲49018.91 ▲3.1413.34 ▲4.3448.60 ▲1.62
Dashboard /wp-admin3,240 ▲3097.97 ▲1.87166.88 ▲21.63117.48 ▼3.54
Posts /wp-admin/edit.php3,035 ▲2964.55 ▲1.8383.29 ▲15.4190.59 ▲2.05
Add New Post /wp-admin/post-new.php2,121 ▲44916.32 ▼2.48368.62 ▼8.30103.62 ▼4.67
Media Library /wp-admin/upload.php1,884 ▲775.36 ▲0.34118.26 ▼35.27117.35 ▲1.00
Sticky Options /wp-admin/themes.php?page=stickyone_many1,4693.9580.3165.46

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sticky-one-many/stickmany-loop.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sticky-one-many/plugin.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: The official readme.txt might help

sticky-one-many/plugin.php 92% from 13 tests

The main file in "Sticky One-Many" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sticky-one-many.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin31,151 lines of code in 68 files:
LanguageFilesBlank linesComment linesLines of code
JSON20017,050
JavaScript91,1007964,652
CSS8166734,340
SVG1002,671
PHP417207611,733
PO File7306334705

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity11.04
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes27.14%
▷ Concrete classes2692.86%
▷ Final classes00.00%
Methods78
▷ Static methods11.28%
▷ Public methods78100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions47
▷ Named functions47100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
library/csf/assets/images/chosen-sprite.png0.53KB0.88KB0.00%
library/csf/assets/images/chosen-sprite@2x.png0.72KB0.83KB0.00%
library/csf/assets/images/checkerboard.png2.29KB2.54KB0.00%