10% st-category-wp

Code Review | ST Categories Widget

WordPress plugin ST Categories Widget scored10%from 54 tests.

About plugin

  • Plugin page: st-category-wp
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.0
  • WordPress version: 6.3.1
  • First release: Oct 23, 2014
  • Latest release: Dec 2, 2015
  • Number of updates: 8
  • Update frequency: every 50.6 days
  • Top authors: beautifultemplates (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,120 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/st-category-wp/widget.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; st_Category has a deprecated constructor

Server metrics [RAM: ▼1.85MB] [CPU: ▼55.70ms] Passed 4 tests

A check of server-side resources used by ST Categories Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.317.05 ▼32.19
Dashboard /wp-admin2.17 ▼1.187.84 ▼51.88
Posts /wp-admin/edit.php2.17 ▼1.197.58 ▼44.43
Add New Post /wp-admin/post-new.php2.17 ▼3.727.40 ▼94.28
Media Library /wp-admin/upload.php2.17 ▼1.068.74 ▼26.21
ST Categories WP /wp-admin/options-general.php?page=st_categories_wp2.177.08

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
widget_st_category
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

ST Categories Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6813.18 ▼1.574.35 ▲2.5939.27 ▼4.47
Dashboard /wp-admin2,214 ▲294.87 ▼0.97109.80 ▲7.8439.12 ▼3.17
Posts /wp-admin/edit.php2,101 ▲121.99 ▼0.2039.64 ▲0.5235.37 ▼2.87
Add New Post /wp-admin/post-new.php1,526 ▼1622.99 ▲4.65662.72 ▲19.0464.23 ▲8.83
Media Library /wp-admin/upload.php1,400 ▲94.19 ▲0.0193.68 ▼12.3342.48 ▼2.40
ST Categories WP /wp-admin/options-general.php?page=st_categories_wp9192.0824.8755.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/st-category-wp/widget.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; st_Category has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_st_category

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=st_categories_wp
    • > Deprecated in wp-content/plugins/st-category-wp/widget.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; st_Category has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=st_categories_wp
    • > Deprecated in wp-content/plugins/st-category-wp/widget.php+172
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=st_categories_wp
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in st_Category is deprecated since version 4.3.0! Use __construct() instead.

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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/st-category-wp/st-categories-wp.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/st-category-wp/widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: widget, categories, st categories, list categories

st-category-wp/st-categories-wp.php 92% from 13 tests

"ST Categories Widget" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("st-category-wp.php" instead of "st-categories-wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected9,935 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61,6691,3466,757
CSS619421,923
PHP22824521
SVG100520
HTML1144158
PO File1191956

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity23.00
▷ Minimum class complexity15.00
▷ Maximum class complexity28.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.17MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
doc/assets/css/img/warning.png0.59KB0.50KB▼ 14.99%
doc/assets/images/st-cat-01.png86.19KB35.60KB▼ 58.69%
images/arrow_red_right.png0.17KB0.11KB▼ 37.57%
doc/assets/css/img/info.png0.67KB0.70KB0.00%
images/categories-icon.png5.85KB2.87KB▼ 51.01%