Support » Plugin: MultilingualPress » Tab MultilingualPress not displayed with plugin SVG Support

  • Resolved ChrisFo

    (@chrisfo)


    WP-Admin > MS Network > All Sites > Site > Tab MultilingualPress (2.5.0) will not show up when plugin SVG Support 2.3.4 is active in my WP 4.7.1 MS installation with currently two sites. Deactivating plugin SVG Support displays the Tab of MP as expected.

    Not sure if this is related to Does not work if an .svg is in the page which seems more like a post/edit issue to me.

    So I have no clue what might cause this problem and are thankful if this incompatibility could be resolved. If I need to post to “SVG Support” Forum I gladly will do.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hey,
    I’ll take a look and see if I can figure out what’s happening.

    I forgot ot tick “Notify me of follow-up replies via email”, so this post is just for that.

    Plugin Contributor Thorsten Frommen

    (@tfrommen)

    Hi there,

    I will also have a look at this.

    Plugin Contributor Thorsten Frommen

    (@tfrommen)

    @benbodhi since you are watching this thread, I will write this here: on (network) activation, I got a PHP warning:

    PHP Warning: array_merge(): Argument #2 is not an array in …\\path\\to\\wordpress\\wp-content\\plugins\\svg-support\\one-time-upgrade-activate.php on line 15, referer: http://example.com/wp-admin/network/plugin-install.php?s=svg-support&tab=search&type=term

    Plugin is active, but this is, of course, something you should have a look at.

    Plugin Contributor Thorsten Frommen

    (@tfrommen)

    I believe, I found it. There is an output buffering clash.

    In svg-support/functions/thumbnail-display.php, there is the function bodhi_svgs_display_thumbs() that starts output buffering.

    The function should do it like so:

    add_action( 'admin_init', 'bodhi_svgs_display_thumbs' );
    function bodhi_svgs_display_thumbs() {
    
    	function bodhi_svgs_thumbs_filter( $content ) {
    
    	    return apply_filters( 'final_output', $content );
    
    	}
    
    	ob_start( 'bodhi_svgs_thumbs_filter' );
    
    	add_filter( 'final_output', 'bodhi_svgs_final_output' );
    	function bodhi_svgs_final_output( $content ) {
    
    		// The current function here.
    
    	}
    
    }

    The difference is that the new code does not call ob_get_clean() itself, but simply gets called when output buffering is complete.

    Also, in the current code, there is $ob_levels = count( ob_get_level() );, which is wrong. It should be $ob_levels = ob_get_level(); as the result is already an integer. But, that code is obsolete now anyway.

    @benbodhi can you check this works for you, and whether or not you like it? 🙂

    Cheers,
    Thorsten

    P.S.: are you sure this function should run on every page no matter what?

    Hey @tfrommen,

    Thanks so much for taking a look into this! I’d love for our plugins to “play nicely”.
    I’ll try the code out that you mentioned and update accordingly.
    Also, thank you for pointing out that it is running ALL of the time, I will also make a conditional to control when to run that.

    Wow, thank you Benbodhi for noticing and writing here and to both for the cooperation to solve this. The code is above my understanding but I hope with the next update/s all may be solved. It is very nice to see how you act nicely and constructively with each other seeking to improve the code situation!
    This is WP Plugins at its best!

    • This reply was modified 3 years, 9 months ago by ChrisFo.

    Hi @tfrommen,

    I tested your code and all seems fine, so I have included it in the latest update (2.3.5) of SVG Support. Thank you for that 🙂
    Let me know if there is still issues.

    Out of curiosity, I removed that file completely and the thumbnails displayed correctly anyway… So I will be looking into which versions of WP need it at all and leaving it out completely for the rest.

    @chrisfo, thanks for your support and patience!

    Thank you @benbodhi and @tfrommen,
    I can confirm with SVG Support 2.3.5 activated the Tab MultilingualPress (2.5.0) is shown as expected. Great!

    Awesome, thanks for letting us know @chrisfo

    Plugin Contributor Thorsten Frommen

    (@tfrommen)

    Well, that went all nicely and smoothly! 🙂

    Have a great day, @chrisfo and @benbodhi.

    Marking this resolved now.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Tab MultilingualPress not displayed with plugin SVG Support’ is closed to new replies.