Translation Stats

By Pedro Mendonça

★ 5.0/5 (7 ratings)10+ active installationsVersion 2.1.1

Show plugins and themes translation stats on your WordPress install.

Description

The plugin adds a “Translation Stats” column to the Plugins screen, and the translation stats to the Themes screen in WordPress admin: a translation stats bar on the theme cards, and a translation stats widget in the theme details.

Select the plugins and themes to show the translation stats in the plugin settings.

Show the translation stats of any plugin or theme on your site with the Translation Stats block: search the project on WordPress.org, choose the language and the subprojects, and update the stats right from the block editor. The block requires WordPress 6.3 or later.

The translation stats are shown only for plugins and themes that exist in translate.wordpress.org and are prepared for localization.

If a plugin doesn’t have complete translation stats, you’ll see a notice with one of the reasons below:

  • Plugin not found on WordPress.org
  • Translation project not found on WordPress.org
  • The plugin is not properly prepared for localization

The color scheme of the translation stats bars is exactly same used in GlotPress for consistency with the translation experience in translate.wp.org.

This plugin is properly prepared for localization.

FAQ

What are the plugin subprojects?

  • Development: the plugin’s Development version (trunk)
  • Development Readme: the plugin page on WordPress.org/plugins, from the Development version
  • Stable: the plugin’s Stable version (latest release)
  • Stable Readme: the plugin page on WordPress.org/plugins, from the Stable version

Do themes have subprojects?

No. The themes translation projects on translate.wordpress.org have no subprojects, so the theme translation stats have a single translation stats bar.

Why don’t I see the translation stats for a plugin or theme?

Only plugins and themes hosted on WordPress.org have translation projects on translate.wordpress.org. Check that it’s selected in Settings > Translation Stats, and that its slug matches its text domain: the settings table shows a check mark when it does.

Which language are the stats shown for?

The language set in Settings > Translation Stats > Settings. By default, the site language.

How often are the stats updated?

The stats are cached for the time set in the Tools tab, 24 hours by default. Use the refresh button on each plugin or theme to update them right away, or clean the whole cache in the Tools tab. In the block editor, use the update button in the Translation Stats block toolbar.

How can I show the translation stats on my site?

Add the Translation Stats block to any post, page or template, and search the plugin or theme, installed or on WordPress.org. Choose the language and the plugin subprojects in the block settings. Visitors see the cached stats, loaded in the background when needed, without slowing down the page. The block requires WordPress 6.3 or later.

How can I translate a plugin or theme?

Should I translate both Stable and Development?

Usually not. New strings and edits to approved translations are synced between Development and Stable, and when a plugin releases a new version, its Development translations are copied to Stable. Read more…

How long does it take for a translation to become available?

Readme translations are published almost immediately.
The first language pack of a plugin or theme is generated when 90% of its strings are translated and approved. For plugins, that’s the Stable (latest release) subproject. After that, language packs are updated with each new approved translation.

Can I help translate this plugin to my own language?

Yes you can! If you want to translate this plugin to your language, please translate it on translate.wordpress.org.

Can I contribute to this plugin?

Sure! You are welcome to report any issues or add feature suggestions on the GitHub repository.

Where can I get support?

Ask your questions in the support forum on WordPress.org.

Screenshots

Changelog

2.1.1

  • Fix the block editor slow to load pages with many Translation Stats blocks, with a spinner on each block. The stats load in the background, as on the frontend, and each block shows the stats placeholder until they are loaded.
  • Update the development dependencies.
  • Developers: The translation_stats_block_load_stats filter defaults to false also in the block editor.

2.1.0

  • New: The Translation Stats block, to show the translation stats of any plugin or theme on your site, in any language, with the project name and links to translate it. Search the plugins and themes on WordPress.org, and update the stats from the block editor. Requires WordPress 6.3.
  • Fix the stats of the language variants, like Português (AO90), Deutsch (Sie), Nederlands (Formeel) or Català (Valencià), shown as not found since 1.3.3, and their links to translate.wordpress.org. The cached stats update when they expire: to see them right away, use Clean Cache in Settings > Translation Stats > Tools.
  • Fix the Translation Stats link of the Themes screen, not translated.
  • Include the SCSS sources in the GitHub archives.
  • Update the development dependencies.
  • Developers: The REST API routes translation-stats/v1/block-stats and translation-stats/v1/block-projects for the block, and the translation_stats_block_load_stats filter.

