84% sb-random-posts-widget

Code Review | SB Random Posts Widget

WordPress plugin SB Random Posts Widget scored84%from 54 tests.

About plugin

  • Plugin page: sb-random-posts-w...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.5.3
  • WordPress version: 6.3.1
  • First release: Jul 9, 2016
  • Latest release: Jul 9, 2016
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: jacking83 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,068 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.01MB] [CPU: ▼4.86ms] Passed 4 tests

An overview of server-side resources used by SB Random Posts Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.41 ▼1.30
Dashboard /wp-admin3.31 ▲0.0147.36 ▼4.76
Posts /wp-admin/edit.php3.37 ▲0.0148.78 ▲1.78
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.15 ▼15.15
Media Library /wp-admin/upload.php3.24 ▲0.0135.54 ▲2.11

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_simple_random_posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for SB Random Posts Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6714.42 ▼0.381.84 ▲0.0543.53 ▼5.04
Dashboard /wp-admin2,209 ▲274.83 ▼0.0599.79 ▲0.7140.71 ▼2.92
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0434.47 ▼1.9431.51 ▼2.98
Add New Post /wp-admin/post-new.php1,533 ▼1123.09 ▲4.83644.18 ▲37.0156.68 ▼1.54
Media Library /wp-admin/upload.php1,388 ▼34.30 ▲0.0892.79 ▼6.7842.99 ▼3.81

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_simple_random_posts
    • widget_recent-comments

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
Good news, no errors were detected

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
Please fix the following items
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sb-random-posts-widget/classes.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sbrpw_get_post_thumbnail() in wp-content/plugins/sb-random-posts-widget/parts/shortcode-content-image_fullwidth_text.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sbrpw_get_post_thumbnail() in wp-content/plugins/sb-random-posts-widget/parts/shortcode-content-image_text.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sb-random-posts-widget/parts/widget-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sb-random-posts-widget/classes.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sbrpw_get_post_thumbnail() in wp-content/plugins/sb-random-posts-widget/parts/shortcode-content-image_only.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/sb-random-posts-widget/parts/shortcode-content-text_only.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Invalid URI ("")
You can look at the official readme.txt

sb-random-posts-widget/sb-random-posts-widget.php Passed 13 tests

Analyzing the main PHP file in "SB Random Posts Widget" version 1.0
48 characters long description:
Simple way display random posts in your blogroll

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
Success! There were no dangerous files found in this plugin249 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP85123195
CSS111254

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity5.00
▷ Minimum class complexity3.00
▷ Maximum class complexity7.00
Average method complexity2.14
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin