Closed XavaIreland closed 1 year ago
Hi @XavaIreland thanks for reaching out.
You would need to add the license key to the URL for it to return a proper response. Like https://api.skelpo.com/v1/licenses/check/KEY
Do you have a call that sends to https://api.skelpo.com/v1/licenses/signup as a POST call? Because that's the one that will register your installation with the key.
Thanks for the quick response. How do I get the key?
I added a DeepL API key for the DeepL free server in the DeepL tab. As for the Usage & License, I don't know where to get the key or how to generate it?
Further info:
When I try to hit Translate on the page edit screen, I get an error this part of the code in translate.js:
async function acft_translate() { if (currentState == undefined) { let c = await acft_check(); if (c == false) { let c = await acft_sign_up(); acft_license_code = c.licenseKey; c = await acft_check(); } currentState = c; }
The error is
Uncaught (in promise) TypeError: Assignment to constant variable. at acft_translate (translate.js?ver=6.3.2:38:22) acft_translate @ translate.js?ver=6.3.2:38 await in acft_translate (async) onclick @ post.php?post=9801&action=edit:814
@XavaIreland we just updated the API, there was in fact a small error there.
Can you reload the plugin settings page and see if you see a license key there?
YAY!!
Does the rest of it work for you as well now? 🙃
So I now go to the page and hit Translate and I get this:
Access to fetch at 'https://api.skelpo.com/v1/translations/translate' from origin 'https://www.superfy.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. api.skelpo.com/v1/translations/translate:1
Failed to load resource: net::ERR_FAILED
translate.js?ver=6.3.2:152
Uncaught (in promise) TypeError: Failed to fetch
at translateTextSkelpo (translate.js?ver=6.3.2:152:26)
at acft_translate (translate.js?ver=6.3.2:112:23)
at HTMLAnchorElement.onclick (post.php?post=9801&action=edit&translated=1:826:135)
This piece of code is referenced:
if (engine == "deepl") { dd["deeplKey"] = acft_deepl_api_key; } const response = await fetch(apiUrl, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(dd), });
I have the following in my htaccess:
Let me check that out, I'll get back to you within 1h.
Thank you
Alright, could you try again? I've enabled some debugging for me to see what is happening on our side here.
Thanks for the changes: here is the debug info:
id: content tN {documentBaseUrl: 'https://www.superfy.com/wp-admin/', settings: {…}, id: 'content', isNotDirty: true, plugins: {…}, …}$: ƒ (e,t)addButton: ƒ (e,t)annotator: {register: ƒ, annotate: ƒ, annotationChanged: ƒ, remove: ƒ, getAll: ƒ}baseURI: zw {settings: {…}, source: 'https://www.superfy.com/wp-includes/js/tinymce', protocol: 'https', authority: 'www.superfy.com', userInfo: undefined, …}bookmark: undefinedbuttons: {align: {…}, alignleft: {…}, aligncenter: {…}, alignright: {…}, formatselect: ƒ, …}container: div#mceu_28.mce-tinymce.mce-container.mce-panelcontentAreaContainer: div#mceu_44.mce-edit-area.mce-container.mce-panel.mce-stack-layout-itemcontentCSS: (7) ['https://www.superfy.com/wp-includes/js/tinymce/skins/lightgray/content.min.css', 'https://www.superfy.com/wp-includes/css/dashicons.min.css?ver=6.3.2', 'https://www.superfy.com/wp-includes/js/tinymce/skins/wordpress/wp-content.css?ver=6.3.2', 'https://www.superfy.com/wp-content/plugins/popup-maker/assets/css/pum-site.min.css', 'https://www.superfy.com/wp-content/plugins/nextgen…post/static/ngg_attach_to_post_tinymce_plugin.css', 'https://www.superfy.com/wp-content/plugins/popup-maker/assets/css/pum-admin-editor-styles.min.css', 'https://www.superfy.com/wp-content/plugins/wordpress-seo/css/dist/inside-editor-2130.css']contentDocument: documentcontentStyles: (3) ['.mce-content-body div.mce-resizehandle {position: …x;padding: 5px;position: absolute;z-index: 10001}', '.mce-visual-caret {position: absolute;background-c…-1000px;right: auto;top: 0;margin: 0;padding: 0;}', '.mce-content-body .mce-offscreen-selection {positi…tent-body *[contentEditable=true] {cursor: text;}']contentWindow: Window {window: Window, self: Window, document: document, name: '', location: Location, …}controlManager: {buttons: {…}, onAdd: i, onPostRender: i, setDisabled: ƒ, setActive: ƒ, …}delegates: {keydown: ƒ, keypress: ƒ, keyup: ƒ, submit: ƒ, focusin: ƒ, …}documentBaseURI: zw {settings: {…}, source: '', protocol: 'https', authority: 'www.superfy.com', userInfo: undefined, …}documentBaseUrl: "https://www.superfy.com/wp-admin/"dom: {doc: document, settings: {…}, win: Window, files: {…}, stdMode: true, …}editorCommands: pp {execCommand: ƒ, queryCommandState: ƒ, queryCommandValue: ƒ, queryCommandSupported: ƒ, addCommands: ƒ, …}editorContainer: div#mceu_28.mce-tinymce.mce-container.mce-paneleditorManager: {defaultSettings: {…}, majorVersion: '4', minorVersion: '9.11', releaseDate: '2020-07-13', $: ƒ, …}editorUpload: {blobCache: {…}, addFilter: ƒ, uploadImages: ƒ, uploadImagesAuto: ƒ, scanForImages: ƒ, …}formElement: form#postformEventDelegate: ƒ (e)formatter: {get: ƒ, register: ƒ, unregister: ƒ, apply: ƒ, remove: ƒ, …}hasVisual: truehidden: falseid: "content"iframeElement: iframe#content_ifriframeHTML: "<!DOCTYPE html>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><body id=\"tinymce\" class=\"mce-content-body content post-type-page post-status-publish page-template-front-page locale-en-us\" data-id=\"content\">
async function acft_check() { if (acft_license_code) {
}
in the settings file informs me that it could not feth the ACFT_liense_code.
I visited https://api.skelpo.com/v1/licenses/check/ directly in my browser and I get the error: {"reason":"Not Found","error":true} which would suggest that the license check is non-existent. Can you please comment on this.