2.0.0

  • New: Show the translation stats of themes on the Themes screen, with a translation stats bar on the theme cards and a translation stats widget in the theme details.
  • New: Select the themes to show the translation stats in the new Themes settings tab.
  • Show the translate.wordpress.org error message in the translation stats notice, like when it’s unavailable.
  • Show a placeholder of the translation stats bars while loading them.
  • Return to the same settings tab after saving the settings.
  • Fix the settings update notice shown before the page, and in any request, after updating the plugin. It’s now shown once in the admin notices.
  • Fix the activation notice not shown with a different plugin folder name, and mention the themes.
  • Fix the settings Save button focus cut on the left.
  • Save the settings checkboxes as booleans, updating the saved settings automatically.
  • Remove the console logs.
  • Remove the bundled Portuguese (pt_PT) translation files, not loaded by WordPress. The translations are loaded from translate.wordpress.org.
  • Developers: Add the Project, Plugin_Project and Theme_Project classes for the translate.wordpress.org projects and their translation stats. Remove Translations_API::translations_api_get_plugin(), plugin_project_on_translate_wporg() and plugin_subproject_on_translate_wporg(), and Plugins::plugin_subproject_stats(), plugin_stats_cached() and plugin_subproject_stats_transient().
  • Developers: The REST API route translation-stats/v1/(plugins|themes)/<slug>/stats loads the plugins and themes translation stats.
  • Developers: Rename the TRANSLATION_STATS_TRANSIENTS_PREFIX constant to TRANSLATION_STATS_TRANSIENTS_PLUGINS_PREFIX. The themes transients use TRANSLATION_STATS_TRANSIENTS_THEMES_PREFIX.
  • Build the JavaScript and CSS with @wordpress/scripts.
  • Increase PHPStan level to 9, and unit tests coverage.

1.4.0

  • Bump minimum WP version to 5.9.
  • Security: Check the user permission to load the plugin translation stats, now loaded with the REST API.
  • Show the cached plugin translation stats instantly, loading only the missing ones.
  • Show the plugin translation stats update status next to the update button, without moving the stats.
  • Fix translate.wordpress.org errors and rate limits shown as translation project not found for a day.
  • Fix the Translation Stats plugins filter, status link and settings update on Multisite.
  • Fix cleaning the cache on Multisite.
  • Fix plugin data not deleted on uninstall with the default settings and on Multisite.
  • Fix default settings saved nested when sanitizing settings without data.
  • Show an error page with status 403 when the settings form nonce fails.
  • Increase unit tests coverage.

1.3.3

  • Tested up to WP 7.1.
  • Fix deprecation notice on PHP 8.5.
  • Fix settings icons.
  • Bump minimum WP version to 5.1.
  • Increase PHPStan Level to 8.

1.3.2

  • Tested up to WP 6.9
  • Fix the translated descriptions of plugins in the plugin table filter for plugins with translation stats.
  • Add sanitization of settings.
  • Add PHP Unit Tests.
  • Update library Tablesorter.
  • Deprecate TRANSLATION_STATS_DEBUG constant.

1.3.1

  • Tested up to WP 6.6
  • Always show notices for plugins not prepared for localization.

1.3.0

  • New checkboxes in the subprojects column to bulk-select a specific subproject in all plugins.
  • Improve the indeterminate [-] behavior of table checkboxes.
  • Cleanup the Debug section and fix the PHP error when there are no settings saved yet.

1.2.8

  • Fix deprecation notice on PHP 8.2+
  • Show current/all counts on subproject statistics. Props @Irinashl

1.2.7

  • Fix typos in comments. Props @szepeviktor
  • Show stats admin notices only on WP_DEBUG. Props @Irinashl

1.2.6

  • Tested up to WP 6.5
  • Fix incorrect position of placeholders in comments to translators. Props @presskopp

1.2.5

  • Custom icon for queued update notice

1.2.4

  • Queue Translation Stats updates in sequence to avoid many Ajax requests in parallel

1.2.3

  • Fix wrong count on plugins filter by only counting plugins enabled on Translation Stats settings that are actually installed

1.2.2

  • Tested up to WP 6.1
  • Tested only on supported PHP versions (7.4+)
  • More detailed console log for updating plugin translation stats
  • Only show language pack information if percent translated is below minimum threshold

1.2.1

  • Tested up to WP 5.9
  • Fix PHP error on new installs before saving settings
  • Fix delete plugin data on uninstall
  • Use minified CSS

1.2.0

  • Stats widget color and border improvements
  • Stats widget notices improved with the WP.org information about translation projects issues
  • Code refactoring of settings sections and fields for easy management and extension
  • Code refactoring of the Stats widget bars and notices
  • Admin notices custom wrap support
  • Fix code prefixes
  • Fix return error on disabled subproject stats bar
  • Fix CSS issues
  • Debug mode improvements
  • Linting and compiling improved

