90% auto-category-for-posts

Code Review | Auto Category for Posts

WordPress plugin Auto Category for Posts scored90%from 54 tests.

About plugin

  • Plugin page: auto-category-for...
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Feb 9, 2022
  • Latest release: Oct 21, 2023
  • Number of updates: 15
  • Update frequency: every 41.3 days
  • Top authors: threadi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /733 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.14ms] Passed 4 tests

A check of server-side resources used by Auto Category for Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.04 ▼8.12
Dashboard /wp-admin3.33 ▲0.0344.92 ▼5.88
Posts /wp-admin/edit.php3.38 ▲0.0349.56 ▼0.60
Add New Post /wp-admin/post-new.php5.92 ▲0.0398.84 ▲0.97
Media Library /wp-admin/upload.php3.25 ▲0.0333.33 ▼1.97

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
auto_category_db_version
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Auto Category for Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.73 ▲0.142.23 ▲0.5743.77 ▲1.66
Dashboard /wp-admin2,192 ▲155.61 ▲0.0291.77 ▲3.9043.71 ▲0.40
Posts /wp-admin/edit.php2,103 ▲32.00 ▼0.0341.86 ▲1.2636.89 ▼3.60
Add New Post /wp-admin/post-new.php1,535 ▲918.10 ▼4.87589.56 ▼90.9867.46 ▲6.51
Media Library /wp-admin/upload.php1,394 ▼64.21 ▲0.0395.28 ▼5.5741.82 ▼3.69

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

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 | 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 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: auto category, posts, category

auto-category-for-posts/auto-category-for-posts.php Passed 13 tests

The main PHP file in "Auto Category for Posts" ver. 1.0.7 adds more information about the plugin and also serves as the entry point for this plugin
79 characters long description:
Automatically add a default-category to each new post before it is first saved.

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
Success! There were no dangerous files found in this plugin183 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP22182112
PO File191138
JavaScript12029
CSS1003
JSON1001

PHP code Passed 2 tests

This is a very shot review of 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.48
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin