Support » Plugin: GR Progress Widget » Cache goodreads asset on server?

  • Resolved caemor

    (@caemor)


    Hello,


    would it be possible to cache the goodreads asset on the server so the end user doesn’t need to connect to a different webserver?
    That would make it easier to comply with the gdpr.

    edit: just before pressing submit I saw the other post about this topic.
    Also related to the other post: No, it’s not illegal to use CDN but you need to make a data protection agreement and name it in your privacy policy.

    Would it be possible to make the images optional although that would remove much of the great design and look?

    thanks in advance,
    caemor

    • This topic was modified 1 year, 5 months ago by caemor.
    • This topic was modified 1 year, 5 months ago by caemor.
Viewing 3 replies - 1 through 3 (of 3 total)
  • So I found the same solution multiple times where the image wouldn’t need to be cached. One needs to have an extra php file which does the following below. The img url would now be: <img src="https://link-to-your-php-skript.com/img.php?url={external-goodreads-url}" />

    And the code in that php file:

    
    <?php
    $url = $_GET['url'];
    if(strpos($url,".jpg"))
    {
    header("Content-Type: image/jpg");
    }
    
    if(strpos($url,".gif"))
    {
        header("Content-Type: image/gif");
    }
    
    if(strpos($url,".png"))
    {
        header("Content-Type: image/png");
    }
    readfile($url);
    ?>
    
    • This reply was modified 1 year, 5 months ago by caemor.
    • This reply was modified 1 year, 5 months ago by caemor.
    • This reply was modified 1 year, 5 months ago by caemor.
    • This reply was modified 1 year, 5 months ago by caemor.
    Plugin Author cmeeren

    (@cmeeren)

    I don’t really understand what you’re attempting, but it seems you have found the solution you’re looking for? Let me know if not.

    Well I am having the same problem as this person here: https://wordpress.org/support/topic/sync-of-book-covers-for-privacy-laws-in-europe/

    For the solution: No I didn’t have the time yet to test it and I am not this proficient with php and even more with wordpress plugins 🙁

    Once more for clarification what I am trying to do:
    At the moment when you visit a site with this plugin installed you also connect to the gr-assets.com server and therefore give them your IP (which according to the gpdr is already protectable data 🙁 ), which makes this plugin sadly a bit more difficult to use for european users (you would need to get a data protection agreement with goodreads).

    Now a possible solution would be adding an option to this great plugin, where the imagedata is redirected through the wordpress server and therefore is no longer external (and gr-assets only sees the servers ip).

    If I found it correctly https://github.com/cmeeren/gr-progress/blob/master/src/gr-progress/includes/gr_progress_cvdm_backend.php#L200 is where this option would need to do its work. Instead of the current line there would need to be sth like:

    echo "<div class='coverImage'><img alt='Book cover' src='<strong>{$optional_redirect_url}</strong>{$book->getCoverURL()}' /></div>";

    Where the optional_redirect_url would be the optional path to the php file from above which just redirects the cover image through your server. (https://link-to-your-php-skript.com/img.php?)

    The drawback of this option is that your server has a slightly higher workload of redirecting an additional 3-10 (depending on the amout of book covers one chooses to show) images.

    • This reply was modified 1 year, 5 months ago by caemor.
    • This reply was modified 1 year, 5 months ago by caemor.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cache goodreads asset on server?’ is closed to new replies.