diff --git a/includes/plugins.inc b/includes/plugins.inc
index 7b53ae19c..14821869d 100644
--- a/includes/plugins.inc
+++ b/includes/plugins.inc
@@ -429,9 +429,9 @@ function ctools_plugin_load_includes($info, $filename = NULL) {
   // Keep a static array so we don't hit file_scan_directory more than necessary.
   $all_files = &drupal_static(__FUNCTION__, array());
 
-  // Store static of plugin arrays for reference because they can't be
-  // reincluded, so there is no point in using drupal_static().
-  static $plugin_arrays = array();
+  // Load static cache of plugin arrays for reference because they can't be
+  // reincluded.
+  $plugin_arrays = ctools_plugin_include_plugin_file();
 
   if (!isset($all_files[$info['module']][$info['type']])) {
     $cache = cache_get("ctools_plugin_files:$info[module]:$info[type]");
@@ -477,7 +477,7 @@ function ctools_plugin_load_includes($info, $filename = NULL) {
           $identifier = $plugin_arrays[$file->uri];
         }
         else {
-          include_once DRUPAL_ROOT . '/' . $file->uri;
+          $plugin_arrays = ctools_plugin_include_plugin_file($file->uri);
           // .inc files have a special format for the hook identifier.
           // For example, 'foo.inc' in the module 'mogul' using the plugin
           // whose hook is named 'borg_type' should have a function named
@@ -485,9 +485,8 @@ function ctools_plugin_load_includes($info, $filename = NULL) {
           // If, however, the .inc file set the quasi-global $plugin array, we
           // can use that and not even call a function. Set the $identifier
           // appropriately and ctools_plugin_process() will handle it.
-          if (isset($plugin)) {
-            $plugin_arrays[$file->uri] = $plugin;
-            $identifier = $plugin;
+          if (isset($plugin_arrays[$file->uri])) {
+            $identifier = $plugin_arrays[$file->uri];
           }
           else {
             $identifier = $module . '_' . $file->name;
@@ -505,6 +504,32 @@ function ctools_plugin_load_includes($info, $filename = NULL) {
   return $plugins;
 }
 
+/**
+ * Load plugin include file.
+ *
+ * Always use this to include plugin files since this will keep track of all
+ * the plugin arrays.
+ *
+ * @param string $uri
+ *   The uri of the file. Will also be used to cache the plugins array. If left
+ *   empty no include will be performed.
+ *
+ * @return array
+ *   The collected plugin information of all includes.
+ */
+function ctools_plugin_include_plugin_file($uri = NULL) {
+  static $plugin_arrays = array();
+  if (!empty($uri)) {
+    require_once DRUPAL_ROOT . '/' . $uri;
+
+    // If a plugin array is set add it tho the cache.
+    if (isset($plugin)) {
+      $plugin_arrays[$uri] = $plugin;
+    }
+  }
+  return $plugin_arrays;
+}
+
 /**
  * Get a list of directories to search for plugins of the given type.
  *
@@ -795,7 +820,7 @@ function ctools_plugin_get_function($plugin_definition, $function_name) {
     // $plugin['file'].  Don't try to run those.
     $info = ctools_plugin_get_info($plugin_definition['plugin module'], $plugin_definition['plugin type']);
     if (empty($info['info file'])) {
-      require_once DRUPAL_ROOT . '/' . $plugin_definition['path'] . '/' . $plugin_definition['file'];
+      ctools_plugin_include_plugin_file($plugin_definition['path'] . '/' . $plugin_definition['file']);
     }
   }
 
@@ -864,7 +889,7 @@ function ctools_plugin_get_class($plugin_definition, $class_name) {
     // $plugin['file'].  Don't try to run those.
     $info = ctools_plugin_get_info($plugin_definition['plugin module'], $plugin_definition['plugin type']);
     if (empty($info['info file'])) {
-      require_once DRUPAL_ROOT . '/' . $plugin_definition['path'] . '/' . $plugin_definition['file'];
+      ctools_plugin_include_plugin_file($plugin_definition['path'] . '/' . $plugin_definition['file']);
     }
   }
 
