• Resolved gofetch

    (@gofetch)


    As detailed on Github, the installation works fine, and I can retreive the shortcode from the ‘Currency Tool’ menu.
    However the shortcode is not converted into a valid iframe content.
    Any idea on how to solve this?

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter gofetch

    (@gofetch)

    Too provide more details, I have been using the widget successfully in the past on my WP.
    Trying to (re)use the current version (3.0.2) of Currency-converter on a 6.0.2 version of WP, I manage to install it fine.

    I can then see a widget in the widget bar, although it is called ‘legacy widget’

    If I go to the ‘Currency tool’ menu, I can see the widget and the code. But copy/pasting the code provided in a shortcode widget leaves me with the code unmodified : the code is left as an basic paragraph by my Firefox browser.
    And there is no relevant visible error in the browser.

    • This reply was modified 2 years, 2 months ago by gofetch.
    • This reply was modified 2 years, 2 months ago by gofetch.
    Plugin Author currencywiki

    (@currencywiki)

    Hi there,

    Thank you for using the plugin!

    Sometimes this could be an issue with the theme you are using, are you using the same exact theme or something different? Sometimes certain plugins create conflict so try to disable some of them and see if it works. Example theme I use for the demo site as you can see shortcodes work ok even after WP core update https://www.currencyconverterplugin.com/shortcode-demo-setup-instructions/

    Best,

    Admin

    • This reply was modified 2 years, 2 months ago by currencywiki.
    Thread Starter gofetch

    (@gofetch)

    Hi,

    That was worth a try, but here the theme is not the issue : I switeched to twenty twenty two theme of WordPress but this did not solve the issue (I keep it as is so that you can have a look).

    Plugin Author currencywiki

    (@currencywiki)

    I just checked your website, the shortcode you are using now will not work with 3.0.2

    Try this one, follow the link and copy the shortcode from there https://codepen.io/currencywiki/pen/JjvvwBO

    Thread Starter gofetch

    (@gofetch)

    There is progress : the code is now converted into the script below.
    It does not display anything yet though. I tried to rebuild the URL manually https://www.currency.wiki/widget/embed?wd=1&f=EUR&t=AUD&cs=&d=1&tm=1664776804&lang=fr-FR
    but it does not display anything either.
    I also looked at the network traces of my browser : nothing there about a call to https://www.currency.wiki
    So this is not an issue with my plugin version, right?

    <script type="text/javascript">
            var wc = document.createElement("DIV");
            function widgetTrigger(type, lang) {
                var uniqID = '633a7a6499048';
    
                var langg = (lang != '-1' && typeof lang != 'undefined') ? '&lang='+lang : "";
                
                var width = (type == 'custom') ? '200' : ((type == 'fix') ? 200 : 0);
                var height = (type == 'custom') ? '350' : ((type == 'fix') ? 350 : 0);
    
                var bg_color = '000000'
                var font_color = 'FFFFFF'
    
                var amount = '1';
    
                var from = 'EUR';
                var to = 'AUD'
                
                var gradient = 'on'
                var shadow = 'on'
                var border = 'off'
                var flag = 'on'
                var display = 'c'
                var currencies = ''
                var symbol = 'off'
                var monetary_format = '1'
                var decimal_format = '2'
                var date_format = '1'
                var support = 'off'
    
                wc.id = "wc"+uniqID;
                wc.name = "wc"+uniqID;
                var wc_style = "position:relative;display:inline-block;border:none;min-width:200px;min-height:350px;";
                if (shadow && shadow == 'on') {
                    wc_style += "box-shadow:0 0 5px #000;";
                }
    
                var fr = document.createElement("IFRAME");
                if (width && height) {
                    if (width < 200 ) width = 200;
                    if (height < 350 ) height = 350;
    
                    fr.width = width+"px";
                    fr.height = height+"px";
                    wc_style += "width:"+width+"px;";
                    wc_style += "height:"+height+"px;";
                }
                else {
                    fr.width= "100%";
                    if (!height || height < 350 ) height = 350;
                    fr.height = height + "px";
                    wc_style += "width:100%;";
                    wc_style += "height:"+height+"px;";
                }
                wc.style = wc_style;
                wc.innerHTML = ''
                wc.appendChild(fr)
    
                if(support && support == 'on') {
                    var lb=document.createElement("DIV");
                    lb.style="position:absolute;display:inline-block;box-sizing:border-box;width:100%;left:0;bottom:0;padding:0 15px;text-align:right;line-height:25px;color:#{{$fc}};font-size:13px;font-family:Arial,Helvetica,sans-serif;"
                    var lb_1=document.createElement("A");
                    lb_1.innerHTML=from+"/"+to;
                    lb_1.href="https://www.currency.wiki/"+from.toLowerCase()+"_"+to.toLowerCase();
                    lb_1.rel="nofollow";
                    lb_1.target="_blank";
                    lb_1.style="float:left;margin:0;padding:0;text-transform:uppercase;line-height:25px;color:#"+font_color+";"
                    var lb_2=document.createElement("A");
                    lb_2.innerHTML="Currency.Wiki";
                    lb_2.href="https://www.currency.wiki";
                    lb_2.rel="nofollow";
                    lb_2.target="_blank";
                    lb_2.style="line-height:25px;margin:0;padding:0;color:#"+font_color+";"
                    lb.appendChild(lb_1);
                    lb.appendChild(lb_2);
                    wc.appendChild(lb);
                }
    
                fr.id = uniqID;
                fr.name = uniqID;
                fr.style = "border:none;min-width:200px;min-height:350px";
                fr.width = (type == 'custom') ? width+"px" : ((type == 'fix') ? "200px" : "100%");
                fr.height = (type == 'custom') ? height+"px" : ((type == 'fix') ? "350px" : "100%");
    
                document.getElementById("currency-bcc-"+uniqID).appendChild(wc);
                
                var yp = JSON.stringify({
                    cd:uniqID,
                    w: width, // width
                    h: height, // height
                    a: amount ? amount: 1, // amount
                    f: from.toUpperCase(), // from currency
                    t: to.toUpperCase(), // to currency
                    fc: font_color, // font color
                    c: bg_color, // bg color
                    g: gradient, // gradient bg
                    sh: shadow, // shadow
                    b: border, // border
                    fl: flag, // flag
                    p: display, // page - converter or exchange rates
                    cs: currencies, // currencies 
                    s: symbol, // symbol right, left, off
                    mf: monetary_format, // monetary format
                    df: decimal_format, // decimal format
                    d: date_format, // date
                    su: support, // support us
                });
               
                var url = "https://www.currency.wiki/widget/embed?wd=1&f="+from+"&t="+to+"&cs="+currencies+"&d="+date_format+"&tm="+1664776804+langg;
                url = url.replace(/\"/g, "");
                fr.setAttribute("src", url);
                var w = window.frames[uniqID];
                fr.onload = function() {
                    w.postMessage({"t": yp}, "*");
                }            
            }
            widgetTrigger('fix', 'fr-FR');
    	</script>
    Plugin Author currencywiki

    (@currencywiki)

    Are you using any type of redirect plugin or via htaccess? Something is blocking. I’d test the following, disable all other plugins that you have, leave the Currency Converter Widget ON and see if that works. Also, are you using PHP7 or PHP8?

    Thread Starter gofetch

    (@gofetch)

    No, there is no redirection.
    To be sure it is not a conflit with other plugins, I setup a new blank wordpress install and placed the code in the default sample page. It is running PHP8 by default
    This is the result : https://go-fetch.online/test/sample-page/

    If it can be a WP server side error, any log that I could check?

    Plugin Author currencywiki

    (@currencywiki)

    If you are running PHP8 that could be an issue, the current plugin supports up-to PHP7

    Here is a quick fix for PHP8 the only problem, it is not optimized or supported at the moment, and you will need to manually install it by downloading it from here https://currencyconverter.s3.us-west-2.amazonaws.com/currency-converter-widget-php8.zip

    Thread Starter gofetch

    (@gofetch)

    I appreciate your support.
    I installed the plugin from your link. It tells me it is still a 3.0.2 version.
    Here again the menu ‘Currency Tool’ is visible.
    The result (https://go-fetch.online/test/) is the same than the previous one thought.
    Looking at the network trace of my browser, I don’t see any call to Currencywiki which makes me think that the issue is on plugin / wordpress side.

    So I downgraded my PHP version to 7.4 using cPanel. It didn’t have a visible improvement, neither with the usual plugin or the version you sent. Strange.

    Plugin Author currencywiki

    (@currencywiki)

    Correct, the fix for PHP8 is the same version just not supported or optimized.

    Unfortunately, I’m not sure what’s going on since we can’t replicate this issue on our end.

    Could be server configuration issues and maybe try a different hosting company.

    • This reply was modified 2 years, 1 month ago by currencywiki.
    • This reply was modified 2 years, 1 month ago by currencywiki.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘No conversion of shortcode’ is closed to new replies.