1.1.5

  • GitHub release process optimization
  • Assets folders optimization
  • Minor code improvements

1.1.4

  • Remove unnecessary development files

1.1.3

  • Tested up to WP 5.8
  • Remove deprecated dark-mode compatibility

1.1.2

  • Tested up to WP 5.7
  • Minor code improvements
  • Update plugin constants prefixes

1.1.1

  • Tested up to WP 5.6
  • Minor code improvements

1.1.0

  • Include Locales list since translate.wp.org Languages API was disabled on meta changeset #10056
  • Remove recent feature to Update WordPress Translation, feature moved to the new spin-off plugin Translation Tools, created specifically to deal with translations updates, with many related features out of the scope of this plugin
  • Tested up to WP 5.5
  • Code optimization

1.0.5

  • Add WPLANG and available languages to the settings languages dropdown

1.0.4

  • Fix admin notices
  • Minor code improvements

1.0.3

  • Add footer custom message
  • Fix utm parameters

1.0.2

  • New sort and filter in the settings plugins table
  • Fix timeout error on get languages list from translate.wp.org API

1.0.1

  • Fix custom column title icon and screen reader text

1.0.0

  • Version 1.0! 🎉
  • New settings database structure and version
  • New settings database updater
  • New activation class
  • Optimized plugins settings table
  • Fix notices not showing when “Warnings” settings was disabled
  • Minor code improvements

0.9.9

  • New plugins View to show only Translation Stats enabled plugins
  • New link to filtered plugins list in settings page
  • New link to settings page in plugins page
  • Fix translation stats not showing when “Warnings” settings was disabled
  • Minor code improvements
  • Tested up to WP 5.4

0.9.8

  • Fix settings checkboxes tristate bug
  • Remove filter ‘tstats_enable_debug’
  • Fix WP core update translation notice on Beta install
  • Refactoring with PHPStan (Level 6)

0.9.7

  • Add tristate to parent checkboxes with enabled and disabled children
  • Minor code improvements

0.9.6.3

  • Fix JavaScript bug

0.9.6.2

  • Code optimization

0.9.6.1

  • Fix admin notices
  • Fix CSS issues

0.9.6

  • Add Slug and Text Domain check to plugins settings table
  • Add class autoloader
  • Add PHPStan check

0.9.5.5

  • Fix i18n issue (Thanks @szepeviktor)
  • Minor code improvements
  • Coffee ☕

0.9.5.4

  • Minor code improvements
  • Tested up to WP 5.3.2

0.9.5.3

  • Minor code improvements

0.9.5.2

  • Minor code improvements
  • Add admin notice to dashboard

0.9.5.1

  • Minor code improvements

0.9.5

  • Now you can update your WordPress translation when you want
  • No more waiting for language packs or your locale to be 100% complete
  • One click to update all WordPress core translation files ( .po, .mo and all .json )
  • Tested up to WP 5.3

0.9.4.3

  • Tested up to WP 5.2.4
  • Add PHP compatibility check

0.9.4.2

  • Tested up to WP 5.2.3
  • Code optimization
  • UI improvement

0.9.4.1

  • Bump PHP minimum required version
  • Code optimization

0.9.4

  • New AJAX loading and updating features
  • Improved plugins screen loading speed
  • New button to quick update a single plugin stats
  • Tested up to WP 5.2.2
  • Code optimization

0.9.3

  • Tested up to WP 5.2.1
  • Code optimization

0.9.2

  • Support for custom WordPress.org Locale Subdomains

0.9.1

  • Support for current GlotPress 2.x variants
  • Fix typo

0.9.0

  • Tested up to WP 5.1.1
  • Fix typo
  • Support new locales
  • Support for all locales in translate.wp.org through WordPress API

0.8.5

  • Tested up to WP 5.1
  • Fix CSS issues
  • Fix WordPress Coding Standards errors

0.8.4

  • Fix CSS issues

0.8.3

  • Fix uninstall function

0.8.2

  • Fix Author links

0.8.1

  • Add Author column to plugins list – feature suggestion from Webdados
  • Add links to plugins and authors
  • Fix WordPress Coding Standards errors

0.8

  • Add Translation Stats settings page
  • Add installed plugins table to select only the plugins you want to manage translation stats to reduce http requests
  • Add option to enable or disable warnings of translation projects
  • Add options to reset settings and clean cache to force update the translation stats
  • Add option to specify the translation language you want
  • Add option to choose to keep or delete plugin data on uninstall
  • Add uninstall file

0.7

0.6

  • Add WordPress core notices styles to error messages
  • Add assets
  • Minor code improvements
  • Readme update

0.5

  • Initial release.