68% show-post-by-category

Code Review | Show post by category

WordPress plugin Show post by category scored68%from 54 tests.

About plugin

  • Plugin page: show-post-by-cate...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 7, 2020
  • Latest release: Oct 7, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: huykiradotnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /387 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.96MB] [CPU: ▼60.15ms] Passed 4 tests

An overview of server-side resources used by Show post by category
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.04 ▼41.78
Dashboard /wp-admin2.05 ▼1.266.13 ▼46.50
Posts /wp-admin/edit.php2.05 ▼1.315.76 ▼44.78
Add New Post /wp-admin/post-new.php2.05 ▼3.845.33 ▼107.54
Media Library /wp-admin/upload.php2.05 ▼1.185.16 ▼30.49

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_hk_post_by_category_widget
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Show post by category
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.51 ▼0.211.74 ▲0.0347.16 ▲2.45
Dashboard /wp-admin2,197 ▲205.46 ▼0.0788.57 ▼16.9237.48 ▼7.96
Posts /wp-admin/edit.php2,099 ▼42.02 ▲0.0239.56 ▼0.3338.25 ▲1.02
Add New Post /wp-admin/post-new.php1,528 ▲223.52 ▲2.30654.96 ▲47.3653.11 ▼4.56
Media Library /wp-admin/upload.php1,399 ▼14.19 ▼0.02102.76 ▼2.8146.06 ▲3.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the postcat handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_hk_post_by_category_widget
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/show-post-by-category/hk-post-by-category.php
  • 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/show-post-by-category/include/widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: get post, post with category, get post by category

show-post-by-category/hk-post-by-category.php 92% from 13 tests

The primary PHP file in "Show post by category" version 1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("show-post-by-category.php" instead of "hk-post-by-category.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin144 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP349103
Sass10040
CSS1011

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.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 functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/no-thumbnail.png7.21KB6.73KB▼ 6.66%