10% category-counter

Code Review | Category counter

WordPress plugin Category counter scored10%from 54 tests.

About plugin

  • Plugin page: category-counter
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.1.1
  • WordPress version: 6.3.1
  • First release: Nov 22, 2014
  • Latest release: Mar 23, 2015
  • Number of updates: 3
  • Update frequency: every 40.3 days
  • Top authors: tomek00 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /814 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/category-counter/categorys.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_Widget_Category_Count has a deprecated constructor

Server metrics [RAM: ▼1.72MB] [CPU: ▼51.69ms] Passed 4 tests

Server-side resources used by Category counter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.189.70 ▼29.77
Dashboard /wp-admin2.30 ▼1.0411.23 ▼50.46
Posts /wp-admin/edit.php2.30 ▼1.0511.21 ▼40.51
Add New Post /wp-admin/post-new.php2.30 ▼3.5812.90 ▼86.01
Media Library /wp-admin/upload.php2.30 ▼0.9310.12 ▼23.02

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
widget_category-count-widget

Browser metrics Passed 4 tests

Category counter: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.29 ▼0.112.07 ▲0.1645.63 ▲2.94
Dashboard /wp-admin2,195 ▲155.67 ▼0.0288.65 ▼3.5741.48 ▲0.09
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0141.12 ▲0.9835.70 ▼1.95
Add New Post /wp-admin/post-new.php1,545 ▲1423.19 ▼0.07674.17 ▲82.0157.74 ▲5.57
Media Library /wp-admin/upload.php1,403 ▼04.16 ▼0.1298.78 ▼4.6945.19 ▲2.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in WP_Widget_Category_Count is deprecated since version 4.3.0! Use __construct() instead.
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_category-count-widget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-counter/categorys.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

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
5 plugin tags: count, widget, categories, counter, category

category-counter/categorys.php 92% from 13 tests

"Category counter" version 0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("category-counter.php" instead of "categorys.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 detected60 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP18837
PO File13423

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.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%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected