/
wp-l10n-validator.php
2317 lines (1856 loc) · 54.2 KB
/
wp-l10n-validator.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Command line app to parse non-gettexted strings from files.
*
* Though written primarily as a CLI app, it may also be used directly. It can
* validate a single file, or an entire directory (including any and all
* levels of subdirectories). Only the later option is available from the default
* CLI usage, although it is possible to extend this as needed. See the README.md
* file for more information.
*
* @link http://plugins.svn.wordpress.org/codestyling-localization/trunk/codestyling-localization.php Revision 778516 (~1.99.30)
*
* @package WP_L10n_Validator
* @version 0.3.0
* @since 0.1.0
* @author J.D. Grimes <jdg@codesymphony.co>
* @license GPLv2
*/
/**
* Extensible gettext localization validator for WordPress.
*
* This class is where the magic happens. It is a parser that can be used to validate
* the gettext localization of a PHP project, either via the commandline or from
* another script. It is also highly customizable, either by setting different
* options and/or by extending the class.
*
* @since 0.1.0
*/
class WP_L10n_Validator {
//
// Protected Vars.
//
/**
* The expected textdomains.
*
* These domains are indexes, the values are currently ignored.
*
* @since 0.1.0
*
* @type array $textdomains
*/
protected $textdomains;
/**
* The base dir.
*
* @since 0.1.0
*
* @type string $basedir
*/
protected $basedir;
/**
* The name of the current file.
*
* @since 0.1.0
*
* @type string $filename
*/
protected $filename;
/**
* The current line number.
*
* @since 0.1.0
*
* @type int $line_number
*/
protected $line_number;
/**
* Info for the current function.
*
* @since 0.1.0
*
* @type array {
* @type string $name The name of the function.
* @type string $type The type of function: l10n, ignored, unknown.
* @type bool $args_started Whether the opening parentheses has been encountered.
* @type int $arg_count The number of comma's encountered since the args started.
* @type int $parentheses The number of open parentheses. When this becomes 0, the function call has ended.
* }
*/
protected $cur_func;
/**
* Whether we are in a function call and the arguments have started.
*
* @since 0.1.0
*
* @type bool $args_started
*/
protected $args_started;
/**
* The name of the current class property.
*
* @since 0.3.0
*
* @type string $cur_prop
*/
protected $cur_prop;
/**
* The name of the current HTML attribute.
*
* @since 0.2.0
*
* @type string $cur_attr
*/
protected $cur_attr;
/**
* Whether we are in an include/require(_once) statement.
*
* @since 0.1.0
*
* @type bool $in_include
*/
protected $in_include;
/**
* Whether we are in a case evaluated expression in a switch statement.
*
* @since 0.1.0
*
* @type bool $in_switch_case
*/
protected $in_switch_case;
/**
* Whether we have just encountered a new Instance() (T_NEW).
*
* @since 0.1.0
*
* @type bool $in_new_class
*/
protected $in_new_class;
/**
* The name of the current class (and possibly parent and interfaces).
*
* @since 0.1.0
* @since 0.3.0 The $implements key is now populated.
*
* @type array {
* @type string $self The name of the class.
* @type string $parent The name the parent of the class (if one).
* @type string[] $implements The names of the interfaces implemented by
* the class (if any).
* }
*/
protected $in_class;
/**
* The name of the current interface (and possibly parent).
*
* @since 0.3.0
*
* @type array {
* @type string $self The name of the interface.
* @type string $parent The name the parent of the interface (if one).
* }
*/
protected $in_interface;
/**
* Whether we have just encountered a function declaration.
*
* This has the value 'func_name' if we have just hit the 'function' token, and
* should be on the lookout for the function name. Then when the opening curly
* bracket of the function body is encountered it is set to 'braces', and will be
* set back to false when the closing bracket is found.
*
* @since 0.2.0
*
* @type bool|string $in_func_declaration
*/
protected $in_func_declaration;
/**
* The function call stack.
*
* This keeps track of the stack when a function is called within a call to
* another function: func_1( func_2() );
*
* When the inner function is entered, the data for the outer function is pushed
* into the stack, and when the inner function is exited, it is pulled back out.
*
* @see L10n_Validator::$cur_func
*
* @type array $func_stack
*/
protected $func_stack;
/**
* Localization functions.
*
* @since 0.1.0
*
* @type array $l10n_functions
*/
protected $l10n_functions = array();
/**
* These l10n function arguments are allowed to be non-strings.
*
* @since 0.1.0
*
* @type array $non_string_l10n_args
*/
protected $non_string_l10n_args = array();
//
// Protected Static Vars.
//
/**
* Whether any errors have been found.
*
* @since 0.2.0
*
* @type bool $errors
*/
protected static $errors;
/**
* The config callbacks.
*
* @since 0.1.0
*
* @type array $config_callbacks
*/
protected static $config_callbacks;
/**
* Basic configuration from the JSON config file.
*
* @since 0.1.0
*
* @type array $config
*/
protected static $config = array(
'ignores-cache' => '.wp-l10n-validator-ignores-cache.json',
'cache' => '.wp-l10n-validator-cache.json',
);
//
// Public Vars.
//
/**
* Functions whose arguments should be ignored.
*
* The (include|require)(_once)? constructs are always ignored, and that cannot
* be overridden here.
*
* @since 0.1.0
*
* @type array $ignored_functions
*/
public $ignored_functions = array();
/**
* Class properties whose values should be ignored.
*
* @since 0.3.0
*
* @type array $ignored_properties
*/
public $ignored_properties = array();
/**
* HTML attributes whose values to ignore.
*
* @since 0.1.0
*
* @type array $ignored_atts
*/
public $ignored_atts = array();
/**
* Strings to ignore universally.
*
* @since 0.1.0
*
* @type array $ignored_strings
*/
public $ignored_strings = array();
/**
* Specific string occurrences to ignore.
*
* @since 0.1.0
*
* @type array $ignored_string_occurrences
*/
public $ignored_string_occurrences = array();
/**
* Specific string occurrence ignores line number tolerance.
*
* @since 0.1.0
*
* @type int $ignores_tolerance
*/
public $ignores_tolerance = 5;
/**
* Rules to apply to strings to determine if they should be ignored.
*
* @since 0.4.0
*
* @var array
*/
public $ignores_rules = array(
'all-lowercase' => false,
);
/**
* The debug marker.
*
* When this token is encountered, the debug_callback() method is called.
*
* @since 0.1.0
*
* @type string $debug_marker
*/
public $debug_marker = '_debug_';
/**
* The full path to the cache file.
*
* @since 0.1.0
*
* @type string $cache_file
*/
public $cache_file = '';
/**
* The cached results.
*
* @since 0.1.0
*
* @type array $cache {
* @type string $config_signature The hash of the configuration used.
* @type array $files The files that were parsed.
* }
*/
public $cache = array();
/**
* Whether to save the cache after parsing.
*
* @since 0.1.0
*
* @type bool $save_cache
*/
public $save_cache = true;
/**
* Whether to run the files one by one.
*
* This is useful for large projects, especially for the first run. When there is
* a cache, it will run until it reaches the first changed file, then stop.
*
* @since 0.1.0
*
* @type bool $one_by_one
*/
public $one_by_one = false;
//
// Public Methods.
//
/**
* Construct the parser.
*
* @since 0.1.0
*
* @param string $basedir The base dir.
* @param string|array $textdomain A text domain or an array of textdomains. If
* an array, the domains should be the keys.
*/
public function __construct( $basedir, $textdomain ) {
$this->basedir = realpath( $basedir );
if ( is_array( $textdomain ) ) {
$this->textdomains = $textdomain;
} else {
// Array values currently ignored.
$this->textdomains = array(
$textdomain => true,
);
}
$this->cache_file = self::resolve_path( self::$config['cache'] );
$ignores = self::load_json_file( self::resolve_path( self::$config['ignores-cache'] ) );
if ( $ignores )
$this->ignored_string_occurrences += $ignores;
foreach ( (array) self::$config_callbacks as $callback ) {
call_user_func( $callback, $this );
}
$this->load_cache();
}
/**
* Load the configuration for the parser.
*
* @since 0.1.0
*
* @param string $type The configuration type, e.g., 'php'.
* @param array $parts The part(s) of the configuration to load. Possible values
* are 'ignores' and 'l10n'. Both parts are loaded by default.
*/
public function load_config( $type, $parts = array( 'l10n', 'ignores' ) ) {
$parser = $this;
foreach ( $parts as $part ) {
include __DIR__ . "/config/{$type}/{$part}.php";
}
}
/**
* Load any cache from the cache file.
*
* @since 0.1.0
*/
public function load_cache() {
if ( empty( $this->cache_file ) )
$this->cache_file = $this->basedir . '/.wp-l10n-validator-cache.json';
$cache = self::load_json_file( $this->cache_file );
if ( $cache ) {
// Back-compat.
if ( ! isset( $cache['files'] ) ) {
$this->cache['files'] = $cache;
} else {
$this->cache = $cache;
}
}
}
/**
* Get the configuration signature for the cache.
*
* @since 0.1.0
*
* @return string The config signature that can be checked against the cache.
*/
public function get_cache_signature() {
return md5(
serialize(
array(
$this->textdomains,
$this->l10n_functions,
$this->non_string_l10n_args,
$this->ignored_functions,
$this->ignored_properties,
$this->ignored_atts,
$this->ignored_strings
)
)
);
}
/**
* Save the cache.
*
* @since 0.1.0
*/
public function save_cache() {
$this->cache['config_signature'] = $this->get_cache_signature();
self::save_json_file( $this->cache_file, $this->cache );
if ( ! empty( $this->ignored_string_occurrences ) )
self::save_json_file( $this->resolve_path( self::$config['ignores-cache'] ), $this->ignored_string_occurrences );
}
/**
* Add to the list of l10n functions.
*
* The function names should be keys, and the values arrays of function data, as
* follows:
*
* @struct array {
* @type string $status 'supported, or 'deprecated' if the function
* should no longer be used.
* @type int $textdomain The argument number of the textdomain, minus one.
* @type int $required The number of required arguments, minus one.
* }
*
* @since 0.1.0
*
* @param array $functions The functions.
*/
public function add_l10n_functions( $functions ) {
$this->l10n_functions += $functions;
}
/**
* Add to the list of l10n function arguments where non-string vars are allowed.
*
* @since 0.1.0
*
* @param
*/
public function add_non_string_l10n_args( $args ) {
$this->non_string_l10n_args += $args;
}
/**
* Add to the list of functions to ignore.
*
* @since 0.1.0
*
* @param array $functions The names of the functions to add.
*/
public function add_ignored_functions( array $functions ) {
$this->ignored_functions += $functions;
}
/**
* Update the list of functions to ignore.
*
* @since 0.2.0
*
* @param array $functions The names of the functions to add/update.
*/
public function update_ignored_functions( array $functions ) {
$this->ignored_functions = array_merge(
$this->ignored_functions
, $functions
);
}
/**
* Remove functions from the ignored list.
*
* @since 0.1.0
*
* @param array $functions The names of the functions to remove.
*/
public function remove_ignored_functions( array $functions ) {
$this->ignored_functions = array_diff( $this->ignored_functions, array_flip( $functions ) );
}
/**
* Add to the list of class properties to ignore.
*
* Properties are expected in this format: Class_Name::$property_name.
*
* @since 0.3.0
*
* @param array $properties The names of the properties to add.
*/
public function add_ignored_properties( array $properties ) {
$this->ignored_properties += $properties;
}
/**
* Update the list of class properties to ignore.
*
* @since 0.3.0
*
* @param array $properties The names of the properties to add/update.
*/
public function update_ignored_properties( array $properties ) {
$this->ignored_properties = array_merge(
$this->ignored_properties
, $properties
);
}
/**
* Remove class properties from the ignored list.
*
* @since 0.3.0
*
* @param array $properties The names of the properties to remove.
*/
public function remove_ignored_properties( array $properties ) {
$this->ignored_properties = array_diff(
$this->ignored_properties
, array_flip( $properties )
);
}
/**
* Add to the list of ignored HTML attributes.
*
* @since 0.1.0
*
* @param array $atts An array of attribute names.
*/
public function add_ignored_atts( array $atts ) {
$this->ignored_atts = array_merge( $this->ignored_atts, $atts );
}
/**
* Update the list of ignored HTML attributes.
*
* @since 0.2.0
*
* @param array $atts An array of attribute names.
*/
public function update_ignored_atts( array $atts ) {
$this->ignored_atts = array_merge( $this->ignored_atts, $atts );
}
/**
* Add to the list of ignored strings.
*
* @since 0.1.0
*
* @param array|string $strings The strings to ignore.
*/
public function add_ignored_strings( $strings ) {
$this->ignored_strings += array_flip( (array) $strings );
}
/**
* Update the list of ignored strings.
*
* @since 0.2.0
*
* @param array|string $strings The strings to ignore.
*/
public function update_ignored_strings( $strings ) {
$this->ignored_strings = array_merge(
$this->ignored_strings
, array_flip( (array) $strings )
);
}
/**
* Update the ignores rules settings.
*
* @since 0.4.0
*
* @param bool[] $rules An array of rules to enable/disable. Keys are the rule
* names, values true (to enable) or false (to disable).
*/
public function update_ignores_rules( array $rules ) {
$this->ignores_rules = array_merge( $this->ignores_rules, $rules );
}
/**
* Parse the project.
*
* Parses all .php files in the project's base directory and any subdirectories.
*
* @since 0.1.0
*/
public function parse() {
// Invalidate the cache if the config signature is different.
if (
! isset( $this->cache['config_signature'] )
|| $this->cache['config_signature'] !== $this->get_cache_signature()
) {
$this->cache = array();
}
$base_length = strlen( $this->basedir );
foreach ( new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $this->basedir ) ) as $filename ) {
if ( $filename->getExtension() != 'php' )
continue;
$this->filename = substr( $filename, $base_length );
if ( $this->is_ignored_file( $this->filename ) ) {
continue;
}
if ( $this->_parse_file() && $this->one_by_one )
break;
}
if ( $this->save_cache )
$this->save_cache();
}
/**
* Check if a file is supposed to be ignored.
*
* @since 0.2.0
*
* @param string $file The path to the file relative to the project root.
*
* @return bool True if the file is ignored, otherwise false.
*/
public function is_ignored_file( $file ) {
if (
! isset( self::$config['ignored-paths'] )
|| ! is_array( self::$config['ignored-paths'] )
) {
return false;
}
foreach ( self::$config['ignored-paths'] as $path ) {
if ( substr( $file, 0, strlen( $path ) ) === $path ) {
return true;
}
}
return false;
}
/**
* Parse a single file within a project.
*
* @since 0.1.0
*
* @param string $filename The name of the file to parse, relative to the basedir.
*
* @return bool|array False if the file doesn't exist, or an array.
*/
public function parse_file( $filename ) {
$full_path = $this->basedir . $filename;
if ( ! file_exists( $full_path ) ) {
static::error( "The file {$full_path} does not exist." );
return false;
}
$this->filename = $filename;
return $this->_parse_file();
}
/**
* Get the current state of the parser.
*
* Useful in debugging.
*
* @since 0.1.0
*
* @return array {
* The current state of the parser.
*
* @type string $filename The name of the file currently being parsed.
* @type int $line The line of the file the parser is on.
* @type array|bool $cur_func {
* Info about the current function, or false if not currently in a function.
*
* @type string $name The name of the current function
* @type string $type The type of the function.
* @type bool $args_started Whether we have encountered the opening parenthesis.
* @type int $args_count The number of arguments we have encountered.
* @type int $parentheses The number of open parenthesis.
* }
* @type array $func_stack If we are inside of multiple functions, the data for the outer ones as above.
* }
*/
public function get_parser_state() {
return array(
'filename' => $this->filename,
'line' => $this->line_number,
'cur_func' => $this->cur_func,
'cur_attr' => $this->cur_attr,
'cur_prop' => $this->cur_prop,
'func_stack' => $this->func_stack,
'in_include' => $this->in_include,
'in_switch_case' => $this->in_switch_case,
'in_new_class' => $this->in_new_class,
'in_class' => $this->in_class,
'in_interface' => $this->in_interface,
'in_func_declaration' => $this->in_func_declaration,
);
}
/**
* Check if there were any errors.
*
* @since 0.2.0
*
* @return bool True if there were errors, false otherwise.
*/
public function had_errors() {
// If the current file has errors we don't need to check the other files.
if ( self::$errors ) {
return true;
}
// Check the cache to see if there are errors recorded for the other files.
$errors = array_map(
function ( $file ) {
return $file['errors'];
}
, $this->cache['files']
);
// Filter out any files where errors was false.
$errors = array_filter( $errors );
// If there are any elements left in the array, then there were errors.
return ! empty( $errors );
}
/**
* Check if a string is ignored.
*
* @since 0.3.0
*
* @param string $string The string to check.
*
* @return bool Whether the string is ignored.
*/
public function is_ignored_string( $string ) {
if ( isset( $this->ignored_string_occurrences[ $this->filename ][ $string ] ) ) {
foreach ( $this->ignored_string_occurrences[ $this->filename ][ $string ] as $line => $cur_func ) {
if (
$line + $this->ignores_tolerance > $this->line_number
&& $line - $this->ignores_tolerance < $this->line_number
&& $this->cur_func == $cur_func
) {
if ( $line != $this->line_number ) {
$this->ignored_string_occurrences[ $this->filename ][ $string ][ $this->line_number ] = $cur_func;
unset( $this->ignored_string_occurrences[ $this->filename ][ $string ][ $line ] );
}
return true;
}
}
}
return false;
}
/**
* Check if a class method is ignored.
*
* @since 0.3.0
*
* @param string $function The full name of the method including the class name.
*
* @return bool Whether the method is ignored.
*/
function is_ignored_method( $function ) {
if ( strpos( $function, "{$this->in_class['self']}::" ) !== 0 ) {
return false;
}
$method = substr( $function, strlen( "{$this->in_class['self']}::" ) );
if (
! empty( $this->in_class['parent'] )
&& isset(
$this->ignored_functions["{$this->in_class['parent']}::{$method}"]
)
) {
return true;
}
if ( ! empty( $this->in_class['implements'] ) ) {
foreach ( $this->in_class['implements'] as $interface ) {
if ( isset( $this->ignored_functions["{$interface}::{$method}"] ) ) {
return true;
}
}
}
return false;
}
//
// Public Static Methods.
//
/**
* Register a config function.
*
* @since 0.1.0
*
* @param string $function The function name.
*/
public static function register_config_callback( $function ) {
self::$config_callbacks[] = $function;
}
//
// Private Methods.
//
/**
* Parse the current a file.
*
* @since 0.1.0
*/
private function _parse_file() {
self::$errors = false;
$check_hash = true;
$file = $this->basedir . $this->filename;
$file_size = @filesize( $file );
if ( $file_size ) {
if ( isset( $this->cache['files'][ $this->filename ]['size'] ) && $file_size != $this->cache['files'][ $this->filename ]['size'] )
$check_hash = false;
$this->cache['files'][ $this->filename ]['size'] = $file_size;
}
$content = file_get_contents( $file );
if ( $content === false ) {
static::error( "The contents of the file {$this->filename} could not be retrieved." );
return false;
}
$checksum = hash( 'md5', $content );
/*
* If we need to check the hash, and we find that the old hash is cached and
* is the same as the current hash, and the file didn't have any errors
* before, then we skip it.
*/
if (
$check_hash
&& isset( $this->cache['files'][ $this->filename ]['hash'] )
&& $checksum == $this->cache['files'][ $this->filename ]['hash']
&& isset( $this->cache['files'][ $this->filename ]['errors'] )
&& ! $this->cache['files'][ $this->filename ]['errors']
) {
return false;
}
$this->cache['files'][ $this->filename ]['hash'] = $checksum;
$this->_parse_string( $content );
$this->cache['files'][ $this->filename ]['errors'] = self::$errors;
return true;
}
/**
* Parse a string.
*
* It attempts to do the following:
* * Find untranslated strings in HTML.
* * Find encapsed strings that aren't being translated.
* * Make sure all l10n function arguments are valid -
* * * No variables where there should be a string.
* * * No variables within strings.
* * * etc.
* * etc.
*
* @since 0.1.0