90% sticky-posts-switch

Code Review | Sticky Posts - Switch

WordPress plugin Sticky Posts - Switch scored90%from 54 tests.

About plugin

  • Plugin page: sticky-posts-switch
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Apr 6, 2017
  • Latest release: Jul 29, 2022
  • Number of updates: 43
  • Update frequency: every 45.1 days
  • Top authors: markusfroehlich (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

6,000+ active /43,504 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼4.79ms] Passed 4 tests

Analyzing server-side resources used by Sticky Posts - Switch
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1534.86 ▼6.79
Dashboard /wp-admin3.46 ▲0.1646.16 ▲0.60
Posts /wp-admin/edit.php3.58 ▲0.2347.66 ▲4.49
Add New Post /wp-admin/post-new.php6.05 ▲0.1685.78 ▼14.72
Media Library /wp-admin/upload.php3.39 ▲0.1636.53 ▲1.76
Sticky Posts - Switch /wp-admin/options-general.php?page=sticky-posts-switch3.3634.84

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
sticky_posts_switch_options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sticky Posts - Switch
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.35 ▼0.001.62 ▼0.1942.37 ▼2.02
Dashboard /wp-admin2,202 ▲315.65 ▲0.0881.34 ▼3.4538.32 ▼0.52
Posts /wp-admin/edit.php2,128 ▲281.97 ▼0.0435.34 ▼5.7534.69 ▼4.07
Add New Post /wp-admin/post-new.php1,534 ▼323.02 ▲4.66676.34 ▲58.6658.01 ▼5.61
Media Library /wp-admin/upload.php1,404 ▲44.21 ▲0.04105.55 ▲7.9844.98 ▲1.53
Sticky Posts - Switch /wp-admin/options-general.php?page=sticky-posts-switch1,0452.3457.8828.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

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 an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === sticky-posts-switch === )
Please take inspiration from this readme.txt

sticky-posts-switch/sticky-posts-switch.php Passed 13 tests

The entry point to "Sticky Posts - Switch" version 2.1.3 is a PHP file that has certain tags in its header comment area
98 characters long description:
This plugin adds a sticky post switch functionality to the admin list post/custom post type pages.

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
Everything looks great! No dangerous files found in this plugin919 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP4187277732
JavaScript53239112
CSS261075

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.67
Average class complexity78.50
▷ Minimum class complexity75.00
▷ Maximum class complexity82.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods3992.86%
▷ Protected methods00.00%
▷ Private methods37.14%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin