first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,430 @@
<?php
function orphans_indicator_options() {
/**
* cache
*/
if ( apply_filters( 'orphans_indicator_options_use_cache', true ) ) {
$cached = wp_cache_get( 'orphans_indicator_options', 'iworks_orphans' );
if ( ! empty( $cached ) ) {
return $cached;
}
}
/**
* Query Monitor profiling
*/
do_action( 'qm/start', 'orphans_indicator_options' );
$options = array();
/**
* main settings
*/
$options['index'] = array(
'use_tabs' => true,
'version' => '0.0',
'page_title' => __( 'Orphans Configuration', 'sierotki' ),
'menu_title' => __( 'Orphans', 'sierotki' ),
'menu' => 'theme',
'enqueue_scripts' => array(),
'enqueue_styles' => array(),
'options' => array(
array(
'type' => 'heading',
'label' => __( 'Terms', 'sierotki' ),
'since' => '3.1.4',
),
array(
'name' => 'language',
'type' => 'radio',
'th' => __( 'Language File', 'sierotki' ),
'default' => 'function_get_locale',
'options' => array(
'function_get_locale' => array(
'label' => __( 'Try to use the site locale to determine the file name', 'sierotki' ),
'description' => __( 'Select if you want the plugin to determine which file to load based on the site\'s language settings.', 'sierotki' ),
),
'pl_PL' => array(
'label' => __( 'Polish', 'sierotki' ),
'description' => __( 'Select if you want to force the loading of Polish language rules.', 'sierotki' ),
),
'cs_CZ' => array(
'label' => __( 'Czech', 'sierotki' ),
'description' => __( 'Select if you want to force the loading of Czech language rules.', 'sierotki' ),
),
'en' => array(
'label' => __( 'English', 'sierotki' ),
'description' => __( 'Select if you want to force the loading of English short words.', 'sierotki' ),
),
array(
'label' => __( 'Do not load any files', 'sierotki' ),
'description' => __( 'Select if you want to rely only on your terms.', 'sierotki' ),
),
),
'multiple' => true,
'default' => 'pl_PL',
'since' => '3.1.4',
),
array(
'name' => 'own_orphans',
'th' => __( 'User Definied Orphans', 'sierotki' ),
'type' => 'textarea',
'description' => __( 'Use a comma to separate orphans.', 'sierotki' ),
'sanitize_callback' => 'esc_html',
'classes' => array( 'large-text' ),
'rows' => 10,
),
array(
'type' => 'heading',
'label' => __( 'Entries', 'sierotki' ),
),
/**
* Since 2.6.8
*/
array(
'name' => 'post_type',
'type' => 'select2',
'th' => __( 'Post Types', 'sierotki' ),
'default' => array( 'post', 'page' ),
'options' => iworks_orphan_post_types(),
'multiple' => true,
),
array(
'name' => 'the_title',
'th' => __( 'Title', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Enabled the substitution of orphans in the post_title.', 'sierotki' ),
'sanitize_callback' => 'absint',
'default' => 1,
'classes' => array( 'switch-button' ),
),
array(
'name' => 'the_excerpt',
'th' => __( 'Excerpt', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Enabled the substitution of orphans in the excerpt.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => 1,
),
array(
'name' => 'the_content',
'th' => __( 'Content', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Enabled the substitution of orphans in the content.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => true,
),
array(
'name' => 'comment_text',
'type' => 'checkbox',
'th' => __( 'Comments', 'sierotki' ),
'description' => __( 'Enabled the substitution of orphans in the comments.', 'sierotki' ),
'sanitize_callback' => 'absint',
'default' => 1,
'classes' => array( 'switch-button' ),
),
array(
'type' => 'heading',
'label' => __( 'Widgets', 'sierotki' ),
),
/**
* Since 2.6.6
*/
array(
'name' => 'widget_title',
'th' => __( 'Widget Title', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Enabled the substitution of orphans in the widget title.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => 1,
),
/**
* Since 2.6.6
*/
array(
'name' => 'widget_text',
'th' => __( 'Widget Text', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Enabled the substitution of orphans in the widget text.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => 1,
),
/**
* Since 2.8.1
*/
array(
'name' => 'widget_block_content',
'th' => __( 'Widget Block Content', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Enabled the substitution of orphans in the widget blocks.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => 1,
),
/**
* Since 2.6.6
*/
array(
'type' => 'heading',
'label' => __( 'Taxonomies', 'sierotki' ),
),
array(
'name' => 'taxonomies',
'type' => 'select2',
'th' => __( 'Taxonomies', 'sierotki' ),
'default' => array( 'category', 'post_tag', 'post_format' ),
'options' => iworks_orphan_taxonomies(),
'multiple' => true,
),
array(
'name' => 'taxonomy_title',
'th' => __( 'Title', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Enabled the substitution of orphans in the taxonomy title.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => 1,
),
array(
'name' => 'term_description',
'th' => __( 'Description', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Enabled the substitution of orphans in the taxonomy description.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => 1,
),
array(
'type' => 'heading',
'label' => __( 'Miscellaneous', 'sierotki' ),
),
/**
* Replace in Translations functions.
*
* Since 3.1.0
*/
array(
'name' => 'gettext',
'type' => 'checkbox',
'th' => __( 'Translation Functions', 'sierotki' ),
'description' => __( 'Enabled the substitution of orphans in Translations functions. <a href="https://developer.wordpress.org/themes/functionality/internationalization/" target="_blank">Read more.</a> <b>WARNING: this can slow your site!</b>', 'sierotki' ),
'sanitize_callback' => 'absint',
'default' => 0,
'classes' => array( 'switch-button' ),
),
/**
* Since 2.6.8
*/
array(
'name' => 'get_the_author_description',
'type' => 'checkbox',
'th' => __( 'Author Description', 'sierotki' ),
'description' => __( 'Enabled the substitution of orphans in the author description.', 'sierotki' ),
'sanitize_callback' => 'absint',
'default' => 1,
'classes' => array( 'switch-button' ),
),
array(
'name' => 'ignore_language',
'th' => __( 'Ignore Language', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Allow to use plugin with another languages then Polish.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => 0,
),
array(
'name' => 'menu_title',
'th' => __( 'Menu Title', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Enabled the substitution of orphans in the menu title.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => 1,
),
array(
'name' => 'numbers',
'th' => __( 'Keep Numbers Together', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Allow to keep together phone number or strings with space between numbers.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
),
array(
'name' => 'attributes',
'th' => __( 'Protect Tag Attributes', 'sierotki' ),
'type' => 'checkbox',
'description' => __( 'Allow to ignore spaces in "class", "style" and "data-*" attributes.', 'sierotki' ),
'sanitize_callback' => 'absint',
'classes' => array( 'switch-button' ),
'default' => 1,
),
array(
'name' => 'post_meta',
'th' => __( 'Entries Custom Fields', 'sierotki' ),
'type' => 'textarea',
'description' => __( 'Use a comma to separate custom fields name (meta fields).', 'sierotki' ),
'sanitize_callback' => 'esc_html',
'classes' => array( 'large-text' ),
'rows' => 10,
),
),
'metaboxes' => array(
'assistance' => array(
'title' => __( 'We are waiting for your message', 'sierotki' ),
'callback' => 'iworks_orphans_options_need_assistance',
'context' => 'side',
'priority' => 'core',
),
'love' => array(
'title' => __( 'I love what I do!', 'sierotki' ),
'callback' => 'iworks_orphan_options_loved_this_plugin',
'context' => 'side',
'priority' => 'core',
),
),
);
/**
* integrations
*/
$integrations = iworks_orphan_options_check_available_integrations();
if ( ! empty( $integrations ) ) {
$options['index']['options'][] = array(
'type' => 'heading',
'label' => __( 'Integrations', 'sierotki' ),
);
if ( in_array( 'acf.php', $integrations ) ) {
$options['index']['options'][] = array(
'type' => 'subheading',
'label' => __( 'Advanced Custom Fields', 'sierotki' ),
);
$options['index']['options'][] = array(
'name' => 'acf_text',
'type' => 'checkbox',
'th' => __( 'Text', 'sierotki' ),
'description' => __( 'Enabled the substitution of orphans in text fields.', 'sierotki' ),
'sanitize_callback' => 'absint',
'default' => 0,
'classes' => array( 'switch-button' ),
);
$options['index']['options'][] = array(
'name' => 'acf_textarea',
'type' => 'checkbox',
'th' => __( 'Textarea', 'sierotki' ),
'description' => __( 'Enabled the substitution of orphans in textarea fields. (Include WYSIWYG).', 'sierotki' ),
'sanitize_callback' => 'absint',
'default' => 0,
'classes' => array( 'switch-button' ),
);
$options['index']['options'][] = array(
'name' => 'acf_wysiwyg',
'type' => 'checkbox',
'th' => __( 'WYSIWYG', 'sierotki' ),
'description' => __( 'Enabled the substitution of orphans in WYSIWYG fields.', 'sierotki' ),
'sanitize_callback' => 'absint',
'default' => 0,
'classes' => array( 'switch-button' ),
);
}
}
/**
* cache it
*/
if ( apply_filters( 'orphans_indicator_options_use_cache', true ) ) {
wp_cache_set( 'orphans_indicator_options', $options, 'iworks_orphans' );
}
/**
* Query Monitor profiling
*/
do_action( 'qm/stop', 'orphans_indicator_options' );
return $options;
}
/**
* check available integrations
*
* @since 2.9.8
*/
function iworks_orphan_options_check_available_integrations() {
$integrations = array();
$plugins = get_option( 'active_plugins' );
/**
* check multisite network wide plugins.
*
* @since 3.0.3
*/
if ( is_multisite() ) {
$network_plugins = array_flip( get_site_option( 'active_sitewide_plugins' ) );
$plugins = array_merge( $plugins, $network_plugins );
$plugins = array_unique( $plugins );
}
/**
* no plugins
*/
if ( empty( $plugins ) ) {
return $integrations;
}
/**
* check ACF plugin
*
* @since 2.9.7
*/
foreach ( $plugins as $plugin ) {
if ( preg_match( '/acf\.php$/', $plugin ) ) {
$integrations[] = basename( $plugin );
}
}
return $integrations;
}
function iworks_orphan_options_loved_this_plugin( $iworks_orphan ) {
$content = apply_filters( 'iworks_rate_love', '', 'sierotki' );
if ( ! empty( $content ) ) {
echo $content;
return;
}
?>
<p><?php _e( 'Below are some links to help spread this plugin to other users', 'sierotki' ); ?></p>
<ul>
<li><a href="https://wordpress.org/support/plugin/sierotki/reviews/#new-post"><?php _e( 'Give it a five stars on WordPress.org', 'sierotki' ); ?></a></li>
<li><a href="<?php _ex( 'https://wordpress.org/plugins/sierotki/', 'plugin home page on WordPress.org', 'sierotki' ); ?>"><?php _e( 'Link to it so others can easily find it', 'sierotki' ); ?></a></li>
</ul>
<?php
}
function iworks_orphan_taxonomies() {
$data = array();
$taxonomies = get_taxonomies( array( 'public' => true ), 'objects' );
foreach ( $taxonomies as $taxonomy ) {
$data[ $taxonomy->name ] = $taxonomy->labels->name;
}
return $data;
}
function iworks_orphan_post_types() {
$args = array(
'public' => true,
);
$p = array();
$post_types = get_post_types( $args, 'names' );
foreach ( $post_types as $post_type ) {
$a = get_post_type_object( $post_type );
$p[ $post_type ] = $a->labels->name;
}
return $p;
}
function iworks_orphans_options_need_assistance( $iworks_orphans ) {
$content = apply_filters( 'iworks_rate_assistance', '', 'sierotki' );
if ( ! empty( $content ) ) {
echo $content;
return;
}
?>
<p><?php _e( 'We are waiting for your message', 'sierotki' ); ?></p>
<ul>
<li><a href="<?php _ex( 'https://wordpress.org/support/plugin/sierotki/', 'link to support forum on WordPress.org', 'sierotki' ); ?>"><?php _e( 'WordPress Help Forum', 'sierotki' ); ?></a></li>
</ul>
<?php
}

View File

@@ -0,0 +1,67 @@
#
# Based on
# https://prirucka.ujc.cas.cz/?id=880
#
#
# prepositions
#
k
s
v
z
#
# conjunctions
#
a
i
o
u
#
# abbreviations
#
cca.
č.
čís.
čj.
čp.
fa
fy
kupř.
mj.
např.
p.
popř.
př.
přib.
přibl.
sl.
str.
sv.
tj.
tzn.
tzv.
zvl.';
#
# number and unit
#
m
l
kg
h
°C
lidí
dní
%

View File

@@ -0,0 +1,38 @@
#
# The one-letter English words in Wiktionary
#
a
I
#
# Some two-letter English words in Wiktionary
#
ad
am
an
as
at
be
by
do
go
ha
he
hi
id
if
in
is
it
me
my
no
of
ok
on
or
pi
so
to
up
us
we

View File

@@ -0,0 +1,438 @@
#
# spójniki
#
a
i
bo
by
ni
że
#
# przyimki
#
o
u
w
z
do
ku
na
od
po
we
za
ze
#
# wykrzyniki
#
e
aa
aj
am
au
ba
ee
eh
ej
fe
fi
fu
ha
he
ho
ii
oj
oo
ot
pa
uf
uu
bu
hi
hm
hu
ko
lu
ts
#
# zaimki
#
co
ki
se
ja
ty
ci
on
mu
go
my
wy
im
je
ma
me
ów
ta
to
te
tu
moich
moje
mojego
mojej
mojemu
mych
mój
twoje
twojego
twojej
twych
twój
tylko
#
# rzeczowniki
#
al
ar
as
at
bi
dy
er
es
Ew
ez
go
id
iw
li
ok
om
op
or
os
oz
ód
ós
su
ud
ul
ut
#
# czasowniki
#
je
ma
#
# nazwy wielu liter łacińskich i greckich
#
be
ce
de
ef
ha
ka
el
em
en
pe
ku
er
es
te
wu
et
mi
my
ni
ny
pi
ro
fi
#
# nazwy dźwięków muzycznych (nut)
#
do
re
mi
fa
la
si
#
# jednostki miar
#
h
s
A
#
# symbole matematyczne
#
π
e
c
x
y
#
# symbole pierwiastków chemicznych
#
H
He
Li
Be
B
C
N
O
F
Ne
Na
Mg
Al
Si
P
S
Cl
Ar
K
Ca
Sc
Ti
V
Cr
Mn
Fe
Co
Ni
Cu
Zn
Ga
Ge
As
Se
Br
Kr
Rb
Sr
Y
Zr
Nb
Mo
Tc
Ru
Rh
Pd
Ag
Cd
In
Sn
Sb
Te
I
Xe
Cs
Ba
La
Ce
Pr
Nd
Pm
Sm
Eu
Gd
Tb
Dy
Ho
Er
Tm
Yb
Lu
Hf
Ta
W
Re
Os
Ir
Pt
Au
Hg
Tl
Pb
Bi
Po
At
Rn
Fr
Ra
Ac
Th
Pa
U
Np
Pu
Am
Cm
Bk
Cf
Es
Fm
Md
No
Lr
Rf
Db
Sg
Bh
Hs
Mt
Ds
Rg
Cn
Nh
Fl
Mc
Lv
Ts
Og
#
# skrótowce
#
RP
UW
UJ
#
# inne
#
al.
albo
ale
ależ
b.
bez
bł.
bm.
bp
br.
bym
byś
cyt.
cz.
czy
czyt.
dn.
doc.
dr
ds.
dyr.
dz.
fot.
gdy
gdyby
gdybym
gdybyś
gdyż
godz.
im.
inż.
jw.
kol.
komu
ks.
która
którego
której
któremu
który
których
którym
którzy
lecz
lic.
max
mgr
m.in.
min
nad
nie
niech
np.
nr
nr.
nrach
nrami
nrem
nrom
nrowi
nrów
nru
nry
nrze
nt.
nw.
oraz
os.
p.
pl.
pn.
pod
pot.
prof.
przed
przez
pt.
pw.
śp.
św.
tak
tamtej
tamto
tej
tel.
tj.
twoich
ul.
wg
więc
woj.
żeby
żebyś