Title: Small tip to improve plugin code and compatibility
Last modified: July 2, 2018

---

# Small tip to improve plugin code and compatibility

 *  Resolved [Česlav Przywara](https://wordpress.org/support/users/chesio/)
 * (@chesio)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/small-tip-to-improve-plugin-code-and-compatibility/)
 * 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](https://developer.wordpress.org/reference/functions/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](https://wordpress.org/support/users/webbistro/)
 * (@webbistro)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/small-tip-to-improve-plugin-code-and-compatibility/#post-10470672)
 * Hello [@chesio](https://wordpress.org/support/users/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
 *  Thread Starter [Česlav Przywara](https://wordpress.org/support/users/chesio/)
 * (@chesio)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/small-tip-to-improve-plugin-code-and-compatibility/#post-10500761)
 * Hi [@webbistro](https://wordpress.org/support/users/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](https://wordpress.org/support/users/webbistro/)
 * (@webbistro)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/small-tip-to-improve-plugin-code-and-compatibility/#post-10680087)
 * 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)

The topic ‘Small tip to improve plugin code and compatibility’ is closed to new 
replies.

 * ![](https://ps.w.org/enhanced-media-library/assets/icon-256x256.png?rev=980107)
 * [Enhanced Media Library](https://wordpress.org/plugins/enhanced-media-library/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enhanced-media-library/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enhanced-media-library/)
 * [Active Topics](https://wordpress.org/support/plugin/enhanced-media-library/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enhanced-media-library/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enhanced-media-library/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [webbistro](https://wordpress.org/support/users/webbistro/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/small-tip-to-improve-plugin-code-and-compatibility/#post-10680087)
 * Status: resolved