84% random-one-cat-widget

Code Review | Random One Cat Widget

WordPress plugin Random One Cat Widget scored 84% from 54 tests.

About plugin

  • Plugin page: random-one-cat-wi...
  • Plugin version: 2.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.9
  • WordPress version: 5.9.2
  • First release: Mar 21, 2008
  • Latest release: Jan 23, 2022
  • Number of updates: 83
  • Update frequency: every 60.9 days
  • Top authors: BrokenCrust (85.54%)Fecundvs (15.66%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 9,606 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼298.50ms] Passed 4 tests

Analyzing server-side resources used by Random One Cat Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0554.05 ▲1.48
Dashboard /wp-admin3.45 ▲0.0435.31 ▲2.05
Posts /wp-admin/edit.php3.68 ▲0.0435.93 ▼1.33
Add New Post /wp-admin/post-new.php6.92 ▼0.0592.95 ▼1,196.21
Media Library /wp-admin/upload.php3.33 ▲0.0424.81 ▲3.03

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 1 new option
New WordPress options
widget_random_one_cat_widget

Browser metrics Passed 4 tests

Random One Cat Widget: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,783 ▲2916.18 ▲0.515.66 ▼0.452.45 ▼0.18
Dashboard /wp-admin2,895 ▲346.22 ▲0.10117.73 ▼13.17155.06 ▼4.50
Posts /wp-admin/edit.php2,688 ▼63.23 ▼0.0063.40 ▼1.90139.54 ▲2.64
Add New Post /wp-admin/post-new.php1,752 ▲9121.39 ▲5.69446.15 ▲59.97153.72 ▼1.07
Media Library /wp-admin/upload.php1,698 ▼05.52 ▼0.01138.40 ▼3.98183.59 ▼9.30

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_random_one_cat_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/random-one-cat-widget/random-one-cat-widget.php:29

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: widget, random post, random, post

random-one-cat-widget/random-one-cat-widget.php Passed 13 tests

"Random One Cat Widget" version 2.4.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
53 characters long description:
This widget shows random posts from a given category.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected144 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12822144

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity9.50
▷ Minimum method complexity1.00
▷ Maximum method complexity26.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 functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin