84% radio-buttons-for-taxonomies

Code Review | Radio Buttons for Taxonomies

WordPress plugin Radio Buttons for Taxonomies scored84%from 54 tests.

About plugin

  • Plugin page: radio-buttons-for...
  • Plugin version: 2.4.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.1.0
  • WordPress version: 6.3.1
  • First release: Jul 12, 2012
  • Latest release: Mar 18, 2023
  • Number of updates: 123
  • Update frequency: every 31.7 days
  • Top authors: helgatheviking (95.12%)deployer (5.69%)

Code review

54 tests

User reviews

49 reviews

Install metrics

20,000+ active /248,344 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.03MB] [CPU: ▼6.15ms] Passed 4 tests

An overview of server-side resources used by Radio Buttons for Taxonomies
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.72 ▼0.06
Dashboard /wp-admin3.33 ▲0.0353.33 ▲0.03
Posts /wp-admin/edit.php3.44 ▲0.0951.87 ▲0.35
Add New Post /wp-admin/post-new.php5.93 ▲0.0588.31 ▼24.93
Media Library /wp-admin/upload.php3.25 ▲0.0240.61 ▲3.59
Radio Buttons for Taxonomies /wp-admin/options-general.php?page=radio-buttons-for-taxonomies3.2633.99

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Radio Buttons for Taxonomies
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲3313.66 ▼0.902.19 ▲0.1241.31 ▼2.18
Dashboard /wp-admin2,222 ▲165.76 ▼0.1498.67 ▼16.6940.31 ▼2.78
Posts /wp-admin/edit.php2,101 ▼22.05 ▲0.0235.28 ▼0.9030.97 ▼5.72
Add New Post /wp-admin/post-new.php1,549 ▲623.16 ▲0.05661.03 ▼10.1353.83 ▼9.40
Media Library /wp-admin/upload.php1,398 ▼24.31 ▲0.10107.21 ▲3.3345.75 ▼2.22
Radio Buttons for Taxonomies /wp-admin/options-general.php?page=radio-buttons-for-taxonomies8412.0625.9734.85

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/radio-buttons-for-taxonomies/inc/class-walker-category-radio.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/radio-buttons-for-taxonomies/inc/plugin-options.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: metabox, radio, terms, interface, taxonomy...

radio-buttons-for-taxonomies/radio-buttons-for-taxonomies.php Passed 13 tests

"Radio Buttons for Taxonomies" version 2.4.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
76 characters long description:
Use radio buttons for any taxonomy so users can only select 1 term at a time

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
Good job! No executable or dangerous file extensions detected1,451 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript67465618
PHP8246564605
PO File57596228

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.39
Average class complexity17.17
▷ Minimum class complexity2.00
▷ Maximum class complexity55.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods46
▷ Static methods715.22%
▷ Public methods4393.48%
▷ Protected methods00.00%
▷ Private methods36.52%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
No PNG files were detected