PluginProbe
Automatic Translator with Google Translate / 2.1.3
Automatic Translator with Google Translate v2.1.3
2.2.1 2.2.0 free-v2.2.0 2.1.2 2.1.3 2.1.1 2.1.0 2.0.0 1.7.1 trunk 1.0.3 1.0.4 1.0.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.3.0 All 41 releases
auto-translate / auto-translate.php

auto-translate.php in Automatic Translator with Google Translate 2.1.3, at auto-translate.php

125 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 *
5 * @link https://pampa.dev
6 * @since 1.0.0
7 * @package Auto_Translate
8 *
9 * @wordpress-plugin
10 * Plugin Name: Automatic Translator with Google Translate
11 * Description: Translate your WordPress site with a polished Google Translate language switcher for instant visitor translation.
12 * Version: 2.1.3
13 * Requires at least: 5.0
14 * Requires PHP: 7.4
15 * Author: Pampa Dev
16 * Author URI: https://pampa.dev
17 * License: GPL-2.0+
18 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
19 * Text Domain: auto-translate
20 * Domain Path: /languages
21 */
22
23 // If this file is called directly, abort.
24 if ( ! defined( 'WPINC' ) ) {
25 die;
26 }
27
28 /**
29 * Currently plugin version.
30 */
31 define( 'AUTO_TRANSLATE_VERSION', '2.1.3' );
32
33 /**
34 * Initialize the plugin tracker.
35 *
36 * @return void
37 */
38 function wpat_appsero_init_tracker_auto_translate() {
39
40 if ( ! class_exists( 'WpatAppsero\\Client' ) ) {
41 require_once __DIR__ . '/appsero/src/Client.php';
42 }
43
44 $client = new WpatAppsero\Client(
45 'f2a83449-c6d2-49f9-8e57-8dbc99eaa136',
46 'Automatic Translator with Google Translate',
47 __FILE__
48 );
49
50 // Active insights.
51 $client->insights()->init();
52 }
53
54 wpat_appsero_init_tracker_auto_translate();
55
56 /**
57 * The code that runs during plugin activation.
58 * This action is documented in includes/class-auto-translate-activator.php
59 */
60 function wpat_activate_auto_translate() {
61 require_once plugin_dir_path( __FILE__ ) . 'includes/class-auto-translate-activator.php';
62 Auto_Translate_Activator::activate();
63 }
64
65 /**
66 * The code that runs during plugin deactivation.
67 * This action is documented in includes/class-auto-translate-deactivator.php
68 */
69 function wpat_deactivate_auto_translate() {
70 require_once plugin_dir_path( __FILE__ ) . 'includes/class-auto-translate-deactivator.php';
71 Auto_Translate_Deactivator::deactivate();
72 }
73
74 register_activation_hook( __FILE__, 'wpat_activate_auto_translate' );
75 register_deactivation_hook( __FILE__, 'wpat_deactivate_auto_translate' );
76
77 /**
78 * The core plugin class that is used to define internationalization,
79 * admin-specific hooks, and public-facing site hooks.
80 */
81 require plugin_dir_path( __FILE__ ) . 'includes/class-auto-translate.php';
82
83 require plugin_dir_path( __FILE__ ) . 'includes/class-auto-translate-config.php';
84
85 require plugin_dir_path( __FILE__ ) . 'includes/class-auto-translate-languages.php';
86
87 /**
88 * Load language/country config after init so translation functions are not called too early.
89 *
90 * @since 1.6.0
91 */
92 function wpat_auto_translate_load_config() {
93 static $config_loaded = false;
94 global $wpat_supported_languages;
95 global $wpat_widget_types;
96 global $wpat_languages_countries;
97
98 if ( $config_loaded ) {
99 return;
100 }
101
102 require plugin_dir_path( __FILE__ ) . 'includes/config.php';
103 $config_loaded = true;
104 }
105
106 add_action( 'init', 'wpat_auto_translate_load_config', 0 );
107
108
109 /**
110 * Begins execution of the plugin.
111 *
112 * Since everything within the plugin is registered via hooks,
113 * then kicking off the plugin from this point in the file does
114 * not affect the page life cycle.
115 *
116 * @since 1.0.0
117 */
118 function wpat_run_auto_translate() {
119
120 $plugin = new Auto_Translate();
121 $plugin->run();
122
123 }
124 wpat_run_auto_translate();
125