79% category-posts

Code Review | Category Posts Widget

WordPress plugin Category Posts Widget scored79%from 54 tests.

About plugin

  • Plugin page: category-posts
  • Plugin version: 4.9.15
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.2
  • WordPress version: 6.3.1
  • First release: Oct 24, 2007
  • Latest release: May 2, 2023
  • Number of updates: 261
  • Update frequency: every 21.7 days
  • Top authors: Kometschuh (74.71%)ZephyrWest (22.99%)mkrdip (3.07%)

Code review

54 tests

User reviews

77 reviews

Install metrics

60,000+ active /1,531,021 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.60MB] [CPU: ▲2.44ms] Passed 4 tests

A check of server-side resources used by Category Posts Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.5947.61 ▲4.82
Dashboard /wp-admin3.95 ▲0.6555.49 ▲3.66
Posts /wp-admin/edit.php4.00 ▲0.6556.08 ▲7.04
Add New Post /wp-admin/post-new.php6.48 ▲0.5993.39 ▼1.89
Media Library /wp-admin/upload.php3.81 ▲0.5939.27 ▲3.16

Server storage [IO: ▲0.74MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 44 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_category-posts

Browser metrics Passed 4 tests

Category Posts Widget: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.23 ▼0.052.45 ▲0.5545.01 ▲1.42
Dashboard /wp-admin2,195 ▲155.61 ▲0.0288.16 ▼8.0539.85 ▼2.84
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0043.67 ▲6.5536.11 ▼0.03
Add New Post /wp-admin/post-new.php1,526 ▼023.16 ▲0.06656.83 ▼30.3560.59 ▲15.63
Media Library /wp-admin/upload.php1,400 ▲64.23 ▼0.00108.04 ▲10.4244.23 ▼2.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'categoryPostsuninstall' not found or invalid function name
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_category-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can look at the official readme.txt

category-posts/cat-posts.php 85% from 13 tests

The primary PHP file in "Category Posts Widget" version 4.9.15 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("category-posts.php" instead of "cat-posts.php")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected13,558 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript152,4956839,784
PHP94531,0122,489
CSS913549847
HTML1110312
JSON10076
XML15028
SVG110022

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity68.25
▷ Minimum class complexity1.00
▷ Maximum class complexity221.00
Average method complexity5.48
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods55
▷ Static methods11.82%
▷ Public methods4480.00%
▷ Protected methods00.00%
▷ Private methods1120.00%
Functions41
▷ Named functions3585.37%
▷ Anonymous functions614.63%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.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