|
3 | 3 | * Plugin Name: PlotBird Analytics |
4 | 4 | * Plugin URI: https://github.com/plotbird/wordpress-plugin |
5 | 5 | * Description: Adds the PlotBird tracking code to your site. PlotBird is self-hosted, cookie-free web analytics that runs on ordinary PHP and MySQL hosting. |
6 | | - * Version: 1.0.4 |
| 6 | + * Version: 1.0.5 |
7 | 7 | * Requires at least: 6.0 |
8 | 8 | * Requires PHP: 7.4 |
9 | 9 | * Author: PlotBird |
10 | 10 | * Author URI: https://plotbird.github.io/ |
11 | 11 | * License: GPL-2.0-or-later |
12 | 12 | * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
13 | 13 | * Text Domain: plotbird-analytics |
14 | | - * Domain Path: /languages |
15 | 14 | * |
16 | 15 | * @package PlotBird_Analytics |
17 | 16 | */ |
18 | 17 |
|
19 | 18 | defined('ABSPATH') || exit; |
20 | 19 |
|
21 | | -define('PLOTBIRD_ANALYTICS_VERSION', '1.0.4'); |
| 20 | +define('PLOTBIRD_ANALYTICS_VERSION', '1.0.5'); |
22 | 21 | define('PLOTBIRD_ANALYTICS_FILE', __FILE__); |
23 | 22 | define('PLOTBIRD_ANALYTICS_DIR', plugin_dir_path(__FILE__)); |
24 | 23 | define('PLOTBIRD_ANALYTICS_URL', plugin_dir_url(__FILE__)); |
|
30 | 29 | require_once PLOTBIRD_ANALYTICS_DIR . 'includes/class-plotbird-chart.php'; |
31 | 30 | require_once PLOTBIRD_ANALYTICS_DIR . 'includes/class-plotbird-admin.php'; |
32 | 31 |
|
33 | | -/** |
34 | | - * Load the translations, either for the site's language or for the one chosen |
35 | | - * on the setup screen. |
36 | | - * |
37 | | - * Following the site is the default and needs no call at all: WordPress loads |
38 | | - * languages/plotbird-analytics-<locale>.mo by itself, and on WordPress.org the |
39 | | - * language packs do the same. When a language is chosen explicitly the catalogue |
40 | | - * has to be loaded by hand, because WordPress 6.7 loads translations just in time |
41 | | - * using the site locale and ignores the plugin_locale filter. |
42 | | - */ |
43 | | -add_action('init', static function (): void { |
44 | | - $chosen = (string) PlotBird_Settings::get('language'); |
45 | | - |
46 | | - if ($chosen === 'site' || $chosen === '') { |
47 | | - return; |
48 | | - } |
49 | | - |
50 | | - $file = PLOTBIRD_ANALYTICS_DIR . 'languages/plotbird-analytics-' . $chosen . '.mo'; |
51 | | - |
52 | | - if (!is_file($file)) { |
53 | | - return; |
54 | | - } |
55 | | - |
56 | | - unload_textdomain('plotbird-analytics'); |
57 | | - load_textdomain('plotbird-analytics', $file); |
58 | | -}, 1); |
59 | | - |
60 | 32 | /** |
61 | 33 | * Store the default settings on activation, without overwriting a repeat run. |
62 | 34 | */ |
|
0 commit comments