Target code area or entity
The functions that provide the help content should be extracted to a class.
Main plug-in file, abp01-plugin-main.php, the following functions:
abp01_get_help_file_for_locale();
abp01_admin_help_page().
Target aspect
Code readability
Proposed solution
A new class should be defined, with the following singature:
class Abp01_Help {
public function getHelpContentForLocale($locale) {}
public function getHelpContentForCurrentLocale() {}
}
Thus:
abp01_get_help_file_for_locale() would disappear from abp01-plugin-main.php and would be integrated as a private method of Abp01_Help;
abp01_admin_help_page() would simply call the appropriate method of Abp01_Help.
Target code area or entity The functions that provide the help content should be extracted to a class. Main plug-in file,
abp01-plugin-main.php
, the following functions:abp01_get_help_file_for_locale()
;abp01_admin_help_page()
.Target aspect Code readability
Proposed solution A new class should be defined, with the following singature:
Thus:
abp01_get_help_file_for_locale()
would disappear fromabp01-plugin-main.php
and would be integrated as a private method ofAbp01_Help
;abp01_admin_help_page()
would simply call the appropriate method ofAbp01_Help
.