• Hi there,

    I just have a plugin that has an annoying banner. Normally it is very easy to eliminate such things using the code snippets. However there is an error and I cannot activate the snipped. I found this code from a forum and a lot of people had good results with it. However I cannot apply it. I have also no idea what the error is and how to fix this. The snipped code for the PHP would be something like this:

    function eliminar_marca_seraphinite() { ?> <script> document.addEventListener(“DOMContentLoaded”, function() { var enlacesConImagen = document.querySelectorAll(‘a img[alt=”Seraphinite Accelerator”]’); enlacesConImagen.forEach(function(imagen) { var enlace = imagen.closest(‘a’); if (enlace) { enlace.style.display = “none”; } }); }); </script> <?php } add_action(‘wp_footer’, ‘eliminar_marca_seraphinite’);

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    This sort of snippet is very dependent on the specific markup the banner uses. Can you provide an example site with the banner on it you’d like to get rid of, or a link to the plugin/theme that adds it?

    Thread Starter cedricbaguilar

    (@cedricbaguilar)

    Hi there,

    Thanks a lot for your answer. I manages to resolve the issue when editing directly the file of the plugin.

    However I guess this is only a temporary solution as once I update the plugin it would always reappear. The plugin is called Seraphinite Accelerator and they use a banner in the footer to promote their plugin. I totally respect that but this really harms my brand image. Therefore with a bit of coding I guess it could have been resolved. Now what I did was directly edit the code here and put in “none” where there was “inline-block” or “block” to stop the banner from showing.

    Unfortunately I did not manage to do this using code snippets. Maybe you want to have a look at it?

    if( $ctxProcess[ 'mode' ] == 'full' )
    {
        $itemhuddqr = HtmlNd::Parse(
            Ui::Tag( 'a',
                Ui::TagOpen( 'img', array( 'src' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAFxIAABcSAWef0lIAAABOUExURUdwTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANyQSi4AAAAZdFJOUwAU7Y9RHUj2hSgEu6fGceGYMw17PLDWXGe4ORhvAAAAz0lEQVQoz42S2RaDIAxEQUBkEXCX///RYtVY28TTPHJhEmbC2J+lFuHmGNtpqO0PlC5fFYW5wUWXQ/1xIScOkDvtpel7NYYWeCUPOjpxNes8XBj2g+beSEKTZlOuv6c0FXDLFPJF6G9RC+pTvMctmgpsFQuBcDDnQlzmhMONYrLKho7A7x/Da3M5kuFto5HS69s3QTzdoyWkw+FYh0FzJpowOoDbCOTXMowInoF6hMr8JM0E4BqN4Um6LN1BNb4jLD1Iv+WL2bMkY7RrEve3L/wzFnTO5UlaAAAAAElFTkSuQmCC', 'alt' => Wp::GetLocString( 'Seraphinite Accelerator', null, 'seraphinite-accelerator' ), 'style' => array_map( $ctxProcess[ 'isAMP' ] ? function( $v ) { return( $v ); } : function( $v ) { return( '' . $v . '!important' ); }, array( 'display' => 'none', 'vertical-align' => 'top', 'position' => 'absolute', 'width' => 'auto', 'height' => 'auto' ) ) ) ) .
                Ui::Tag( 'span', sprintf( __( 'BannerText_%s', 'seraphinite-accelerator' ), Wp::GetLocString( 'Seraphinite Accelerator', null, 'seraphinite-accelerator' ) ) . Ui::TagOpen( 'br' ) . Ui::Tag( 'span', Wp::GetLocString( 'Turns on site high speed to be attractive for people and search engines.', null, 'seraphinite-accelerator' ), array( 'style' => array_map( $ctxProcess[ 'isAMP' ] ? function( $v ) { return( $v ); } : function( $v ) { return( '' . $v . '!important' ); }, array( 'font-size' => '0.7em' ) ) ) ), array( 'style' => array_map( $ctxProcess[ 'isAMP' ] ? function( $v ) { return( $v ); } : function( $v ) { return( '' . $v . '!important' ); }, array( 'display' => 'none', 'text-align' => 'left', 'vertical-align' => 'top', 'font-size' => '16px', 'padding-left' => '36px' ) ) ) ) .
                ( !$ctxProcess[ 'isAMP' ] ? Ui::Tag( 'script', '(function(){var c=document.currentScript.parentNode;setTimeout(function(){var x=new window.XMLHttpRequest();x.onload=function(){if(this.status==200&&this.responseText=="f")c.outerHTML="";};x.open("GET","?seraph_accel_gbnr",true);x.send()},0)})()', array( 'seraph-accel-crit' => '1' ) ) : '' )
            , array( 'href' => Plugin::RmtCfgFld_GetLoc( PluginRmtCfg::Get(), 'Links.FrontendBannerUrl' ), 'target' => '_blank', 'style' => array_map( $ctxProcess[ 'isAMP' ] ? function( $v ) { return( $v ); } : function( $v ) { return( '' . $v . '!important' ); }, array( 'display' => 'none', 'clear' => 'both', 'text-align' => 'center', 'position' => 'relative', 'padding' => '0.5em', 'background-color' => 'transparent', 'color' => '#000', 'line-height' => 1 ) ) ) )
        );
        if( $itemhuddqr && $itemhuddqr -> firstChild )
            if( $item = $doc -> importNode( $itemhuddqr -> firstChild, true ) )
                $ctxProcess[ 'ndBody' ] -> appendChild( $item );
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.