84% category-featured-image

Code Review | Category Featured Image

WordPress plugin Category Featured Image scored84%from 54 tests.

About plugin

  • Plugin page: category-featured...
  • Plugin version: 2.08
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: May 3, 2019
  • Latest release: Oct 27, 2023
  • Number of updates: 43
  • Update frequency: every 38.1 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

600+ active /15,144 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.30ms] Passed 4 tests

Analyzing server-side resources used by Category Featured Image
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0838.33 ▲0.30
Dashboard /wp-admin3.38 ▲0.0843.59 ▼14.19
Posts /wp-admin/edit.php3.50 ▲0.1446.72 ▲0.36
Add New Post /wp-admin/post-new.php5.97 ▲0.0890.94 ▲3.85
Media Library /wp-admin/upload.php3.31 ▲0.0734.96 ▲0.33
Category Featured Image /wp-admin/edit.php?page=categoryfeaturedimage3.2830.72

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Category Featured Image: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.45 ▲0.101.83 ▲0.0847.74 ▲1.60
Dashboard /wp-admin2,196 ▲195.53 ▼0.1384.73 ▼17.0238.59 ▼9.17
Posts /wp-admin/edit.php2,101 ▲12.00 ▲0.0240.06 ▲4.4535.06 ▲0.11
Add New Post /wp-admin/post-new.php1,529 ▲322.95 ▼0.16587.27 ▼101.9252.92 ▼3.12
Media Library /wp-admin/upload.php1,407 ▲44.21 ▲0.0298.50 ▲5.1043.83 ▲1.23
Category Featured Image /wp-admin/edit.php?page=categoryfeaturedimage8631.9835.6545.65

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-featured-image/lib/class-categoryfeaturedimageadmin.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-featured-image/lib/class-categoryfeaturedimage.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-featured-image/lib/class-categoryfeaturedimage.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: post, featured image, category

category-featured-image/categoryfeaturedimage.php 92% from 13 tests

"Category Featured Image" version 2.08's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("category-featured-image.php" instead of "categoryfeaturedimage.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 detected446 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP470218446
JavaScript1030

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity25.00
▷ Minimum class complexity13.00
▷ Maximum class complexity37.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods1263.16%
▷ Protected methods00.00%
▷ Private methods736.84%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected