Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter mjb2000

    (@mjb2000)

    Doh… This was the problem with my plugin… White space after the final php close tag ?>

    
    987     }
    988 ?>
    989
    990
    

    I have to deleted lines 989 and 990 and it then worked.

    It does seem strange the the minify+compression was working after first-load though.

    • This reply was modified 6 years ago by mjb2000.
    Thread Starter mjb2000

    (@mjb2000)

    Hi Marko

    I hadn’t spotted the empty minify cache before – That seems to be the simplist way to trigger the issue. As soon as I hit that and then reload the page in a browser I see the error.

    BUT – I guessed from your response that this is not something you have seen before so I started disabling plugins one-by-one and found that a custom plugin I wrote seems to be causing the problem. I have probably not done something in line with the correct way to write plugins (I don’t really know what I’m doing).

    So I’ll work on fixing my plugin (all it does it tweak a few WooCommerce things and add some CSS, so I might move it to the theme functions.php).

    I’ll write back here once I realise what the problem was.

    mjb2000

    (@mjb2000)

    I had the same problem. I don’t think this is W3TC specific. It will happen any time you serve fonts from a different domain to your site.

    The easiest way to work on solving this issue is to first of all remove the CDN from the equation, BUT continue to serve fonts from a different domain so you can check what is happening.

    So lets pretend you are using mysite.com and cdn.mysite.com

    Create another subdomain like temp.mysite.com and point this at you main server (mysite.com). Now temp.mysite.com and mysite.com are both your server, meanwhile cdn.myseite.com remains you CDN.

    Go in to the CDN settings of W3TC and tell W3TC that your CDN domain is temp.mysite.com

    Now you should have you site loading would-be CDN content from temp.mysite.com (which is of course also your server).

    Now you will probably still see the same CORS error, since the font is still coming from a different domain.

    Follow the info here to fiddle with the headers of fonts (I actually found this was already implemented in the nginx.conf file the W3TC creates, but perhaps it is not for apache???).

    Once you has fiddled with your nginx/apache config restart apache and see if fonts are now working from temp.mysite.com

    If they are working OK then you can switch back to using cdn.mysite.com (you might need to invalidate all font files depending on your config).

    • This reply was modified 6 years ago by mjb2000.
    Thread Starter mjb2000

    (@mjb2000)

    Hi @fahadmahmood

    Have you had any time to look in to this? Do you think there might be way to achieve this using you plugin?

    Thread Starter mjb2000

    (@mjb2000)

    It could be either (since I haven’t actually built the WooCommerce config yet), but on the face of it I would think it would make sense to have it as an add-on since I would need to keep track of the fact the Carolina needs wrapping on her Apple, but not her Orange and that John and Amy need wrapping on all their items… I imagine to keep track of the individual items and which do/don’t require wrapping it would make sense to assign it as an add-on???

    Thread Starter mjb2000

    (@mjb2000)

    Hi

    I am literally building a site from scratch, so there is nothing for you to log in to and check an existing configuration. Because this is a new build I can configure my new site in any way you recommend if you can confirm your plugin will support this sort of discount configuration.

    • This reply was modified 7 years, 9 months ago by mjb2000.
    Thread Starter mjb2000

    (@mjb2000)

    I just want to add (because maybe I wasn’t clear). The client can add any combination of items to get the discount (they don’t need all three). For example 3 Apples for one person is enough to get the discount.

    Thread Starter mjb2000

    (@mjb2000)

    That’s awesome. Thanks so much.

    Thread Starter mjb2000

    (@mjb2000)

    Hi – Thanks for taking a look. I wouldn’t know how to make a specific plugin for this and I am using so much of your plugins ability to traverse a JSON response it doesn’t seem worth doing it in my own plugin – plus I am already using Post Snippets for other tasks across my site.

    What do you think of the option to take only the most recent photos from all albums (essentially by flattening the results of the JSON response and not treating them as having a hierarchy above a certain point).

    For example, my JSON is currently:

    {
       "albums": {
          "data": [
             {
                "id": "823682474379751",
                "created_time": "2015-04-09T10:15:10+0000",
                "photos": {
                   "data": [
                      {
                         "source": "https://scontent.xx.fbcdn.net/hphotos-xfa1/t31.0-8/p180x540/10003843_823688131045852_3038101641900331404_o.jpg",
                         "name": "Diving",
                         "created_time": "2015-04-09T10:36:17+0000",
                         "id": "823688131045852"
                      },
                      {
                         "source": "https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-xat1/t31.0-8/q85/p180x540/11124847_823688127712519_7238539669568836794_o.jpg",
                         "name": "Stavronikita Diving",
                         "created_time": "2015-04-09T10:36:17+0000",
                         "id": "823688127712519"
                      },
                      {
                         "source": "https://scontent.xx.fbcdn.net/hphotos-xfp1/t31.0-8/p180x540/11149713_823688124379186_563225082774744305_o.jpg",
                         "name": "Diving",
                         "created_time": "2015-04-09T10:36:17+0000",
                         "id": "823688124379186"
                      }
                   ],
                   "paging": {
                      "cursors": {
                         "before": "ODIzOTY3MzA3Njg0NjAx",
                         "after": "ODIzNjg4MTI0Mzc5MTg2"
                      }
                   }
                }
             },
             {
                "description": "Photos from our dives at SS Stavronikita",
                "id": "823687504379248",
                "created_time": "2015-04-09T10:32:51+0000",
                "photos": {
                   "data": [
                      {
                         "source": "https://scontent.xx.fbcdn.net/hphotos-xfp1/t31.0-8/q81/p180x540/11022607_823687524379246_3507442812931297998_o.jpg",
                         "name": "Deep Cource at Stavronikita",
                         "created_time": "2015-04-09T10:32:53+0000",
                         "id": "823687524379246"
                      },
                      {
                         "source": "https://scontent.xx.fbcdn.net/hphotos-xpf1/t31.0-8/p180x540/10847563_823687531045912_8894344381248598132_o.jpg",
                         "name": "Stavronikita",
                         "created_time": "2015-04-09T10:32:54+0000",
                         "id": "823687531045912"
                      }
                   ],
                   "paging": {
                      "cursors": {
                         "before": "ODIzNjg3NTI0Mzc5MjQ2",
                         "after": "ODIzODM1MzY0MzY0NDYy"
                      }
                   }
                }
             },
             {
                "id": "823681047713227",
                "created_time": "2015-04-09T10:10:01+0000",
                "photos": {
                   "data": [
                      {
                         "source": "https://scontent.xx.fbcdn.net/hphotos-xtp1/v/t1.0-9/11110274_823681057713226_6085211337323344840_n.png?oh=e3ece133e264d75c50ae9b88e9d3c202&oe=55B10FB0",
                         "created_time": "2015-04-09T10:10:05+0000",
                         "id": "823681057713226"
                      }
                   ],
                   "paging": {
                      "cursors": {
                         "before": "ODIzNjgxMDU3NzEzMjI2",
                         "after": "ODIzNjgxMDU3NzEzMjI2"
                      }
                   }
                }
             }
          ],
          "paging": {
             "cursors": {
                "after": "ODIzNjgxMDQ3NzEzMjI3",
                "before": "ODIzNjgyNDc0Mzc5NzUx"
             }
          }
       },
       "id": "823680787713253"
    }

    It would be helpful if only the Photos > Data nodes were kept and collapsed to just one level (where hopefully they could be sorted by date). Resulting in a JSON structure such as this:

    {
       "photos":{
          "data":[
             {
                "source":"https://scontent.xx.fbcdn.net/hphotos-xfa1/t31.0-8/p180x540/10003843_823688131045852_3038101641900331404_o.jpg",
                "name":"Diving",
                "created_time":"2015-04-09T10:36:17+0000",
                "id":"823688131045852"
             },
             {
                "source":"https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-xat1/t31.0-8/q85/p180x540/11124847_823688127712519_7238539669568836794_o.jpg",
                "name":"Stavronikita Diving",
                "created_time":"2015-04-09T10:36:17+0000",
                "id":"823688127712519"
             },
             {
                "source":"https://scontent.xx.fbcdn.net/hphotos-xfp1/t31.0-8/p180x540/11149713_823688124379186_563225082774744305_o.jpg",
                "name":"Diving",
                "created_time":"2015-04-09T10:36:17+0000",
                "id":"823688124379186"
             },
             {
                "source":"https://scontent.xx.fbcdn.net/hphotos-xfp1/t31.0-8/q81/p180x540/11022607_823687524379246_3507442812931297998_o.jpg",
                "name":"Deep Cource at Stavronikita",
                "created_time":"2015-04-09T10:32:53+0000",
                "id":"823687524379246"
             },
             {
                "source":"https://scontent.xx.fbcdn.net/hphotos-xpf1/t31.0-8/p180x540/10847563_823687531045912_8894344381248598132_o.jpg",
                "name":"Stavronikita",
                "created_time":"2015-04-09T10:32:54+0000",
                "id":"823687531045912"
             }
          ]
       }
    }

    Natai – I don’t think prettyPhoto is a solution – it seems to be just displaying the original image scaled (within the browser) to fit the screen.

    This topic is not about displaying an image, it’s about controlling the link that is used when a link is added to an image.

    Has anyone found a solution for this? It seems really strange that such an important feature is missing.

    Hi – I’m not sure if you’re still looking, but this page gives some information on how to do this. Unfortunately I’m having difficulties because the Post ID doesn’t seem to be passed in to the function – which makes it tricky to do anything with it!

Viewing 11 replies - 1 through 11 (of 11 total)