Changeset 3408373
- Timestamp:
- 12/02/2025 06:21:38 PM (6 weeks ago)
- Location:
- geo-targetly-geo-translate
- Files:
-
- 24 added
- 8 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/geo-targetly-geo-translate.php (added)
-
tags/1.0.1/php (added)
-
tags/1.0.1/php/shared (added)
-
tags/1.0.1/php/shared/autoload.php (added)
-
tags/1.0.1/php/shared/identification.php (added)
-
tags/1.0.1/php/shared/plugins_api.php (added)
-
tags/1.0.1/php/wordpress (added)
-
tags/1.0.1/php/wordpress/admin_builder.php (added)
-
tags/1.0.1/php/wordpress/analytics.php (added)
-
tags/1.0.1/php/wordpress/autoload.php (added)
-
tags/1.0.1/php/wordpress/html (added)
-
tags/1.0.1/php/wordpress/html/ids_input.php (added)
-
tags/1.0.1/php/wordpress/html/settings_page.php (added)
-
tags/1.0.1/php/wordpress/identification.php (added)
-
tags/1.0.1/php/wordpress/script_injector.php (added)
-
tags/1.0.1/readme.txt (added)
-
tags/1.0.1/shared (added)
-
tags/1.0.1/shared/templates (added)
-
tags/1.0.1/shared/templates/script.js.php (added)
-
tags/1.0.1/templates (added)
-
tags/1.0.1/templates/settings_description.php (added)
-
trunk/geo-targetly-geo-translate.php (modified) (2 diffs)
-
trunk/php/shared/autoload.php (modified) (1 diff)
-
trunk/php/shared/identification.php (modified) (1 diff)
-
trunk/php/shared/plugins_api.php (added)
-
trunk/php/wordpress/admin_builder.php (modified) (3 diffs)
-
trunk/php/wordpress/analytics.php (added)
-
trunk/php/wordpress/autoload.php (modified) (1 diff)
-
trunk/php/wordpress/identification.php (modified) (1 diff)
-
trunk/php/wordpress/script_injector.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
geo-targetly-geo-translate/trunk/geo-targetly-geo-translate.php
r3375764 r3408373 3 3 * Plugin Name: Geo Targetly Geo Translate 4 4 * Description: Auto-translate and localize your site by visitor location. Show language variants by country, region, or browser language. 5 * Version: 1.0. 05 * Version: 1.0.1 6 6 * Author: Geo Targetly 7 7 * Author URI: https://geotargetly.com … … 24 24 25 25 inject_script(); 26 27 register_wp_installation(__FILE__); -
geo-targetly-geo-translate/trunk/php/shared/autoload.php
r3375764 r3408373 6 6 7 7 require_once __DIR__ . '/identification.php'; 8 require_once __DIR__ . '/plugins_api.php'; -
geo-targetly-geo-translate/trunk/php/shared/identification.php
r3375764 r3408373 6 6 return 'geotargetly_geo_translate' . ($resource ? "_$resource" : ''); 7 7 } 8 9 function get_instance_id($siteId) 10 { 11 $salt = get_unique_id('instance_id'); 12 return hash('sha512', $salt . '|' . $siteId); 13 } -
geo-targetly-geo-translate/trunk/php/wordpress/admin_builder.php
r3375764 r3408373 7 7 * @return void 8 8 */ 9 function register_wp_menu($title, $renderDescriptionSection )9 function register_wp_menu($title, $renderDescriptionSection, $id = null) 10 10 { 11 add_action('admin_menu', function () use ($title, $renderDescriptionSection) { 11 add_action('admin_menu', function () use ( 12 $title, 13 $renderDescriptionSection, 14 $id 15 ) { 12 16 add_menu_page( 13 17 "$title - Geo Targetly", 14 18 $title, 15 19 'manage_options', 16 get_unique_id(),20 !empty($id) ? $id : get_unique_id(), 17 21 function () use ($title, $renderDescriptionSection) { 18 22 return require __DIR__ . '/html/settings_page.php'; … … 23 27 } 24 28 25 function register_wp_settings( )29 function register_wp_settings($legacyOptionName = null, $legacyFieldName = null) 26 30 { 27 add_action('admin_init', function () { 31 add_action('admin_init', function () use ( 32 $legacyOptionName, 33 $legacyFieldName 34 ) { 28 35 register_setting(get_unique_id('pluginPage'), get_settings_field_name(), [ 29 36 'sanitize_callback' => function ($input) { … … 46 53 get_unique_id('ids'), 47 54 __('IDs (comma separated)', 'geo-targetly-geo-translate'), 48 function () {55 function () use ($legacyOptionName, $legacyFieldName) { 49 56 $optionFieldName = get_settings_field_name(); 50 57 $options = get_option($optionFieldName); 51 58 $arrayKey = get_unique_id('ids'); 59 $fieldName = $arrayKey; 60 if (empty($options) && $legacyOptionName && $legacyFieldName) { 61 $options = get_option($legacyOptionName); 62 $fieldName = $legacyFieldName; 63 } 52 64 $name = "{$optionFieldName}[$arrayKey]"; 53 $value = is_array($options) ? $options[ get_unique_id('ids')] : '';65 $value = is_array($options) ? $options[$fieldName] : ''; 54 66 return require __DIR__ . '/html/ids_input.php'; 55 67 }, -
geo-targetly-geo-translate/trunk/php/wordpress/autoload.php
r3375764 r3408373 8 8 require_once __DIR__ . '/admin_builder.php'; 9 9 require_once __DIR__ . '/script_injector.php'; 10 require_once __DIR__ . '/analytics.php'; -
geo-targetly-geo-translate/trunk/php/wordpress/identification.php
r3375764 r3408373 6 6 return get_unique_id('settings'); 7 7 } 8 9 function get_instance_field_name() 10 { 11 return get_unique_id('instance'); 12 } 13 14 function get_wp_instance_id() 15 { 16 return get_instance_id(get_site_url()); 17 } -
geo-targetly-geo-translate/trunk/php/wordpress/script_injector.php
r3375764 r3408373 2 2 namespace GeoTargetly\GeoTranslate; 3 3 4 function inject_script( )4 function inject_script($legacyOptionName = null, $legacyFieldName = null) 5 5 { 6 add_action('init', function () {6 add_action('init', function () use ($legacyOptionName, $legacyFieldName) { 7 7 $optionFieldName = get_settings_field_name(); 8 8 $options = get_option($optionFieldName); 9 $value = is_array($options) ? $options[get_unique_id('ids')] : ''; 9 $fieldName = get_unique_id('ids'); 10 if (empty($options) && $legacyOptionName && $legacyFieldName) { 11 $options = get_option($legacyOptionName); 12 $fieldName = $legacyFieldName; 13 } 14 $value = is_array($options) ? $options[$fieldName] : ''; 10 15 $ids = array_filter( 11 16 array_map(function ($value) { -
geo-targetly-geo-translate/trunk/readme.txt
r3375764 r3408373 5 5 Requires at least: 3.0 6 6 Tested up to: 6.8 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 49 49 == External services == 50 50 51 This plugin connects to an external endpoint via the domain https://g594253005.co to load and run a script that powers its core 52 functionality, as outlined previously in the description. 51 This plugin connects to an external endpoint via the domain https://g594253005.co to load and run a script that powers its core functionality, as outlined previously in the description. 53 52 54 It sends the user's location each time the plugin is loaded. This is necessary to determine and customize the plugin’s 55 behavior based on the user's geographical context. 53 It sends the user's location each time the plugin is loaded. This is necessary to determine and customize the plugin’s behavior based on the user's geographical context. 56 54 57 This service is provided by Geo Targetly – [Terms of Use](https://geotargetly.com/website-terms-of-use), 58 [Privacy Policy](https://geotargetly.com/privacy-policy). 55 Additionally, this plugin connects to analytics endpoint https://g97676560.co/ to track plugin installation and usage over time. 56 57 This service is provided by Geo Targetly – [Terms of Use](https://geotargetly.com/website-terms-of-use), [Privacy Policy](https://geotargetly.com/privacy-policy).
Note: See TracChangeset
for help on using the changeset viewer.