Small tip to improve plugin code and compatibility
-
Hi,
I have a small tip for improvement. On line
176
inenhanced-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 defaultfalse
, but in your case an array would make more sense – see the next line, which hasisset($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 ??
- The topic ‘Small tip to improve plugin code and compatibility’ is closed to new replies.