10% post-per-category-widget

Code Review | POST PER CATEGORY WIDGET

WordPress plugin POST PER CATEGORY WIDGET scored10%from 54 tests.

About plugin

  • Plugin page: post-per-category...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.1-4.2.1
  • WordPress version: 6.3.1
  • First release: Oct 22, 2012
  • Latest release: May 4, 2015
  • Number of updates: 16
  • Update frequency: every 57.7 days
  • Top authors: zykhan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,252 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/post-per-category-widget/index.php+35
    Methods with the same name as their class will not be constructors in a future version of PHP; latestpost_widget has a deprecated constructor

Server metrics [RAM: ▼1.72MB] [CPU: ▼54.86ms] Passed 4 tests

A check of server-side resources used by POST PER CATEGORY WIDGET
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.189.99 ▼29.15
Dashboard /wp-admin2.29 ▼1.0513.07 ▼53.42
Posts /wp-admin/edit.php2.29 ▼1.069.33 ▼38.45
Add New Post /wp-admin/post-new.php2.29 ▼3.5910.75 ▼98.42
Media Library /wp-admin/upload.php2.29 ▼0.9410.32 ▼24.59

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_latestpost_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for POST PER CATEGORY WIDGET
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.31 ▼0.251.74 ▼0.1449.71 ▲10.05
Dashboard /wp-admin2,195 ▲175.64 ▼0.1495.89 ▼7.0742.84 ▼5.76
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0235.32 ▼1.2532.08 ▼6.86
Add New Post /wp-admin/post-new.php1,545 ▲1623.24 ▲5.74652.00 ▲15.3455.96 ▲8.67
Media Library /wp-admin/upload.php1,397 ▼04.28 ▲0.0597.83 ▼3.1943.74 ▼0.78

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in latestpost_widget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_latestpost_widget
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-per-category-widget/index.php:23

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Screenshot #1 (post per category widget in sidebar) image missing
The official readme.txt might help

post-per-category-widget/index.php 92% from 13 tests

"POST PER CATEGORY WIDGET" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("post-per-category-widget.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin94 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1142772
CSS11622

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ 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%
Functions2
▷ Named functions2100.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 files were detected