/**
  * Checks whether a specific plugin (version) dependency is met.
  *
  * If no version is provided, the method will simply check if the plugin is active in any version.
  * The third parameter is used to ensure that a dependency is active network-wide, for example
  * if the dependant plugin is activated network-wide.
  *
  * Only the exact return value of a boolean `true` signalizes a successful check.
  *
  * @since 1.5.0
  * @param string $plugin either a plugin slug, plugin basename or plugin path
  * @param string $version required version number (or empty if no specific version needed)
  * @param boolean $must_network_wide whether the dependency must be active network-wide
  * @return boolean|string true if the dependency is met, otherwise the current version or 'SITEONLY' or the current version prefixed with 'MU' for a must-use plugin
  */
 private static function _check_plugin($plugin, $version = '', $must_network_wide = false)
 {
     $plugin_slug = LaL_WP_Plugin_Util::make_plugin_slug($plugin);
     if (isset(self::$plugins[$plugin_slug])) {
         if ($must_network_wide && !self::_is_network_wide_plugin($plugin_slug)) {
             return 'SITEONLY';
         }
         $plugin_class = get_class(self::$plugins[$plugin_slug]);
         $plugin_mode = call_user_func(array($plugin_class, 'get_info'), 'mode');
         if ('muplugin' === $plugin_mode || 'plugin' === $plugin_mode) {
             if (!empty($version)) {
                 $plugin_version = call_user_func(array($plugin_class, 'get_info'), 'version');
                 if (version_compare($plugin_version, $version) < 0) {
                     if ('muplugin' === $plugin_mode) {
                         return 'MU' . $plugin_version;
                     }
                     return $plugin_version;
                 }
             }
             return true;
         }
     }
     if (!function_exists('get_plugin_data')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $muplugin_basename = LaL_WP_Plugin_Util::make_muplugin_basename($plugin);
     if (file_exists(WPMU_PLUGIN_DIR . '/' . $muplugin_basename)) {
         if (!empty($version)) {
             $plugin_data = get_plugin_data(WPMU_PLUGIN_DIR . '/' . $muplugin_basename);
             if ($plugin_data && isset($plugin_data['Version'])) {
                 if (version_compare($plugin_data['Version'], $version) < 0) {
                     return 'MU' . $plugin_data['Version'];
                 }
             }
         }
         return true;
     }
     $plugin_basename = LaL_WP_Plugin_Util::make_plugin_basename($plugin);
     if (is_plugin_active($plugin_basename)) {
         if ($must_network_wide && !is_plugin_active_for_network($plugin_basename)) {
             return 'SITEONLY';
         }
         if (!empty($version)) {
             $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_basename);
             if ($plugin_data && isset($plugin_data['Version'])) {
                 if (version_compare($plugin_data['Version'], $version) < 0) {
                     return $plugin_data['Version'];
                 }
             }
         }
         return true;
     }
     return false;
 }
 /**
  * Creates a full URL from a path relative to the plugin's directory.
  *
  * @since 1.5.0
  * @param string $path path relative to this plugin's directory
  * @return string full URL to be used for loading assets for example
  */
 public static function get_url($path = '')
 {
     $base_path = '';
     switch (static::$_args['mode']) {
         case 'bundled-childtheme':
             $base_path = get_stylesheet_directory_uri() . str_replace(wp_normalize_path(get_stylesheet_directory()), '', wp_normalize_path(dirname(static::$_args['main_file'])));
             break;
         case 'bundled-theme':
             $base_path = get_template_directory_uri() . str_replace(wp_normalize_path(get_template_directory()), '', wp_normalize_path(dirname(static::$_args['main_file'])));
             break;
         case 'muplugin':
             $base_path = plugin_dir_url(dirname(static::$_args['main_file']) . '/' . static::$_args['slug'] . '/composer.json');
             break;
         case 'bundled-muplugin':
         case 'bundled-plugin':
         case 'plugin':
         default:
             $base_path = plugin_dir_url(static::$_args['main_file']);
     }
     return \LaL_WP_Plugin_Util::build_path($base_path, $path);
 }