84% require-post-category

Code Review | Require Post Category

WordPress plugin Require Post Category scored 84% from 54 tests.

About plugin

  • Plugin page: require-post-cate...
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.9
  • WordPress version: 6.3.1
  • First release: Feb 14, 2011
  • Latest release: Jan 23, 2022
  • Number of updates: 47
  • Update frequency: every 85.0 days
  • Top authors: joshhartman (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active / 17,741 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.24ms] Passed 4 tests

Server-side resources used by Require Post Category
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0249.04 ▲5.48
Dashboard /wp-admin3.32 ▲0.0243.25 ▼7.76
Posts /wp-admin/edit.php3.37 ▲0.0242.82 ▼7.18
Add New Post /wp-admin/post-new.php5.87 ▼0.0284.23 ▼10.22
Media Library /wp-admin/upload.php3.24 ▲0.0235.94 ▲4.22

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Require Post Category
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.112.04 ▲0.0243.65 ▼1.38
Dashboard /wp-admin2,209 ▲185.91 ▲0.96100.85 ▼6.8641.81 ▼2.49
Posts /wp-admin/edit.php2,096 ▲72.01 ▼0.0537.38 ▼0.6531.08 ▼4.31
Add New Post /wp-admin/post-new.php1,531 ▲1723.00 ▲5.50639.34 ▼39.4859.99 ▲6.50
Media Library /wp-admin/upload.php1,391 ▲64.40 ▲0.1999.32 ▼8.6343.64 ▼2.31

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 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/require-post-category/require-post-category.php:29

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 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Screenshots: These screenshots require images: #1 (Notice appears when editing a post without selecting a category (Gutenberg)), #2 (Alert appears when you try to save a post without selecting a category (Classic))
You can look at the official readme.txt

require-post-category/require-post-category.php Passed 13 tests

The main PHP script in "Require Post Category" version 2.1 is automatically included on every request by WordPress
77 characters long description:
Require users to choose a post category before updating or publishing a post.

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
Everything looks great! No dangerous files found in this plugin240 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP1292395
JavaScript27084
PO File441261

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.71
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.06MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png30.85KB30.35KB▼ 1.63%
screenshot-2.png29.40KB28.41KB▼ 3.36%