WordPress.org

Ready to get started?Download WordPress

Forums

WP SVG Icons
[resolved] Only variables should be passed by reference line 115 (6 posts)

  1. Chirag Vora
    Member
    Posted 1 year ago #

    Getting this warning in logs again and again about line 115

    [09-Feb-2014 22:20:19 UTC] PHP Strict Standards:  Only variables should be passed by reference in /htdocs/wp-content/plugins/svg-vector-icon-plugin/wordpress-svg-icons-plugin.php on line 115
    $urlBasename = array_pop(explode('/', $actual_link));

    https://wordpress.org/plugins/svg-vector-icon-plugin/

  2. Chirag Vora
    Member
    Posted 1 year ago #

    Also receiving this for line 137

    $urlBasename = array_pop(explode('/', $actual_link));
  3. Evan Herman
    Member
    Plugin Author

    Posted 1 year ago #

    Hm,

    I think I know what the issue is. Fortunately the issue isn't going to affect the plugin. It is just a warning to let you know. I will re-code this section of the plugin to avoid this error, and I will push out an update. Thank you for making me aware of the issue Chirag!

    Evan

  4. Evan Herman
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chirag Vora,

    This issue will be resolved in the latest version of the plugin. If you'd like to resolve the issue yourself (or any one else reading this) you can do so by replacing the following lines inside of the main plugin file, wordpress-svg-icons-plugin.php

    Open that file, and search for this function:
    wp_svg_change_downloads_upload_dir()

    replace the code within this function with these lines:

    $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    
    	$exploded_link = explode('/', $actual_link);
    
    	$urlBasename = array_pop($exploded_link);
    
    	if ($urlBasename == 'admin.php?page=wp-svg-icons-upload-custom-pack' ) {
    
    		add_filter( 'upload_dir', 'wp_svg_set_upload_dir' );
    
    	}

    Now the function right below it,wp_svg_customPack_installed_error(). Replace the first three lines of code within this function with this code:

    $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    
    		$exploded_link = explode('/', $actual_link);
    
    		$urlBasename = array_pop($exploded_link);

    This should remove the warnings being thrown by the wp_debug. Sorry about that!

  5. Chirag Vora
    Member
    Posted 1 year ago #

    Thank you for reply Evan. You don't have anything to be sorry about. Your plugins is awesome. I have an addition query. Does this support IE below v8 and old versions of android?

  6. Chirag Vora
    Member
    Posted 1 year ago #

    Btw, custom icon packs are not showing up.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.