94% display-category-post-count

Code Review | Display Category Post Count

WordPress plugin Display Category Post Count scored 94% from 54 tests.

About plugin

  • Plugin page: display-category-...
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.6.1
  • WordPress version: 5.8.1
  • First release: Jun 12, 2019
  • Latest release: Feb 6, 2021
  • Number of updates: 6
  • Update frequency: every 100.8 days
  • Top authors: amitk06 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 936 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼134.66ms] Passed 4 tests

This is a short check of server-side resources used by Display Category Post Count
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1238.49 ▲13.44
Dashboard /wp-admin3.06 ▲0.0158.10 ▲11.56
Posts /wp-admin/edit.php3.12 ▲0.0152.67 ▲8.62
Add New Post /wp-admin/post-new.php5.42 ▼0.0194.62 ▼561.43
Media Library /wp-admin/upload.php3.01 ▲0.0136.65 ▲2.62

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Display Category Post Count: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8316.23 ▲0.587.88 ▼0.0851.31 ▼0.53
Dashboard /wp-admin2,970 ▲335.85 ▼0.24154.26 ▼6.17120.05 ▲0.98
Posts /wp-admin/edit.php2,739 ▼02.70 ▲0.0268.41 ▼7.9993.87 ▼2.16
Add New Post /wp-admin/post-new.php1,683 ▲1318.71 ▼0.40391.62 ▲1.56111.37 ▼0.69
Media Library /wp-admin/upload.php1,807 ▼05.03 ▼0.00152.80 ▼11.20125.72 ▲1.70

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/display-category-post-count/category-post-count.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: woocommerce category, category, category wise post count, post count, category post count...

display-category-post-count/category-post-count.php 85% from 13 tests

The main PHP file in "Display Category Post Count" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 179 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("display-category-post-count.php" instead of "category-post-count.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
No dangerous file extensions were detected18 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15718

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin