10% category-feature

Code Review | Featured Category Widget

WordPress plugin Featured Category Widget scored10%from 54 tests.

About plugin

  • Plugin page: category-feature
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-4.5
  • WordPress version: 6.3.1
  • First release: Mar 22, 2012
  • Latest release: Feb 26, 2016
  • Number of updates: 43
  • Update frequency: every 33.4 days
  • Top authors: tepelstreel (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /28,391 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/category-feature/class-lib/CF_WidgetClass.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; Featured_Category_Widget has a deprecated constructor

Server metrics [RAM: ▼1.41MB] [CPU: ▼55.35ms] Passed 4 tests

Analyzing server-side resources used by Featured Category Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.58 ▼0.887.73 ▼37.59
Dashboard /wp-admin2.60 ▼0.7410.14 ▼56.46
Posts /wp-admin/edit.php2.61 ▼0.759.35 ▼39.19
Add New Post /wp-admin/post-new.php2.60 ▼3.288.66 ▼88.15
Media Library /wp-admin/upload.php2.61 ▼0.6211.75 ▼23.91
Featured Category /wp-admin/options-general.php?page=featured-category-settings2.618.35

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
cf_options
widget_recent-posts
widget_featured_category_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Featured Category Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8613.29 ▼1.064.67 ▲3.0441.48 ▼3.68
Dashboard /wp-admin2,228 ▲435.83 ▲0.97106.96 ▼8.8476.22 ▲29.08
Posts /wp-admin/edit.php2,108 ▲222.00 ▼0.0139.73 ▲2.2436.21 ▼0.27
Add New Post /wp-admin/post-new.php1,526 ▲617.54 ▼5.94735.30 ▲102.1353.70 ▼21.86
Media Library /wp-admin/upload.php1,401 ▲134.23 ▼0.0898.95 ▼4.0872.56 ▲26.45
Featured Category /wp-admin/options-general.php?page=featured-category-settings1,0344.7952.2059.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/category-feature/class-lib/CF_WidgetClass.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; Featured_Category_Widget has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_featured_category_widget
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=featured-category-settings
    • > Deprecated in wp-content/plugins/category-feature/class-lib/CF_WidgetClass.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; Featured_Category_Widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=featured-category-settings
    • > Deprecated in wp-content/plugins/category-feature/class-lib/CF_WidgetClass.php+508
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=featured-category-settings
    • > Notice in wp-content/plugins/category-feature/class-lib/CF_AdminClass.php+124
    Undefined index: css
    • > GET request to /wp-admin/options-general.php?page=featured-category-settings
    • > Notice in wp-content/plugins/category-feature/class-lib/CF_AdminClass.php+132
    Undefined index: custom_css

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 fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'A5_OptionPage' not found in wp-content/plugins/category-feature/class-lib/CF_AdminClass.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/category-feature/class-lib/A5_WidgetClass.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'A5_Widget' not found in wp-content/plugins/category-feature/class-lib/CF_WidgetClass.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'A5_DynamicFiles' not found in wp-content/plugins/category-feature/class-lib/CF_DynamicCSSClass.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=featured-category-settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/category-feature/ta-expander.min.js?ver=3.0:1:2865)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=featured-category-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt might help

category-feature/category-feature.php 92% from 13 tests

The principal PHP file in "Featured Category Widget" v. 2.5 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 253 characters long)

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
Good job! No executable or dangerous file extensions detected2,215 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,3485181,757
PO File19399297
JavaScript26516161

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity28.80
▷ Minimum class complexity10.00
▷ Maximum class complexity72.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods88
▷ Static methods3236.36%
▷ Public methods7989.77%
▷ Protected methods00.00%
▷ Private methods910.23%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/a5-icon-11.png0.67KB0.42KB▼ 37.17%
img/a5-icon-34.png1.65KB1.35KB▼ 18.07%