refactor: remove Hungarian notation and MCI prefixes

I had to use some RegEx-fu for this. Specifically:

```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```

This should have covered all the bases.

In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.

This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.

Close #34, progress #36
This commit is contained in:
Ben Goldsworthy 2021-04-16 23:55:05 +01:00
parent df7160fad8
commit 1284544556
15 changed files with 1710 additions and 1710 deletions

View file

@ -15,7 +15,7 @@
*
* @since 1.5.0
*/
class MCI_Footnotes_Language {
class Footnotes_Language {
/**
* Register WordPress Hook.
@ -23,7 +23,7 @@ class MCI_Footnotes_Language {
* @since 1.5.0
*/
public static function register_hooks() {
add_action( 'plugins_loaded', array( 'MCI_Footnotes_Language', 'load_text_domain' ) );
add_action( 'plugins_loaded', array( 'Footnotes_Language', 'load_text_domain' ) );
}
/**
@ -72,7 +72,7 @@ class MCI_Footnotes_Language {
* Loads a specific text domain.
*
* @since 1.5.1
* @param string $p_str_language_code Language Code to load a specific text domain.
* @param string $language_code Language Code to load a specific text domain.
* @return bool
*
*
@ -87,11 +87,11 @@ class MCI_Footnotes_Language {
* “The .mo file should be named based on the text domain with a dash, and then the locale exactly.
* @see wp-includes/l10n.php:857
*/
private static function load( $p_str_language_code ) {
private static function load( $language_code ) {
return load_plugin_textdomain(
MCI_Footnotes_Config::C_STR_PLUGIN_NAME,
Footnotes_Config::PLUGIN_NAME,
false,
MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/languages'
Footnotes_Config::PLUGIN_NAME . '/languages'
);
}
}