90% primary-categories

Code Review | Primary Categories

WordPress plugin Primary Categories scored90%from 54 tests.

About plugin

  • Plugin page: primary-categories
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.9.8
  • WordPress version: 6.3.1
  • First release: May 17, 2016
  • Latest release: Aug 5, 2018
  • Number of updates: 7
  • Update frequency: every 115.7 days
  • Top authors: jacobmc (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /3,682 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
Install script ran successfully

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

Analyzing server-side resources used by Primary Categories
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.47 ▼10.08
Dashboard /wp-admin3.32 ▲0.0249.98 ▲1.19
Posts /wp-admin/edit.php3.37 ▲0.0147.70 ▼4.77
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.95 ▼5.18
Media Library /wp-admin/upload.php3.24 ▲0.0133.86 ▼1.27

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Primary Categories
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.72 ▲0.131.94 ▲0.1345.29 ▼0.11
Dashboard /wp-admin2,198 ▲185.61 ▼0.0887.88 ▼12.3240.65 ▼0.43
Posts /wp-admin/edit.php2,097 ▼31.96 ▼0.0635.21 ▼2.8240.73 ▲5.44
Add New Post /wp-admin/post-new.php6,225 ▲4,69926.28 ▲2.59896.30 ▲188.5763.93 ▲12.77
Media Library /wp-admin/upload.php1,394 ▼64.25 ▲0.1195.61 ▼15.5743.02 ▼2.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
Everything seems fine, however this is by no means an exhaustive test

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid URI ("")
You can look at the official readme.txt

primary-categories/primary-categories.php Passed 13 tests

This is the main PHP file of "Primary Categories" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
127 characters long description:
Enebles user to select a primary category for posts and custom posts types and display posts based on their primary categories.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin87 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4602781
Markdown1406

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.50
▷ Minimum class complexity3.00
▷ Maximum class complexity6.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin