Skip to content

Commit e96a625

Browse files
committed
Update UX
1 parent 4ac637d commit e96a625

13 files changed

Lines changed: 276 additions & 423 deletions

CHANGELOG.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Versioned APCu class map
55
* Secured and sanitized AJAX HTML input/output
66
* Purge autoloader cache on update
7+
* UX update
78

89
= 2.4.3 =
910
* Fixing issue with PHP 8.4 + FPM + OPcache

classes/settings.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -729,17 +729,6 @@ public function transliterator_dashboard_widget_display(): void
729729
</ul>
730730
<?php else: ?>
731731
<p style="color:#cc0000"><?php echo esc_html__('Transliterator plugin options are not yet available. Please update plugin settings!', 'serbian-transliteration'); ?></p>
732-
<?php endif; ?>
733-
734-
<h3><b><?php echo esc_html__('Recommendations:', 'serbian-transliteration'); ?></b></h3>
735-
<p><?php echo esc_html__('Explore these recommended tools and resources that complement our plugin.', 'serbian-transliteration'); ?></p>
736-
<div class="postbox transliteration-affiliate">
737-
<a href="https://freelanceposlovi.com/poslovi" target="_blank">
738-
<img src="<?php echo esc_url(RSTR_ASSETS . '/img/' . (Transliteration_Utilities::get_locale('sr_RS') ? 'logo-freelance-poslovi-sr_RS.jpg' : 'logo-freelance-poslovi.jpg')); ?>" alt="<?php esc_attr_e('Freelance Jobs - Find or post freelance jobs', 'serbian-transliteration'); ?>">
739-
</a>
740-
</div>
741-
<?php add_action('admin_footer', function (): void { ?>
742-
<style>/* <![CDATA[ */#transliterator_dashboard_widget .transliteration-affiliate img{display: block;width: 100%;max-width: 100%;height: auto;margin: 0 auto}/* ]]> */</style>
743-
<?php });
732+
<?php endif;
744733
}
745734
}

classes/settings/page-credits.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@
1111
];
1212

