84% recent-posts-by-category-widget

Code Review | Recent Posts by Category Widget

WordPress plugin Recent Posts by Category Widget scored 84% from 54 tests.

About plugin

  • Plugin page: recent-posts-by-c...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.4
  • WordPress version: 5.8.1
  • First release: Feb 26, 2014
  • Latest release: Aug 16, 2015
  • Number of updates: 10
  • Update frequency: every 53.6 days
  • Top authors: RossC (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

7,000+ active / 30,407 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.02MB] [CPU: ▼143.54ms] Passed 4 tests

This is a short check of server-side resources used by Recent Posts by Category Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0232.34 ▲1.86
Dashboard /wp-admin3.08 ▲0.0341.66 ▼2.80
Posts /wp-admin/edit.php3.13 ▲0.0341.56 ▲2.12
Add New Post /wp-admin/post-new.php5.44 ▲0.0186.19 ▼565.14
Media Library /wp-admin/upload.php3.02 ▲0.0229.74 ▼8.08

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 1 new option
New WordPress options
widget_rpjc_widget_cat_recent_posts

Browser metrics Passed 4 tests

Checking browser requirements for Recent Posts by Category Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.85 ▲0.337.96 ▼0.6348.06 ▲1.85
Dashboard /wp-admin2,973 ▲365.88 ▼0.05128.54 ▼10.91108.85 ▲5.93
Posts /wp-admin/edit.php2,739 ▼02.68 ▼0.0164.31 ▼6.0180.18 ▼25.63
Add New Post /wp-admin/post-new.php1,672 ▲218.89 ▼0.23377.14 ▲4.57105.93 ▲0.43
Media Library /wp-admin/upload.php1,807 ▼05.03 ▲0.00152.21 ▼15.41112.74 ▼7.98

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_rpjc_widget_cat_recent_posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/recent-posts-by-category-widget/recent-posts-by-category-widget.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (The widget UI) image not found
The official readme.txt might help

recent-posts-by-category-widget/recent-posts-by-category-widget.php Passed 13 tests

"Recent Posts by Category Widget" version 1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
94 characters long description:
Just like the default Recent Posts widget except you can choose a category to pull posts from.

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 plugin90 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1571390

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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.png17.44KB7.22KB▼ 58.61%