84% deniz-primary-category

Code Review | Select Primary Category

WordPress plugin Select Primary Category scored84%from 54 tests.

About plugin

  • Plugin page: deniz-primary-cat...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5+
  • WordPress version: 6.3.1
  • First release: Jun 13, 2018
  • Latest release: Jun 13, 2018
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: denizozsen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /657 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
This plugin's installer ran successfully

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

Analyzing server-side resources used by Select Primary Category
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.85 ▲0.52
Dashboard /wp-admin3.35 ▲0.0451.89 ▼0.93
Posts /wp-admin/edit.php3.46 ▲0.1151.01 ▲0.85
Add New Post /wp-admin/post-new.php5.97 ▲0.0888.05 ▼8.82
Media Library /wp-admin/upload.php3.27 ▲0.0437.85 ▼0.72

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Select Primary Category
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.071.82 ▼0.1343.07 ▼3.55
Dashboard /wp-admin2,198 ▲245.64 ▼0.0397.30 ▼1.0442.23 ▼3.38
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0633.13 ▼4.0535.36 ▲0.45
Add New Post /wp-admin/post-new.php1,542 ▲1623.42 ▲0.28681.72 ▼10.0055.34 ▲4.94
Media Library /wp-admin/upload.php1,397 ▼34.24 ▲0.1396.73 ▼18.6644.39 ▼4.98

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'SPC_Infrastructure_Container' not found in wp-content/plugins/deniz-primary-category/src/infrastructure/spc-di.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: primary, taxonomy, category

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

The principal PHP file in "Select Primary Category" v. 1.0 is loaded by WordPress automatically on each request
80 characters long description:
Adds the ability to designate a primary category for posts and custom post types

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin543 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13123269353
JavaScript24176113
Sass18043
CSS18034

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.12
▷ Minimum class complexity2.00
▷ Maximum class complexity12.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods31
▷ Static methods13.23%
▷ Public methods2374.19%
▷ Protected methods26.45%
▷ Private methods619.35%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin