10% spider-random-post

Code Review | RPost

WordPress plugin RPost scored 10% from 54 tests.

About plugin

  • Plugin page: spider-random-post
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8
  • WordPress version: 6.3.1
  • First release: Aug 29, 2012
  • Latest release: Dec 11, 2019
  • Number of updates: 49
  • Update frequency: every 54.3 days
  • Top authors: webdorado (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

600+ active / 33,833 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/spider-random-post/Spider_Random_Post.php+417
    Function create_function() is deprecated

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

Server-side resources used by RPost
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.76 ▼34.05
Dashboard /wp-admin2.05 ▼1.265.32 ▼42.10
Posts /wp-admin/edit.php2.05 ▼1.316.27 ▼46.18
Add New Post /wp-admin/post-new.php2.05 ▼3.846.51 ▼87.99
Media Library /wp-admin/upload.php2.05 ▼1.185.47 ▼28.95

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

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

Browser metrics Passed 4 tests

RPost: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲9013.95 ▼0.4510.77 ▲8.1443.67 ▼3.23
Dashboard /wp-admin2,206 ▼35.91 ▲1.10114.51 ▲8.2839.30 ▼1.24
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0144.52 ▲7.9842.64 ▲6.94
Add New Post /wp-admin/post-new.php1,533 ▼423.35 ▲0.12739.42 ▲15.8370.00 ▲14.47
Media Library /wp-admin/upload.php1,388 ▼04.23 ▲0.02103.37 ▲7.1145.21 ▲2.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/spider-random-post/Spider_Random_Post.php+417
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_spider_random_article
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/spider-random-post/spider_rand_front_end.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/spider-random-post/Spider_Random_Post.php:20

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, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
No tags were detected

spider-random-post/Spider_Random_Post.php 92% from 13 tests

"RPost" version 1.0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("spider-random-post.php" instead of "Spider_Random_Post.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin299 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP215722299

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity11.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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
header.png12.98KB3.88KB▼ 70.09%