Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    This branch has been merged into the master, so is now part of the plugin. Do you have any specific issues with blocking images at the moment?

    Thread Starter dobicki

    (@dobicki)

    Hi Rogier.

    Thank you for the quick feedback.
    Yes indeed I have this ratings widget right here. It loads a png from an external source and i would like to have that blocket.

    I had been able to to add custom scripts to the script center before. That all worked splendidly. However with the images I am adraid I missed something.

    https://pflegeberatung-sattelberger.de/promedica/

    Hope you can point me in the right direction.

    Kind regards

    Roman

    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @dobicki,

    You can upload the attached code as a PHP file to the folder /wp-content/mu-plugins/, which will block the image (the one seen on the URL you attached) prior to consent.

    You can see an example in action on this URL.

    <?php
    
    defined( 'ABSPATH' ) or die( "you do not have acces to this page!" );
    
    /**
    * Block the image
    *
    * @param $tags
    *
    * @return array
    */
    
    function cmplz_block_image_sources( $tags ) {
    	$tags[] = 'provenexpert.com';
    
    	return $tags;
    }
    add_filter( 'cmplz_image_tags', 'cmplz_block_image_sources' );

    Hope it helps!
    Kind regards,
    Jarno

    Thread Starter dobicki

    (@dobicki)

    Hi Jarno.

    Thank you so much. Now I understand how this works. 😀

    Cheers

    Roman

    Thread Starter dobicki

    (@dobicki)

    hm.
    Sadly it is still not working.
    Checkt the mu-plugins Path, checked your code, cleared all the page cache.

    Am I forgetting something?

    _

    Update:
    Weirdly enough now it works. I generated a new testpage, pasted the widget code again, deleted and reuploaded the php file to the mu-plugins folder and now it does work.
    https://pflegeberatung-sattelberger.de/test/

    Must have been a cache problem after all.

    Anyway many thanks for your help.

    Kind regards

    Roman

    • This reply was modified 2 years, 1 month ago by dobicki.
    Plugin Contributor Mathieu Paapst

    (@paapst)

    Hi @dobicki

    Great to hear that your issue is resolved! Could you tell us what you think of the plugin or the support by casting your Review here? We’d love to hear your feedback!

    It worked also for me! Also for an image of service “Proven Expert”.

    Thanks much!

    Robert

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Block external image src – NEW’ is closed to new replies.