WP Manifestindependent plugin directory
manifest / i18n / zu-translate

Zu Translate WP Registry grade B. Medium-severity findings · 2 findingsWP RegistryMedium-severity findings · 2 findingsOpen the reportB

Additional functionality and the Gutenberg support for 'qTranslate-XT' plugin. Customization of language switch buttons.

★ 4stars
1.3.5latest · 4 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/picasso/zu-translate/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Zu Translate: qTranslate-XT on steroids.

This plugin is not independent. It adds functionality and implements Gutenberg (WordPress Block Editor) support for the qTranslate-XT plugin. Perhaps someday it will be integrated into qTranslate-XT, and perhaps never.

Zu Translate - qTranslate-XT on steroids.

Description

After the WordPress changed the TinyMCE to the Block Editor (Gutenberg), editing the multilingual content significantly complicated. The old algorithms of the qTranslate-XT plugin, which successfully worked before - stopped working. This plugin is an attempt to find a new solution for editing multilingual content in the Block Editor. In addition, there were always nuances that did not suit me in qTranslate-XT plugin. Solutions of these "problems" are also implemented in this plugin. Use it or not - that's your choice.

🎃 Testing this plugin cannot be called comprehensive. Therefore, use it at your own risk.

Features

  • Support for switching language in the Block Editor
  • Synchronize language switch for all editable blocks
  • Ability to add custom blocks to the list supported by this plugin
  • Control of the appearance of buttons to switch language
  • Ability to switch language in the list of posts/pages
  • Support for Quick Edit in the list of posts/pages
  • Supports adding a language switcher to any post or page using a shortcode
  • Ability to use shortcode in the WordPress menu
  • Integrated and tested with WooCommerce plugin

Shortcode attributes

You can configure the language switcher using these attributes:

  • class - additional classes that will be added to the main element: class="my-switcher"
  • __as_code__ - use language codes as the name of the switcher items: as_code=true
  • unsorted - when sorted (default) then the active language will be always on top: unsorted=true
  • __post_id__ - post ID for which you want to create the switcher (default for the current post): post_id=123

If shortcode is used in the menu, use the following template to describe the shortcode:

#location+tag?attribute1=value1&attribute2=value2&linkclass=red_color,bold#
  • location - a position where the result of the shortcode will be inserted. Possible options - after|before|url, that is, before link, after link or instead of the link itself
  • tag - the name of shortcode
  • attribute1, attribute2 - names of attributes of shortcode
  • value1, value2 - attribute values
  • linkclass - a special attribute that sets the class name that will be added to the link (note that if you want to add several classes, you can specify them through the comma)

Examples

  • With language codes and "unsorted":

[zu-lang unsorted=true as_code=true]

  • With custom class for post ID 1209:

[zu-lang class="my-switcher" post_id=1209]

  • In menu with custom class, only language codes, before link and with a special link class:

#before+zu-lang?class=my-switcher&as_code=true&linkclass=none#

Download

Installation

  1. Upload the zu-translate folder to the /wp-content/plugins/ directory.
  2. Activate the plugin using the Plugins menu in your WordPress admin panel.
  3. You can adjust the necessary settings using your WordPress admin panel in Settings > Zu Translate.

Public methods

In order to take advantage of the Gutenberg support implemented in this plugin, plugins and themes can add their custom blocks using the public methods:

  • zutrans_is_multilang()
  • __zutrans_register_translated_blocks($blocks)__
  • __zutrans_get_all_languages($sorted = true)__
  • zutrans_convert_text($text, $lang = null, $flags = 0)
  • zutrans_convert_url($url, $lang = null, $flags = 0)

If you are using the Zukit framework, you can use the internal methods of your class - snippets and _snippets.

// for regular theme or plugin
function register_my_blocks() {
    add_action('init', function() {
        if(function_exists('zutrans_register_translated_blocks')) {
            zutrans_register_translated_blocks([
                'myplugin/mega'     => ['title' => 'Mega Block', 'atts' => 'content'],
                'myplugin/super'    => ['title' => 'Super Block', 'atts' => ['text', 'note']],
            ]);
        }
    });
}

// for a theme or plugin that uses the 'Zukit' framework
public function init() {
    if($this->_snippets('is_multilang')) {
        $this->snippets('register_translated_blocks', [
            'myplugin/mega'     => ['title' => 'Mega Block', 'atts' => 'content'],
            'myplugin/super'    => ['title' => 'Super Block', 'atts' => ['text', 'note']],
        ]);
    }
}

Releases

11 releases.

Tag
Published
1.3.5 latest
Mar 7, 2022 4 years ago
Mar 5, 2022 4 years ago
Feb 24, 2022 4 years ago
Feb 9, 2022 4 years ago
Jan 25, 2022 4 years ago
Jan 21, 2022 4 years ago
Jan 20, 2022 4 years ago
Jan 19, 2022 4 years ago
Jan 10, 2022 4 years ago
Jan 9, 2022 4 years ago
Jan 5, 2022 4 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

B grade

Security

Zu Translate 1.3.5 · audited by WP Registry

Medium-severity findings.

2 medium
Audited release
1.3.5
Findings
2
Worst severity
medium
Content hash
6d2c5b87d38530d01814787d…

Findings

  • medium Plugin options writable via REST with only edit_posts

    missing_capability

    Zukit registers CREATABLE /options with permission edit_posts. set_options_ajax calls $router->set_option/$del_option for requested keys. Contributors/authors can alter Zu Translate settings that should be admin-only.

    zukit/traits/ajax-rest.php:90-114

    Recommendation

    Require manage_options for options mutation endpoints.

  • medium Bulk classic-block conversion without per-post edit checks

    missing_capability

    ajax_more actions zutranslate_convert_classic / split_classic accept id=0 and then get_posts(... fields=>ids) for the post type, converting every post. REST/ajax gate is only edit_posts, not current_user_can(edit_post, $id) per post, so low-privilege editors can modify others' content en masse.

    includes/traits/ajax.php:88-105

    Recommendation

    Require manage_options for bulk mode; for single IDs require current_user_can('edit_post', $id).

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.