83% display-categories-widget

Code Review | Display Categories Widget

WordPress plugin Display Categories Widget scored 83% from 54 tests.

About plugin

  • Plugin page: display-categorie...
  • Plugin version: 3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2.4
  • WordPress version: 6.3.1
  • First release: Aug 16, 2012
  • Latest release: Nov 3, 2019
  • Number of updates: 31
  • Update frequency: every 85.0 days
  • Top authors: iteamweb (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

6,000+ active / 77,825 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.10ms] Passed 4 tests

A check of server-side resources used by Display Categories Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.67 ▲0.45
Dashboard /wp-admin3.36 ▲0.0647.26 ▼2.00
Posts /wp-admin/edit.php3.42 ▲0.0645.89 ▼0.20
Add New Post /wp-admin/post-new.php5.95 ▲0.0685.31 ▼13.48
Media Library /wp-admin/upload.php3.29 ▲0.0635.70 ▼0.71

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
widget_displaycategorieswidget

Browser metrics Passed 4 tests

Checking browser requirements for Display Categories Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.65 ▼0.941.61 ▲0.0640.55 ▼5.17
Dashboard /wp-admin2,206 ▲234.90 ▼0.0099.28 ▼11.4640.08 ▼2.96
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0339.58 ▼0.2036.40 ▲2.02
Add New Post /wp-admin/post-new.php1,533 ▼1023.22 ▲4.64629.26 ▼19.8951.70 ▼1.06
Media Library /wp-admin/upload.php1,391 ▲64.24 ▼0.1294.63 ▼6.3742.09 ▼1.68

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_displaycategorieswidget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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
Good news, no errors were detected

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/display-categories-widget/display_categories_widget.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid URI ("")
  • Screenshots: Add images for these screenshots: #1 (On the backend widget configuration can be made like this), #2 (This is how the widget will appear on your screen, you can add design to the class), #3 (Display categories with number of posts inside them)
The official readme.txt is a good inspiration

display-categories-widget/display_categories_widget.php 92% from 13 tests

Analyzing the main PHP file in "Display Categories Widget" version 3.1
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("display-categories-widget.php" instead of "display_categories_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin265 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1189265

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity11.25
▷ 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%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.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
3 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png51.74KB18.54KB▼ 64.17%
screenshot-2.png3.78KB2.64KB▼ 30.16%
screenshot-3.png4.89KB3.20KB▼ 34.64%