78% default-category

Code Review | Wordpress Default Category

WordPress plugin Wordpress Default Category scored78%from 54 tests.

About plugin

  • Plugin page: default-category
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8.1
  • WordPress version: 6.3.1
  • First release: Mar 5, 2014
  • Latest release: Mar 6, 2014
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: jkalawe (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /4,613 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Server-side resources used by Wordpress Default Category
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.96 ▼2.18
Dashboard /wp-admin3.32 ▼0.0350.78 ▼17.66
Posts /wp-admin/edit.php3.37 ▲0.0150.11 ▼3.51
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.47 ▼14.55
Media Library /wp-admin/upload.php3.24 ▲0.0139.92 ▲3.72
Default Category /wp-admin/options-general.php?page=options-default-category3.1833.03

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

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

Browser metrics Passed 4 tests

Wordpress Default Category: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9813.30 ▼1.502.05 ▼0.0346.02 ▲1.85
Dashboard /wp-admin2,228 ▲255.87 ▲0.0198.88 ▼26.7041.34 ▼6.24
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0239.63 ▼1.5035.59 ▼0.99
Add New Post /wp-admin/post-new.php1,543 ▼223.18 ▲0.01619.22 ▼84.7860.53 ▼10.60
Media Library /wp-admin/upload.php1,404 ▲44.22 ▲0.0098.62 ▼11.2745.94 ▼5.83
Default Category /wp-admin/options-general.php?page=options-default-category7922.0224.2627.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=options-default-category
    • > Notice in wp-content/plugins/default-category/settings.php+86
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/default-category/user-profile.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/default-category/settings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/default-category/settings.php:18

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 97% 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:
  • Screenshots: These screenshots do not have images: #1 (Animated demo of functionality.), #2 (User profile settings.)
You can look at the official readme.txt

default-category/default-category.php Passed 13 tests

The entry point to "Wordpress Default Category" version 2.0 is a PHP file that has certain tags in its header comment area
73 characters long description:
Auto select categories for new posts based on user or site-wide settings.

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
Success! There were no dangerous files found in this plugin108 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34060108

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png15.60KB4.93KB▼ 68.37%