84% posts-in-category-widget

Code Review | Posts from a Category Widget

WordPress plugin Posts from a Category Widget scored84%from 54 tests.

About plugin

  • Plugin page: posts-in-category...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.4
  • WordPress version: 6.3.1
  • First release: Oct 4, 2011
  • Latest release: Jan 3, 2016
  • Number of updates: 37
  • Update frequency: every 42.0 days
  • Top authors: miyauchi (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active /17,530 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.50ms] Passed 4 tests

This is a short check of server-side resources used by Posts from a Category Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0436.59 ▲0.20
Dashboard /wp-admin3.35 ▲0.0047.21 ▼12.91
Posts /wp-admin/edit.php3.40 ▲0.0444.97 ▼2.81
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.06 ▼6.47
Media Library /wp-admin/upload.php3.27 ▲0.0434.90 ▲1.61

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_postsfromcategorywidget

Browser metrics Passed 4 tests

A check of browser resources used by Posts from a Category Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲4514.35 ▲0.081.80 ▲0.0538.24 ▼1.10
Dashboard /wp-admin2,198 ▲215.63 ▲0.0290.74 ▲0.4437.55 ▲1.29
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0238.70 ▲3.0437.27 ▲6.55
Add New Post /wp-admin/post-new.php1,526 ▼1123.64 ▲5.27631.58 ▼12.7260.07 ▼24.68
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.0395.99 ▼11.0842.28 ▲0.57

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_postsfromcategorywidget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

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 | 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/posts-in-category-widget/posts-in-category-widget.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: widget

posts-in-category-widget/posts-in-category-widget.php 92% from 13 tests

"Posts from a Category Widget" version 1.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
There were no executable files found in this plugin320 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP12711267
PO File1121737
CSS23016

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity17.00
▷ Minimum class complexity2.00
▷ Maximum class complexity32.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin