84% wpsiren-random-post-by-click

Code Review | WPSIREN Random Post by Click

WordPress plugin WPSIREN Random Post by Click scored84%from 54 tests.

About plugin

  • Plugin page: wpsiren-random-po...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5.1
  • WordPress version: 6.3.1
  • First release: Apr 9, 2013
  • Latest release: Apr 12, 2013
  • Number of updates: 11
  • Update frequency: every 0.4 days
  • Top authors: wpsiren (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

60+ active /4,461 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

An overview of server-side resources used by WPSIREN Random Post by Click
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.04 ▼2.45
Dashboard /wp-admin3.35 ▲0.0544.52 ▼0.26
Posts /wp-admin/edit.php3.40 ▲0.0546.36 ▼3.80
Add New Post /wp-admin/post-new.php5.93 ▲0.0594.23 ▼0.85
Media Library /wp-admin/upload.php3.28 ▲0.0539.34 ▲2.05

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WPSIREN Random Post by Click
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.19 ▼1.201.62 ▼0.1441.43 ▼2.46
Dashboard /wp-admin2,206 ▲185.87 ▲0.97105.39 ▼5.7141.93 ▲4.68
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0339.41 ▲3.7133.88 ▼2.65
Add New Post /wp-admin/post-new.php1,533 ▲523.09 ▲4.87589.81 ▼36.5153.85 ▼0.39
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0396.91 ▼0.0543.49 ▼0.60

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_wprp
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpsiren-random-post-by-click/wpsiren-random-post-by-click.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Widget Options Panel)
The official readme.txt is a good inspiration

wpsiren-random-post-by-click/wpsiren-random-post-by-click.php Passed 13 tests

The main file in "WPSIREN Random Post by Click" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
46 characters long description:
Lets you add random post button in the sidebar

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin207 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP18640207

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity14.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%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png21.14KB7.47KB▼ 64.67%