{"action":"created","issue":{"url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/1","labels_url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/1/comments","events_url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/1/events","html_url":"https://github.com/deliciousbrains/GlotPress/issues/1","id":103815205,"number":1,"title":"Attempting to \"import originals\" times out","user":{"login":"JRGould","id":1509647,"avatar_url":"https://avatars.githubusercontent.com/u/1509647?v=3","gravatar_id":"","url":"https://api.github.com/users/JRGould","html_url":"https://github.com/JRGould","followers_url":"https://api.github.com/users/JRGould/followers","following_url":"https://api.github.com/users/JRGould/following{/other_user}","gists_url":"https://api.github.com/users/JRGould/gists{/gist_id}","starred_url":"https://api.github.com/users/JRGould/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JRGould/subscriptions","organizations_url":"https://api.github.com/users/JRGould/orgs","repos_url":"https://api.github.com/users/JRGould/repos","events_url":"https://api.github.com/users/JRGould/events{/privacy}","received_events_url":"https://api.github.com/users/JRGould/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/deliciousbrains/GlotPress/milestones/1","html_url":"https://github.com/deliciousbrains/GlotPress/milestones/Convert%20to%20Plugin","labels_url":"https://api.github.com/repos/deliciousbrains/GlotPress/milestones/1/labels","id":1322118,"number":1,"title":"Convert to Plugin","description":"","creator":{"login":"bradt","id":190095,"avatar_url":"https://avatars.githubusercontent.com/u/190095?v=3","gravatar_id":"","url":"https://api.github.com/users/bradt","html_url":"https://github.com/bradt","followers_url":"https://api.github.com/users/bradt/followers","following_url":"https://api.github.com/users/bradt/following{/other_user}","gists_url":"https://api.github.com/users/bradt/gists{/gist_id}","starred_url":"https://api.github.com/users/bradt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradt/subscriptions","organizations_url":"https://api.github.com/users/bradt/orgs","repos_url":"https://api.github.com/users/bradt/repos","events_url":"https://api.github.com/users/bradt/events{/privacy}","received_events_url":"https://api.github.com/users/bradt/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":2,"state":"open","created_at":"2015-09-24T13:18:51Z","updated_at":"2015-09-25T14:22:40Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-08-29T00:05:23Z","updated_at":"2015-10-01T04:44:21Z","closed_at":null,"body":"Tried a few times to import the WPMDB .mo file, but keep getting timeouts:\r\n\r\n```php\r\n[28-Aug-2015 23:55:46 UTC] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /.../glotpress/gp-includes/strings.php on line 58\r\n[28-Aug-2015 23:55:46 UTC] PHP Stack trace:\r\n[28-Aug-2015 23:55:46 UTC] PHP   1. {main}() /.../glotpress-plugin.dev/index.php:0\r\n[28-Aug-2015 23:55:46 UTC] PHP   2. require() /.../glotpress-plugin.dev/index.php:17\r\n[28-Aug-2015 23:55:46 UTC] PHP   3. require_once() /.../glotpress-plugin.dev/wp-blog-header.php:16\r\n[28-Aug-2015 23:55:46 UTC] PHP   4. do_action() /.../glotpress-plugin.dev/wp-includes/template-loader.php:12\r\n[28-Aug-2015 23:55:46 UTC] PHP   5. call_user_func_array:{/.../glotpress-plugin.dev/wp-includes/plugin.php:496}() /.../glotpress-plugin.dev/wp-includes/plugin.php:496\r\n[28-Aug-2015 23:55:46 UTC] PHP   6. gp_run_route() /.../glotpress-plugin.dev/wp-includes/plugin.php:496\r\n[28-Aug-2015 23:55:46 UTC] PHP   7. GP_Router->route() /.../glotpress/gp-settings.php:170\r\n[28-Aug-2015 23:55:46 UTC] PHP   8. call_user_func_array:{/.../glotpress/gp-includes/router.php:168}() /.../glotpress/gp-includes/router.php:168\r\n[28-Aug-2015 23:55:46 UTC] PHP   9. GP_Route_Project->import_originals_post() /.../glotpress/gp-includes/router.php:168\r\n[28-Aug-2015 23:55:46 UTC] PHP  10. GP_Original->import_for_project() /.../glotpress/gp-includes/routes/project.php:115\r\n[28-Aug-2015 23:55:46 UTC] PHP  11. GP_Original->closest_original() /.../glotpress/gp-includes/things/original.php:145\r\n[28-Aug-2015 23:55:46 UTC] PHP  12. gp_string_similarity() /.../glotpress/gp-includes/things/original.php:226\r\n[28-Aug-2015 23:55:46 UTC] PHP  13. gp_levenshtein() /.../glotpress/gp-includes/strings.php:98\r\n[28-Aug-2015 23:55:46 UTC] PHP  14. gp_substr() /.../glotpress/gp-includes/strings.php:139\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/comments/144618739","html_url":"https://github.com/deliciousbrains/GlotPress/issues/1#issuecomment-144618739","issue_url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/1","id":144618739,"user":{"login":"JRGould","id":1509647,"avatar_url":"https://avatars.githubusercontent.com/u/1509647?v=3","gravatar_id":"","url":"https://api.github.com/users/JRGould","html_url":"https://github.com/JRGould","followers_url":"https://api.github.com/users/JRGould/followers","following_url":"https://api.github.com/users/JRGould/following{/other_user}","gists_url":"https://api.github.com/users/JRGould/gists{/gist_id}","starred_url":"https://api.github.com/users/JRGould/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JRGould/subscriptions","organizations_url":"https://api.github.com/users/JRGould/orgs","repos_url":"https://api.github.com/users/JRGould/repos","events_url":"https://api.github.com/users/JRGould/events{/privacy}","received_events_url":"https://api.github.com/users/JRGould/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T04:44:21Z","updated_at":"2015-10-01T04:44:21Z","body":"I've figured out what's going wrong here. In `import_for_project` we're checking each of the uploaded translations to see if it already exists in the project by looping through the array and seeing if each key is a key in the existing set: https://github.com/deliciousbrains/GlotPress/blob/wordpress-plugin-dbi/gp-includes/things/original.php#L111 b\r\n\r\nI'm assuming that this has something to do with utf8mb4 encoding because the keys for translations pulled from db are encoded as utf8 and have a BOM character at the start of the string `ord(original_first_char)===4` where the imported translations' keys are encoded as ascii and don't have the BOM character. \r\n\r\nI haven't had time to figure out a solution yet, in my setup I could just save the `originals_by_key` key as `substr(original_key, 1)` if it's encoded as utf8, but that's probably not a complete solution. \r\n\r\nThis has been a rabbit hole for me, so I won't be surprised if the ideal solution is obvious to someone else - please let me know or feel free to submit a PR, otherwise I'll dive back into this at a later date."}}