Cyr-To-Lat - Version 4.3.3

Version Description

(14.01.2020) = * Reworked main plugin filter * Improved performance by minimizing number of calls * Updated Georgian table * Fixed slug duplication in taxonomies * Fixed warnings with WooCommerce when mbstring is not loaded * Fixed transliteration of draft post slug * Tables sorted by local alphabets

Download this release

Release Info

Developer mihdan
Plugin Icon 128x128 Cyr-To-Lat
Version 4.3.3
Comparing to
See all releases

Code changes from version 4.3.2 to 4.3.3

Files changed (112) hide show
  1. classes/background-processes/class-post-conversion-process.php +5 -6
  2. classes/background-processes/class-term-conversion-process.php +5 -6
  3. classes/class-conversion-tables.php +550 -293
  4. classes/class-main.php +50 -54
  5. classes/class-requirements.php +0 -2
  6. cyr-to-lat.php +3 -3
  7. lib/polyfill-mbstring/LICENSE +19 -0
  8. lib/polyfill-mbstring/Mbstring.php +15 -5
  9. lib/polyfill-mbstring/bootstrap.php +179 -0
  10. readme.txt +10 -1
  11. vendor/autoload.php +1 -1
  12. vendor/composer/ClassLoader.php +2 -2
  13. vendor/composer/LICENSE +52 -17
  14. vendor/composer/autoload_files.php +10 -0
  15. vendor/composer/autoload_real.php +22 -4
  16. vendor/composer/autoload_static.php +8 -4
  17. vendor/composer/installers/composer.json +0 -107
  18. vendor/composer/installers/src/Composer/Installers/AglInstaller.php +0 -21
  19. vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php +0 -9
  20. vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +0 -11
  21. vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php +0 -49
  22. vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php +0 -9
  23. vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +0 -136
  24. vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +0 -126
  25. vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php +0 -9
  26. vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +0 -82
  27. vendor/composer/installers/src/Composer/Installers/ChefInstaller.php +0 -11
  28. vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php +0 -9
  29. vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php +0 -10
  30. vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php +0 -34
  31. vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +0 -11
  32. vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php +0 -13
  33. vendor/composer/installers/src/Composer/Installers/CraftInstaller.php +0 -35
  34. vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +0 -21
  35. vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php +0 -10
  36. vendor/composer/installers/src/Composer/Installers/DframeInstaller.php +0 -10
  37. vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +0 -50
  38. vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php +0 -16
  39. vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +0 -20
  40. vendor/composer/installers/src/Composer/Installers/ElggInstaller.php +0 -9
  41. vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php +0 -12
  42. vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php +0 -29
  43. vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php +0 -10
  44. vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +0 -11
  45. vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php +0 -9
  46. vendor/composer/installers/src/Composer/Installers/GravInstaller.php +0 -30
  47. vendor/composer/installers/src/Composer/Installers/HuradInstaller.php +0 -25
  48. vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php +0 -11
  49. vendor/composer/installers/src/Composer/Installers/Installer.php +0 -278
  50. vendor/composer/installers/src/Composer/Installers/ItopInstaller.php +0 -9
  51. vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +0 -15
  52. vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php +0 -18
  53. vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php +0 -11
  54. vendor/composer/installers/src/Composer/Installers/KnownInstaller.php +0 -11
  55. vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php +0 -10
  56. vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +0 -9
  57. vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php +0 -27
  58. vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +0 -9
  59. vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php +0 -10
  60. vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +0 -10
  61. vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +0 -9
  62. vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php +0 -16
  63. vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +0 -11
  64. vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php +0 -37
  65. vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +0 -9
  66. vendor/composer/installers/src/Composer/Installers/MauticInstaller.php +0 -25
  67. vendor/composer/installers/src/Composer/Installers/MayaInstaller.php +0 -33
  68. vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +0 -51
  69. vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +0 -119
  70. vendor/composer/installers/src/Composer/Installers/ModxInstaller.php +0 -12
  71. vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +0 -58
  72. vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +0 -47
  73. vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php +0 -24
  74. vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php +0 -14
  75. vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +0 -59
  76. vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +0 -9
  77. vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php +0 -11
  78. vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +0 -11
  79. vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php +0 -21
  80. vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php +0 -32
  81. vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php +0 -29
  82. vendor/composer/installers/src/Composer/Installers/Plugin.php +0 -17
  83. vendor/composer/installers/src/Composer/Installers/PortoInstaller.php +0 -9
  84. vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php +0 -10
  85. vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php +0 -11
  86. vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php +0 -63
  87. vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php +0 -24
  88. vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php +0 -10
  89. vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php +0 -10
  90. vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php +0 -10
  91. vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php +0 -22
  92. vendor/composer/installers/src/Composer/Installers/SMFInstaller.php +0 -10
  93. vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php +0 -60
  94. vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +0 -35
  95. vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php +0 -25
  96. vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php +0 -49
  97. vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +0 -26
  98. vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +0 -16
  99. vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +0 -38
  100. vendor/composer/installers/src/Composer/Installers/TaoInstaller.php +0 -12
  101. vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php +0 -12
  102. vendor/composer/installers/src/Composer/Installers/TuskInstaller.php +0 -14
  103. vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php +0 -9
  104. vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php +0 -10
  105. vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php +0 -49
  106. vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +0 -21
  107. vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php +0 -9
  108. vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +0 -12
  109. vendor/composer/installers/src/Composer/Installers/YawikInstaller.php +0 -32
  110. vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +0 -11
  111. vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php +0 -10
  112. vendor/composer/installers/src/bootstrap.php +0 -13
