84% randompost

Code Review | randomPost

WordPress plugin randomPost scored 84% from 54 tests.

About plugin

  • Plugin page: randompost
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.9
  • WordPress version: 6.3.1
  • First release: Nov 17, 2015
  • Latest release: Nov 11, 2017
  • Number of updates: 22
  • Update frequency: every 33.0 days
  • Top authors: obrienlabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 4,015 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.55ms] Passed 4 tests

Server-side resources used by randomPost
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.31 ▼2.10
Dashboard /wp-admin3.36 ▲0.0645.68 ▼3.18
Posts /wp-admin/edit.php3.41 ▲0.0647.18 ▼1.56
Add New Post /wp-admin/post-new.php5.94 ▲0.0694.02 ▲2.31
Media Library /wp-admin/upload.php3.28 ▲0.0535.93 ▼3.35
randomPost Settings /wp-admin/options-general.php?page=rp-settings3.2531.58

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
rp_javascript_hotkey
rp_version
rp_slug_option_previous
rp_hotkey_enabled
rp_slug_option
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by randomPost
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲7813.22 ▼1.091.81 ▼0.3936.88 ▼12.57
Dashboard /wp-admin2,212 ▲245.81 ▼0.09104.40 ▼12.0240.15 ▼3.43
Posts /wp-admin/edit.php2,095 ▲62.06 ▲0.0340.12 ▲4.3036.31 ▲0.36
Add New Post /wp-admin/post-new.php1,542 ▲918.32 ▼5.12600.44 ▼80.1848.21 ▼5.45
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.0893.69 ▼9.3341.45 ▼4.71
randomPost Settings /wp-admin/options-general.php?page=rp-settings9182.0122.8330.51

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • rp_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/randompost/randompost.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

randompost/randompost.php Passed 13 tests

The main file in "randomPost" v. 1.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
137 characters long description:
Easily create a custom URL to redirect visitors to view random posts. Keyboard hotkey shortcuts also available for browsing random posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin270 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP35627226
CSS13044

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity1.59
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/OBrienLabs-Logo-h75px.png12.21KB4.67KB▼ 61.79%