90% easy-primary-category

Code Review | Easy Primary Category

WordPress plugin Easy Primary Category scored90%from 54 tests.

About plugin

  • Plugin page: easy-primary-cate...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2.2
  • WordPress version: 6.3.1
  • First release: Aug 22, 2017
  • Latest release: May 27, 2023
  • Number of updates: 11
  • Update frequency: every 191.3 days
  • Top authors: gagan0123 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

700+ active /37,475 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.93ms] Passed 4 tests

This is a short check of server-side resources used by Easy Primary Category
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0241.13 ▲3.95
Dashboard /wp-admin3.36 ▲0.0540.10 ▼9.66
Posts /wp-admin/edit.php3.47 ▲0.1145.35 ▼0.57
Add New Post /wp-admin/post-new.php5.97 ▲0.0881.34 ▼12.25
Media Library /wp-admin/upload.php3.28 ▲0.0533.65 ▼1.25

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Easy Primary Category
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.301.60 ▼0.0237.64 ▼1.82
Dashboard /wp-admin2,195 ▲235.62 ▲0.0294.58 ▼5.2842.51 ▼1.44
Posts /wp-admin/edit.php2,103 ▲31.96 ▼0.0039.06 ▲5.0837.37 ▲2.02
Add New Post /wp-admin/post-new.php1,542 ▲1623.57 ▼0.03688.94 ▼0.0851.80 ▼7.27
Media Library /wp-admin/upload.php1,400 ▼34.30 ▲0.0797.52 ▲0.2341.79 ▼2.67

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("PayPal.me/gagan0123")
The official readme.txt is a good inspiration

easy-primary-category/easy-primary-category.php Passed 13 tests

"Easy Primary Category" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
69 characters long description:
Allows you to choose primary category for posts and custom post types

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
There were no executable files found in this plugin487 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP9123470334
JavaScript24176113
Sass17039
CSS1011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity7.20
▷ Minimum class complexity4.00
▷ Maximum class complexity15.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods30
▷ Static methods310.00%
▷ Public methods1963.33%
▷ Protected methods723.33%
▷ Private methods413.33%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin