84% lh-display-default-category

Code Review | LH Display Default Category

WordPress plugin LH Display Default Category scored84%from 54 tests.

About plugin

  • Plugin page: lh-display-defaul...
  • Plugin version: 1.01
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 6, 2018
  • Latest release: Aug 1, 2022
  • Number of updates: 5
  • Update frequency: every 298.6 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /571 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.58ms] Passed 4 tests

Server-side resources used by LH Display Default Category
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.19 ▼1.62
Dashboard /wp-admin3.31 ▲0.0147.72 ▼5.36
Posts /wp-admin/edit.php3.36 ▲0.0142.16 ▼6.58
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.01 ▼20.74
Media Library /wp-admin/upload.php3.24 ▲0.0136.44 ▲3.50

Server storage [IO: ▲0.00MB] [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: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by LH Display Default Category
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.33 ▼1.001.81 ▼0.1143.72 ▼1.41
Dashboard /wp-admin2,203 ▲185.84 ▲0.9094.90 ▼19.0941.35 ▼4.18
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0136.32 ▼0.7735.68 ▲2.41
Add New Post /wp-admin/post-new.php1,514 ▼517.60 ▼5.46673.14 ▲44.5353.62 ▼1.85
Media Library /wp-admin/upload.php1,382 ▼34.26 ▲0.0599.74 ▼0.9543.11 ▼1.41

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
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_action() in wp-content/plugins/lh-display-default-category/lh-display-default-category.php:78

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)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: default, category, shortcode, taxonomy, timesaver

lh-display-default-category/lh-display-default-category.php Passed 13 tests

The main PHP script in "LH Display Default Category" version 1.01 is automatically included on every request by WordPress
56 characters long description:
Displays info about the default category via a shortcode

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin39 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2401339

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.36
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
PNG images were not found in this plugin