10% simplicy-random-post

Code Review | Simplicy Random Post

WordPress plugin Simplicy Random Post scored 10% from 54 tests.

About plugin

  • Plugin page: simplicy-random-post
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4
  • WordPress version: 6.3.1
  • First release: Dec 22, 2011
  • Latest release: Oct 23, 2012
  • Number of updates: 9
  • Update frequency: every 34.1 days
  • Top authors: fred91 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active / 5,477 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/simplicy-random-post/func/function.php+103
    Methods with the same name as their class will not be constructors in a future version of PHP; WARP__widget has a deprecated constructor

Server metrics [RAM: ▼1.96MB] [CPU: ▼50.45ms] Passed 4 tests

An overview of server-side resources used by Simplicy Random Post
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.36 ▼39.88
Dashboard /wp-admin2.05 ▼1.266.14 ▼43.32
Posts /wp-admin/edit.php2.05 ▼1.316.12 ▼38.16
Add New Post /wp-admin/post-new.php2.05 ▼3.846.70 ▼80.42
Media Library /wp-admin/upload.php2.05 ▼1.185.67 ▼29.67

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_sp-random-post
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Simplicy Random Post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲6713.30 ▼1.361.99 ▼0.1344.44 ▼2.84
Dashboard /wp-admin2,213 ▲225.88 ▼0.01104.23 ▼8.5637.74 ▼6.68
Posts /wp-admin/edit.php2,096 ▲42.02 ▲0.0139.07 ▲1.6634.43 ▲0.54
Add New Post /wp-admin/post-new.php1,523 ▼523.15 ▲0.09601.67 ▼64.2357.39 ▲0.13
Media Library /wp-admin/upload.php1,386 ▼54.20 ▼0.0596.77 ▼7.2344.40 ▲0.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the simplicy_random_post handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_sp-random-post
    • 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simplicy-random-post/func/function.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simplicy-random-post/func/function.php:27

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Example of display in the panel administrator of your blog.
    ), #2 (Example of display Widget of your blog.
    )
  • Donate link: Invalid URI found ("")
The official readme.txt might help

simplicy-random-post/sp-random-post.php 92% from 13 tests

The entry point to "Simplicy Random Post" version 1.7 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("simplicy-random-post.php" instead of "sp-random-post.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin465 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP25838224
PO File23634104
JavaScript12487
CSS2111150

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/reload_icon.png1.00KB0.93KB▼ 7.21%