Introduce proper user-facing names for check categories #373
Labels
Infrastructure
Issues for the overall plugin infrastructure
[Type] Bug
An existing feature is broken
The available check categories are currently only defined as a slug, via class constants on
Check_Categories
. While those slugs are the key to the functionality, the categories are also displayed to end users. Right now this is accomplished viaucfirst( str_replace( '_', ' ', $category ) )
, which really isn't right. We need to use a proper i18n string for each category.In other words, each available category should also have a label. Here's what I'd suggest:
Check_Categories::get_category_labels()
.Admin_Page
class should then call the new method to have both the category slugs and labels, and theadmin-page.php
template should be adjusted accordingly.Another related observation is that the
Check_Categories::get_categories()
method is unnecessarily complex, usingReflectionClass
to dynamically get the class constants. I think that's a bit "too smart" and more importantly inefficient, so I think it would be better to simply return a "hard-coded" array including the class constants in there. I think it would be worth making that change here too, while we're enhancing that class anyway.cc @mukeshpanchal27 @swissspidy @ernilambar
The text was updated successfully, but these errors were encountered: