PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
wp-google-maps
/
includes
<?php namespace WPGMZA; class DynamicTranslations { private $map; public function __construct() { } public function updateDummyFile() { global $wpdb; global $wpgmza; $this->map = array(); $source = "<?php\r\n\r\n"; // Global settings $source .= $this->convert('wpgmza_gdpr_default_notice'); $source .= $this->convert('wpgmza_gdpr_company_name'); $source .= $this->convert('wpgmza_gdpr_retention_purpose'); // Markers, polygons, custom fields, categories, etc. $tables = $wpdb->get_col('SHOW TABLES LIKE "%wpgmza%"'); foreach($tables as $table) { if(preg_match('/geocode_cache/', $table)) continue; // Don't want cached JSON, ignore $columns = array(); foreach($wpdb->get_results("SHOW COLUMNS FROM $table") as $name => $definition) { if(!preg_match('/text|char/', $definition->Type)) continue; // Not text, ignore if(preg_match('/other_data|other_settings|polydata|lat|lng|latlng|points/', $definition->Field)) continue; // Ignore serialized data, it's a security risk. Also ignore geometry $columns[] = $definition->Field; } if(empty($columns)) continue; $qstr = "SELECT " . implode(', ', $columns) . " FROM $table"; $results = $wpdb->get_results($qstr); foreach($results as $obj) { foreach($obj as $key => $value) { if(empty($value) || is_numeric($value)) continue; // Looks like coordinates or numeric settings, ignore if(!preg_match('/[^\-+,.0-9() ]/', $value)) continue; // Looks like geometry, ignore if($json = json_decode($value)) { foreach($json as $jsonKey => $jsonValue) $source .= $this->convert($jsonValue); continue; } $source .= $this->convert($value); } } } file_put_contents(plugin_dir_path(__DIR__) . 'languages/dynamic/dummy.php', $source); } protected function convert($value) { if(empty($value)) return ""; // Empty if(isset($this->map[$value])) return ""; // Already added $this->map[$value] = true; return "__('" . addslashes($value) . "', 'wp-google-maps');\r\n"; } }
[-] class.admin-ui.php
[edit]
[+]
3rd-party-integration
[-] class.latlng.php
[edit]
[-] class.map.php
[edit]
[-] class.admin-notices.php
[edit]
[-] class.dom-query-results.php
[edit]
[-] class.pointlabel.php
[edit]
[-] class.upgrader.php
[edit]
[-] class.map-list-page.php
[edit]
[-] class.integrity-checker.php
[edit]
[-] class.dom-document.php
[edit]
[-] class.crud.php
[edit]
[+]
styling
[-] class.dynamic-translations.php
[edit]
[-] class.strings.php
[edit]
[-] class.library-script-panel.php
[edit]
[+]
open-layers
[-] class.maps-engine-dialog.php
[edit]
[+]
compat
[-] class.plugin.php
[edit]
[-] class.theme-panel.php
[edit]
[-] class.global-settings.php
[edit]
[+]
google-maps
[-] class.query.php
[edit]
[-] class.modal-dialog.php
[edit]
[-] class.script-loader.php
[edit]
[-] class.internal-engine.php
[edit]
[-] class.selector-to-xpath.php
[edit]
[-] class.polygon.php
[edit]
[-] class.rectangle.php
[edit]
[-] class.system-info.php
[edit]
[-] class.shortcodes.php
[edit]
[-] class.gdpr-compliance.php
[edit]
[+]
php8
[-] build.log
[edit]
[+]
tables
[-] class.polyline.php
[edit]
[-] class.settings.php
[edit]
[-] class.store-locator.php
[edit]
[-] class.country-select.php
[edit]
[-] class.settings-page.php
[edit]
[-] class.dom-element.php
[edit]
[+]
..
[-] class.elias-fano.php
[edit]
[-] class.distance.php
[edit]
[-] class.auto-loader.php
[edit]
[-] class.circle.php
[edit]
[-] class.page.php
[edit]
[-] class.component-anchor-control.php
[edit]
[+]
map-edit-page
[-] class.feature.php
[edit]
[-] class.marker.php
[edit]
[-] class.database.php
[edit]
[-] class.marker-filter.php
[edit]
[-] class.google-maps-api-loader.php
[edit]
[-] class.factory.php
[edit]
[+]
legacy
[-] class.installer-page.php
[edit]
[-] class.query-fragment.php
[edit]