classes/background-processes/class-post-conversion-process.php CHANGED
@@ -59,16 +59,15 @@ class Post_Conversion_Process extends Conversion_Process {
59
  $post_name = urldecode( $post->post_name );
60
 
61
  add_filter( 'locale', [ $this, 'filter_post_locale' ] );
62
- $sanitized_name = sanitize_title( $post_name );
63
  remove_filter( 'locale', [ $this, 'filter_post_locale' ] );
64
 
65
- if ( urldecode( $sanitized_name ) !== $post_name ) {
66
  update_post_meta( $post->ID, '_wp_old_slug', $post_name );
67
- // phpcs:disable WordPress.DB.DirectDatabaseQuery
68
- $wpdb->update( $wpdb->posts, [ 'post_name' => $sanitized_name ], [ 'ID' => $post->ID ] );
69
- // phpcs:enable
70
 
71
- $this->log( __( 'Post slug converted:', 'cyr2lat' ) . ' ' . $post_name . ' => ' . urldecode( $sanitized_name ) );
72
  }
73
 
74
  return false;
59
  $post_name = urldecode( $post->post_name );
60
 
61
  add_filter( 'locale', [ $this, 'filter_post_locale' ] );
62
+ $transliterated_name = $this->main->transliterate( $post_name );
63
  remove_filter( 'locale', [ $this, 'filter_post_locale' ] );
64
 
65
+ if ( $transliterated_name !== $post_name ) {
66
  update_post_meta( $post->ID, '_wp_old_slug', $post_name );
67
+ // phpcs:ignore WordPress.DB.DirectDatabaseQuery
68
+ $wpdb->update( $wpdb->posts, [ 'post_name' => rawurlencode( $transliterated_name ) ], [ 'ID' => $post->ID ] );
 
69
 
70
+ $this->log( __( 'Post slug converted:', 'cyr2lat' ) . ' ' . $post_name . ' => ' . $transliterated_name );
71
  }
72
 
73
  return false;
classes/background-processes/class-term-conversion-process.php CHANGED
@@ -59,15 +59,14 @@ class Term_Conversion_Process extends Conversion_Process {
59
  $slug = urldecode( $term->slug );
60
 
61
  add_filter( 'locale', [ $this, 'filter_term_locale' ] );
62
- $sanitized_slug = sanitize_title( $slug );
63
  remove_filter( 'locale', [ $this, 'filter_term_locale' ] );
64
 
65
- if ( urldecode( $sanitized_slug ) !== $slug ) {
66
- // phpcs:disable WordPress.DB.DirectDatabaseQuery
67
- $wpdb->update( $wpdb->terms, [ 'slug' => $sanitized_slug ], [ 'term_id' => $term->term_id ] );
68
- // phpcs:enable
69
 
70
- $this->log( __( 'Term slug converted:', 'cyr2lat' ) . ' ' . $slug . ' => ' . urldecode( $sanitized_slug ) );
71
  }
72
 
73
  return false;
59
  $slug = urldecode( $term->slug );
60
 
61
  add_filter( 'locale', [ $this, 'filter_term_locale' ] );
62
+ $transliterated_slug = $this->main->transliterate( $slug );
63
  remove_filter( 'locale', [ $this, 'filter_term_locale' ] );
64
 
65
+ if ( $transliterated_slug !== $slug ) {
66
+ // phpcs:ignore WordPress.DB.DirectDatabaseQuery
67
+ $wpdb->update( $wpdb->terms, [ 'slug' => rawurlencode( $transliterated_slug ) ], [ 'term_id' => $term->term_id ] );
 
68
 
69
+ $this->log( __( 'Term slug converted:', 'cyr2lat' ) . ' ' . $slug . ' => ' . $transliterated_slug );
70
  }
71
 
72
  return false;
classes/class-conversion-tables.php CHANGED
@@ -26,320 +26,500 @@ class Conversion_Tables {
26
  * @return array
27
  */
28
  public static function get( $locale = '' ) {
29
- $table = [
30
- 'А' => 'A',
31
- 'Б' => 'B',
32
- 'В' => 'V',
33
- 'Г' => 'G',
34
- 'Д' => 'D',
35
- 'Е' => 'E',
36
- 'Ё' => 'YO',
37
- 'Ж' => 'ZH',
38
- 'З' => 'Z',
39
- 'И' => 'I',
40
- 'Й' => 'J',
41
- 'І' => 'I',
42
- 'К' => 'K',
43
- 'Л' => 'L',
44
- 'М' => 'M',
45
- 'Н' => 'N',
46
- 'О' => 'O',
47
- 'П' => 'P',
48
- 'Р' => 'R',
49
- 'С' => 'S',
50
- 'Т' => 'T',
51
- 'У' => 'U',
52
- 'Ф' => 'F',
53
- 'Х' => 'H',
54
- 'Ц' => 'CZ',
55
- 'Ч' => 'CH',
56
- 'Ш' => 'SH',
57
- 'Щ' => 'SHH',
58
- 'Ъ' => '',
59
- 'Ы' => 'Y',
60
- 'Ь' => '',
61
- 'Э' => 'E',
62
- 'Ю' => 'YU',
63
- 'Я' => 'YA',
64
- 'Ѣ' => 'YE',
65
- 'Ѳ' => 'FH',
66
- 'Ѵ' => 'YH',
67
- 'а' => 'a',
68
- 'б' => 'b',
69
- 'в' => 'v',
70
- 'г' => 'g',
71
- 'д' => 'd',
72
- 'е' => 'e',
73
- 'ё' => 'yo',
74
- 'ж' => 'zh',
75
- 'з' => 'z',
76
- 'и' => 'i',
77
- 'й' => 'j',
78
- 'і' => 'i',
79
- 'к' => 'k',
80
- 'л' => 'l',
81
- 'м' => 'm',
82
- 'н' => 'n',
83
- 'о' => 'o',
84
- 'п' => 'p',
85
- 'р' => 'r',
86
- 'с' => 's',
87
- 'т' => 't',
88
- 'у' => 'u',
89
- 'ф' => 'f',
90
- 'х' => 'h',
91
- 'ц' => 'cz',
92
- 'ч' => 'ch',
93
- 'ш' => 'sh',
94
- 'щ' => 'shh',
95
- 'ъ' => '',
96
- 'ы' => 'y',
97
- 'ь' => '',
98
- 'э' => 'e',
99
- 'ю' => 'yu',
100
- 'я' => 'ya',
101
- 'ѣ' => 'ye',
102
- 'ѳ' => 'fh',
103
- 'ѵ' => 'yh',
104
- ];
105
  switch ( $locale ) {
106
  // Belorussian.
107
  case 'bel':
108
- unset( $table['И'] );
109
- unset( $table['и'] );
110
- $table['Ў'] = 'U';
111
- $table['ў'] = 'u';
112
- unset( $table['Щ'] );
113
- unset( $table['щ'] );
114
- unset( $table['Ъ'] );
115
- unset( $table['ъ'] );
116
- unset( $table['Ѣ'] );
117
- unset( $table['ѣ'] );
118
- unset( $table['Ѳ'] );
119
- unset( $table['ѳ'] );
120
- unset( $table['Ѵ'] );
121
- unset( $table['ѵ'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  break;
123
  // Ukrainian.
124
  case 'uk':
125
- $table['Ґ'] = 'G';
126
- $table['ґ'] = 'g';
127
- unset( $table['Ё'] );
128
- unset( $table['ё'] );
129
- $table['Є'] = 'YE';
130
- $table['є'] = 'ye';
131
- $table['И'] = 'Y';
132
- $table['и'] = 'y';
133
- $table['Ї'] = 'YI';
134
- $table['ї'] = 'yi';
135
- unset( $table['Ъ'] );
136
- unset( $table['ъ'] );
137
- unset( $table['Ы'] );
138
- unset( $table['ы'] );
139
- unset( $table['Э'] );
140
- unset( $table['э'] );
141
- unset( $table['Ѣ'] );
142
- unset( $table['ѣ'] );
143
- unset( $table['Ѳ'] );
144
- unset( $table['ѳ'] );
145
- unset( $table['Ѵ'] );
146
- unset( $table['ѵ'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  break;
148
  // Bulgarian.
149
  case 'bg_BG':
150
- unset( $table['Ё'] );
151
- unset( $table['ё'] );
152
- $table['Щ'] = 'STH';
153
- $table['щ'] = 'sth';
154
- $table['Ъ'] = 'A';
155
- $table['ъ'] = 'a';
156
- unset( $table['Ы'] );
157
- unset( $table['ы'] );
158
- unset( $table['Э'] );
159
- unset( $table['э'] );
160
- $table['Ѫ'] = 'О';
161
- $table['ѫ'] = 'о';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  break;
163
  // Macedonian.
164
  case 'mk_MK':
165
- $table['Ѓ'] = 'G';
166
- $table['ѓ'] = 'g';
167
- unset( $table['Ё'] );
168
- unset( $table['ё'] );
169
- $table['Ѕ'] = 'Z';
170
- $table['ѕ'] = 'z';
171
- unset( $table['Й'] );
172
- unset( $table['й'] );
173
- $table['Ј'] = 'J';
174
- $table['ј'] = 'j';
175
- unset( $table['I'] );
176
- unset( $table['i'] );
177
- $table['Ќ'] = 'K';
178
- $table['ќ'] = 'k';
179
- $table['Љ'] = 'L';
180
- $table['љ'] = 'l';
181
- $table['Њ'] = 'N';
182
- $table['њ'] = 'n';
183
- $table['Џ'] = 'DH';
184
- $table['џ'] = 'dh';
185
- unset( $table['Щ'] );
186
- unset( $table['щ'] );
187
- unset( $table['Ъ'] );
188
- unset( $table['ъ'] );
189
- unset( $table['Ы'] );
190
- unset( $table['ы'] );
191
- unset( $table['Ь'] );
192
- unset( $table['ь'] );
193
- unset( $table['Э'] );
194
- unset( $table['э'] );
195
- unset( $table['Ю'] );
196
- unset( $table['ю'] );
197
- unset( $table['Я'] );
198
- unset( $table['я'] );
199
- unset( $table['Ѣ'] );
200
- unset( $table['ѣ'] );
201
- unset( $table['Ѳ'] );
202
- unset( $table['ѳ'] );
203
- unset( $table['Ѵ'] );
204
- unset( $table['ѵ'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  break;
206
  // Serbian.
207
  case 'sr_RS':
208
- $table['Ђ'] = 'Dj';
209
- $table['ђ'] = 'dj';
210
- unset( $table['Ё'] );
211
- unset( $table['ё'] );
212
- $table['Ж'] = 'Z';
213
- $table['ж'] = 'z';
214
- unset( $table['Й'] );
215
- unset( $table['й'] );
216
- unset( $table['І'] );
217
- unset( $table['і'] );
218
- $table['J'] = 'J';
219
- $table['j'] = 'j';
220
- $table['Љ'] = 'Lj';
221
- $table['љ'] = 'lj';
222
- $table['Њ'] = 'Nj';
223
- $table['њ'] = 'nj';
224
- $table['Ћ'] = 'C';
225
- $table['ћ'] = 'c';
226
- $table['Ц'] = 'C';
227
- $table['ц'] = 'c';
228
- $table['Ч'] = 'C';
229
- $table['ч'] = 'c';
230
- $table['Џ'] = 'Dz';
231
- $table['џ'] = 'dz';
232
- $table['Ш'] = 'S';
233
- $table['ш'] = 's';
234
- unset( $table['Щ'] );
235
- unset( $table['щ'] );
236
- unset( $table['Ъ'] );
237
- unset( $table['ъ'] );
238
- unset( $table['Ы'] );
239
- unset( $table['ы'] );
240
- unset( $table['Ь'] );
241
- unset( $table['ь'] );
242
- unset( $table['Э'] );
243
- unset( $table['э'] );
244
- unset( $table['Ю'] );
245
- unset( $table['ю'] );
246
- unset( $table['Я'] );
247
- unset( $table['я'] );
248
- unset( $table['Ѣ'] );
249
- unset( $table['ѣ'] );
250
- unset( $table['Ѳ'] );
251
- unset( $table['ѳ'] );
252
- unset( $table['Ѵ'] );
253
- unset( $table['ѵ'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  break;
255
  // Georgian.
256
  case 'ka_GE':
257
- $table['ა'] = 'a';
258
- $table['ბ'] = 'b';
259
- $table['გ'] = 'g';
260
- $table['დ'] = 'd';
261
- $table['ე'] = 'e';
262
- $table['ვ'] = 'v';
263
- $table['ზ'] = 'z';
264
- $table['თ'] = 'th';
265
- $table['ი'] = 'i';
266
- $table['კ'] = 'k';
267
- $table['ლ'] = 'l';
268
- $table['მ'] = 'm';
269
- $table['ნ'] = 'n';
270
- $table['ო'] = 'o';
271
- $table['პ'] = 'p';
272
- $table['ჟ'] = 'zh';
273
- $table['რ'] = 'r';
274
- $table['ს'] = 's';
275
- $table['ტ'] = 't';
276
- $table['უ'] = 'u';
277
- $table['ფ'] = 'ph';
278
- $table['ქ'] = 'q';
279
- $table['ღ'] = 'gh';
280
- $table['ყ'] = 'qh';
281
- $table['შ'] = 'sh';
282
- $table['ჩ'] = 'ch';
283
- $table['ც'] = 'ts';
284
- $table['ძ'] = 'dz';
285
- $table['წ'] = 'ts';
286
- $table['ჭ'] = 'tch';
287
- $table['ხ'] = 'kh';
288
- $table['ჯ'] = 'j';
289
- $table['ჰ'] = 'h';
 
 
 
 
 
 
 
290
  break;
291
  // Kazakh.
292
  case 'kk':
293
- $table['Ә'] = 'Ae';
294
- $table['ә'] = 'ae';
295
- $table['Ғ'] = 'Gh';
296
- $table['ғ'] = 'gh';
297
- unset( $table['Ё'] );
298
- unset( $table['ё'] );
299
- $table['Қ'] = 'Q';
300
- $table['қ'] = 'q';
301
- $table['Ң'] = 'Ng';
302
- $table['ң'] = 'ng';
303
- $table['Ө'] = 'Oe';
304
- $table['ө'] = 'oe';
305
- $table['У'] = 'W';
306
- $table['у'] = 'w';
307
- $table['Ұ'] = 'U';
308
- $table['ұ'] = 'u';
309
- $table['Ү'] = 'Ue';
310
- $table['ү'] = 'ue';
311
- $table['Һ'] = 'H';
312
- $table['һ'] = 'h';
313
- $table['Ц'] = 'C';
314
- $table['ц'] = 'c';
315
- unset( $table['Щ'] );
316
- unset( $table['щ'] );
317
- unset( $table['Ъ'] );
318
- unset( $table['ъ'] );
319
- unset( $table['Ь'] );
320
- unset( $table['ь'] );
321
- unset( $table['Э'] );
322
- unset( $table['э'] );
323
- unset( $table['Ю'] );
324
- unset( $table['ю'] );
325
- unset( $table['Я'] );
326
- unset( $table['я'] );
327
-
328
- // Kazakh 2018 latin.
329
- $table['Á'] = 'A';
330
- $table['á'] = 'a';
331
- $table['Ǵ'] = 'G';
332
- $table['ǵ'] = 'g';
333
- $table['I'] = 'I';
334
- $table['ı'] = 'i';
335
- $table['Ń'] = 'N';
336
- $table['ń'] = 'n';
337
- $table['Ó'] = 'O';
338
- $table['ó'] = 'o';
339
- $table['Ú'] = 'O';
340
- $table['ú'] = 'o';
341
- $table['Ý'] = 'O';
342
- $table['ý'] = 'o';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  break;
344
  // Hebrew.
345
  case 'he_IL':
@@ -792,7 +972,84 @@ class Conversion_Tables {
792
  'Zun' => '尊遵撙樽鳟',
793
  'Zuo' => '昨左佐做作坐座阼唑嘬怍胙祚酢',
794
  ];
 
795
  default:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
796
  }
797
 
798
  return $table;
26
  * @return array
27
  */
28
  public static function get( $locale = '' ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  switch ( $locale ) {
30
  // Belorussian.
31
  case 'bel':
32
+ $table = [
33
+ 'А' => 'A',
34
+ 'Б' => 'B',
35
+ 'В' => 'V',
36
+ 'Г' => 'G',
37
+ 'Д' => 'D',
38
+ 'Е' => 'E',
39
+ 'Ё' => 'YO',
40
+ 'Ж' => 'ZH',
41
+ 'З' => 'Z',
42
+ 'І' => 'I',
43
+ 'Й' => 'J',
44
+ 'К' => 'K',
45
+ 'Л' => 'L',
46
+ 'М' => 'M',
47
+ 'Н' => 'N',
48
+ 'О' => 'O',
49
+ 'П' => 'P',
50
+ 'Р' => 'R',
51
+ 'С' => 'S',
52
+ 'Т' => 'T',
53
+ 'У' => 'U',
54
+ 'Ў' => 'U',
55
+ 'Ф' => 'F',
56
+ 'Х' => 'H',
57
+ 'Ц' => 'CZ',
58
+ 'Ч' => 'CH',
59
+ 'Ш' => 'SH',
60
+ 'Ы' => 'Y',
61
+ 'Ь' => '',
62
+ 'Э' => 'E',
63
+ 'Ю' => 'YU',
64
+ 'Я' => 'YA',
65
+ 'а' => 'a',
66
+ 'б' => 'b',
67
+ 'в' => 'v',
68
+ 'г' => 'g',
69
+ 'д' => 'd',
70
+ 'е' => 'e',
71
+ 'ё' => 'yo',
72
+ 'ж' => 'zh',
73
+ 'з' => 'z',
74
+ 'і' => 'i',
75
+ 'й' => 'j',
76
+ 'к' => 'k',
77
+ 'л' => 'l',
78
+ 'м' => 'm',
79
+ 'н' => 'n',
80
+ 'о' => 'o',
81
+ 'п' => 'p',
82
+ 'р' => 'r',
83
+ 'с' => 's',
84
+ 'т' => 't',
85
+ 'у' => 'u',
86
+ 'ў' => 'u',
87
+ 'ф' => 'f',
88
+ 'х' => 'h',
89
+ 'ц' => 'cz',
90
+ 'ч' => 'ch',
91
+ 'ш' => 'sh',
92
+ 'ы' => 'y',
93
+ 'ь' => '',
94
+ 'э' => 'e',
95
+ 'ю' => 'yu',
96
+ 'я' => 'ya',
97
+ ];
98
  break;
99
  // Ukrainian.
100
  case 'uk':
101
+ $table = [
102
+ 'А' => 'A',
103
+ 'Б' => 'B',
104
+ 'В' => 'V',
105
+ 'Г' => 'G',
106
+ 'Ґ' => 'G',
107
+ 'Д' => 'D',
108
+ 'Е' => 'E',
109
+ 'Є' => 'YE',
110
+ 'Ж' => 'ZH',
111
+ 'З' => 'Z',
112
+ 'И' => 'Y',
113
+ 'І' => 'I',
114
+ 'Ї' => 'YI',
115
+ 'Й' => 'J',
116
+ 'К' => 'K',
117
+ 'Л' => 'L',
118
+ 'М' => 'M',
119
+ 'Н' => 'N',
120
+ 'О' => 'O',
121
+ 'П' => 'P',
122
+ 'Р' => 'R',
123
+ 'С' => 'S',
124
+ 'Т' => 'T',
125
+ 'У' => 'U',
126
+ 'Ф' => 'F',
127
+ 'Х' => 'H',
128
+ 'Ц' => 'CZ',
129
+ 'Ч' => 'CH',
130
+ 'Ш' => 'SH',
131
+ 'Щ' => 'SHH',
132
+ 'Ь' => '',
133
+ 'Ю' => 'YU',
134
+ 'Я' => 'YA',
135
+ 'а' => 'a',
136
+ 'б' => 'b',
137
+ 'в' => 'v',
138
+ 'г' => 'g',
139
+ 'ґ' => 'g',
140
+ 'д' => 'd',
141
+ 'е' => 'e',
142
+ 'є' => 'ye',
143
+ 'ж' => 'zh',
144
+ 'з' => 'z',
145
+ 'и' => 'y',
146
+ 'і' => 'i',
147
+ 'ї' => 'yi',
148
+ 'й' => 'j',
149
+ 'к' => 'k',
150
+ 'л' => 'l',
151
+ 'м' => 'm',
152
+ 'н' => 'n',
153
+ 'о' => 'o',
154
+ 'п' => 'p',
155
+ 'р' => 'r',
156
+ 'с' => 's',
157
+ 'т' => 't',
158
+ 'у' => 'u',
159
+ 'ф' => 'f',
160
+ 'х' => 'h',
161
+ 'ц' => 'cz',
162
+ 'ч' => 'ch',
163
+ 'ш' => 'sh',
164
+ 'щ' => 'shh',
165
+ 'ь' => '',
166
+ 'ю' => 'yu',
167
+ 'я' => 'ya',
168
+ ];
169
  break;
170
  // Bulgarian.
171
  case 'bg_BG':
172
+ $table = [
173
+ 'А' => 'A',
174
+ 'Б' => 'B',
175
+ 'В' => 'V',
176
+ 'Г' => 'G',
177
+ 'Д' => 'D',
178
+ 'Е' => 'E',
179
+ 'Ж' => 'ZH',
180
+ 'З' => 'Z',
181
+ 'И' => 'I',
182
+ 'Й' => 'J',
183
+ 'К' => 'K',
184
+ 'Л' => 'L',
185
+ 'М' => 'M',
186
+ 'Н' => 'N',
187
+ 'О' => 'O',
188
+ 'П' => 'P',
189
+ 'Р' => 'R',
190
+ 'С' => 'S',
191
+ 'Т' => 'T',
192
+ 'У' => 'U',
193
+ 'Ф' => 'F',
194
+ 'Х' => 'H',
195
+ 'Ц' => 'CZ',
196
+ 'Ч' => 'CH',
197
+ 'Ш' => 'SH',
198
+ 'Щ' => 'STH',
199
+ 'Ъ' => 'A',
200
+ 'Ь' => '',
201
+ 'Ю' => 'YU',
202
+ 'Я' => 'YA',
203
+ 'а' => 'a',
204
+ 'б' => 'b',
205
+ 'в' => 'v',
206
+ 'г' => 'g',
207
+ 'д' => 'd',
208
+ 'е' => 'e',
209
+ 'ж' => 'zh',
210
+ 'з' => 'z',
211
+ 'и' => 'i',
212
+ 'й' => 'j',
213
+ 'к' => 'k',
214
+ 'л' => 'l',
215
+ 'м' => 'm',
216
+ 'н' => 'n',
217
+ 'о' => 'o',
218
+ 'п' => 'p',
219
+ 'р' => 'r',
220
+ 'с' => 's',
221
+ 'т' => 't',
222
+ 'у' => 'u',
223
+ 'ф' => 'f',
224
+ 'х' => 'h',
225
+ 'ц' => 'cz',
226
+ 'ч' => 'ch',
227
+ 'ш' => 'sh',
228
+ 'щ' => 'sth',
229
+ 'ъ' => 'a',
230
+ 'ь' => '',
231
+ 'ю' => 'yu',
232
+ 'я' => 'ya',
233
+ 'І' => 'I',
234
+ 'і' => 'i',
235
+ 'Ѣ' => 'YE',
236
+ 'ѣ' => 'ye',
237
+ 'Ѫ' => 'О',
238
+ 'ѫ' => 'о',
239
+ 'Ѳ' => 'FH',
240
+ 'ѳ' => 'fh',
241
+ 'Ѵ' => 'YH',
242
+ 'ѵ' => 'yh',
243
+ ];
244
  break;
245
  // Macedonian.
246
  case 'mk_MK':
247
+ $table = [
248
+ 'А' => 'A',
249
+ 'Б' => 'B',
250
+ 'В' => 'V',
251
+ 'Г' => 'G',
252
+ 'Д' => 'D',
253
+ 'Ѓ' => 'G',
254
+ 'Е' => 'E',
255
+ 'Ж' => 'ZH',
256
+ 'З' => 'Z',
257
+ 'И' => 'I',
258
+ 'Ѕ' => 'Z',
259
+ 'Ј' => 'J',
260
+ 'К' => 'K',
261
+ 'Л' => 'L',
262
+ 'Љ' => 'L',
263
+ 'М' => 'M',
264
+ 'Н' => 'N',
265
+ 'Њ' => 'N',
266
+ 'О' => 'O',
267
+ 'П' => 'P',
268
+ 'Р' => 'R',
269
+ 'С' => 'S',
270
+ 'Т' => 'T',
271
+ 'Ќ' => 'K',
272
+ 'У' => 'U',
273
+ 'Ф' => 'F',
274
+ 'Х' => 'H',
275
+ 'Ц' => 'CZ',
276
+ 'Ч' => 'CH',
277
+ 'Џ' => 'DH',
278
+ 'Ш' => 'SH',
279
+ 'а' => 'a',
280
+ 'б' => 'b',
281
+ 'в' => 'v',
282
+ 'г' => 'g',
283
+ 'д' => 'd',
284
+ 'ѓ' => 'g',
285
+ 'е' => 'e',
286
+ 'ж' => 'zh',
287
+ 'з' => 'z',
288
+ 'и' => 'i',
289
+ 'ѕ' => 'z',
290
+ 'ј' => 'j',
291
+ 'к' => 'k',
292
+ 'л' => 'l',
293
+ 'љ' => 'l',
294
+ 'м' => 'm',
295
+ 'н' => 'n',
296
+ 'њ' => 'n',
297
+ 'о' => 'o',
298
+ 'п' => 'p',
299
+ 'р' => 'r',
300
+ 'с' => 's',
301
+ 'т' => 't',
302
+ 'ќ' => 'k',
303
+ 'у' => 'u',
304
+ 'ф' => 'f',
305
+ 'х' => 'h',
306
+ 'ц' => 'cz',
307
+ 'ч' => 'ch',
308
+ 'џ' => 'dh',
309
+ 'ш' => 'sh',
310
+ ];
311
  break;
312
  // Serbian.
313
  case 'sr_RS':
314
+ $table = [
315
+ 'А' => 'A',
316
+ 'Б' => 'B',
317
+ 'В' => 'V',
318
+ 'Г' => 'G',
319
+ 'Д' => 'D',
320
+ 'Ђ' => 'Dj',
321
+ 'Е' => 'E',
322
+ 'Ж' => 'Z',
323
+ 'З' => 'Z',
324
+ 'И' => 'I',
325
+ 'J' => 'J',
326
+ 'К' => 'K',
327
+ 'Л' => 'L',
328
+ 'Љ' => 'Lj',
329
+ 'М' => 'M',
330
+ 'Н' => 'N',
331
+ 'Њ' => 'Nj',
332
+ 'О' => 'O',
333
+ 'П' => 'P',
334
+ 'Р' => 'R',
335
+ 'С' => 'S',
336
+ 'Т' => 'T',
337
+ 'Ћ' => 'C',
338
+ 'У' => 'U',
339
+ 'Ф' => 'F',
340
+ 'Х' => 'H',
341
+ 'Ц' => 'C',
342
+ 'Ч' => 'C',
343
+ 'Џ' => 'Dz',
344
+ 'Ш' => 'S',
345
+ 'а' => 'a',
346
+ 'б' => 'b',
347
+ 'в' => 'v',
348
+ 'г' => 'g',
349
+ 'д' => 'd',
350
+ 'ђ' => 'dj',
351
+ 'е' => 'e',
352
+ 'ж' => 'z',
353
+ 'з' => 'z',
354
+ 'и' => 'i',
355
+ 'j' => 'j',
356
+ 'к' => 'k',
357
+ 'л' => 'l',
358
+ 'љ' => 'lj',
359
+ 'м' => 'm',
360
+ 'н' => 'n',
361
+ 'њ' => 'nj',
362
+ 'о' => 'o',
363
+ 'п' => 'p',
364
+ 'р' => 'r',
365
+ 'с' => 's',
366
+ 'т' => 't',
367
+ 'ћ' => 'c',
368
+ 'у' => 'u',
369
+ 'ф' => 'f',
370
+ 'х' => 'h',
371
+ 'ц' => 'c',
372
+ 'ч' => 'c',
373
+ 'џ' => 'dz',
374
+ 'ш' => 's',
375
+ ];
376
  break;
377
  // Georgian.
378
  case 'ka_GE':
379
+ $table = [
380
+ '' => 'a',
381
+ '' => 'b',
382
+ '' => 'g',
383
+ '' => 'd',
384
+ '' => 'e',
385
+ '' => 'v',
386
+ '' => 'z',
387
+ '' => '',
388
+ '' => 'th',
389
+ '' => 'i',
390
+ '' => 'k',
391
+ '' => 'l',
392
+ '' => 'm',
393
+ '' => 'n',
394
+ '' => '',
395
+ '' => 'o',
396
+ '' => 'p',
397
+ '' => 'zh',
398
+ '' => 'r',
399
+ '' => 's',
400
+ '' => 't',
401
+ '' => '',
402
+ '' => 'u',
403
+ '' => 'ph',
404
+ '' => 'kh',
405
+ '' => 'gh',
406
+ '' => 'qh',
407
+ '' => 'sh',
408
+ '' => 'ch',
409
+ '' => 'ts',
410
+ '' => 'dz',
411
+ '' => 'c',
412
+ 'ჭ' => 'ch',
413
+ 'ხ' => 'kh',
414
+ 'ჴ' => '',
415
+ 'ჯ' => 'j',
416
+ 'ჰ' => 'h',
417
+ 'ჵ' => '',
418
+ ];
419
  break;
420
  // Kazakh.
421
  case 'kk':
422
+ $table = [
423
+ 'А' => 'A',
424
+ 'Ә' => 'Ae',
425
+ 'Б' => 'B',
426
+ 'В' => 'V',
427
+ 'Г' => 'G',
428
+ 'Ғ' => 'Gh',
429
+ 'Д' => 'D',
430
+ 'Е' => 'E',
431
+ 'Ё' => 'YO',
432
+ 'Ж' => 'ZH',
433
+ 'З' => 'Z',
434
+ 'И' => 'I',
435
+ 'Й' => 'J',
436
+ 'К' => 'K',
437
+ 'Қ' => 'Q',
438
+ 'Л' => 'L',
439
+ 'М' => 'M',
440
+ 'Н' => 'N',
441
+ 'Ң' => 'Ng',
442
+ 'О' => 'O',
443
+ 'Ө' => 'Oe',
444
+ 'П' => 'P',
445
+ 'Р' => 'R',
446
+ 'С' => 'S',
447
+ 'Т' => 'T',
448
+ 'У' => 'W',
449
+ 'Ұ' => 'U',
450
+ 'Ү' => 'Ue',
451
+ 'Ф' => 'F',
452
+ 'Х' => 'H',
453
+ 'Һ' => 'H',
454
+ 'Ц' => 'C',
455
+ 'Ч' => 'CH',
456
+ 'Ш' => 'SH',
457
+ 'Щ' => 'SHH',
458
+ 'Ъ' => '',
459
+ 'Ы' => 'Y',
460
+ 'І' => 'I',
461
+ 'Ь' => '',
462
+ 'Э' => 'E',
463
+ 'Ю' => 'YU',
464
+ 'Я' => 'YA',
465
+ 'а' => 'a',
466
+ 'ә' => 'ae',
467
+ 'б' => 'b',
468
+ 'в' => 'v',
469
+ 'г' => 'g',
470
+ 'ғ' => 'gh',
471
+ 'д' => 'd',
472
+ 'е' => 'e',
473
+ 'ё' => 'yo',
474
+ 'ж' => 'zh',
475
+ 'з' => 'z',
476
+ 'и' => 'i',
477
+ 'й' => 'j',
478
+ 'к' => 'k',
479
+ 'қ' => 'q',
480
+ 'л' => 'l',
481
+ 'м' => 'm',
482
+ 'н' => 'n',
483
+ 'ң' => 'ng',
484
+ 'о' => 'o',
485
+ 'ө' => 'oe',
486
+ 'п' => 'p',
487
+ 'р' => 'r',
488
+ 'с' => 's',
489
+ 'т' => 't',
490
+ 'у' => 'w',
491
+ 'ұ' => 'u',
492
+ 'ү' => 'ue',
493
+ 'ф' => 'f',
494
+ 'х' => 'h',
495
+ 'һ' => 'h',
496
+ 'ц' => 'c',
497
+ 'ч' => 'ch',
498
+ 'ш' => 'sh',
499
+ 'щ' => 'shh',
500
+ 'ъ' => '',
501
+ 'ы' => 'y',
502
+ 'і' => 'i',
503
+ 'ь' => '',
504
+ 'э' => 'e',
505
+ 'ю' => 'yu',
506
+ 'я' => 'ya',
507
+ // Kazakh 2018 latin.
508
+ 'Á' => 'A',
509
+ 'Ǵ' => 'G',
510
+ 'I' => 'I',
511
+ 'Ń' => 'N',
512
+ 'Ó' => 'O',
513
+ 'Ú' => 'O',
514
+ 'Ý' => 'O',
515
+ 'á' => 'a',
516
+ 'ǵ' => 'g',
517
+ 'ı' => 'i',
518
+ 'ń' => 'n',
519
+ 'ó' => 'o',
520
+ 'ú' => 'o',
521
+ 'ý' => 'o',
522
+ ];
523
  break;
524
  // Hebrew.
525
  case 'he_IL':
972
  'Zun' => '尊遵撙樽鳟',
973
  'Zuo' => '昨左佐做作坐座阼唑嘬怍胙祚酢',
974
  ];
975
+ break;
976
  default:
977
+ $table = [
978
+ 'А' => 'A',
979
+ 'Б' => 'B',
980
+ 'В' => 'V',
981
+ 'Г' => 'G',
982
+ 'Д' => 'D',
983
+ 'Е' => 'E',
984
+ 'Ё' => 'YO',
985
+ 'Ж' => 'ZH',
986
+ 'З' => 'Z',
987
+ 'И' => 'I',
988
+ 'Й' => 'J',
989
+ 'К' => 'K',
990
+ 'Л' => 'L',
991
+ 'М' => 'M',
992
+ 'Н' => 'N',
993
+ 'О' => 'O',
994
+ 'П' => 'P',
995
+ 'Р' => 'R',
996
+ 'С' => 'S',
997
+ 'Т' => 'T',
998
+ 'У' => 'U',
999
+ 'Ф' => 'F',
1000
+ 'Х' => 'H',
1001
+ 'Ц' => 'CZ',
1002
+ 'Ч' => 'CH',
1003
+ 'Ш' => 'SH',
1004
+ 'Щ' => 'SHH',
1005
+ 'Ъ' => '',
1006
+ 'Ы' => 'Y',
1007
+ 'Ь' => '',
1008
+ 'Э' => 'E',
1009
+ 'Ю' => 'YU',
1010
+ 'Я' => 'YA',
1011
+ 'а' => 'a',
1012
+ 'б' => 'b',
1013
+ 'в' => 'v',
1014
+ 'г' => 'g',
1015
+ 'д' => 'd',
1016
+ 'е' => 'e',
1017
+ 'ё' => 'yo',
1018
+ 'ж' => 'zh',
1019
+ 'з' => 'z',
1020
+ 'и' => 'i',
1021
+ 'й' => 'j',
1022
+ 'к' => 'k',
1023
+ 'л' => 'l',
1024
+ 'м' => 'm',
1025
+ 'н' => 'n',
1026
+ 'о' => 'o',
1027
+ 'п' => 'p',
1028
+ 'р' => 'r',
1029
+ 'с' => 's',
1030
+ 'т' => 't',
1031
+ 'у' => 'u',
1032
+ 'ф' => 'f',
1033
+ 'х' => 'h',
1034
+ 'ц' => 'cz',
1035
+ 'ч' => 'ch',
1036
+ 'ш' => 'sh',
1037
+ 'щ' => 'shh',
1038
+ 'ъ' => '',
1039
+ 'ы' => 'y',
1040
+ 'ь' => '',
1041
+ 'э' => 'e',
1042
+ 'ю' => 'yu',
1043
+ 'я' => 'ya',
1044
+ 'І' => 'I',
1045
+ 'і' => 'i',
1046
+ 'Ѣ' => 'YE',
1047
+ 'ѣ' => 'ye',
1048
+ 'Ѳ' => 'FH',
1049
+ 'ѳ' => 'fh',
1050
+ 'Ѵ' => 'YH',
1051
+ 'ѵ' => 'yh',
1052
+ ];
1053
  }
1054
 
1055
  return $table;
classes/class-main.php CHANGED
@@ -110,61 +110,53 @@ class Main {
110
  * Init class hooks.
111
  */
112
  public function init_hooks() {
113
- add_filter( 'sanitize_title', [ $this, 'ctl_sanitize_title' ], 9, 3 );
 
 
 
114
  add_filter( 'sanitize_file_name', [ $this, 'ctl_sanitize_filename' ], 10, 2 );
115
  add_filter( 'wp_insert_post_data', [ $this, 'ctl_sanitize_post_name' ], 10, 2 );
116
  }
117
 
118
  /**
119
- * Sanitize title.
120
  *
121
- * @param string $title Sanitized title.
122
- * @param string $raw_title The title prior to sanitization.
123
- * @param string $context The context for which the title is being sanitized.
 
 
 
124
  *
125
  * @return string
126
  */
127
- public function ctl_sanitize_title( $title, $raw_title = '', $context = '' ) {
128
- global $wpdb;
129
-
130
- if ( ! $title ) {
131
- return $title;
132
- }
133
-
134
- // Fixed bug with `_wp_old_slug` redirect.
135
- if ( 'query' === $context ) {
136
- return $title;
137
- }
138
-
139
- $title = urldecode( $title );
140
- $pre = apply_filters( 'ctl_pre_sanitize_title', false, $title );
141
-
142
- if ( false !== $pre ) {
143
- return $pre;
144
- }
145
-
146
- $is_term = false;
147
- // phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace
148
- $backtrace = debug_backtrace( ~DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS );
149
- // phpcs:enable
150
- foreach ( $backtrace as $backtrace_entry ) {
151
- if ( 'wp_insert_term' === $backtrace_entry['function'] ) {
152
- $is_term = true;
153
- break;
154
- }
155
- }
156
-
157
- // phpcs:disable WordPress.DB.DirectDatabaseQuery
158
- $term = $is_term ? $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE name = %s", $title ) ) : '';
159
- // phpcs:enable
160
 
161
- if ( ! empty( $term ) ) {
162
- $title = $term;
163
- } else {
164
- $title = $this->transliterate( $title );
165
- }
 
 
 
 
 
 
 
166
 
167
- return $title;
 
 
 
 
 
 
 
 
 
168
  }
169
 
170
  /**
@@ -183,7 +175,7 @@ class Main {
183
  }
184
 
185
  if ( seems_utf8( $filename ) ) {
186
- $filename = Mbstring::mb_strtolower( $filename );
187
  }
188
 
189
  return $this->transliterate( $filename );
@@ -219,7 +211,7 @@ class Main {
219
  * @return string
220
  */
221
  protected function split_chinese_string( $string, $table ) {
222
- if ( ! $this->settings->is_chinese_locale() || Mbstring::mb_strlen( $string ) < 4 ) {
223
  return $string;
224
  }
225
 
@@ -237,6 +229,17 @@ class Main {
237
  return $string;
238
  }
239
 
 
 
 
 
 
 
 
 
 
 
 
240
  /**
241
  * Get transliteration table.
242
  *
@@ -253,7 +256,7 @@ class Main {
253
  *
254
  * @return string
255
  */
256
- private function transliterate( $string ) {
257
  $table = $this->get_filtered_table();
258
 
259
  $string = $this->fix_mac_string( $string );
@@ -329,17 +332,10 @@ class Main {
329
  * @return mixed
330
  */
331
  public function ctl_sanitize_post_name( $data, $postarr = [] ) {
332
- global $current_screen;
333
-
334
  if ( ! $this->ctl_is_gutenberg_editor_active() ) {
335
  return $data;
336
  }
337
 
338
- // Run code only on post edit screen.
339
- if ( ! ( $current_screen && 'post' === $current_screen->base ) ) {
340
- return $data;
341
- }
342
-
343
  if (
344
  ! $data['post_name'] && $data['post_title'] &&
345
  ! in_array( $data['post_status'], [ 'auto-draft', 'revision' ], true )
110
  * Init class hooks.
111
  */
112
  public function init_hooks() {
113
+ add_filter( 'wp_unique_post_slug', [ $this, 'wp_unique_post_slug_filter' ], 10, 6 );
114
+ add_filter( 'wp_unique_term_slug', [ $this, 'wp_unique_term_slug_filter' ], 10, 3 );
115
+ add_filter( 'pre_term_slug', [ $this, 'pre_term_slug_filter' ], 10, 2 );
116
+
117
  add_filter( 'sanitize_file_name', [ $this, 'ctl_sanitize_filename' ], 10, 2 );
118
  add_filter( 'wp_insert_post_data', [ $this, 'ctl_sanitize_post_name' ], 10, 2 );
119
  }
120
 
121
  /**
122
+ * Filter post slug.
123
  *
124
+ * @param string $slug The post slug.
125
+ * @param int $post_ID Post ID.
126
+ * @param string $post_status The post status.
127
+ * @param string $post_type Post type.
128
+ * @param int $post_parent Post parent ID.
129
+ * @param string $original_slug The original post slug.
130
  *
131
  * @return string
132
  */
133
+ public function wp_unique_post_slug_filter( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) {
134
+ return $this->transliterate_encoded( $slug );
135
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
 
137
+ /**
138
+ * Filter wp_unique_term_slug.
139
+ *
140
+ * @param string $slug Unique term slug.
141
+ * @param object $term Term object.
142
+ * @param string $original_slug Slug originally passed to the function for testing.
143
+ *
144
+ * @return string
145
+ */
146
+ public function wp_unique_term_slug_filter( $slug, $term, $original_slug ) {
147
+ return $this->transliterate_encoded( $slug );
148
+ }
149
 
150
+ /**
151
+ * Filter pre_term_slug.
152
+ *
153
+ * @param mixed $value Value of the term field.
154
+ * @param string $taxonomy Taxonomy slug.
155
+ *
156
+ * @return string
157
+ */
158
+ public function pre_term_slug_filter( $value, $taxonomy ) {
159
+ return $this->transliterate_encoded( $value );
160
  }
161
 
162
  /**
175
  }
176
 
177
  if ( seems_utf8( $filename ) ) {
178
+ $filename = mb_strtolower( $filename );
179
  }
180
 
181
  return $this->transliterate( $filename );
211
  * @return string
212
  */
213
  protected function split_chinese_string( $string, $table ) {
214
+ if ( ! $this->settings->is_chinese_locale() || mb_strlen( $string ) < 4 ) {
215
  return $string;
216
  }
217
 
229
  return $string;
230
  }
231
 
232
+ /**
233
+ * Transliterate encoded url.
234
+ *
235
+ * @param string $url Url.
236
+ *
237
+ * @return string
238
+ */
239
+ private function transliterate_encoded( $url ) {
240
+ return rawurlencode( $this->transliterate( urldecode( $url ) ) );
241
+ }
242
+
243
  /**
244
  * Get transliteration table.
245
  *
256
  *
257
  * @return string
258
  */
259
+ public function transliterate( $string ) {
260
  $table = $this->get_filtered_table();
261
 
262
  $string = $this->fix_mac_string( $string );
332
  * @return mixed
333
  */
334
  public function ctl_sanitize_post_name( $data, $postarr = [] ) {
 
 
335
  if ( ! $this->ctl_is_gutenberg_editor_active() ) {
336
  return $data;
337
  }
338
 
 
 
 
 
 
339
  if (
340
  ! $data['post_name'] && $data['post_title'] &&
341
  ! in_array( $data['post_status'], [ 'auto-draft', 'revision' ], true )
classes/class-requirements.php CHANGED
@@ -43,8 +43,6 @@ if ( ! class_exists( __NAMESPACE__ . '\Requirements' ) ) {
43
  *
44
  * @param Admin_Notices $admin_notices Admin notices.
45
  * @param WP_Filesystem_Direct $wp_filesystem File system.
46
- *
47
- * @throws RuntimeException RuntimeException.
48
  */
49
  public function __construct( $admin_notices = null, $wp_filesystem = null ) {
50
  $this->admin_notices = $admin_notices;
43
  *
44
  * @param Admin_Notices $admin_notices Admin notices.
45
  * @param WP_Filesystem_Direct $wp_filesystem File system.
 
 
46
  */
47
  public function __construct( $admin_notices = null, $wp_filesystem = null ) {
48
  $this->admin_notices = $admin_notices;
cyr-to-lat.php CHANGED
@@ -9,8 +9,8 @@
9
  * Author URI: https://profiles.wordpress.org/sergeybiryukov/
10
  * Requires at least: 5.1
11
  * Tested up to: 5.3
12
- * Version: 4.3.2
13
- * Stable tag: 4.3.2
14
  *
15
  * Text Domain: cyr2lat
16
  * Domain Path: /languages/
@@ -30,7 +30,7 @@ if ( ! defined( 'CYR_TO_LAT_VERSION' ) ) {
30
  /**
31
  * Plugin version.
32
  */
33
- define( 'CYR_TO_LAT_VERSION', '4.3.2' );
34
  }
35
 
36
  if ( ! defined( 'CYR_TO_LAT_PATH' ) ) {
9
  * Author URI: https://profiles.wordpress.org/sergeybiryukov/
10
  * Requires at least: 5.1
11
  * Tested up to: 5.3
12
+ * Version: 4.3.3
13
+ * Stable tag: 4.3.3
14
  *
15
  * Text Domain: cyr2lat
16
  * Domain Path: /languages/
30
  /**
31
  * Plugin version.
32
  */
33
+ define( 'CYR_TO_LAT_VERSION', '4.3.3' );
34
  }
35
 
36
  if ( ! defined( 'CYR_TO_LAT_PATH' ) ) {
lib/polyfill-mbstring/LICENSE ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2015-2019 Fabien Potencier
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is furnished
8
+ to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
lib/polyfill-mbstring/Mbstring.php CHANGED
@@ -1,13 +1,12 @@
1
  <?php
2
- /**
 
3
  * This file is part of the Symfony package.
4
  *
5
  * (c) Fabien Potencier <fabien@symfony.com>
6
  *
7
  * For the full copyright and license information, please view the LICENSE
8
  * file that was distributed with this source code.
9
- *
10
- * @package cyr-to-lat
11
  */
12
 
13
  namespace Cyr_To_Lat\Symfony\Polyfill\Mbstring;
@@ -513,7 +512,9 @@ final class Mbstring
513
  $offset = 0;
514
  } elseif ($offset = (int) $offset) {
515
  if ($offset < 0) {
516
- $haystack = self::mb_substr($haystack, 0, $offset, $encoding);
 
 
517
  $offset = 0;
518
  } else {
519
  $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
@@ -533,7 +534,7 @@ final class Mbstring
533
  return null;
534
  }
535
 
536
- if ($split_length < 1) {
537
  trigger_error('The length of each segment must be greater than zero', E_USER_WARNING);
538
 
539
  return false;
@@ -543,6 +544,10 @@ final class Mbstring
543
  $encoding = mb_internal_encoding();
544
  }
545
 
 
 
 
 
546
  $result = array();
547
  $length = mb_strlen($string, $encoding);
548
 
@@ -816,11 +821,16 @@ final class Mbstring
816
  return self::$internalEncoding;
817
  }
818
 
 
 
 
 
819
  $encoding = strtoupper($encoding);
820
 
821
  if ('8BIT' === $encoding || 'BINARY' === $encoding) {
822
  return 'CP850';
823
  }
 
824
  if ('UTF8' === $encoding) {
825
  return 'UTF-8';
826
  }
1
  <?php
2
+
3
+ /*
4
  * This file is part of the Symfony package.
5
  *
6
  * (c) Fabien Potencier <fabien@symfony.com>
7
  *
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
 
 
10
  */
11
 
12
  namespace Cyr_To_Lat\Symfony\Polyfill\Mbstring;
512
  $offset = 0;
513
  } elseif ($offset = (int) $offset) {
514
  if ($offset < 0) {
515
+ if (0 > $offset += self::mb_strlen($needle)) {
516
+ $haystack = self::mb_substr($haystack, 0, $offset, $encoding);
517
+ }
518
  $offset = 0;
519
  } else {
520
  $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
534
  return null;
535
  }
536
 
537
+ if (1 > $split_length = (int) $split_length) {
538
  trigger_error('The length of each segment must be greater than zero', E_USER_WARNING);
539
 
540
  return false;
544
  $encoding = mb_internal_encoding();
545
  }
546
 
547
+ if ('UTF-8' === $encoding = self::getEncoding($encoding)) {
548
+ return preg_split("/(.{{$split_length}})/u", $string, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
549
+ }
550
+
551
  $result = array();
552
  $length = mb_strlen($string, $encoding);
553
 
821
  return self::$internalEncoding;
822
  }
823
 
824
+ if ('UTF-8' === $encoding) {
825
+ return 'UTF-8';
826
+ }
827
+
828
  $encoding = strtoupper($encoding);
829
 
830
  if ('8BIT' === $encoding || 'BINARY' === $encoding) {
831
  return 'CP850';
832
  }
833
+
834
  if ('UTF8' === $encoding) {
835
  return 'UTF-8';
836
  }
lib/polyfill-mbstring/bootstrap.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Cyr_To_Lat;
4
+
5
+ /*
6
+ * This file is part of the Symfony package.
7
+ *
8
+ * (c) Fabien Potencier <fabien@symfony.com>
9
+ *
10
+ * For the full copyright and license information, please view the LICENSE
11
+ * file that was distributed with this source code.
12
+ */
13
+ use Cyr_To_Lat\Symfony\Polyfill\Mbstring as p;
14
+ if (!\function_exists('mb_strpos')) {
15
+ \define('MB_CASE_UPPER', 0);
16
+ \define('MB_CASE_LOWER', 1);
17
+ \define('MB_CASE_TITLE', 2);
18
+ function mb_convert_encoding($s, $to, $from = null)
19
+ {
20
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding($s, $to, $from);
21
+ }
22
+ function mb_decode_mimeheader($s)
23
+ {
24
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_decode_mimeheader($s);
25
+ }
26
+ function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null)
27
+ {
28
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent);
29
+ }
30
+ function mb_decode_numericentity($s, $convmap, $enc = null)
31
+ {
32
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_decode_numericentity($s, $convmap, $enc);
33
+ }
34
+ function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = \false)
35
+ {
36
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex);
37
+ }
38
+ function mb_convert_case($s, $mode, $enc = null)
39
+ {
40
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_convert_case($s, $mode, $enc);
41
+ }
42
+ function mb_internal_encoding($enc = null)
43
+ {
44
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_internal_encoding($enc);
45
+ }
46
+ function mb_language($lang = null)
47
+ {
48
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_language($lang);
49
+ }
50
+ function mb_list_encodings()
51
+ {
52
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_list_encodings();
53
+ }
54
+ function mb_encoding_aliases($encoding)
55
+ {
56
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_encoding_aliases($encoding);
57
+ }
58
+ function mb_check_encoding($var = null, $encoding = null)
59
+ {
60
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_check_encoding($var, $encoding);
61
+ }
62
+ function mb_detect_encoding($str, $encodingList = null, $strict = \false)
63
+ {
64
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_detect_encoding($str, $encodingList, $strict);
65
+ }
66
+ function mb_detect_order($encodingList = null)
67
+ {
68
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_detect_order($encodingList);
69
+ }
70
+ function mb_parse_str($s, &$result = array())
71
+ {
72
+ \parse_str($s, $result);
73
+ }
74
+ if (!\function_exists('mb_strlen')) {
75
+ function mb_strlen($s, $enc = null)
76
+ {
77
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strlen($s, $enc);
78
+ }
79
+ }
80
+ function mb_strpos($s, $needle, $offset = 0, $enc = null)
81
+ {
82
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strpos($s, $needle, $offset, $enc);
83
+ }
84
+ function mb_strtolower($s, $enc = null)
85
+ {
86
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strtolower($s, $enc);
87
+ }
88
+ function mb_strtoupper($s, $enc = null)
89
+ {
90
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strtoupper($s, $enc);
91
+ }
92
+ function mb_substitute_character($char = null)
93
+ {
94
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_substitute_character($char);
95
+ }
96
+ if (!\function_exists('mb_substr')) {
97
+ function mb_substr($s, $start, $length = 2147483647, $enc = null)
98
+ {
99
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_substr($s, $start, $length, $enc);
100
+ }
101
+ }
102
+ function mb_stripos($s, $needle, $offset = 0, $enc = null)
103
+ {
104
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_stripos($s, $needle, $offset, $enc);
105
+ }
106
+ function mb_stristr($s, $needle, $part = \false, $enc = null)
107
+ {
108
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_stristr($s, $needle, $part, $enc);
109
+ }
110
+ function mb_strrchr($s, $needle, $part = \false, $enc = null)
111
+ {
112
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strrchr($s, $needle, $part, $enc);
113
+ }
114
+ function mb_strrichr($s, $needle, $part = \false, $enc = null)
115
+ {
116
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strrichr($s, $needle, $part, $enc);
117
+ }
118
+ function mb_strripos($s, $needle, $offset = 0, $enc = null)
119
+ {
120
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strripos($s, $needle, $offset, $enc);
121
+ }
122
+ function mb_strrpos($s, $needle, $offset = 0, $enc = null)
123
+ {
124
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strrpos($s, $needle, $offset, $enc);
125
+ }
126
+ function mb_strstr($s, $needle, $part = \false, $enc = null)
127
+ {
128
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strstr($s, $needle, $part, $enc);
129
+ }
130
+ function mb_get_info($type = 'all')
131
+ {
132
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_get_info($type);
133
+ }
134
+ function mb_http_output($enc = null)
135
+ {
136
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_http_output($enc);
137
+ }
138
+ function mb_strwidth($s, $enc = null)
139
+ {
140
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_strwidth($s, $enc);
141
+ }
142
+ function mb_substr_count($haystack, $needle, $enc = null)
143
+ {
144
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_substr_count($haystack, $needle, $enc);
145
+ }
146
+ function mb_output_handler($contents, $status)
147
+ {
148
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_output_handler($contents, $status);
149
+ }
150
+ function mb_http_input($type = '')
151
+ {
152
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_http_input($type);
153
+ }
154
+ function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
155
+ {
156
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f);
157
+ }
158
+ }
159
+ if (!\function_exists('mb_chr')) {
160
+ function mb_ord($s, $enc = null)
161
+ {
162
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_ord($s, $enc);
163
+ }
164
+ function mb_chr($code, $enc = null)
165
+ {
166
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_chr($code, $enc);
167
+ }
168
+ function mb_scrub($s, $enc = null)
169
+ {
170
+ $enc = null === $enc ? \mb_internal_encoding() : $enc;
171
+ return \mb_convert_encoding($s, $enc, $enc);
172
+ }
173
+ }
174
+ if (!\function_exists('mb_str_split')) {
175
+ function mb_str_split($string, $split_length = 1, $encoding = null)
176
+ {
177
+ return \Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring::mb_str_split($string, $split_length, $encoding);
178
+ }
179
+ }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: SergeyBiryukov, mihdan, karevn, webvitaly, kaggdesign
3
  Tags: cyrillic, belorussian, ukrainian, bulgarian, macedonian, georgian, kazakh, latin, l10n, russian, cyr-to-lat, cyr2lat, rustolat, slugs, translations, transliteration
4
  Requires at least: 5.1
5
  Tested up to: 5.3
6
- Stable tag: 4.3.2
7
  Requires PHP: 5.6.20
8
 
9
  Converts Cyrillic characters in post, page and term slugs to Latin characters.
@@ -91,6 +91,15 @@ Yes you can!
91
 
92
  == Changelog ==
93
 
 
 
 
 
 
 
 
 
 
94
  = 4.3.2 (29.12.2019) =
95
  * Fixed problems with setting of max_input_vars on some hostings
96
 
3
  Tags: cyrillic, belorussian, ukrainian, bulgarian, macedonian, georgian, kazakh, latin, l10n, russian, cyr-to-lat, cyr2lat, rustolat, slugs, translations, transliteration
4
  Requires at least: 5.1
5
  Tested up to: 5.3
6
+ Stable tag: 4.3.3
7
  Requires PHP: 5.6.20
8
 
9
  Converts Cyrillic characters in post, page and term slugs to Latin characters.
91
 
92
  == Changelog ==
93
 
94
+ = 4.3.3 (14.01.2020) =
95
+ * Reworked main plugin filter
96
+ * Improved performance by minimizing number of calls
97
+ * Updated Georgian table
98
+ * Fixed slug duplication in taxonomies
99
+ * Fixed warnings with WooCommerce when mbstring is not loaded
100
+ * Fixed transliteration of draft post slug
101
+ * Tables sorted by local alphabets
102
+
103
  = 4.3.2 (29.12.2019) =
104
  * Fixed problems with setting of max_input_vars on some hostings
105
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit889b56da8e5c956977b4e015c55d5852::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -279,7 +279,7 @@ class ClassLoader
279
  */
280
  public function setApcuPrefix($apcuPrefix)
281
  {
282
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
  }
284
 
285
  /**
@@ -377,7 +377,7 @@ class ClassLoader
377
  $subPath = $class;
378
  while (false !== $lastPos = strrpos($subPath, '\\')) {
379
  $subPath = substr($subPath, 0, $lastPos);
380
- $search = $subPath.'\\';
381
  if (isset($this->prefixDirsPsr4[$search])) {
382
  $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
279
  */
280
  public function setApcuPrefix($apcuPrefix)
281
  {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
  }
284
 
285
  /**
377
  $subPath = $class;
378
  while (false !== $lastPos = strrpos($subPath, '\\')) {
379
  $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath . '\\';
381
  if (isset($this->prefixDirsPsr4[$search])) {
382
  $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
vendor/composer/LICENSE CHANGED
@@ -1,21 +1,56 @@
 
 
 
 
1
 
2
- Copyright (c) Nils Adermann, Jordi Boggiano
 
 
 
3
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is furnished
9
- to do so, subject to the following conditions:
10
 
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2
+ Upstream-Name: Composer
3
+ Upstream-Contact: Jordi Boggiano <j.boggiano@seld.be>
4
+ Source: https://github.com/composer/composer
5
 
6
+ Files: *
7
+ Copyright: 2016, Nils Adermann <naderman@naderman.de>
8
+ 2016, Jordi Boggiano <j.boggiano@seld.be>
9
+ License: Expat
10
 
11
+ Files: src/Composer/Util/TlsHelper.php
12
+ Copyright: 2016, Nils Adermann <naderman@naderman.de>
13
+ 2016, Jordi Boggiano <j.boggiano@seld.be>
14
+ 2013, Evan Coury <me@evancoury.com>
15
+ License: Expat and BSD-2-Clause
 
16
 
17
+ License: BSD-2-Clause
18
+ Redistribution and use in source and binary forms, with or without modification,
19
+ are permitted provided that the following conditions are met:
20
+ .
21
+ * Redistributions of source code must retain the above copyright notice,
22
+ this list of conditions and the following disclaimer.
23
+ .
24
+ * Redistributions in binary form must reproduce the above copyright notice,
25
+ this list of conditions and the following disclaimer in the documentation
26
+ and/or other materials provided with the distribution.
27
+ .
28
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
29
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
32
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
33
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
 
39
+ License: Expat
40
+ Permission is hereby granted, free of charge, to any person obtaining a copy
41
+ of this software and associated documentation files (the "Software"), to deal
42
+ in the Software without restriction, including without limitation the rights
43
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44
+ copies of the Software, and to permit persons to whom the Software is furnished
45
+ to do so, subject to the following conditions:
46
+ .
47
+ The above copyright notice and this permission notice shall be included in all
48
+ copies or substantial portions of the Software.
49
+ .
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
56
+ THE SOFTWARE.
vendor/composer/autoload_files.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_files.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ '344a0f93a05b8ca362c22e39586db500' => $baseDir . '/lib/polyfill-mbstring/bootstrap.php',
10
+ );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit19d4b07fb39b1ad38f5986a3c11b2a54::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -47,6 +47,24 @@ class ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54
47
 
48
  $loader->register(true);
49
 
 
 
 
 
 
 
 
 
 
50
  return $loader;
51
  }
52
  }
 
 
 
 
 
 
 
 
 
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit889b56da8e5c956977b4e015c55d5852
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit889b56da8e5c956977b4e015c55d5852', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit889b56da8e5c956977b4e015c55d5852', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit889b56da8e5c956977b4e015c55d5852::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
47
 
48
  $loader->register(true);
49
 
50
+ if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit889b56da8e5c956977b4e015c55d5852::$files;
52
+ } else {
53
+ $includeFiles = require __DIR__ . '/autoload_files.php';
54
+ }
55
+ foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire889b56da8e5c956977b4e015c55d5852($fileIdentifier, $file);
57
+ }
58
+
59
  return $loader;
60
  }
61
  }
62
+
63
+ function composerRequire889b56da8e5c956977b4e015c55d5852($fileIdentifier, $file)
64
+ {
65
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
+ require $file;
67
+
68
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
69
+ }
70
+ }
vendor/composer/autoload_static.php CHANGED
@@ -4,8 +4,12 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit19d4b07fb39b1ad38f5986a3c11b2a54
8
  {