89% admin-category-filter

Code Review | Post Category Filter

WordPress plugin Post Category Filter scored89%from 54 tests.

About plugin

  • Plugin page: admin-category-fi...
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.9
  • WordPress version: 6.3.1
  • First release: Jan 24, 2014
  • Latest release: Dec 1, 2017
  • Number of updates: 53
  • Update frequency: every 26.6 days
  • Top authors: vengisss (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

2,000+ active /33,427 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼11.27ms] Passed 4 tests

An overview of server-side resources used by Post Category Filter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.91 ▼4.27
Dashboard /wp-admin3.32 ▼0.0345.63 ▼15.75
Posts /wp-admin/edit.php3.37 ▲0.0143.36 ▼4.18
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.09 ▼20.89
Media Library /wp-admin/upload.php3.24 ▲0.0132.37 ▼2.45

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Post Category Filter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.82 ▲0.511.77 ▲0.2739.27 ▼2.49
Dashboard /wp-admin2,203 ▲115.82 ▲0.9393.75 ▼18.0339.26 ▼5.84
Posts /wp-admin/edit.php2,116 ▲272.06 ▲0.0333.86 ▼5.2532.68 ▼2.48
Add New Post /wp-admin/post-new.php1,533 ▼1123.12 ▲4.91629.44 ▼18.8050.40 ▼2.27
Media Library /wp-admin/upload.php1,391 ▲94.17 ▼0.1395.18 ▼2.4342.64 ▼1.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Contributors: Contributors not specified
The official readme.txt might help

admin-category-filter/category-filter.php 92% from 13 tests

The main file in "Post Category Filter" v. 1.6.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("admin-category-filter.php" instead of "category-filter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin110 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript129448
PHP3199742
PO File11320

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods480.00%
▷ Protected methods00.00%
▷ Private methods120.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
No PNG images were found in this plugin