Orphans - Version 2.9.0

Version Description

  • 2021-12-09 =
  • Added filter iworks_orphan_own_terms_file to add ability to change whole terms definition file.
  • Moved terms into etc/terms.txt.
  • Renamed file includes/iworks/orphan.php into includes/iworks/class-iworks-orphan.php.
  • Updated orphans list, based on Sierotka (typografia)
Download this release

Release Info

Developer iworks
Plugin Icon 128x128 Orphans
Version 2.9.0
Comparing to
See all releases

Code changes from version 2.8.2 to 2.9.0

etc/terms.txt ADDED
@@ -0,0 +1,438 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # spójniki
3
+ #
4
+
5
+ a
6
+ i
7
+
8
+ bo
9
+ by
10
+
11
+ ni
12
+ że
13
+
14
+
15
+ #
16
+ # przyimki
17
+ #
18
+
19
+ o
20
+ u
21
+ w
22
+ z
23
+ do
24
+ ku
25
+ na
26
+ od
27
+ po
28
+ we
29
+ za
30
+ ze
31
+
32
+ #
33
+ # wykrzyniki
34
+ #
35
+
36
+ e
37
+ aa
38
+ aj
39
+ am
40
+ au
41
+ ba
42
+ ee
43
+ eh
44
+ ej
45
+ fe
46
+ fi
47
+ fu
48
+ ha
49
+ he
50
+ ho
51
+ ii
52
+ oj
53
+ oo
54
+ ot
55
+
56
+ pa
57
+ uf
58
+ uu
59
+ bu
60
+
61
+ hi
62
+ hm
63
+ hu
64
+ ko
65
+ lu
66
+ ts
67
+
68
+ #
69
+ # zaimki
70
+ #
71
+
72
+ co
73
+ ki
74
+ se
75
+ ja
76
+ ty
77
+ ci
78
+ on
79
+ mu
80
+ go
81
+
82
+
83
+ my
84
+ wy
85
+ im
86
+ je
87
+ ma
88
+
89
+ me
90
+ ów
91
+ ta
92
+
93
+
94
+ to
95
+ te
96
+ tu
97
+ moich
98
+ moje
99
+ mojego
100
+ mojej
101
+ mojemu
102
+ mych
103
+ mój
104
+ twoje
105
+ twojego
106
+ twojej
107
+ twych
108
+ twój
109
+ tylko
110
+
111
+ #
112
+ # rzeczowniki
113
+ #
114
+
115
+ al
116
+ ar
117
+ as
118
+ at
119
+ bi
120
+ dy
121
+ er
122
+ es
123
+ Ew
124
+ ez
125
+ go
126
+ id
127
+
128
+ iw
129
+ li
130
+ ok
131
+ om
132
+ op
133
+ or
134
+ os
135
+
136
+ oz
137
+ ód
138
+ ós
139
+ su
140
+ ud
141
+ ul
142
+ ut
143
+
144
+ #
145
+ # czasowniki
146
+ #
147
+
148
+ je
149
+ ma
150
+
151
+
152
+ #
153
+ # nazwy wielu liter łacińskich i greckich
154
+ #
155
+
156
+ be
157
+ ce
158
+ de
159
+ ef
160
+ ha
161
+ ka
162
+ el
163
+ em
164
+ en
165
+ pe
166
+ ku
167
+ er
168
+ es
169
+ te
170
+ wu
171
+ et
172
+ mi
173
+ my
174
+ ni
175
+ ny
176
+ pi
177
+ ro
178
+ fi
179
+
180
+ #
181
+ # nazwy dźwięków muzycznych (nut)
182
+ #
183
+
184
+ do
185
+ re
186
+ mi
187
+ fa
188
+ la
189
+ si
190
+
191
+ #
192
+ # jednostki miar
193
+ #
194
+
195
+ h
196
+ s
197
+ A
198
+
199
+ #
200
+ # symbole matematyczne
201
+ #
202
+
203
+ π
204
+ e
205
+ c
206
+ x
207
+ y
208
+
209
+ #
210
+ # symbole pierwiastków chemicznych
211
+ #
212
+
213
+ H
214
+ He
215
+ Li
216
+ Be
217
+ B
218
+ C
219
+ N
220
+ O
221
+ F
222
+ Ne
223
+ Na
224
+ Mg
225
+ Al
226
+ Si
227
+ P
228
+ S
229
+ Cl
230
+ Ar
231
+ K
232
+ Ca
233
+ Sc
234
+ Ti
235
+ V
236
+ Cr
237
+ Mn
238
+ Fe
239
+ Co
240
+ Ni
241
+ Cu
242
+ Zn
243
+ Ga
244
+ Ge
245
+ As
246
+ Se
247
+ Br
248
+ Kr
249
+ Rb
250
+ Sr
251
+ Y
252
+ Zr
253
+ Nb
254
+ Mo
255
+ Tc
256
+ Ru
257
+ Rh
258
+ Pd
259
+ Ag
260
+ Cd
261
+ In
262
+ Sn
263
+ Sb
264
+ Te
265
+ I
266
+ Xe
267
+ Cs
268
+ Ba
269
+ La
270
+ Ce
271
+ Pr
272
+ Nd
273
+ Pm
274
+ Sm
275
+ Eu
276
+ Gd
277
+ Tb
278
+ Dy
279
+ Ho
280
+ Er
281
+ Tm
282
+ Yb
283
+ Lu
284
+ Hf
285
+ Ta
286
+ W
287
+ Re
288
+ Os
289
+ Ir
290
+ Pt
291
+ Au
292
+ Hg
293
+ Tl
294
+ Pb
295
+ Bi
296
+ Po
297
+ At
298
+ Rn
299
+ Fr
300
+ Ra
301
+ Ac
302
+ Th
303
+ Pa
304
+ U
305
+ Np
306
+ Pu
307
+ Am
308
+ Cm
309
+ Bk
310
+ Cf
311
+ Es
312
+ Fm
313
+ Md
314
+ No
315
+ Lr
316
+ Rf
317
+ Db
318
+ Sg
319
+ Bh
320
+ Hs
321
+ Mt
322
+ Ds
323
+ Rg
324
+ Cn
325
+ Nh
326
+ Fl
327
+ Mc
328
+ Lv
329
+ Ts
330
+ Og
331
+
332
+ #
333
+ # skrótowce
334
+ #
335
+
336
+ RP
337
+ UW
338
+ UJ
339
+
340
+ #
341
+ # inne
342
+ #
343
+
344
+
345
+ al.
346
+ albo
347
+ ale
348
+ ależ
349
+ b.
350
+ bez
351
+ bł.
352
+ bm.
353
+ bp
354
+ br.
355
+ bym
356
+ byś
357
+ cyt.
358
+ cz.
359
+ czy
360
+ czyt.
361
+ dn.
362
+ doc.
363
+ dr
364
+ ds.
365
+ dyr.
366
+ dz.
367
+ fot.
368
+ gdy
369
+ gdyby
370
+ gdybym
371
+ gdybyś
372
+ gdyż
373
+ godz.
374
+ im.
375
+ inż.
376
+ jw.
377
+ kol.
378
+ komu
379
+ ks.
380
+ która
381
+ którego
382
+ której
383
+ któremu
384
+ który
385
+ których
386
+ którym
387
+ którzy
388
+ lecz
389
+ lic.
390
+ max
391
+ mgr
392
+ m.in.
393
+ min
394
+ nad
395
+ nie
396
+ niech
397
+ np.
398
+ nr
399
+ nr.
400
+ nrach
401
+ nrami
402
+ nrem
403
+ nrom
404
+ nrowi
405
+ nrów
406
+ nru
407
+ nry
408
+ nrze
409
+ nt.
410
+ nw.
411
+ oraz
412
+ os.
413
+ p.
414
+ pl.
415
+ pn.
416
+ pod
417
+ pot.
418
+ prof.
419
+ przed
420
+ przez
421
+ pt.
422
+ pw.
423
+ śp.
424
+ św.
425
+ tak
426
+ tamtej
427
+ tamto
428
+ tej
429
+ tel.
430
+ tj.
431
+ twoich
432
+ ul.
433
+ wg
434
+ więc
435
+ woj.
436
+ żeby
437
+ żebyś
438
+
includes/iworks/{orphan.php → class-iworks-orphan.php} RENAMED
@@ -24,6 +24,13 @@ class iworks_orphan {
24
  private $settings;
25
  private $plugin_file;
26
 
 
 
 
 
 
 
 
27
  /**
28
  * terms cache
29
  */
@@ -40,7 +47,8 @@ class iworks_orphan {
40
  /**
41
  * basic settings
42
  */
43
- $file = dirname( dirname( dirname( __FILE__ ) ) ) . '/sierotki.php';
 
44
  /**
45
  * options
46
  */
@@ -218,7 +226,7 @@ class iworks_orphan {
218
  *
219
  * @since 2.7.6
220
  */
221
- $terms = $this->_terms();
222
  $terms_terms = array_chunk( $terms, 10 );
223
  foreach ( $terms_terms as $terms ) {
224
  /**
@@ -456,127 +464,23 @@ class iworks_orphan {
456
  $terms = apply_filters( 'iworks_orphan_terms', $terms );
457
  return $terms;
458
  }
459
- $terms = array(
460
- 'al.',
461
- 'albo',
462
- 'ale',
463
- 'ależ',
464
- 'b.',
465
- 'bez',
466
- 'bm.',
467
- 'bp',
468
- 'br.',
469
- 'by',
470
- 'bym',
471
- 'byś',
472
- 'bł.',
473
- 'cyt.',
474
- 'cz.',
475
- 'czy',
476
- 'czyt.',
477
- 'dn.',
478
- 'do',
479
- 'doc.',
480
- 'dr',
481
- 'ds.',
482
- 'dyr.',
483
- 'dz.',
484
- 'fot.',
485
- 'gdy',
486
- 'gdyby',
487
- 'gdybym',
488
- 'gdybyś',
489
- 'gdyż',
490
- 'godz.',
491
- 'im.',
492
- 'inż.',
493
- 'jw.',
494
- 'kol.',
495
- 'komu',
496
- 'ks.',
497
- 'która',
498
- 'którego',
499
- 'której',
500
- 'któremu',
501
- 'który',
502
- 'których',
503
- 'którym',
504
- 'którzy',
505
- 'lecz',
506
- 'lic.',
507
- 'm.in.',
508
- 'max',
509
- 'mgr',
510
- 'min',
511
- 'moich',
512
- 'moje',
513
- 'mojego',
514
- 'mojej',
515
- 'mojemu',
516
- 'mych',
517
- 'mój',
518
- 'na',
519
- 'nad',
520
- 'nie',
521
- 'niech',
522
- 'np.',
523
- 'nr',
524
- 'nr.',
525
- 'nrach',
526
- 'nrami',
527
- 'nrem',
528
- 'nrom',
529
- 'nrowi',
530
- 'nru',
531
- 'nry',
532
- 'nrze',
533
- 'nrze',
534
- 'nrów',
535
- 'nt.',
536
- 'nw.',
537
- 'od',
538
- 'oraz',
539
- 'os.',
540
- 'p.',
541
- 'pl.',
542
- 'pn.',
543
- 'po',
544
- 'pod',
545
- 'pot.',
546
- 'prof.',
547
- 'przed',
548
- 'przez',
549
- 'pt.',
550
- 'pw.',
551
- 'pw.',
552
- 'tak',
553
- 'tamtej',
554
- 'tamto',
555
- 'tej',
556
- 'tel.',
557
- 'tj.',
558
- 'to',
559
- 'twoich',
560
- 'twoje',
561
- 'twojego',
562
- 'twojej',
563
- 'twych',
564
- 'twój',
565
- 'tylko',
566
- 'ul.',
567
- 'we',
568
- 'wg',
569
- 'woj.',
570
- 'więc',
571
- 'za',
572
- 'ze',
573
- 'śp.',
574
- 'św.',
575
- 'że',
576
- 'żeby',
577
- 'żebyś',
578
- '—',
579
- );
580
  /**
581
  * get own orphans
582
  */
24
  private $settings;
25
  private $plugin_file;
26
 
27
+ /**
28
+ * plugin root
29
+ *
30
+ * @since 2.9.0
31
+ */
32
+ private $root;
33
+
34
  /**
35
  * terms cache
36
  */
47
  /**
48
  * basic settings
49
  */
50
+ $file = dirname( dirname( dirname( __FILE__ ) ) ) . '/sierotki.php';
51
+ $this->root = dirname( $file );
52
  /**
53
  * options
54
  */
226
  *
227
  * @since 2.7.6
228
  */
229
+ $terms = $this->_terms();
230
  $terms_terms = array_chunk( $terms, 10 );
231
  foreach ( $terms_terms as $terms ) {
232
  /**
464
  $terms = apply_filters( 'iworks_orphan_terms', $terms );
465
  return $terms;
466
  }
467
+ /**
468
+ * read terms from file
469
+ *
470
+ * @since 2.9.0
471
+ */
472
+ $file = apply_filters( 'iworks_orphan_own_terms_file', $this->root . '/etc/terms.txt' );
473
+ $data = preg_split( '/[\r\n]/', file_get_contents( $file ) );
474
+ foreach ( $data as $term ) {
475
+ if ( preg_match( '/^#/', $term ) ) {
476
+ continue;
477
+ }
478
+ $term = trim( $term );
479
+ if ( empty( $term ) ) {
480
+ continue;
481
+ }
482
+ $terms[] = $term;
483
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
  /**
485
  * get own orphans
486
  */
languages/sierotki.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Orphans PLUGIN_VERSION\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sierotki\n"
7
- "POT-Creation-Date: 2021-12-03 17:00:52+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -184,6 +184,39 @@ msgstr ""
184
  msgid "WordPress Help Forum"
185
  msgstr ""
186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  #: includes/iworks/options/options.php:237
188
  msgid "An error occurred while getting the configuration."
189
  msgstr ""
@@ -224,38 +257,6 @@ msgstr ""
224
  msgid "ON"
225
  msgstr ""
226
 
227
- #: includes/iworks/orphan.php:272
228
- msgid "Plugin fix some Polish gramary rules with orphans."
229
- msgstr ""
230
-
231
- #: includes/iworks/orphan.php:279
232
- msgid "For more information:"
233
- msgstr ""
234
-
235
- #: includes/iworks/orphan.php:280
236
- msgid ""
237
- "<a href=\"http://wordpress.org/extend/plugins/sierotki/\" "
238
- "target=\"_blank\">Plugin Homepage</a>"
239
- msgstr ""
240
-
241
- #: includes/iworks/orphan.php:281
242
- msgid ""
243
- "<a href=\"http://wordpress.org/support/plugin/sierotki/\" "
244
- "target=\"_blank\">Support Forums</a>"
245
- msgstr ""
246
-
247
- #: includes/iworks/orphan.php:282
248
- msgid "<a href=\"http://iworks.pl/en/\" target=\"_blank\">break the web</a>"
249
- msgstr ""
250
-
251
- #: includes/iworks/orphan.php:385 includes/iworks/rate/rate.php:111
252
- msgid "Settings"
253
- msgstr ""
254
-
255
- #: includes/iworks/orphan.php:397
256
- msgid "Donate"
257
- msgstr ""
258
-
259
  #: includes/iworks/rate/rate.php:117
260
  #: includes/iworks/rate/templates/thanks.php:28
261
  msgid "Provide us a coffee"
4
  msgstr ""
5
  "Project-Id-Version: Orphans PLUGIN_VERSION\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sierotki\n"
7
+ "POT-Creation-Date: 2021-12-09 15:37:28+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
184
  msgid "WordPress Help Forum"
185
  msgstr ""
186
 
187
+ #: includes/iworks/class-iworks-orphan.php:280
188
+ msgid "Plugin fix some Polish gramary rules with orphans."
189
+ msgstr ""
190
+
191
+ #: includes/iworks/class-iworks-orphan.php:287
192
+ msgid "For more information:"
193
+ msgstr ""
194
+
195
+ #: includes/iworks/class-iworks-orphan.php:288
196
+ msgid ""
197
+ "<a href=\"http://wordpress.org/extend/plugins/sierotki/\" "
198
+ "target=\"_blank\">Plugin Homepage</a>"
199
+ msgstr ""
200
+
201
+ #: includes/iworks/class-iworks-orphan.php:289
202
+ msgid ""
203
+ "<a href=\"http://wordpress.org/support/plugin/sierotki/\" "
204
+ "target=\"_blank\">Support Forums</a>"
205
+ msgstr ""
206
+
207
+ #: includes/iworks/class-iworks-orphan.php:290
208
+ msgid "<a href=\"http://iworks.pl/en/\" target=\"_blank\">break the web</a>"
209
+ msgstr ""
210
+
211
+ #: includes/iworks/class-iworks-orphan.php:393
212
+ #: includes/iworks/rate/rate.php:111
213
+ msgid "Settings"
214
+ msgstr ""
215
+
216
+ #: includes/iworks/class-iworks-orphan.php:405
217
+ msgid "Donate"
218
+ msgstr ""
219
+
220
  #: includes/iworks/options/options.php:237
221
  msgid "An error occurred while getting the configuration."
222
  msgstr ""
257
  msgid "ON"
258
  msgstr ""
259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  #: includes/iworks/rate/rate.php:117
261
  #: includes/iworks/rate/templates/thanks.php:28
262
  msgid "Provide us a coffee"
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://ko-fi.com/iworks?utm_source=sierotki&utm_medium=readme-dona
4
  Tags: sierotka, sierotki, spójniki, twarda spacja
5
  Requires at least: 4.6
6
  Tested up to: 5.9
7
- Stable tag: 2.8.2
8
 
9
  Plugin supports some of the grammatical rules of the Polish language.
10
 
@@ -126,6 +126,12 @@ function remove_iworks_orphan_terms( $terms ) {
126
 
127
  == Changelog ==
128
 
 
 
 
 
 
 
129
  = 2.8.2 - 2021-12-03 =
130
  * Fixed problem with option "Keep numbers together" - it changed inline CSS too. Props for [gierand](https://wordpress.org/support/users/gierand/).
131
 
4
  Tags: sierotka, sierotki, spójniki, twarda spacja
5
  Requires at least: 4.6
6
  Tested up to: 5.9
7
+ Stable tag: 2.9.0
8
 
9
  Plugin supports some of the grammatical rules of the Polish language.
10
 
126
 
127
  == Changelog ==
128
 
129
+ = 2.9.0 - 2021-12-09 =
130
+ * Added filter `iworks_orphan_own_terms_file` to add ability to change whole terms definition file.
131
+ * Moved terms into `etc/terms.txt`.
132
+ * Renamed file `includes/iworks/orphan.php` into `includes/iworks/class-iworks-orphan.php`.
133
+ * Updated orphans list, based on [Sierotka (typografia)](https://pl.wikipedia.org/wiki/Sierotka_(typografia))
134
+
135
  = 2.8.2 - 2021-12-03 =
136
  * Fixed problem with option "Keep numbers together" - it changed inline CSS too. Props for [gierand](https://wordpress.org/support/users/gierand/).
137
 
sierotki.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://iworks.pl/2011/02/16/sierotki/
5
  Text Domain: sierotki
6
  Description: Implement Polish grammar rules with orphans.
7
  Author: Marcin Pietrzak
8
- Version: 2.8.2
9
  Author URI: http://iworks.pl/
10
  */
11
 
@@ -14,7 +14,7 @@ include_once dirname( __FILE__ ) . '/etc/options.php';
14
 
15
  $includes = dirname( __FILE__ ) . '/includes';
16
 
17
- require_once $includes . '/iworks/orphan.php';
18
  if ( ! class_exists( 'iworks_rate' ) ) {
19
  include_once $includes . '/iworks/rate/rate.php';
20
  }
5
  Text Domain: sierotki
6
  Description: Implement Polish grammar rules with orphans.
7
  Author: Marcin Pietrzak
8
+ Version: 2.9.0
9
  Author URI: http://iworks.pl/
10
  */
11
 
14
 
15
  $includes = dirname( __FILE__ ) . '/includes';
16
 
17
+ require_once $includes . '/iworks/class-iworks-orphan.php';
18
  if ( ! class_exists( 'iworks_rate' ) ) {
19
  include_once $includes . '/iworks/rate/rate.php';
20
  }