84% recent-categories

Code Review | Recent Categories

WordPress plugin Recent Categories scored 84% from 54 tests.

About plugin

  • Plugin page: recent-categories
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0.3
  • WordPress version: 5.8.1
  • First release: Apr 28, 2015
  • Latest release: Feb 2, 2019
  • Number of updates: 16
  • Update frequency: every 86.3 days
  • Top authors: twodayslate (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 863 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Analyzing server-side resources used by Recent Categories
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1535.77 ▲15.51
Dashboard /wp-admin3.09 ▲0.0447.49 ▲2.45
Posts /wp-admin/edit.php3.14 ▲0.0445.92 ▲0.16
Add New Post /wp-admin/post-new.php5.45 ▲0.0289.39 ▼569.83
Media Library /wp-admin/upload.php3.03 ▲0.0331.17 ▼0.01

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 1 new option
New WordPress options
widget_recent_categories_widget

Browser metrics Passed 4 tests

A check of browser resources used by Recent Categories
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.90 ▼0.069.81 ▲0.3648.59 ▲0.66
Dashboard /wp-admin2,967 ▲306.05 ▲0.09133.16 ▼6.85112.36 ▲5.18
Posts /wp-admin/edit.php2,736 ▼32.72 ▲0.0165.54 ▲1.3795.81 ▲3.40
Add New Post /wp-admin/post-new.php1,672 ▲17218.78 ▼0.08356.11 ▼17.53107.79 ▲3.02
Media Library /wp-admin/upload.php1,810 ▼05.02 ▲0.01143.46 ▲5.43120.31 ▲5.16

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 detected upon uninstall: 1 option
    • widget_recent_categories_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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/recent-categories/widget.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === recent-categories === )
The official readme.txt is a good inspiration

recent-categories/widget.php 92% from 13 tests

The main PHP file in "Recent Categories" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("recent-categories.php" instead of "widget.php")

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

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity7.50
▷ Minimum method complexity1.00
▷ Maximum method complexity22.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

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