Support » Plugin: Enhanced Media Library » Small tip to improve plugin code and compatibility

  • Resolved chesio

    (@chesio)



    Hi,

    I have a small tip for improvement. On line 176 in enhanced-media-library.php, a list of sitewide active plugins is retrieved via $plugins = get_site_option('active_sitewide_plugins');. This call could be improved to: $plugins = get_site_option('active_sitewide_plugins', array()); – notice the second parameter.

    Background: if there is no value for active_sitewide_plugins option in database, the get_site_option function returns the value of its second argument which is by default false, but in your case an array would make more sense – see the next line, which has isset($plugins[wpuxss_get_eml_basename()] test in it.

    I noticed this, because some plugins filter the active_sitewide_plugins option and expect the passed value to be an array, but the way in which this option is retrieved in your plugin makes them complain 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author webbistro

    (@webbistro)

    Hello @chesio,

    Thank you very much! We are about to release an improved version exactly for multisite. Will check all cases like this and improve the code.

    Best,
    -Nadia

    chesio

    (@chesio)

    Hi @webbistro,

    I’m looking forward to it!

    Btw. I’ve found one more instance of the same problem on line 650 in the same file (in wpuxss_eml_on_activation function).

    All the best,
    Česlav

    Plugin Author webbistro

    (@webbistro)

    Hi Česlav,

    Thank you! We improved the code of v2.7.1 Please update.

    Best,
    -Nadia

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.