1313
$special_thanks = [
14-
'tihi' => 'https://profiles.wordpress.org/tihi',
15-
'dizajn24' => 'https://profiles.wordpress.org/dizajn24',
16-
'Yaroslav Ingulskyi' => 'https://profiles.wordpress.org/ingyaroslav',
17-
'BlackWiCKED' => 'https://profiles.wordpress.org/blackwicked',
18-
'Nemanja Novaković' => 'https://profiles.wordpress.org/lupus1204',
19-
'ivantre' => 'https://profiles.wordpress.org/ivantre',
20-
'daliborm74' => 'https://profiles.wordpress.org/daliborm74',
21-
'Željko Galetić' => 'https://profiles.wordpress.org/zeljkogaletic',
22-
'Toni' => 'https://profiles.wordpress.org/tonistankovic',
14+
'tihi' => 'https://profiles.wordpress.org/tihi/',
15+
'dizajn24' => 'https://profiles.wordpress.org/dizajn24/',
16+
'Yaroslav Ingulskyi' => 'https://profiles.wordpress.org/ingyaroslav/',
17+
'BlackWiCKED' => 'https://profiles.wordpress.org/blackwicked/',
18+
'Nemanja Novaković' => 'https://profiles.wordpress.org/lupus1204/',
19+
'ivantre' => 'https://profiles.wordpress.org/ivantre/',
20+
'daliborm74' => 'https://profiles.wordpress.org/daliborm74/',
21+
'zlatkopaprikart' => 'https://profiles.wordpress.org/zlatkopaprikart/',
22+
'Losmi' => 'https://profiles.wordpress.org/uloszaminje/',
23+
'Željko Galetić' => 'https://profiles.wordpress.org/zeljkogaletic/',
24+
'Toni' => 'https://profiles.wordpress.org/tonistankovic/',
2325
'Slobodan Mirić' => 'https://www.facebook.com/websitesworkshop',
2426
'Branislav Mitić' => 'https://profiles.wordpress.org/xlr84xs/',
2527
'Dušan Filiferović' => 'https://korisnickicentar.contrateam.com/aff.php?aff=385',

classes/settings/page-debug.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@
120120
<tfoot><?php do_action('rstr/settings/debug/table/tfoot'); ?></tfoot>
121121
</table>
122122
<br><br>
123-
<div class="accordion-container">
123+
<?php /* div class="accordion-container">
124124
<button class="accordion-link" type="button"><?php esc_html_e('Plugin settings', 'serbian-transliteration'); ?></button>
125125
<div class="accordion-panel" style="padding:0;">
126126
<?php Transliteration_Utilities::debug_render_all_settings_fields('html'); ?>
127127
</div>
128-
</div>
128+
</div */ ?>
129+
<h3><?php esc_html_e('Plugin settings', 'serbian-transliteration'); ?></h3>
130+
<?php Transliteration_Utilities::debug_render_all_settings_fields('html');

classes/utilities.php

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,18 @@ public static function available_modes($mode = null)
224224
* Retrieve plugin modes with descriptions.
225225
* Modes include predefined options with support for WooCommerce and developer-specific settings.
226226
*
227-
* @param string|null $mode Optional specific mode key to retrieve.
227+
* @param string|null $mode Optional specific mode key to retrieve.
228+
* @param mixed $default Optional default mode.
228229
* @return array|string Modes array with labels or specific mode description.
229230
*/
230-
public static function plugin_mode($mode = null)
231+
public static function plugin_mode($mode = null, $default=[])
231232
{
232233
// Get available modes
233234
$available_modes = self::available_modes();
234235

235236
// Map available modes to their descriptions
236237
$modes = [
237-
'phantom' => __('Phantom Mode (ultra fast DOM-based transliteration, experimental)', 'serbian-transliteration'),
238+
'phantom' => __('Phantom Mode (ultra fast DOM-based transliteration)', 'serbian-transliteration'),
238239
'light' => __('Light mode (basic parts of the site)', 'serbian-transliteration'),
239240
'standard' => __('Standard mode (content, themes, plugins, translations, menu)', 'serbian-transliteration'),
240241
'advanced' => __('Advanced mode (content, widgets, themes, plugins, translations, menu, permalinks, media)', 'serbian-transliteration'),
@@ -251,10 +252,14 @@ public static function plugin_mode($mode = null)
251252

252253
// Return specific mode description if $mode is provided
253254
if ($mode) {
254-
return $filtered_modes[$mode] ?? [];
255+
return $filtered_modes[$mode] ?? $default;
255256
}
256257

257-
return $filtered_modes;
258+
if ($mode === null) {
259+
return $filtered_modes;
260+
}
261+
262+
return $default;
258263
}
259264

260265
/*
@@ -1621,12 +1626,12 @@ public static function debug_render_all_settings_fields($format = 'html')
16211626
foreach ($val as $i => $prop) {
16221627
echo '<tr>';
16231628
echo '<td style="border:1px solid #efefef;padding:8px;">' . esc_html($i) . '</td>';
1624-
echo '<td style="border:1px solid #efefef;padding:8px;">' . esc_html($prop) . '</td>';
1629+
echo '<td style="border:1px solid #efefef;padding:8px;">' . esc_html( self::__debug_translate_values($prop) ) . '</td>';
16251630
echo '</tr>';
16261631
}
16271632
echo '</table>';
1628-
} else {
1629-
echo esc_html($val);
1633+
} else {
1634+
echo esc_html( self::__debug_translate_values($val) );
16301635
}
16311636

16321637
echo '</td>';
@@ -1636,6 +1641,44 @@ public static function debug_render_all_settings_fields($format = 'html')
16361641
echo '</table>';
16371642
}
16381643

1644+
private static function __debug_translate_values($val = '') {
1645+
switch ($val) {
1646+
case 'yes':
1647+
return __('Yes');
1648+
break;
1649+
1650+
case 'no':
1651+
return __('No');
1652+
break;
1653+
1654+
case 'auto':
1655+
return __('Automatic', 'serbian-transliteration');
1656+
break;
1657+
1658+
case 'cyr_to_lat':
1659+
return __('Cyrillic to Latin', 'serbian-transliteration');
1660+
break;
1661+
1662+
case 'lat_to_cyr':
1663+
return __('Latin to Cyrillic', 'serbian-transliteration');
1664+
break;
1665+
1666+
case 'lat':
1667+
return __('Latin', 'serbian-transliteration');
1668+
break;
1669+
1670+
case 'cyr':
1671+
return __('Cyrillic', 'serbian-transliteration');
1672+
break;
1673+
1674+
case 'none':
1675+
return __('Disabled', 'serbian-transliteration');
1676+
break;
1677+
}
1678+
1679+
return self::plugin_mode((string) $val, $val);
1680+
}
1681+
16391682
/**
16401683
* Hook to capture language when Polylang announces it. Runs very early.
16411684
* @param string $slug

languages/serbian-transliteration-hr.l10n.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
-265 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)