79% select-primary-category

Code Review | Select Main Category

WordPress plugin Select Main Category scored79%from 54 tests.

About plugin

  • Plugin page: select-primary-ca...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9
  • WordPress version: 6.3.1
  • First release: Jun 19, 2018
  • Latest release: Jun 20, 2018
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: oscarssanchez (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /564 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

This is a short check of server-side resources used by Select Main Category
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.24 ▼2.19
Dashboard /wp-admin3.32 ▲0.0165.70 ▲17.11
Posts /wp-admin/edit.php3.37 ▲0.0150.73 ▼1.54
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.30 ▼1.69
Media Library /wp-admin/upload.php3.24 ▲0.0134.24 ▼0.85

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Select Main Category: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.24 ▼0.481.74 ▼0.0144.30 ▲0.03
Dashboard /wp-admin2,198 ▲215.52 ▼0.0785.94 ▼8.1640.25 ▼0.28
Posts /wp-admin/edit.php2,100 ▲211.97 ▼0.0039.22 ▲0.6835.10 ▼0.05
Add New Post /wp-admin/post-new.php1,529 ▼823.62 ▲5.50646.53 ▼14.3477.43 ▲18.07
Media Library /wp-admin/upload.php1,394 ▼94.24 ▲0.0899.04 ▼4.8645.89 ▼0.86

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/select-primary-category/select-primary-category.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/select-primary-category/templates/admin/primary-category-meta-box.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: categories, category

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

The principal PHP file in "Select Main Category" v. 1.0 is loaded by WordPress automatically on each request
41 characters long description:
Choose a Primary Category for your posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected139 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP526130120
Markdown111019

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity3.67
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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