84% sticky-recent-random-posts

Code Review | Sticky Recent Random Posts

WordPress plugin Sticky Recent Random Posts scored84%from 54 tests.

About plugin

  • Plugin page: sticky-recent-ran...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.6
  • WordPress version: 6.3.1
  • First release: Apr 17, 2015
  • Latest release: Aug 17, 2016
  • Number of updates: 22
  • Update frequency: every 22.2 days
  • Top authors: mahavirnahata (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,819 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼3.65ms] Passed 4 tests

This is a short check of server-side resources used by Sticky Recent Random Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.38 ▲0.56
Dashboard /wp-admin3.31 ▼0.0348.91 ▼16.46
Posts /wp-admin/edit.php3.36 ▲0.0148.62 ▼1.78
Add New Post /wp-admin/post-new.php5.91 ▲0.03115.69 ▲16.03
Media Library /wp-admin/upload.php3.24 ▲0.0137.59 ▲3.07
Sticky Recent Random Posts /wp-admin/options-general.php?page=mn-customize-random-posts3.2030.76

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
mn_sticky_recent_posts

Browser metrics Passed 4 tests

A check of browser resources used by Sticky Recent Random Posts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.41 ▲0.121.64 ▼0.1437.57 ▼3.04
Dashboard /wp-admin2,214 ▲375.83 ▲0.3092.41 ▲5.4041.94 ▲0.96
Posts /wp-admin/edit.php2,130 ▲332.29 ▲0.3240.85 ▲3.6835.35 ▲3.38
Add New Post /wp-admin/post-new.php1,545 ▲1023.32 ▲4.95617.20 ▲8.0435.26 ▼37.25
Media Library /wp-admin/upload.php1,425 ▲224.42 ▲0.22102.03 ▼2.9543.46 ▼8.12
Sticky Recent Random Posts /wp-admin/options-general.php?page=mn-customize-random-posts1,5242.6160.7236.33

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • mn_sticky_recent_posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/sticky-recent-random-posts/sticky-recent-random-posts.php:46

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: recent post, sticky custom post, sticky recent random post, random post, random custom post...

sticky-recent-random-posts/sticky-recent-random-posts.php Passed 13 tests

The main PHP script in "Sticky Recent Random Posts" version 1.2 is automatically included on every request by WordPress
115 characters long description:
This plugin will show random recent post as sticky bar. you can customize color and other properties of sticky bar.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin285 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP14325211
CSS12045
JavaScript22029

PHP code Passed 2 tests

Analyzing 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.32
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin