From 9ec4175fe24b1b1f3ba41a0efb7019ccdecfc531 Mon Sep 17 00:00:00 2001 From: Sibin Grasic Date: Sun, 22 Mar 2020 17:43:09 +0100 Subject: [PATCH] Update to 2.0.1 --- composer.json | 19 +++++- lib/Admin/Pages.php | 16 ++--- lib/Admin/Settings.php | 6 -- lib/Core/Utils.php | 3 - readme.txt | 148 +++++++++++++++++++++++++++++++++++++++++ srbtranslatin.php | 4 +- 6 files changed, 176 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index f4564eb..8874106 100644 --- a/composer.json +++ b/composer.json @@ -1,4 +1,21 @@ { + "name": "sgi/srbtranslatin", + "description": "SrbTransLatin - Serbian Latinisation plugin allows you to have a website in both cyrillic and latin scripts", + "keywords": [ + "wordpress", + "transliteration", + "latinisation" + ], + "homepage": "https://sgi.io/plugins/srbtranslatin", + "license": "GPL-2.0-or-later", + "authors": [ + { + "name": "Sibin Grasic", + "email": "sg@sgi.io", + "homepage": "https://sgi.io" + } + ], + "type": "wordpress-plugin", "autoload": { "files": [ "lib/Core/Utils.php", @@ -11,7 +28,7 @@ } }, "require": { - "simplehtmldom/simplehtmldom": "dev-master", + "simplehtmldom/simplehtmldom": "2.0-RC2", "sgi/transliterator": "^1.0" } } diff --git a/lib/Admin/Pages.php b/lib/Admin/Pages.php index d90dd35..c646b23 100644 --- a/lib/Admin/Pages.php +++ b/lib/Admin/Pages.php @@ -48,14 +48,14 @@ function(){}, [&$this, 'settings_page'] ); - add_submenu_page( - 'stl', - __('System Status - SrbTransLatin', DOMAIN), - __('System Status', DOMAIN), - 'manage_options', - 'stl_status', - [&$this, 'settings_page'] - ); + // add_submenu_page( + // 'stl', + // __('System Status - SrbTransLatin', DOMAIN), + // __('System Status', DOMAIN), + // 'manage_options', + // 'stl_status', + // [&$this, 'settings_page'] + // ); remove_submenu_page('stl', 'stl'); diff --git a/lib/Admin/Settings.php b/lib/Admin/Settings.php index 97f45dd..4d94081 100644 --- a/lib/Admin/Settings.php +++ b/lib/Admin/Settings.php @@ -106,8 +106,6 @@ public function sanitize_opts($opts) foreach ($array as $opt) : - - if (in_array($opt, $expert_settings)) : if ($this->expert_enable) : @@ -153,10 +151,6 @@ public function sanitize_opts($opts) endif; - $opts['core']['versions'] = [ - '2.0' - ]; - return $opts; } diff --git a/lib/Core/Utils.php b/lib/Core/Utils.php index 63603fd..099fe6d 100644 --- a/lib/Core/Utils.php +++ b/lib/Core/Utils.php @@ -19,9 +19,6 @@ function get_default_config() { return [ - 'versions' =>[ - '2.0' - ], 'migrated' => false, 'core' => [ 'script' => 'cir', diff --git a/readme.txt b/readme.txt index e69de29..41ffde3 100644 --- a/readme.txt +++ b/readme.txt @@ -0,0 +1,148 @@ +=== SrbTransLatin - SrbTransLatin === +Contributors: seebeen +Donate link: https://sgi.io/donate +Tags: letter, serbian, cyrillic, latin, transliteration, latinisation, script, multilanguage, wpml-compatible +Requires at least: 4.0 +Tested up to: 5.3.2 +Requires PHP: 7.0 +Stable tag: 2.0.1 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +SrbTransLatin plugin allows you to use both Cyrillic and Latin scripts on your website. + +== Description == + +### SrbTransLatin: The only WordPress transliteration plugin + +SrbTransLatin enables you to have **both cyrillic and latin scripts** on your website. Transliteration is done in-place automatically. + +If your content is written in cyrillic script, this plugin will allow your visitors to view the content both in cyrillic and latin scripts. +This plugin also fixes searching cyrillic posts using latin script. + +### Features + +* Works everywhere - Plugin hooks into WordPress core transliterating your content inplace +* **Auto-Fix permalinks** - Your cyrillic permalinks will be automatically saved as latin (optional) +* **SEARCH FIX** - Search posts written in cyrillic script using both latin and cyrillic script +* Lightweight - Plugin does not use any external stylesheets, or js files. +* **Partial transliteration** - You can selectively choose which parts of your website to keep in cyrilic +* WPML Compatible - Fully compatible with WPML. Transliteration only works on Serbian portion of your website +* Script / Language selector - Integrates into WPML language selectors in menu / widget +* **Widget Ready** - Switch script via sidebar widget + +== Documentation == + +If you can't find your anwsers in the FAQ below, documentation can be found [here](https://rtfm.sgi.io/srbtranslatin) + +== Authorship == + +Original version of this plugin was developer by [Predrag Supurović](https://pedja.supurovic.net/). +Plugin development was handed over to [me](https://sgi.io) in march 2020. Since then, I am the sole author and maintainer of the plugin + +== Installation == + +1. Upload serbian-latinisation.zip to plugins via WordPress admin panel, or upload unzipped folder to your plugins folder +2. Activate the plugin through the "Plugins" menu in WordPress +3. Go to Settings->Latinisation to manage the options + +== Frequently Asked Questions == + += Can I use your plugin to transliterate my latin content into cyrillic? = + +Short answer: No. + +Long Answer: At the moment, no. Such conversions are very hard to do since HTML language is also written in latin script, and converting text only is very resource intensive process. + +I'm currently working on a tool which will enable you to convert your latin content into cyrillic + += How can I keep parts of content in cyrilic? = + +You can use [stl_cyr][/stl_cyr] shortcode. This will keep the shortcode text in cyrilic script, even when viewing latin version of the site. + += Will this plugin transliterate my page title into latin as well? = + +Yes, it will. + += Will this plugin enable my visitors to search for content using latin script = + +Yes it will. Plugin hooks into default WordPress search function and enables searching of cyrilic content using latin text on frontend + += Is this plugin Compatible with WPML = + +Yes it is. It has no compatibility issues with WPML, since the transliteration core is being used only in serbian version of the website + += Will I be able to select script for Serbian language in WPML language Widget? = + +Yes, Plugin fully integrates with all WPML functions on the frontend because it directly extends the available language list + += I'm having search issues - not all posts show up when searching for them using latin characters = + +Open a support thread, or send me an e-mail. + += Your plugin is converting my cyrilic filenames into latin which prevents them from loading = + +First - you shouldn't be using cyrilic filenames in the first place. Due to the fact that most hosting providers do not have full UTF-8 support. + +I'm working on a tool which will convert filenames and post / page content on your website, so the errors will be automagically fixed + +Temporary fix: redownload all attachments with cyrilic filenames and reupload them. This plugin will do an on-the-fly conversion of filenames. + += Some parts of my page aren't being transliterated = + +Depending on the theme / plugins you're currently using, some content might be generated via javascript / ajax. This plugin works fully on the backend side (content is being transliterated via PHP), so it cannot influence JS generated content and content pulled via ajax calls. + +Feel free to contact me via e-mail, and I'll see if I can assist you for your specific case. + +== Screenshots == + +1. Plugin Settings page + +2. Script Selector + +3. WPML Language selector with cyrillic and latin scripts + +== Changelog == + += 2.0.1 = +Release date: March 22nd, 2020 + +Breaking changes: + +* Complete plugin is namespaced, old functions can still be used without namespace, but they will throw **E_USER_DEPRECATED** error +* Shortcodes have been renamed, old shortcodes can still be used, but they will throw **E_USER_DEPRECATED** error +* Minimum WP version bumped to 4.8 +* Minimum PHP version bumped to **7.0** + +Improvements: + +* Full PSR-1 and PSR-12 compatibility +* Full PSR-4 compatibility +* Huge performance increase over version 1.70 of SrbTransLatin and Version 1.4 of Serbian Latinisation +* Reworked the settings screen +* Reworked the entire shortcode functionality +* Moved Transliterator to a composer module, details can be found [here](https://github.com/seebeen/Transliterator) + +Features: + +* New Script Selector Widget +* New Script Selector function + +Bug Fixes: + +* Fixed transliteration not working when WPML is active +* Fixed buggy transliteration in certain scenarios +* Fixed issues with performance when using Avada Theme +* Fixed Shortcodes not behaving properly when WPML is active +* Fixed Memory leaks +* Fixed Performance issues on cerain hosting providers + +== Upgrade Notice == + +When upgrading from + +* SrbTransLatin 1.XX +* Serbian Latinisation 1.X.X + +your options will be migrated from the old versions, please double check settings panel to see if everything is in order. + diff --git a/srbtranslatin.php b/srbtranslatin.php index 9702154..6be8a3d 100644 --- a/srbtranslatin.php +++ b/srbtranslatin.php @@ -5,7 +5,7 @@ * Description: SrbTransLatin - Serbian Latinisation plugin allows you to have a website in both cyrillic and latin scripts * Author: Sibin Grasic * Author URI: https://sgi.io - * Version: 2.0 + * Version: 2.0.1 * Requires at least: 4.8 * Requires PHP: 7.0 * Text Domain: SrbTransLatin @@ -20,7 +20,7 @@ !defined(__NAMESPACE__ . '\FILE') && define(__NAMESPACE__ . '\FILE', __FILE__); // Define Main plugin file !defined(__NAMESPACE__ . '\BASENAME') && define(__NAMESPACE__ . '\BASENAME', plugin_basename(FILE)); // Define Basename !defined(__NAMESPACE__ . '\PATH') && define(__NAMESPACE__ . '\PATH', plugin_dir_path( FILE )); // Define internal path -!defined(__NAMESPACE__ . '\VERSION') && define (__NAMESPACE__ . '\VERSION', '2.0'); // Define internal version +!defined(__NAMESPACE__ . '\VERSION') && define (__NAMESPACE__ . '\VERSION', '2.0.1'); // Define internal version !defined(__NAMESPACE__ . '\DOMAIN') && define (__NAMESPACE__ . '\DOMAIN', 'SrbTransLatin'); // Define Text domain // Bootstrap the plugin