89% sticky-posts-expire

Code Review | Sticky Posts Expire

WordPress plugin Sticky Posts Expire scored89%from 54 tests.

About plugin

  • Plugin page: sticky-posts-expire
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: WP 4.5-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2020
  • Latest release: Dec 28, 2022
  • Number of updates: 4
  • Update frequency: every 201.0 days
  • Top authors: mubeenkhan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,279 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼0.27ms] Passed 4 tests

This is a short check of server-side resources used by Sticky Posts Expire
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.05 ▲4.90
Dashboard /wp-admin3.32 ▲0.0247.95 ▲3.43
Posts /wp-admin/edit.php3.44 ▲0.0848.78 ▼3.36
Add New Post /wp-admin/post-new.php5.91 ▲0.0290.52 ▲1.23
Media Library /wp-admin/upload.php3.25 ▲0.0233.95 ▼2.38

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Sticky Posts Expire
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.73 ▲0.331.73 ▼0.0841.94 ▲1.84
Dashboard /wp-admin2,203 ▲155.83 ▲0.9697.70 ▼2.7738.38 ▼8.14
Posts /wp-admin/edit.php2,086 ▼62.01 ▲0.0239.55 ▼1.8334.46 ▼4.41
Add New Post /wp-admin/post-new.php6,261 ▲4,73326.06 ▲3.05856.45 ▲228.6960.07 ▲8.59
Media Library /wp-admin/upload.php1,388 ▼34.21 ▼0.0095.44 ▼5.6141.50 ▼3.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Metabox added to each post / custom post type), #2 (Metabox with calendar showing)
The official readme.txt might help

sticky-posts-expire/sticky-posts-expire.php 85% from 13 tests

The primary PHP file in "Sticky Posts Expire" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path is invalid: folder "/language" does not exist
  • Requires at least: Required version number should only contain digits separated by dots (ex. "7.0" instead of "WP 4.5")

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 plugin239 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP352151222
JavaScript112016
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity8.33
▷ Minimum class complexity4.00
▷ Maximum class complexity14.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods19
▷ Static methods00.00%
▷ Public methods1894.74%
▷ Protected methods00.00%
▷ Private methods15.26%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.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
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png15.64KB8.40KB▼ 46.29%
screenshot-1.png10.52KB5.98KB▼ 43.14%