diff --git a/core/modules/filter/filter.admin.inc b/core/modules/filter/filter.admin.inc
index 4cc4a1f..731c960 100644
--- a/core/modules/filter/filter.admin.inc
+++ b/core/modules/filter/filter.admin.inc
@@ -187,26 +187,6 @@ function filter_admin_format_form($form, &$form_state, $format) {
     $form['roles']['#default_value'] = array($admin_role);
   }
 
-  // Retrieve available filters and load all configured filters for existing
-  // text formats.
-  $filter_info = filter_get_filters();
-  $filters = !empty($format->format) ? filter_list_format($format->format) : array();
-
-  // Prepare filters for form sections.
-  foreach ($filter_info as $name => $filter) {
-    // Create an empty filter object for new/unconfigured filters.
-    if (!isset($filters[$name])) {
-      $filters[$name] = new stdClass();
-      $filters[$name]->format = $format->format;
-      $filters[$name]->module = $filter['module'];
-      $filters[$name]->name = $name;
-      $filters[$name]->status = 0;
-      $filters[$name]->weight = $filter['weight'];
-      $filters[$name]->settings = array();
-    }
-  }
-  $form['#filters'] = $filters;
-
   // Filter status.
   $form['filters']['status'] = array(
     '#type' => 'item',
@@ -218,16 +198,6 @@ function filter_admin_format_form($form, &$form_state, $format) {
     // @see http://drupal.org/node/1829202
     '#input' => FALSE,
   );
-  foreach ($filter_info as $name => $filter) {
-    $form['filters']['status'][$name] = array(
-      '#type' => 'checkbox',
-      '#title' => $filter['title'],
-      '#default_value' => $filters[$name]->status,
-      '#parents' => array('filters', $name, 'status'),
-      '#description' => $filter['description'],
-      '#weight' => $filter['weight'],
-    );
-  }
 
   // Filter order (tabledrag).
   $form['filters']['order'] = array(
@@ -239,43 +209,61 @@ function filter_admin_format_form($form, &$form_state, $format) {
     // @see http://drupal.org/node/1829202
     '#input' => FALSE,
   );
-  foreach ($filter_info as $name => $filter) {
+
+  // Filter settings.
+  $form['filter_settings'] = array(
+    '#type' => 'vertical_tabs',
+    '#title' => t('Filter settings'),
+  );
+
+  // Retrieve available filters and load all configured filters for existing
+  // text formats.
+  $filters = !empty($format->format) ? filter_list_format($format->format) : array();
+
+  // Prepare filters for form sections.
+  foreach (filter_get_filters() as $name => $filter) {
+    // Create an empty filter object for new/unconfigured filters.
+    if (!isset($filters[$name])) {
+      $filters[$name] = $format->filterPlugins->get($name);
+    }
+  }
+  $form['#filters'] = $filters;
+
+  foreach ($filters as $name => $filter) {
+    $form['filters']['status'][$name] = array(
+      '#type' => 'checkbox',
+      '#title' => $filter->title,
+      '#default_value' => $filter->status,
+      '#parents' => array('filters', $name, 'status'),
+      '#description' => $filter->description,
+      '#weight' => $filter->weight,
+    );
+
     $form['filters']['order'][$name]['filter'] = array(
-      '#markup' => $filter['title'],
+      '#markup' => $filter->title,
     );
     $form['filters']['order'][$name]['weight'] = array(
       '#type' => 'weight',
-      '#title' => t('Weight for @title', array('@title' => $filter['title'])),
+      '#title' => t('Weight for @title', array('@title' => $filter->title)),
       '#title_display' => 'invisible',
       '#delta' => 50,
-      '#default_value' => $filters[$name]->weight,
+      '#default_value' => $filter->weight,
       '#parents' => array('filters', $name, 'weight'),
     );
-    $form['filters']['order'][$name]['#weight'] = $filters[$name]->weight;
-  }
-
-  // Filter settings.
-  $form['filter_settings'] = array(
-    '#type' => 'vertical_tabs',
-    '#title' => t('Filter settings'),
-  );
-
-  foreach ($filter_info as $name => $filter) {
-    if (isset($filter['settings callback'])) {
-      $function = $filter['settings callback'];
-      // Pass along stored filter settings and default settings, but also the
-      // format object and all filters to allow for complex implementations.
-      $settings_form = $function($form, $form_state, $filters[$name], $format, $filter['default settings'], $filters);
-      if (!empty($settings_form)) {
-        $form['filters']['settings'][$name] = array(
-          '#type' => 'details',
-          '#title' => $filter['title'],
-          '#parents' => array('filters', $name, 'settings'),
-          '#weight' => $filter['weight'],
-          '#group' => 'filter_settings',
-        );
-        $form['filters']['settings'][$name] += $settings_form;
-      }
+    $form['filters']['order'][$name]['#weight'] = $filter->weight;
+
+    // Pass along stored filter settings and default settings, but also the
+    // format object and all filters to allow for complex implementations.
+    $settings_form = $filter->settingsForm($form, $form_state);
+    if (!empty($settings_form)) {
+      $form['filters']['settings'][$name] = array(
+        '#type' => 'details',
+        '#title' => $filter->title,
+        '#parents' => array('filters', $name, 'settings'),
+        '#weight' => $filter->weight,
+        '#group' => 'filter_settings',
+      );
+      $form['filters']['settings'][$name] += $settings_form;
     }
   }
 
diff --git a/core/modules/filter/filter.api.php b/core/modules/filter/filter.api.php
index c041eb4..8d6aa01 100644
--- a/core/modules/filter/filter.api.php
+++ b/core/modules/filter/filter.api.php
@@ -11,272 +11,19 @@
  */
 
 /**
- * Define content filters.
- *
- * User submitted content is passed through a group of filters before it is
- * output in HTML, in order to remove insecure or unwanted parts, correct or
- * enhance the formatting, transform special keywords, etc. A group of filters
- * is referred to as a "text format". Administrators can create as many text
- * formats as needed. Individual filters can be enabled and configured
- * differently for each text format.
- *
- * This hook is invoked by filter_get_filters() and allows modules to register
- * input filters they provide.
- *
- * Filtering is a two-step process. First, the content is 'prepared' by calling
- * the 'prepare callback' function for every filter. The purpose of the
- * 'prepare callback' is to escape HTML-like structures. For example, imagine a
- * filter which allows the user to paste entire chunks of programming code
- * without requiring manual escaping of special HTML characters like < or &. If
- * the programming code were left untouched, then other filters could think it
- * was HTML and change it. For many filters, the prepare step is not necessary.
- *
- * The second step is the actual processing step. The result from passing the
- * text through all the filters' prepare steps gets passed to all the filters
- * again, this time with the 'process callback' function. The process callbacks
- * should then actually change the content: transform URLs into hyperlinks,
- * convert smileys into images, etc.
- *
- * For performance reasons content is only filtered once; the result is stored
- * in the cache table and retrieved from the cache the next time the same piece
- * of content is displayed. If a filter's output is dynamic, it can override
- * the cache mechanism, but obviously this should be used with caution: having
- * one filter that does not support caching in a particular text format
- * disables caching for the entire format, not just for one filter.
- *
- * Beware of the filter cache when developing your module: it is advised to set
- * your filter to 'cache' => FALSE while developing, but be sure to remove that
- * setting if it's not needed, when you are no longer in development mode.
- *
- * @return
- *   An associative array of filters, whose keys are internal filter names,
- *   which should be unique and therefore prefixed with the name of the module.
- *   Each value is an associative array describing the filter, with the
- *   following elements (all are optional except as noted):
- *   - title: (required) An administrative summary of what the filter does.
- *   - description: Additional administrative information about the filter's
- *     behavior, if needed for clarification.
- *   - settings callback: The name of a function that returns configuration
- *     form elements for the filter. See hook_filter_FILTER_settings() for
- *     details.
- *   - default settings: An associative array containing default settings for
- *     the filter, to be applied when the filter has not been configured yet.
- *   - prepare callback: The name of a function that escapes the content before
- *     the actual filtering happens. See hook_filter_FILTER_prepare() for
- *     details.
- *   - process callback: (required) The name the function that performs the
- *     actual filtering. See hook_filter_FILTER_process() for details.
- *   - cache (default TRUE): Specifies whether the filtered text can be cached.
- *     Note that setting this to FALSE makes the entire text format not
- *     cacheable, which may have an impact on the site's overall performance.
- *     See filter_format_allowcache() for details.
- *   - tips callback: The name of a function that returns end-user-facing
- *     filter usage guidelines for the filter. See hook_filter_FILTER_tips()
- *     for details.
- *   - weight: A default weight for the filter in new text formats.
- *
- * @see filter_example.module
- * @see hook_filter_info_alter()
- */
-function hook_filter_info() {
-  $filters['filter_html'] = array(
-    'title' => t('Limit allowed HTML tags'),
-    'description' => t('Allows you to restrict the HTML tags the user can use. It will also remove harmful content such as JavaScript events, JavaScript URLs and CSS styles from those tags that are not removed.'),
-    'process callback' => '_filter_html',
-    'settings callback' => '_filter_html_settings',
-    'default settings' => array(
-      'allowed_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>',
-      'filter_html_help' => 1,
-      'filter_html_nofollow' => 0,
-    ),
-    'tips callback' => '_filter_html_tips',
-  );
-  $filters['filter_autop'] = array(
-    'title' => t('Convert line breaks'),
-    'description' => t('Converts line breaks into HTML (i.e. &lt;br&gt; and &lt;p&gt;) tags.'),
-    'process callback' => '_filter_autop',
-    'tips callback' => '_filter_autop_tips',
-  );
-  return $filters;
-}
-
-/**
  * Perform alterations on filter definitions.
  *
  * @param $info
- *   Array of information on filters exposed by hook_filter_info()
- *   implementations.
+ *   Array of information on filters exposed by filter plugins.
  */
 function hook_filter_info_alter(&$info) {
-  // Replace the PHP evaluator process callback with an improved
-  // PHP evaluator provided by a module.
-  $info['php_code']['process callback'] = 'my_module_php_evaluator';
-
   // Alter the default settings of the URL filter provided by core.
-  $info['filter_url']['default settings'] = array(
+  $info['filter_url']['default_settings'] = array(
     'filter_url_length' => 100,
   );
 }
 
 /**
- * @} End of "addtogroup hooks".
- */
-
-/**
- * Settings callback for hook_filter_info().
- *
- * Note: This is not really a hook. The function name is manually specified via
- * 'settings callback' in hook_filter_info(), with this recommended callback
- * name pattern. It is called from filter_admin_format_form().
- *
- * This callback function is used to provide a settings form for filter
- * settings, for filters that need settings on a per-text-format basis. This
- * function should return the form elements for the settings; the filter
- * module will take care of saving the settings in the database.
- *
- * If the filter's behavior depends on an extensive list and/or external data
- * (e.g. a list of smileys, a list of glossary terms), then the filter module
- * can choose to provide a separate, global configuration page rather than
- * per-text-format settings. In that case, the settings callback function
- * should provide a link to the separate settings page.
- *
- * @param $form
- *   The prepopulated form array of the filter administration form.
- * @param $form_state
- *   The state of the (entire) configuration form.
- * @param $filter
- *   The filter object containing the current settings for the given format,
- *   in $filter->settings.
- * @param $format
- *   The format object being configured.
- * @param $defaults
- *   The default settings for the filter, as defined in 'default settings' in
- *   hook_filter_info(). These should be combined with $filter->settings to
- *   define the form element defaults.
- * @param $filters
- *   The complete list of filter objects that are enabled for the given format.
- *
- * @return
- *   An array of form elements defining settings for the filter. Array keys
- *   should match the array keys in $filter->settings and $defaults.
- */
-function hook_filter_FILTER_settings($form, &$form_state, $filter, $format, $defaults, $filters) {
-  $filter->settings += $defaults;
-
-  $elements = array();
-  $elements['nofollow'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Add rel="nofollow" to all links'),
-    '#default_value' => $filter->settings['nofollow'],
-  );
-  return $elements;
-}
-
-/**
- * Prepare callback for hook_filter_info().
- *
- * Note: This is not really a hook. The function name is manually specified via
- * 'prepare callback' in hook_filter_info(), with this recommended callback
- * name pattern. It is called from check_markup().
- *
- * See hook_filter_info() for a description of the filtering process. Filters
- * should not use the 'prepare callback' step for anything other than escaping,
- * because that would short-circuit the control the user has over the order in
- * which filters are applied.
- *
- * @param $text
- *   The text string to be filtered.
- * @param $filter
- *   The filter object containing settings for the given format.
- * @param $format
- *   The text format object assigned to the text to be filtered.
- * @param $langcode
- *   The language code of the text to be filtered.
- * @param $cache
- *   A Boolean indicating whether the filtered text is going to be cached in
- *   {cache_filter}.
- * @param $cache_id
- *   The ID of the filtered text in {cache_filter}, if $cache is TRUE.
- *
- * @return
- *   The prepared, escaped text.
- */
-function hook_filter_FILTER_prepare($text, $filter, $format, $langcode, $cache, $cache_id) {
-  // Escape <code> and </code> tags.
-  $text = preg_replace('|<code>(.+?)</code>|se', "[codefilter_code]$1[/codefilter_code]", $text);
-  return $text;
-}
-
-/**
- * Process callback for hook_filter_info().
- *
- * Note: This is not really a hook. The function name is manually specified via
- * 'process callback' in hook_filter_info(), with this recommended callback
- * name pattern. It is called from check_markup().
- *
- * See hook_filter_info() for a description of the filtering process. This step
- * is where the filter actually transforms the text.
- *
- * @param $text
- *   The text string to be filtered.
- * @param $filter
- *   The filter object containing settings for the given format.
- * @param $format
- *   The text format object assigned to the text to be filtered.
- * @param $langcode
- *   The language code of the text to be filtered.
- * @param $cache
- *   A Boolean indicating whether the filtered text is going to be cached in
- *   {cache_filter}.
- * @param $cache_id
- *   The ID of the filtered text in {cache_filter}, if $cache is TRUE.
- *
- * @return
- *   The filtered text.
- */
-function hook_filter_FILTER_process($text, $filter, $format, $langcode, $cache, $cache_id) {
-  $text = preg_replace('|\[codefilter_code\](.+?)\[/codefilter_code\]|se', "<pre>$1</pre>", $text);
-
-  return $text;
-}
-
-/**
- * Tips callback for hook_filter_info().
- *
- * Note: This is not really a hook. The function name is manually specified via
- * 'tips callback' in hook_filter_info(), with this recommended callback
- * name pattern. It is called from _filter_tips().
- *
- * A filter's tips should be informative and to the point. Short tips are
- * preferably one-liners.
- *
- * @param $filter
- *   An object representing the filter.
- * @param $format
- *   An object representing the text format the filter is contained in.
- * @param $long
- *   Whether this callback should return a short tip to display in a form
- *   (FALSE), or whether a more elaborate filter tips should be returned for
- *   theme_filter_tips() (TRUE).
- *
- * @return
- *   Translated text to display as a tip.
- */
-function hook_filter_FILTER_tips($filter, $format, $long) {
- if ($long) {
-    return t('Lines and paragraphs are automatically recognized. The &lt;br /&gt; line break, &lt;p&gt; paragraph and &lt;/p&gt; close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.');
-  }
-  else {
-    return t('Lines and paragraphs break automatically.');
-  }
-}
-
-/**
- * @addtogroup hooks
- * @{
- */
-
-/**
  * Perform actions when a text format has been disabled.
  *
  * @param $format
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index 3ff344c..7e83c2c 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -478,19 +478,11 @@ function filter_get_filter_types_by_format($format_id) {
   $filter_types = array();
 
   $filters = filter_list_format($format_id);
-
-  // Ignore filters that are disabled.
-  $filters = array_filter($filters, function($filter) {
-    return $filter->status;
-  });
-
-  $filters_info = filter_get_filters();
   foreach ($filters as $filter) {
-    if (!isset($filters_info[$filter->name]['type'])) {
-      throw new Exception(t('Filter %filter has no type specified.', array ('%filter' => $filter->name)));
+    // Ignore filters that are disabled.
+    if ($filter->status) {
+      $filter_types[] = $filter->type;
     }
-
-    $filter_types[] = $filters_info[$filter->name]['type'];
   }
 
   return array_unique($filter_types);
@@ -556,41 +548,13 @@ function filter_get_filters() {
   $filters = &drupal_static(__FUNCTION__, array());
 
   if (empty($filters)) {
-    foreach (module_implements('filter_info') as $module) {
-      $info = module_invoke($module, 'filter_info');
-      if (isset($info) && is_array($info)) {
-        // Assign the name of the module implementing the filters and ensure
-        // default values.
-        foreach (array_keys($info) as $name) {
-          $info[$name]['module'] = $module;
-          $info[$name] += array(
-            'description' => '',
-            'weight' => 0,
-            'default settings' => array(),
-          );
-        }
-        $filters = array_merge($filters, $info);
-      }
-    }
-    // Allow modules to alter filter definitions.
-    drupal_alter('filter_info', $filters);
-
-    uasort($filters, '_filter_list_cmp');
+    $filters = drupal_container()->get('plugin.manager.filter')->getDefinitions();
   }
 
   return $filters;
 }
 
 /**
- * Sorts an array of filters by filter name.
- *
- * Callback for uasort() within filter_get_filters().
- */
-function _filter_list_cmp($a, $b) {
-  return strcmp($a['title'], $b['title']);
-}
-
-/**
  * Checks if the text in a certain text format is allowed to be cached.
  *
  * This function can be used to check whether the result of the filtering
@@ -627,10 +591,8 @@ function _filter_format_is_cacheable($format) {
   if (empty($format->filters)) {
     return TRUE;
   }
-  $filter_info = filter_get_filters();
-  foreach ($format->filters as $name => $filter) {
-    // By default, 'cache' is TRUE for all filters unless specified otherwise.
-    if (!empty($filter['status']) && isset($filter_info[$name]['cache']) && !$filter_info[$name]['cache']) {
+  foreach ($format->filterPlugins as $name => $filter) {
+    if ($filter->status && !$filter->cache) {
       return FALSE;
     }
   }
@@ -654,7 +616,6 @@ function _filter_format_is_cacheable($format) {
  */
 function filter_list_format($format_id) {
   $filters = &drupal_static(__FUNCTION__, array());
-  $filter_info = filter_get_filters();
 
   if (!isset($filters['all'])) {
     if ($cache = cache()->get('filter_list_format')) {
@@ -664,35 +625,15 @@ function filter_list_format($format_id) {
       $filter_formats = filter_formats();
       foreach ($filter_formats as $filter_format) {
         foreach ($filter_format->filters as $filter_name => $filter) {
-          $filter['name'] = $filter_name;
-          $filters['all'][$filter_format->format][$filter_name] = $filter;
-        }
-        uasort($filters['all'][$filter_format->format], 'Drupal\filter\Plugin\Core\Entity\FilterFormat::sortFilters');
-        // Convert filters into objects.
-        // @todo Retain filters as arrays or convert to plugins.
-        foreach ($filters['all'][$filter_format->format] as $filter_name => $filter) {
-          $filters['all'][$filter_format->format][$filter_name] = (object) $filter;
+          $filters['all'][$filter_format->format][$filter_name] = $filter_format->filterPlugins->get($filter_name);
         }
       }
       cache()->set('filter_list_format', $filters['all']);
     }
   }
 
-  if (!isset($filters[$format_id])) {
-    $format_filters = array();
-    $filter_map = isset($filters['all'][$format_id]) ? $filters['all'][$format_id] : array();
-    foreach ($filter_map as $name => $filter) {
-      if (isset($filter_info[$name])) {
-        $filter->title = $filter_info[$name]['title'];
-
-        $filter->settings = isset($filter->settings) ? $filter->settings : array();
-        // Merge in default settings.
-        $filter->settings += $filter_info[$name]['default settings'];
-
-        $format_filters[$name] = $filter;
-      }
-    }
-    $filters[$format_id] = $format_filters;
+  if (!isset($filters[$format_id]) && isset($filters['all'][$format_id])) {
+    $filters[$format_id] = $filters['all'][$format_id];
   }
 
   return isset($filters[$format_id]) ? $filters[$format_id] : array();
@@ -768,29 +709,26 @@ function check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE,
 
   // Get a complete list of filters, ordered properly.
   $filters = filter_list_format($format->format);
-  $filter_info = filter_get_filters();
 
   // Give filters the chance to escape HTML-like data such as code or formulas.
   foreach ($filters as $name => $filter) {
     // If necessary, skip filters of a certain type.
-    if (in_array($filter_info[$name]['type'], $filter_types_to_skip)) {
+    if (in_array($filter->type, $filter_types_to_skip)) {
       continue;
     }
-    if ($filter->status && isset($filter_info[$name]['prepare callback'])) {
-      $function = $filter_info[$name]['prepare callback'];
-      $text = $function($text, $filter, $format, $langcode, $cache, $cache_id);
+    if ($filter->status) {
+      $text = $filter->prepare($text, $filter, $langcode, $cache, $cache_id);
     }
   }
 
   // Perform filtering.
   foreach ($filters as $name => $filter) {
     // If necessary, skip filters of a certain type.
-    if (in_array($filter_info[$name]['type'], $filter_types_to_skip)) {
+    if (in_array($filter->type, $filter_types_to_skip)) {
       continue;
     }
-    if ($filter->status && isset($filter_info[$name]['process callback'])) {
-      $function = $filter_info[$name]['process callback'];
-      $text = $function($text, $filter, $format, $langcode, $cache, $cache_id);
+    if ($filter->status) {
+      $text = $filter->process($text, $filter, $langcode, $cache, $cache_id);
     }
   }
 
@@ -1049,7 +987,6 @@ function _filter_tips($format_id, $long = FALSE) {
   global $user;
 
   $formats = filter_formats($user);
-  $filter_info = filter_get_filters();
 
   $tips = array();
 
@@ -1060,10 +997,9 @@ function _filter_tips($format_id, $long = FALSE) {
 
   foreach ($formats as $format) {
     $filters = filter_list_format($format->format);
-    $tips[$format->name] = array();
     foreach ($filters as $name => $filter) {
-      if ($filter->status && isset($filter_info[$name]['tips callback'])) {
-        $tip = $filter_info[$name]['tips callback']($filter, $format, $long);
+      if ($filter->status) {
+        $tip = $filter->tips($filter, $long);
         if (isset($tip)) {
           $tips[$format->name][$name] = array('tip' => $tip, 'id' => $name);
         }
@@ -1207,93 +1143,6 @@ function theme_filter_guidelines($variables) {
  */
 
 /**
- * Implements hook_filter_info().
- */
-function filter_filter_info() {
-  $filters['filter_html'] = array(
-    'title' => t('Limit allowed HTML tags'),
-    'type' => FILTER_TYPE_HTML_RESTRICTOR,
-    'process callback' => '_filter_html',
-    'settings callback' => '_filter_html_settings',
-    'default settings' => array(
-      'allowed_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>',
-      'filter_html_help' => 1,
-      'filter_html_nofollow' => 0,
-    ),
-    'tips callback' => '_filter_html_tips',
-    'weight' => -10,
-  );
-  $filters['filter_autop'] = array(
-    'title' => t('Convert line breaks into HTML (i.e. <code>&lt;br&gt;</code> and <code>&lt;p&gt;</code>)'),
-    'type' => FILTER_TYPE_MARKUP_LANGUAGE,
-    'process callback' => '_filter_autop',
-    'tips callback' => '_filter_autop_tips',
-  );
-  $filters['filter_url'] = array(
-    'title' => t('Convert URLs into links'),
-    'type' => FILTER_TYPE_MARKUP_LANGUAGE,
-    'process callback' => '_filter_url',
-    'settings callback' => '_filter_url_settings',
-    'default settings' => array(
-      'filter_url_length' => 72,
-    ),
-    'tips callback' => '_filter_url_tips',
-  );
-  $filters['filter_html_image_secure'] = array(
-    'title' => t('Restrict images to this site'),
-    'type' => FILTER_TYPE_HTML_RESTRICTOR,
-    'description' => t('Disallows usage of &lt;img&gt; tag sources that are not hosted on this site by replacing them with a placeholder image.'),
-    'process callback' => '_filter_html_image_secure_process',
-    'tips callback' => '_filter_html_image_secure_tips',
-    // Supposed to run after other filters and before HTML corrector by default.
-    'weight' => 9,
-  );
-  $filters['filter_htmlcorrector'] = array(
-    'title' =>  t('Correct faulty and chopped off HTML'),
-    'type' => FILTER_TYPE_HTML_RESTRICTOR,
-    'process callback' => '_filter_htmlcorrector',
-    'weight' => 10,
-  );
-  $filters['filter_html_escape'] = array(
-    'title' => t('Display any HTML as plain text'),
-    'type' => FILTER_TYPE_HTML_RESTRICTOR,
-    'process callback' => '_filter_html_escape',
-    'tips callback' => '_filter_html_escape_tips',
-    'weight' => -10,
-  );
-  return $filters;
-}
-
-/**
- * Filter settings callback for the HTML content filter.
- *
- * See hook_filter_FILTER_settings() for documentation of parameters and return
- * value.
- */
-function _filter_html_settings($form, &$form_state, $filter, $format, $defaults) {
-  $filter->settings += $defaults;
-
-  $settings['allowed_html'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Allowed HTML tags'),
-    '#default_value' => $filter->settings['allowed_html'],
-    '#maxlength' => 1024,
-    '#description' => t('A list of HTML tags that can be used. JavaScript event attributes, JavaScript URLs, and CSS are always stripped.'),
-  );
-  $settings['filter_html_help'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Display basic HTML help in long filter tips'),
-    '#default_value' => $filter->settings['filter_html_help'],
-  );
-  $settings['filter_html_nofollow'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Add rel="nofollow" to all links'),
-    '#default_value' => $filter->settings['filter_html_nofollow'],
-  );
-  return $settings;
-}
-
-/**
  * Provides filtering of input into accepted HTML.
  */
 function _filter_html($text, $filter) {
@@ -1313,125 +1162,6 @@ function _filter_html($text, $filter) {
 }
 
 /**
- * Filter tips callback: Provides help for the HTML filter.
- *
- * @see filter_filter_info()
- */
-function _filter_html_tips($filter, $format, $long = FALSE) {
-  global $base_url;
-
-  if (!($allowed_html = $filter->settings['allowed_html'])) {
-    return;
-  }
-  $output = t('Allowed HTML tags: @tags', array('@tags' => $allowed_html));
-  if (!$long) {
-    return $output;
-  }
-
-  $output = '<p>' . $output . '</p>';
-  if (!$filter->settings['filter_html_help']) {
-    return $output;
-  }
-
-  $output .= '<p>' . t('This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.') . '</p>';
-  $output .= '<p>' . t('For more information see W3C\'s <a href="@html-specifications">HTML Specifications</a> or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) . '</p>';
-  $tips = array(
-    'a' => array(t('Anchors are used to make links to other pages.'), '<a href="' . $base_url . '">' . check_plain(config('system.site')->get('name')) . '</a>'),
-    'br' => array(t('By default line break tags are automatically added, so use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others. Use the extra " /" inside the tag to maintain XHTML 1.0 compatibility'), t('Text with <br />line break')),
-    'p' => array(t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '<p>' . t('Paragraph one.') . '</p> <p>' . t('Paragraph two.') . '</p>'),
-    'strong' => array(t('Strong', array(), array('context' => 'Font weight')), '<strong>' . t('Strong', array(), array('context' => 'Font weight')) . '</strong>'),
-    'em' => array(t('Emphasized'), '<em>' . t('Emphasized') . '</em>'),
-    'cite' => array(t('Cited'), '<cite>' . t('Cited') . '</cite>'),
-    'code' => array(t('Coded text used to show programming source code'), '<code>' . t('Coded') . '</code>'),
-    'b' => array(t('Bolded'), '<b>' . t('Bolded') . '</b>'),
-    'u' => array(t('Underlined'), '<u>' . t('Underlined') . '</u>'),
-    'i' => array(t('Italicized'), '<i>' . t('Italicized') . '</i>'),
-    'sup' => array(t('Superscripted'), t('<sup>Super</sup>scripted')),
-    'sub' => array(t('Subscripted'), t('<sub>Sub</sub>scripted')),
-    'pre' => array(t('Preformatted'), '<pre>' . t('Preformatted') . '</pre>'),
-    'abbr' => array(t('Abbreviation'), t('<abbr title="Abbreviation">Abbrev.</abbr>')),
-    'acronym' => array(t('Acronym'), t('<acronym title="Three-Letter Acronym">TLA</acronym>')),
-    'blockquote' => array(t('Block quoted'), '<blockquote>' . t('Block quoted') . '</blockquote>'),
-    'q' => array(t('Quoted inline'), '<q>' . t('Quoted inline') . '</q>'),
-    // Assumes and describes tr, td, th.
-    'table' => array(t('Table'), '<table> <tr><th>' . t('Table header') . '</th></tr> <tr><td>' . t('Table cell') . '</td></tr> </table>'),
-    'tr' => NULL, 'td' => NULL, 'th' => NULL,
-    'del' => array(t('Deleted'), '<del>' . t('Deleted') . '</del>'),
-    'ins' => array(t('Inserted'), '<ins>' . t('Inserted') . '</ins>'),
-     // Assumes and describes li.
-    'ol' => array(t('Ordered list - use the &lt;li&gt; to begin each list item'), '<ol> <li>' . t('First item') . '</li> <li>' . t('Second item') . '</li> </ol>'),
-    'ul' => array(t('Unordered list - use the &lt;li&gt; to begin each list item'), '<ul> <li>' . t('First item') . '</li> <li>' . t('Second item') . '</li> </ul>'),
-    'li' => NULL,
-    // Assumes and describes dt and dd.
-    'dl' => array(t('Definition lists are similar to other HTML lists. &lt;dl&gt; begins the definition list, &lt;dt&gt; begins the definition term and &lt;dd&gt; begins the definition description.'), '<dl> <dt>' . t('First term') . '</dt> <dd>' . t('First definition') . '</dd> <dt>' . t('Second term') . '</dt> <dd>' . t('Second definition') . '</dd> </dl>'),
-    'dt' => NULL, 'dd' => NULL,
-    'h1' => array(t('Heading'), '<h1>' . t('Title') . '</h1>'),
-    'h2' => array(t('Heading'), '<h2>' . t('Subtitle') . '</h2>'),
-    'h3' => array(t('Heading'), '<h3>' . t('Subtitle three') . '</h3>'),
-    'h4' => array(t('Heading'), '<h4>' . t('Subtitle four') . '</h4>'),
-    'h5' => array(t('Heading'), '<h5>' . t('Subtitle five') . '</h5>'),
-    'h6' => array(t('Heading'), '<h6>' . t('Subtitle six') . '</h6>')
-  );
-  $header = array(t('Tag Description'), t('You Type'), t('You Get'));
-  preg_match_all('/<([a-z0-9]+)[^a-z0-9]/i', $allowed_html, $out);
-  foreach ($out[1] as $tag) {
-    if (!empty($tips[$tag])) {
-      $rows[] = array(
-        array('data' => $tips[$tag][0], 'class' => array('description')),
-        array('data' => '<code>' . check_plain($tips[$tag][1]) . '</code>', 'class' => array('type')),
-        array('data' => $tips[$tag][1], 'class' => array('get'))
-      );
-    }
-    else {
-      $rows[] = array(
-        array('data' => t('No help provided for tag %tag.', array('%tag' => $tag)), 'class' => array('description'), 'colspan' => 3),
-      );
-    }
-  }
-  $output .= theme('table', array('header' => $header, 'rows' => $rows));
-
-  $output .= '<p>' . t('Most unusual characters can be directly entered without any problems.') . '</p>';
-  $output .= '<p>' . t('If you do encounter problems, try using HTML character entities. A common example looks like &amp;amp; for an ampersand &amp; character. For a full list of entities see HTML\'s <a href="@html-entities">entities</a> page. Some of the available characters include:', array('@html-entities' => 'http://www.w3.org/TR/html4/sgml/entities.html')) . '</p>';
-
-  $entities = array(
-    array(t('Ampersand'), '&amp;'),
-    array(t('Greater than'), '&gt;'),
-    array(t('Less than'), '&lt;'),
-    array(t('Quotation mark'), '&quot;'),
-  );
-  $header = array(t('Character Description'), t('You Type'), t('You Get'));
-  unset($rows);
-  foreach ($entities as $entity) {
-    $rows[] = array(
-      array('data' => $entity[0], 'class' => array('description')),
-      array('data' => '<code>' . check_plain($entity[1]) . '</code>', 'class' => array('type')),
-      array('data' => $entity[1], 'class' => array('get'))
-    );
-  }
-  $output .= theme('table', array('header' => $header, 'rows' => $rows));
-  return $output;
-}
-
-/**
- * Filter URL settings callback: Provides settings for the URL filter.
- *
- * @see filter_filter_info()
- */
-function _filter_url_settings($form, &$form_state, $filter, $format, $defaults) {
-  $filter->settings += $defaults;
-
-  $settings['filter_url_length'] = array(
-    '#type' => 'number',
-    '#title' => t('Maximum link text length'),
-    '#default_value' => $filter->settings['filter_url_length'],
-    '#min' => 1,
-    '#field_suffix' => t('characters'),
-    '#description' => t('URLs longer than this number of characters will be truncated to prevent long strings that break formatting. The link itself will be retained; just the text portion of the link will be truncated.'),
-  );
-  return $settings;
-}
-
-/**
  * Converts text into hyperlinks automatically.
  *
  * This filter identifies and makes clickable three types of "links".
@@ -1658,15 +1388,6 @@ function _filter_url_trim($text, $length = NULL) {
 }
 
 /**
- * Filter tips callback: Provides help for the URL filter.
- *
- * @see filter_filter_info()
- */
-function _filter_url_tips($filter, $format, $long = FALSE) {
-  return t('Web page addresses and e-mail addresses turn into links automatically.');
-}
-
-/**
  * Scans the input and makes sure that HTML tags are properly closed.
  */
 function _filter_htmlcorrector($text) {
@@ -1741,20 +1462,6 @@ function _filter_autop($text) {
 }
 
 /**
- * Filter tips callback: Provides help for the auto-paragraph filter.
- *
- * @see filter_filter_info()
- */
-function _filter_autop_tips($filter, $format, $long = FALSE) {
-  if ($long) {
-    return t('Lines and paragraphs are automatically recognized. The &lt;br /&gt; line break, &lt;p&gt; paragraph and &lt;/p&gt; close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.');
-  }
-  else {
-    return t('Lines and paragraphs break automatically.');
-  }
-}
-
-/**
  * Escapes all HTML tags, so they will be visible instead of being effective.
  */
 function _filter_html_escape($text) {
@@ -1762,15 +1469,6 @@ function _filter_html_escape($text) {
 }
 
 /**
- * Filter tips callback: Provides help for the HTML escaping filter.
- *
- * @see filter_filter_info()
- */
-function _filter_html_escape_tips($filter, $format, $long = FALSE) {
-  return t('No HTML tags allowed.');
-}
-
-/**
  * Process callback for local image filter.
  */
 function _filter_html_image_secure_process($text) {
@@ -1836,13 +1534,6 @@ function theme_filter_html_image_secure_image(&$variables) {
 }
 
 /**
- * Filter tips callback for secure HTML image filter.
- */
-function _filter_html_image_secure_tips($filter, $format, $long = FALSE) {
-  return t('Only images hosted on this site may be used in &lt;img&gt; tags.');
-}
-
-/**
  * @} End of "defgroup standard_filters".
  */
 
diff --git a/core/modules/filter/lib/Drupal/filter/FilterBundle.php b/core/modules/filter/lib/Drupal/filter/FilterBundle.php
new file mode 100644
index 0000000..fac680e
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/FilterBundle.php
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\FilterBundle.
+ */
+
+namespace Drupal\filter;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\HttpKernel\Bundle\Bundle;
+
+/**
+ * Filter dependency injection container.
+ */
+class FilterBundle extends Bundle {
+
+  /**
+   * Overrides \Symfony\Component\HttpKernel\Bundle\Bundle::build().
+   */
+  public function build(ContainerBuilder $container) {
+    $container->register('plugin.manager.filter', 'Drupal\filter\FilterPluginManager');
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatStorageController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatStorageController.php
index 1e8bdb2..ce67a92 100644
--- a/core/modules/filter/lib/Drupal/filter/FilterFormatStorageController.php
+++ b/core/modules/filter/lib/Drupal/filter/FilterFormatStorageController.php
@@ -23,7 +23,20 @@ protected function preSave(EntityInterface $entity) {
 
     $entity->name = trim($entity->label());
     $entity->cache = _filter_format_is_cacheable($entity);
+
+    if (!isset($entity->filters)) {
+      $entity->filters = array();
+    }
+    // Clear out invalid entries, including 'status' and 'order' from tabledrag.
+    else {
+      $entity->filters = array_filter($entity->filters);
+    }
+
+    // Clear out any instances to ensure they are rebuilt.
+    $entity->filterPlugins->clear();
+
     $filter_info = filter_get_filters();
+    $entity->filters = array_intersect_key($entity->filters, $filter_info);
     foreach ($filter_info as $name => $filter) {
       // Merge the actual filter definition into the filter default definition.
       $defaults = array(
@@ -38,19 +51,17 @@ protected function preSave(EntityInterface $entity) {
         // default weight defined in hook_filter_info() or the default of 0 by
         // filter_get_filters().
         'weight' => $filter['weight'],
-        'settings' => $filter['default settings'],
+        'settings' => $filter['default_settings'],
       );
       // All available filters are saved for each format, in order to retain all
       // filter properties regardless of whether a filter is currently enabled
       // or not, since some filters require extensive configuration.
       // @todo Do not save disabled filters whose properties are identical to
       //   all default properties.
-      if (isset($entity->filters[$name])) {
-        $entity->filters[$name] = array_merge($defaults, $entity->filters[$name]);
-      }
-      else {
-        $entity->filters[$name] = $defaults;
+      if (!isset($entity->filters[$name])) {
+        $entity->filters[$name] = array();
       }
+      $entity->filters[$name] += $defaults;
       // The module definition from hook_filter_info() always takes precedence
       // and needs to be updated in case it changes.
       $entity->filters[$name]['module'] = $filter['module'];
diff --git a/core/modules/filter/lib/Drupal/filter/FilterPluginManager.php b/core/modules/filter/lib/Drupal/filter/FilterPluginManager.php
new file mode 100644
index 0000000..c2db373
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/FilterPluginManager.php
@@ -0,0 +1,123 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\FilterPluginManager.
+ */
+
+namespace Drupal\filter;
+
+use Drupal\Component\Plugin\PluginManagerBase;
+use Drupal\Component\Plugin\Factory\DefaultFactory;
+use Drupal\Component\Plugin\Discovery\ProcessDecorator;
+use Drupal\Core\Plugin\Discovery\AlterDecorator;
+use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
+use Drupal\filter\Plugin\Core\Entity\FilterFormat;
+
+/**
+ * Manages content filters.
+ *
+ * User submitted content is passed through a group of filters before it is
+ * output in HTML, in order to remove insecure or unwanted parts, correct or
+ * enhance the formatting, transform special keywords, etc. A group of filters
+ * is referred to as a "text format". Administrators can create as many text
+ * formats as needed. Individual filters can be enabled and configured
+ * differently for each text format.
+ *
+ * This hook is invoked by filter_get_filters() and allows modules to register
+ * input filters they provide.
+ *
+ * Filtering is a two-step process. First, the content is 'prepared' by calling
+ * the 'prepare_callback' function for every filter. The purpose of the
+ * 'prepare_callback' is to escape HTML-like structures. For example, imagine a
+ * filter which allows the user to paste entire chunks of programming code
+ * without requiring manual escaping of special HTML characters like < or &. If
+ * the programming code were left untouched, then other filters could think it
+ * was HTML and change it. For many filters, the prepare step is not necessary.
+ *
+ * The second step is the actual processing step. The result from passing the
+ * text through all the filters' prepare steps gets passed to all the filters
+ * again, this time with the
+ * \Drupal\filter\Plugin\filter\filter\FilterInterface::process() method. The
+ * process method should then actually change the content: transform URLs into
+ * hyperlinks, convert smileys into images, etc.
+ *
+ * For performance reasons content is only filtered once; the result is stored
+ * in the cache table and retrieved from the cache the next time the same piece
+ * of content is displayed. If a filter's output is dynamic, it can override
+ * the cache mechanism, but obviously this should be used with caution: having
+ * one filter that does not support caching in a particular text format
+ * disables caching for the entire format, not just for one filter.
+ *
+ * Beware of the filter cache when developing your module: it is advised to set
+ * your filter to 'cache' => FALSE while developing, but be sure to remove that
+ * setting if it's not needed, when you are no longer in development mode.
+ *
+ * @return
+ *   An associative array of filters, whose keys are internal filter names,
+ *   which should be unique and therefore prefixed with the name of the module.
+ *   Each value is an associative array describing the filter, with the
+ *   following elements (all are optional except as noted):
+ *   - title: (required) An administrative summary of what the filter does.
+ *   - description: Additional administrative information about the filter's
+ *     behavior, if needed for clarification.
+ *   - default settings: An associative array containing default settings for
+ *     the filter, to be applied when the filter has not been configured yet.
+ *   - prepare callback: The name of a function that escapes the content before
+ *     the actual filtering happens. See hook_filter_FILTER_prepare() for
+ *     details.
+ *   - cache (default TRUE): Specifies whether the filtered text can be cached.
+ *     Note that setting this to FALSE makes the entire text format not
+ *     cacheable, which may have an impact on the site's overall performance.
+ *     See filter_format_allowcache() for details.
+ *   - weight: A default weight for the filter in new text formats.
+ *
+ * @see filter_example.module
+ * @see hook_filter_info_alter()
+ */
+class FilterPluginManager extends PluginManagerBase {
+
+  /**
+   * Constructs a FilterPluginManager object.
+   */
+  public function __construct() {
+    $this->discovery = new AnnotatedClassDiscovery('filter', 'filter');
+    $this->discovery = new ProcessDecorator($this->discovery, array($this, 'processDefinition'));
+    $this->discovery = new AlterDecorator($this->discovery, 'filter_info');
+
+    $this->defaults += array(
+      'description' => '',
+      'default_settings' => array(),
+      'weight' => 0,
+      'status' => FALSE,
+      'cache' => TRUE,
+      'settings' => array(),
+    );
+  }
+
+  /**
+   * Overrides \Drupal\Component\Plugin\PluginManagerBase::processDefinition().
+   */
+  public function processDefinition(&$definition, $plugin_id) {
+    parent::processDefinition($definition, $plugin_id);
+
+    // @todo Remove this check once http://drupal.org/node/1780396 is resolved.
+    if (!module_exists($definition['module'])) {
+      $definition = NULL;
+      return;
+    }
+
+    if (!isset($definition['type'])) {
+      throw new \Exception(t('Filter %filter has no type specified.', array ('%filter' => $definition['title'])));
+    }
+  }
+
+  /**
+   * Overrides \Drupal\Component\Plugin\PluginManagerBase::createInstance().
+   */
+  public function createInstance($plugin_id, array $configuration = array(), FilterFormat $entity = NULl) {
+    $plugin_class = DefaultFactory::getPluginClass($plugin_id, $this->discovery);
+    return new $plugin_class($configuration, $plugin_id, $this->discovery, $entity);
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/Core/Entity/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Plugin/Core/Entity/FilterFormat.php
index 4bf976a..50b130a 100644
--- a/core/modules/filter/lib/Drupal/filter/Plugin/Core/Entity/FilterFormat.php
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/Core/Entity/FilterFormat.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Annotation\Plugin;
 use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\FilterBag;
 
 /**
  * Represents a text format.
@@ -118,6 +119,22 @@ class FilterFormat extends ConfigEntityBase {
   public $filters = array();
 
   /**
+   * @todo.
+   *
+   * @var \Drupal\filter\Plugin\FilterBag
+   */
+  public $filterPlugins;
+
+  /**
+   * Overrides \Drupal\Core\Config\Entity\ConfigEntityBase::__construct();
+   */
+  public function __construct(array $values, $entity_type) {
+    parent::__construct($values, $entity_type);
+
+    $this->filterPlugins = new FilterBag($this, drupal_container()->get('plugin.manager.filter'));
+  }
+
+  /**
    * Overrides \Drupal\Core\Entity\Entity::id().
    */
   public function id() {
@@ -127,10 +144,9 @@ public function id() {
   /**
    * Helper callback for uasort() to sort filters by status, weight, module, and name.
    *
-   * @see Drupal\filter\FilterFormatStorageController::preSave()
    * @see filter_list_format()
    */
-  public static function sortFilters($a, $b) {
+  public static function sortFilters(array $a, array $b) {
     if ($a['status'] != $b['status']) {
       return !empty($a['status']) ? -1 : 1;
     }
@@ -143,4 +159,13 @@ public static function sortFilters($a, $b) {
     return strnatcasecmp($a['name'], $b['name']);
   }
 
+  /**
+   * Overrides \Drupal\Core\Config\Entity\ConfigEntityBase::getExportProperties();
+   */
+  public function getExportProperties() {
+    $properties = parent::getExportProperties();
+    unset($properties['filterPlugins']);
+    return $properties;
+  }
+
 }
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/FilterBag.php b/core/modules/filter/lib/Drupal/filter/Plugin/FilterBag.php
new file mode 100644
index 0000000..71788fc
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/FilterBag.php
@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\Plugin\FilterBag.
+ */
+
+namespace Drupal\filter\Plugin;
+
+use Drupal\Component\Plugin\PluginBag;
+use Drupal\filter\Plugin\Core\Entity\FilterFormat;
+use Drupal\Component\Plugin\PluginManagerInterface;
+
+/**
+ * @todo.
+ */
+class FilterBag extends PluginBag {
+
+  /**
+   * Stores a reference to the view which has this displays attached.
+   *
+   * @var \Drupal\filter\Plugin\Core\Entity\FilterFormat
+   */
+  protected $format;
+
+  /**
+   * The manager used to instantiate the plugins.
+   *
+   * @var \Drupal\Component\Plugin\PluginManagerInterface
+   */
+  protected $manager;
+
+  /**
+   * Constructs a FilterBag object.
+   *
+   * @param \Drupal\filter\Plugin\Core\Entity\FilterFormat $format
+   *   The text format that contains these filters.
+   * @param \Drupal\Component\Plugin\PluginManagerInterface $manager
+   *   The manager to be used for instantiating plugins.
+   */
+  public function __construct(FilterFormat $format, PluginManagerInterface $manager) {
+    $this->format = $format;
+    $this->manager = $manager;
+    $this->instanceIDs = drupal_map_assoc(array_keys($manager->getDefinitions()));
+  }
+
+  /**
+   * Overrides \Drupal\Component\Plugin\PluginBag::initializePlugin().
+   */
+  protected function initializePlugin($instance_id) {
+    // If the display was initialized before, just return.
+    if (isset($this->pluginInstances[$instance_id])) {
+      return;
+    }
+
+    if (isset($this->instanceIDs[$instance_id])) {
+      $filter = array();
+      if (isset($this->format->filters[$instance_id])) {
+        $filter = $this->format->filters[$instance_id];
+      }
+      $this->pluginInstances[$instance_id] = $this->manager->createInstance($instance_id, $filter, $this->format);
+    }
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterAutoP.php b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterAutoP.php
new file mode 100644
index 0000000..b23643c
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterAutoP.php
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\Plugin\filter\filter\FilterAutoP.
+ */
+
+namespace Drupal\filter\Plugin\filter\filter;
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\filter\filter\FilterBase;
+
+/**
+ * @todo.
+ *
+ * @Plugin(
+ *   id = "filter_autop",
+ *   module = "filter",
+ *   title = @Translation("Convert line breaks into HTML (i.e. <code>&lt;br&gt;</code> and <code>&lt;p&gt;</code>)"),
+ *   type = FILTER_TYPE_MARKUP_LANGUAGE
+ * )
+ */
+class FilterAutoP extends FilterBase {
+
+  /**
+   * Overrides \Drupal\filter\Plugin\filter\filter\FilterBase::tips().
+   */
+  public function tips($filter, $long = FALSE) {
+    if ($long) {
+      return t('Lines and paragraphs are automatically recognized. The &lt;br /&gt; line break, &lt;p&gt; paragraph and &lt;/p&gt; close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.');
+    }
+    else {
+      return t('Lines and paragraphs break automatically.');
+    }
+  }
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::process().
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id) {
+    return _filter_autop($text);
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterBase.php b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterBase.php
new file mode 100644
index 0000000..ae10380
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterBase.php
@@ -0,0 +1,96 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\Plugin\filter\filter\FilterBase.
+ */
+
+namespace Drupal\filter\Plugin\filter\filter;
+
+use Drupal\Component\Plugin\PluginBase;
+use Drupal\filter\Plugin\Core\Entity\FilterFormat;
+use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
+
+/**
+ * Provides a base class for Filter plugins.
+ */
+abstract class FilterBase extends PluginBase implements FilterInterface {
+
+  /**
+   * An object representing the text format the filter is contained in.
+   *
+   * @var \Drupal\filter\Plugin\Core\Entity\FilterFormat
+   */
+  protected $format;
+
+  /**
+   * Overrides \Drupal\Component\Plugin\PluginBase::__construct().
+   */
+  public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery, FilterFormat $format) {
+    parent::__construct($configuration, $plugin_id, $discovery);
+
+    $this->configuration += $this->getDefinition();
+    $this->settings += $this->default_settings;
+    $this->format = $format;
+  }
+
+  /**
+   * Implements the magic __get() method.
+   */
+  public function __get($key) {
+    if (isset($this->configuration[$key])) {
+      return $this->configuration[$key];
+    }
+  }
+
+  /**
+   * Implements the magic __set() method.
+   */
+  public function __set($key, $value) {
+    $this->configuration[$key] = $value;
+  }
+
+  /**
+   * Implements the magic __isset() method.
+   */
+  public function __isset($key) {
+    return isset($this->configuration[$key]);
+  }
+
+  /**
+   * Sorts an array of filters by filter status, weight, module, name.
+   */
+  public static function sort($a, $b) {
+    if ($a->status != $b->status) {
+      return !empty($a->status) ? -1 : 1;
+    }
+    if ($a->weight != $b->weight) {
+      return ($a->weight < $b->weight) ? -1 : 1;
+    }
+    elseif ($a->module != $b->module) {
+      return strcmp($a->module, $b->module);
+    }
+    return strcmp($a->name, $b->name);
+  }
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::tips().
+   */
+  public function tips($filter, $long = FALSE) {
+  }
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::settingsForm().
+   */
+  public function settingsForm(array $form, array &$form_state) {
+    return array();
+  }
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::prepare().
+   */
+  public function prepare($text, $filter, $langcode, $cache, $cache_id) {
+    return $text;
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtml.php b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtml.php
new file mode 100644
index 0000000..fa45c67
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtml.php
@@ -0,0 +1,161 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\Plugin\filter\filter\FilterHtml.
+ */
+
+namespace Drupal\filter\Plugin\filter\filter;
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\filter\filter\FilterBase;
+
+/**
+ * @todo.
+ *
+ * @Plugin(
+ *   id = "filter_html",
+ *   module = "filter",
+ *   title = @Translation("Limit allowed HTML tags"),
+ *   type = FILTER_TYPE_HTML_RESTRICTOR,
+ *   default_settings = {
+ *     "allowed_html" = "<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>",
+ *     "filter_html_help" = 1,
+ *     "filter_html_nofollow" = 0
+ *   },
+ *   weight = -10
+ * )
+ */
+class FilterHtml extends FilterBase {
+
+  /**
+   * Overrides \Drupal\filter\Plugin\filter\filter\FilterBase::tips().
+   */
+  public function tips($filter, $long = FALSE) {
+    global $base_url;
+
+    if (!($allowed_html = $filter->settings['allowed_html'])) {
+      return;
+    }
+    $output = t('Allowed HTML tags: @tags', array('@tags' => $allowed_html));
+    if (!$long) {
+      return $output;
+    }
+
+    $output = '<p>' . $output . '</p>';
+    if (!$filter->settings['filter_html_help']) {
+      return $output;
+    }
+
+    $output .= '<p>' . t('This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.') . '</p>';
+    $output .= '<p>' . t('For more information see W3C\'s <a href="@html-specifications">HTML Specifications</a> or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) . '</p>';
+    $tips = array(
+      'a' => array(t('Anchors are used to make links to other pages.'), '<a href="' . $base_url . '">' . check_plain(config('system.site')->get('name')) . '</a>'),
+      'br' => array(t('By default line break tags are automatically added, so use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others. Use the extra " /" inside the tag to maintain XHTML 1.0 compatibility'), t('Text with <br />line break')),
+      'p' => array(t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '<p>' . t('Paragraph one.') . '</p> <p>' . t('Paragraph two.') . '</p>'),
+      'strong' => array(t('Strong', array(), array('context' => 'Font weight')), '<strong>' . t('Strong', array(), array('context' => 'Font weight')) . '</strong>'),
+      'em' => array(t('Emphasized'), '<em>' . t('Emphasized') . '</em>'),
+      'cite' => array(t('Cited'), '<cite>' . t('Cited') . '</cite>'),
+      'code' => array(t('Coded text used to show programming source code'), '<code>' . t('Coded') . '</code>'),
+      'b' => array(t('Bolded'), '<b>' . t('Bolded') . '</b>'),
+      'u' => array(t('Underlined'), '<u>' . t('Underlined') . '</u>'),
+      'i' => array(t('Italicized'), '<i>' . t('Italicized') . '</i>'),
+      'sup' => array(t('Superscripted'), t('<sup>Super</sup>scripted')),
+      'sub' => array(t('Subscripted'), t('<sub>Sub</sub>scripted')),
+      'pre' => array(t('Preformatted'), '<pre>' . t('Preformatted') . '</pre>'),
+      'abbr' => array(t('Abbreviation'), t('<abbr title="Abbreviation">Abbrev.</abbr>')),
+      'acronym' => array(t('Acronym'), t('<acronym title="Three-Letter Acronym">TLA</acronym>')),
+      'blockquote' => array(t('Block quoted'), '<blockquote>' . t('Block quoted') . '</blockquote>'),
+      'q' => array(t('Quoted inline'), '<q>' . t('Quoted inline') . '</q>'),
+      // Assumes and describes tr, td, th.
+      'table' => array(t('Table'), '<table> <tr><th>' . t('Table header') . '</th></tr> <tr><td>' . t('Table cell') . '</td></tr> </table>'),
+      'tr' => NULL, 'td' => NULL, 'th' => NULL,
+      'del' => array(t('Deleted'), '<del>' . t('Deleted') . '</del>'),
+      'ins' => array(t('Inserted'), '<ins>' . t('Inserted') . '</ins>'),
+       // Assumes and describes li.
+      'ol' => array(t('Ordered list - use the &lt;li&gt; to begin each list item'), '<ol> <li>' . t('First item') . '</li> <li>' . t('Second item') . '</li> </ol>'),
+      'ul' => array(t('Unordered list - use the &lt;li&gt; to begin each list item'), '<ul> <li>' . t('First item') . '</li> <li>' . t('Second item') . '</li> </ul>'),
+      'li' => NULL,
+      // Assumes and describes dt and dd.
+      'dl' => array(t('Definition lists are similar to other HTML lists. &lt;dl&gt; begins the definition list, &lt;dt&gt; begins the definition term and &lt;dd&gt; begins the definition description.'), '<dl> <dt>' . t('First term') . '</dt> <dd>' . t('First definition') . '</dd> <dt>' . t('Second term') . '</dt> <dd>' . t('Second definition') . '</dd> </dl>'),
+      'dt' => NULL, 'dd' => NULL,
+      'h1' => array(t('Heading'), '<h1>' . t('Title') . '</h1>'),
+      'h2' => array(t('Heading'), '<h2>' . t('Subtitle') . '</h2>'),
+      'h3' => array(t('Heading'), '<h3>' . t('Subtitle three') . '</h3>'),
+      'h4' => array(t('Heading'), '<h4>' . t('Subtitle four') . '</h4>'),
+      'h5' => array(t('Heading'), '<h5>' . t('Subtitle five') . '</h5>'),
+      'h6' => array(t('Heading'), '<h6>' . t('Subtitle six') . '</h6>')
+    );
+    $header = array(t('Tag Description'), t('You Type'), t('You Get'));
+    preg_match_all('/<([a-z0-9]+)[^a-z0-9]/i', $allowed_html, $out);
+    foreach ($out[1] as $tag) {
+      if (!empty($tips[$tag])) {
+        $rows[] = array(
+          array('data' => $tips[$tag][0], 'class' => array('description')),
+          array('data' => '<code>' . check_plain($tips[$tag][1]) . '</code>', 'class' => array('type')),
+          array('data' => $tips[$tag][1], 'class' => array('get'))
+        );
+      }
+      else {
+        $rows[] = array(
+          array('data' => t('No help provided for tag %tag.', array('%tag' => $tag)), 'class' => array('description'), 'colspan' => 3),
+        );
+      }
+    }
+    $output .= theme('table', array('header' => $header, 'rows' => $rows));
+
+    $output .= '<p>' . t('Most unusual characters can be directly entered without any problems.') . '</p>';
+    $output .= '<p>' . t('If you do encounter problems, try using HTML character entities. A common example looks like &amp;amp; for an ampersand &amp; character. For a full list of entities see HTML\'s <a href="@html-entities">entities</a> page. Some of the available characters include:', array('@html-entities' => 'http://www.w3.org/TR/html4/sgml/entities.html')) . '</p>';
+
+    $entities = array(
+      array(t('Ampersand'), '&amp;'),
+      array(t('Greater than'), '&gt;'),
+      array(t('Less than'), '&lt;'),
+      array(t('Quotation mark'), '&quot;'),
+    );
+    $header = array(t('Character Description'), t('You Type'), t('You Get'));
+    unset($rows);
+    foreach ($entities as $entity) {
+      $rows[] = array(
+        array('data' => $entity[0], 'class' => array('description')),
+        array('data' => '<code>' . check_plain($entity[1]) . '</code>', 'class' => array('type')),
+        array('data' => $entity[1], 'class' => array('get'))
+      );
+    }
+    $output .= theme('table', array('header' => $header, 'rows' => $rows));
+    return $output;
+  }
+
+  /**
+   * Overrides \Drupal\filter\Plugin\filter\filter\FilterBase::settingsForm().
+   */
+  public function settingsForm(array $form, array &$form_state) {
+    $settings['allowed_html'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Allowed HTML tags'),
+      '#default_value' => $this->settings['allowed_html'],
+      '#maxlength' => 1024,
+      '#description' => t('A list of HTML tags that can be used. JavaScript event attributes, JavaScript URLs, and CSS are always stripped.'),
+    );
+    $settings['filter_html_help'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Display basic HTML help in long filter tips'),
+      '#default_value' => $this->settings['filter_html_help'],
+    );
+    $settings['filter_html_nofollow'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Add rel="nofollow" to all links'),
+      '#default_value' => $this->settings['filter_html_nofollow'],
+    );
+    return $settings;
+  }
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::process().
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id) {
+    return _filter_html($text, $filter);
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtmlCorrector.php b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtmlCorrector.php
new file mode 100644
index 0000000..e885cf1
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtmlCorrector.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\Plugin\filter\filter\FilterHtmlCorrector.
+ */
+
+namespace Drupal\filter\Plugin\filter\filter;
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\filter\filter\FilterBase;
+
+/**
+ * @todo.
+ *
+ * @Plugin(
+ *   id = "filter_htmlcorrector",
+ *   module = "filter",
+ *   title = @Translation("Correct faulty and chopped off HTML"),
+ *   type = FILTER_TYPE_HTML_RESTRICTOR,
+ *   weight = 10
+ * )
+ */
+class FilterHtmlCorrector extends FilterBase {
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::process().
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id) {
+    return _filter_htmlcorrector($text);
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtmlEscape.php b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtmlEscape.php
new file mode 100644
index 0000000..9469744
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtmlEscape.php
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\Plugin\filter\filter\FilterHtmlEscape.
+ */
+
+namespace Drupal\filter\Plugin\filter\filter;
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\filter\filter\FilterBase;
+
+/**
+ * @todo.
+ *
+ * @Plugin(
+ *   id = "filter_html_escape",
+ *   module = "filter",
+ *   title = @Translation("Display any HTML as plain text"),
+ *   type = FILTER_TYPE_HTML_RESTRICTOR,
+ *   weight = -10
+ * )
+ */
+class FilterHtmlEscape extends FilterBase {
+
+  /**
+   * Overrides \Drupal\filter\Plugin\filter\filter\FilterBase::tips().
+   */
+  public function tips($filter, $long = FALSE) {
+    return t('No HTML tags allowed.');
+  }
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::process().
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id) {
+    return _filter_html_escape($text);
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtmlImageSecure.php b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtmlImageSecure.php
new file mode 100644
index 0000000..f16b292
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterHtmlImageSecure.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\Plugin\filter\filter\FilterHtmlImageSecure.
+ */
+
+namespace Drupal\filter\Plugin\filter\filter;
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\filter\filter\FilterBase;
+
+/**
+ * @todo.
+ *
+ * @Plugin(
+ *   id = "filter_html_image_secure",
+ *   module = "filter",
+ *   title = @Translation("Restrict images to this site"),
+ *   description = @Translation("Disallows usage of &lt;img&gt; tag sources that are not hosted on this site by replacing them with a placeholder image."),
+ *   type = FILTER_TYPE_HTML_RESTRICTOR,
+ *   weight = 9
+ * )
+ */
+class FilterHtmlImageSecure extends FilterBase {
+
+  /**
+   * Overrides \Drupal\filter\Plugin\filter\filter\FilterBase::tips().
+   */
+  public function tips($filter, $long = FALSE) {
+  return t('Only images hosted on this site may be used in &lt;img&gt; tags.');
+  }
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::process().
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id) {
+    return _filter_html_image_secure_process($text);
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterInterface.php b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterInterface.php
new file mode 100644
index 0000000..754f1d9
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterInterface.php
@@ -0,0 +1,104 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\Plugin\filter\filter\FilterInterface.
+ */
+
+namespace Drupal\filter\Plugin\filter\filter;
+
+use Drupal\filter\Plugin\Core\Entity\FilterFormat;
+
+/**
+ * @todo.
+ */
+interface FilterInterface {
+
+  /**
+   * Generates a filter's tip.
+   *
+   * A filter's tips should be informative and to the point. Short tips are
+   * preferably one-liners.
+   *
+   * @param \stdClass $filter
+   *   An object representing the filter.
+   * @param bool $long
+   *   Whether this callback should return a short tip to display in a form
+   *   (FALSE), or whether a more elaborate filter tips should be returned for
+   *   theme_filter_tips() (TRUE).
+   *
+   * @return string|null
+   *   Translated text to display as a tip, or NULL if this filter has no tip.
+   */
+  public function tips($filter, $long = FALSE);
+
+  /**
+   * Generates a filter's settings form.
+   *
+   * This method is used to provide a settings form for filter settings, for
+   * filters that need settings on a per-text-format basis. This method should
+   * return the form elements for the settings; the filter module will take care
+   * of saving the settings in the database.
+   *
+   * If the filter's behavior depends on an extensive list and/or external data
+   * (e.g. a list of smileys, a list of glossary terms), then the filter module
+   * can choose to provide a separate, global configuration page rather than
+   * per-text-format settings. In that case, the settings method should provide
+   * a link to the separate settings page.
+   *
+   * @param array $form
+   *   The prepopulated form array of the filter administration form.
+   * @param array $form_state
+   *   The state of the (entire) configuration form.
+   *
+   * @return array
+   *   An array of form elements defining settings for the filter. Array keys
+   *   should match the array keys in $filter->settings and $defaults.
+   */
+  public function settingsForm(array $form, array &$form_state);
+
+  /**
+   * Prepares the text for processing.
+   *
+   * Filters should not use the prepare method for anything other than escaping,
+   * because that would short-circuit the control the user has over the order in
+   * which filters are applied.
+   *
+   * @param string $text
+   *   The text string to be filtered.
+   * @param \stdClass $filter
+   *   The filter object containing settings for the given format.
+   * @param string $langcode
+   *   The language code of the text to be filtered.
+   * @param bool $cache
+   *   A Boolean indicating whether the filtered text is going to be cached in
+   *   {cache_filter}.
+   * @param string $cache_id
+   *   The ID of the filtered text in {cache_filter}, if $cache is TRUE.
+   *
+   * @return string
+   *   The prepared, escaped text.
+   */
+  public function prepare($text, $filter, $langcode, $cache, $cache_id);
+
+  /**
+   * Performs the filter processing.
+   *
+   * @param string $text
+   *   The text string to be filtered.
+   * @param \stdClass $filter
+   *   The filter object containing settings for the given format.
+   * @param string $langcode
+   *   The language code of the text to be filtered.
+   * @param bool $cache
+   *   A Boolean indicating whether the filtered text is going to be cached in
+   *   {cache_filter}.
+   * @param string $cache_id
+   *   The ID of the filtered text in {cache_filter}, if $cache is TRUE.
+   *
+   * @return string
+   *   The filtered text.
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id);
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterUrl.php b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterUrl.php
new file mode 100644
index 0000000..70d12c3
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/filter/filter/FilterUrl.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter\Plugin\filter\filter\FilterUrl.
+ */
+
+namespace Drupal\filter\Plugin\filter\filter;
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\filter\filter\FilterBase;
+
+/**
+ * @todo.
+ *
+ * @Plugin(
+ *   id = "filter_url",
+ *   module = "filter",
+ *   title = @Translation("Convert URLs into links"),
+ *   type = FILTER_TYPE_MARKUP_LANGUAGE,
+ *   default_settings = {
+ *     "filter_url_length" = 72
+ *   }
+ * )
+ */
+class FilterUrl extends FilterBase {
+
+  /**
+   * Overrides \Drupal\filter\Plugin\filter\filter\FilterBase::tips().
+   */
+  public function tips($filter, $long = FALSE) {
+    return t('Web page addresses and e-mail addresses turn into links automatically.');
+  }
+
+  /**
+   * Overrides \Drupal\filter\Plugin\filter\filter\FilterBase::settingsForm().
+   */
+  public function settingsForm(array $form, array &$form_state) {
+    $settings['filter_url_length'] = array(
+      '#type' => 'number',
+      '#title' => t('Maximum link text length'),
+      '#default_value' => $this->settings['filter_url_length'],
+      '#min' => 1,
+      '#field_suffix' => t('characters'),
+      '#description' => t('URLs longer than this number of characters will be truncated to prevent long strings that break formatting. The link itself will be retained; just the text portion of the link will be truncated.'),
+    );
+    return $settings;
+  }
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::process().
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id) {
+    return _filter_url($text, $filter);
+  }
+
+}
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php
index f516b0c..672a283 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php
@@ -93,13 +93,12 @@ function verifyTextFormat($format) {
     $this->assertEqual($filter_format->weight, $format->weight, format_string('filter_format_load: Proper weight for text format %format.', $t_args));
 
     // Verify the 'cache' text format property according to enabled filters.
-    $filter_info = filter_get_filters();
     $filters = filter_list_format($filter_format->format);
     $cacheable = TRUE;
     foreach ($filters as $name => $filter) {
       // If this filter is not cacheable, update $cacheable accordingly, so we
       // can verify $format->cache after iterating over all filters.
-      if ($filter->status && isset($filter_info[$name]['cache']) && !$filter_info[$name]['cache']) {
+      if ($filter->status && !$filter->cache) {
         $cacheable = FALSE;
         break;
       }
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterDefaultConfigTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterDefaultConfigTest.php
index fd37fb8..1d36d8a 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterDefaultConfigTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterDefaultConfigTest.php
@@ -40,7 +40,7 @@ function testInstallation() {
 
     // Verify that the format was installed correctly.
     $format = filter_format_load('filter_test');
-    $this->assertTrue($format);
+    $this->assertTrue((bool) $format);
     $this->assertEqual($format->id(), 'filter_test');
     $this->assertEqual($format->label(), 'Test format');
     $this->assertEqual($format->get('weight'), 2);
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterSettingsTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterSettingsTest.php
index 1a0be97..161b543 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterSettingsTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterSettingsTest.php
@@ -32,7 +32,7 @@ public static function getInfo() {
    * Tests explicit and implicit default settings for filters.
    */
   function testFilterDefaults() {
-    $filter_info = filter_filter_info();
+    $filter_info = filter_get_filters();
     $filters = array_fill_keys(array_keys($filter_info), array());
 
     // Create text format using filter default settings.
diff --git a/core/modules/filter/tests/filter_test/filter_test.module b/core/modules/filter/tests/filter_test/filter_test.module
index a61941a..e3983b4 100644
--- a/core/modules/filter/tests/filter_test/filter_test.module
+++ b/core/modules/filter/tests/filter_test/filter_test.module
@@ -25,40 +25,3 @@ function filter_test_filter_format_update($format) {
 function filter_test_filter_format_disable($format) {
   drupal_set_message('hook_filter_format_disable invoked.');
 }
-
-/**
- * Implements hook_filter_info().
- */
-function filter_test_filter_info() {
-  $filters['filter_test_uncacheable'] = array(
-    'title' => 'Uncacheable filter',
-    'type' => FILTER_TYPE_TRANSFORM_IRREVERSIBLE,
-    'description' => 'Does nothing, but makes a text format uncacheable.',
-    'cache' => FALSE,
-  );
-  $filters['filter_test_replace'] = array(
-    'title' => 'Testing filter',
-    'type' => FILTER_TYPE_TRANSFORM_IRREVERSIBLE,
-    'description' => 'Replaces all content with filter and text format information.',
-    'process callback' => 'filter_test_replace',
-  );
-  return $filters;
-}
-
-/**
- * Process handler for filter_test_replace filter.
- *
- * Replaces all text with filter and text format information.
- */
-function filter_test_replace($text, $filter, $format, $langcode, $cache, $cache_id) {
-  $text = array();
-  $text[] = 'Filter: ' . $filter->title . ' (' . $filter->name . ')';
-  $text[] = 'Format: ' . $format->name . ' (' . $format->format . ')';
-  $text[] = 'Language: ' . $langcode;
-  $text[] = 'Cache: ' . ($cache ? 'Enabled' : 'Disabled');
-  if ($cache_id) {
-    $text[] = 'Cache ID: ' . $cache_id;
-  }
-  return implode("<br />\n", $text);
-}
-
diff --git a/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/filter/filter/FilterTestReplace.php b/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/filter/filter/FilterTestReplace.php
new file mode 100644
index 0000000..109e39f
--- /dev/null
+++ b/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/filter/filter/FilterTestReplace.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter_test\Plugin\filter\filter\FilterTestReplace.
+ */
+
+namespace Drupal\filter_test\Plugin\filter\filter;
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\filter\filter\FilterBase;
+
+/**
+ * @todo.
+ *
+ * @Plugin(
+ *   id = "filter_test_replace",
+ *   module = "filter_test",
+ *   title = @Translation("Testing filter"),
+ *   description = @Translation("Replaces all content with filter and text format information."),
+ *   type = FILTER_TYPE_TRANSFORM_IRREVERSIBLE
+ * )
+ */
+class FilterTestReplace extends FilterBase {
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::process().
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id) {
+    $text = array();
+    $text[] = 'Filter: ' . $filter->title . ' (' . $filter->name . ')';
+    $text[] = 'Format: ' . $this->format->name . ' (' . $this->format->format . ')';
+    $text[] = 'Language: ' . $langcode;
+    $text[] = 'Cache: ' . ($cache ? 'Enabled' : 'Disabled');
+    if ($cache_id) {
+      $text[] = 'Cache ID: ' . $cache_id;
+    }
+    return implode("<br />\n", $text);
+  }
+
+}
diff --git a/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/filter/filter/FilterTestUncacheable.php b/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/filter/filter/FilterTestUncacheable.php
new file mode 100644
index 0000000..32909a0
--- /dev/null
+++ b/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/filter/filter/FilterTestUncacheable.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\filter_test\Plugin\filter\filter\FilterTestUncacheable.
+ */
+
+namespace Drupal\filter_test\Plugin\filter\filter;
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\filter\filter\FilterBase;
+
+/**
+ * @todo.
+ *
+ * @Plugin(
+ *   id = "filter_test_uncacheable",
+ *   module = "filter_test",
+ *   title = @Translation("Uncacheable filter"),
+ *   description = @Translation("Does nothing, but makes a text format uncacheable"),
+ *   type = FILTER_TYPE_TRANSFORM_IRREVERSIBLE,
+ *   cache = FALSE
+ * )
+ */
+class FilterTestUncacheable extends FilterBase {
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::process().
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id) {
+    return $text;
+  }
+
+}
diff --git a/core/modules/php/lib/Drupal/php/Plugin/filter/filter/Php.php b/core/modules/php/lib/Drupal/php/Plugin/filter/filter/Php.php
new file mode 100644
index 0000000..1fa0e2e
--- /dev/null
+++ b/core/modules/php/lib/Drupal/php/Plugin/filter/filter/Php.php
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\php\Plugin\filter\filter\Php.
+ */
+
+namespace Drupal\php\Plugin\filter\filter;
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+use Drupal\filter\Plugin\filter\filter\FilterBase;
+
+/**
+ * Provides PHP code filter. Use with care.
+ *
+ * @Plugin(
+ *   id = "php_code",
+ *   module = "php",
+ *   title = @Translation("PHP evaluator"),
+ *   description = @Translation("Executes a piece of PHP code. The usage of this filter should be restricted to administrators only!"),
+ *   type = FILTER_TYPE_MARKUP_LANGUAGE,
+ *   cache = FALSE
+ * )
+ */
+class Php extends FilterBase {
+
+  /**
+   * Overrides \Drupal\filter\Plugin\filter\filter\FilterBase::tips().
+   */
+  public function tips($filter, $long = FALSE) {
+    global $base_url;
+    if ($long) {
+      $output = '<h4>' . t('Using custom PHP code') . '</h4>';
+      $output .= '<p>' . t('Custom PHP code may be embedded in some types of site content, including posts and blocks. While embedding PHP code inside a post or block is a powerful and flexible feature when used by a trusted user with PHP experience, it is a significant and dangerous security risk when used improperly. Even a small mistake when posting PHP code may accidentally compromise your site.') . '</p>';
+      $output .= '<p>' . t('If you are unfamiliar with PHP, SQL, or Drupal, avoid using custom PHP code within posts. Experimenting with PHP may corrupt your database, render your site inoperable, or significantly compromise security.') . '</p>';
+      $output .= '<p>' . t('Notes:') . '</p>';
+      $output .= '<ul><li>' . t('Remember to double-check each line for syntax and logic errors <strong>before</strong> saving.') . '</li>';
+      $output .= '<li>' . t('Statements must be correctly terminated with semicolons.') . '</li>';
+      $output .= '<li>' . t('Global variables used within your PHP code retain their values after your script executes.') . '</li>';
+      $output .= '<li>' . t('<code>register_globals</code> is <strong>turned off</strong>. If you need to use forms, understand and use the functions in <a href="@formapi">the Drupal Form API</a>.', array('@formapi' => url('http://api.drupal.org/api/group/form_api/8'))) . '</li>';
+      $output .= '<li>' . t('Use a <code>print</code> or <code>return</code> statement in your code to output content.') . '</li>';
+      $output .= '<li>' . t('Develop and test your PHP code using a separate test script and sample database before deploying on a production site.') . '</li>';
+      $output .= '<li>' . t('Consider including your custom PHP code within a site-specific module or <code>template.php</code> file rather than embedding it directly into a post or block.') . '</li>';
+      $output .= '<li>' . t('Be aware that the ability to embed PHP code within content is provided by the PHP Filter module. If this module is disabled or deleted, then blocks and posts with embedded PHP may display, rather than execute, the PHP code.') . '</li></ul>';
+      $output .= '<p>' . t('A basic example: <em>Creating a "Welcome" block that greets visitors with a simple message.</em>') . '</p>';
+      $output .= '<ul><li>' . t('<p>Add a custom block to your site, named "Welcome" . With its text format set to "PHP code" (or another format supporting PHP input), add the following in the Block body:</p>
+  <pre>
+  print t(\'Welcome visitor! Thank you for visiting.\');
+  </pre>') . '</li>';
+      $output .= '<li>' . t('<p>To display the name of a registered user, use this instead:</p>
+  <pre>
+  global $user;
+  if ($user->uid) {
+    print t(\'Welcome @name! Thank you for visiting.\', array(\'@name\' => user_format_name($user)));
+  }
+  else {
+    print t(\'Welcome visitor! Thank you for visiting.\');
+  }
+  </pre>') . '</li></ul>';
+      $output .= '<p>' . t('<a href="@drupal">Drupal.org</a> offers <a href="@php-snippets">some example PHP snippets</a>, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/documentation/customization/php-snippets'))) . '</p>';
+      return $output;
+    }
+    else {
+      return t('You may post PHP code. You should include &lt;?php ?&gt; tags.');
+    }
+  }
+
+  /**
+   * Implements \Drupal\filter\Plugin\filter\filter\FilterInterface::process().
+   */
+  public function process($text, $filter, $langcode, $cache, $cache_id) {
+    return php_eval($text);
+  }
+
+}
diff --git a/core/modules/php/php.module b/core/modules/php/php.module
index 8e885e4..2932bfa 100644
--- a/core/modules/php/php.module
+++ b/core/modules/php/php.module
@@ -86,63 +86,3 @@ function php_eval($code) {
 
   return $output;
 }
-
-/**
- * Implements hook_filter_FILTER_tips().
- *
- * @see php_filter_info()
- */
-function _php_filter_tips($filter, $format, $long = FALSE) {
-  global $base_url;
-  if ($long) {
-    $output = '<h4>' . t('Using custom PHP code') . '</h4>';
-    $output .= '<p>' . t('Custom PHP code may be embedded in some types of site content, including posts and blocks. While embedding PHP code inside a post or block is a powerful and flexible feature when used by a trusted user with PHP experience, it is a significant and dangerous security risk when used improperly. Even a small mistake when posting PHP code may accidentally compromise your site.') . '</p>';
-    $output .= '<p>' . t('If you are unfamiliar with PHP, SQL, or Drupal, avoid using custom PHP code within posts. Experimenting with PHP may corrupt your database, render your site inoperable, or significantly compromise security.') . '</p>';
-    $output .= '<p>' . t('Notes:') . '</p>';
-    $output .= '<ul><li>' . t('Remember to double-check each line for syntax and logic errors <strong>before</strong> saving.') . '</li>';
-    $output .= '<li>' . t('Statements must be correctly terminated with semicolons.') . '</li>';
-    $output .= '<li>' . t('Global variables used within your PHP code retain their values after your script executes.') . '</li>';
-    $output .= '<li>' . t('<code>register_globals</code> is <strong>turned off</strong>. If you need to use forms, understand and use the functions in <a href="@formapi">the Drupal Form API</a>.', array('@formapi' => url('http://api.drupal.org/api/group/form_api/8'))) . '</li>';
-    $output .= '<li>' . t('Use a <code>print</code> or <code>return</code> statement in your code to output content.') . '</li>';
-    $output .= '<li>' . t('Develop and test your PHP code using a separate test script and sample database before deploying on a production site.') . '</li>';
-    $output .= '<li>' . t('Consider including your custom PHP code within a site-specific module or <code>template.php</code> file rather than embedding it directly into a post or block.') . '</li>';
-    $output .= '<li>' . t('Be aware that the ability to embed PHP code within content is provided by the PHP Filter module. If this module is disabled or deleted, then blocks and posts with embedded PHP may display, rather than execute, the PHP code.') . '</li></ul>';
-    $output .= '<p>' . t('A basic example: <em>Creating a "Welcome" block that greets visitors with a simple message.</em>') . '</p>';
-    $output .= '<ul><li>' . t('<p>Add a custom block to your site, named "Welcome" . With its text format set to "PHP code" (or another format supporting PHP input), add the following in the Block body:</p>
-<pre>
-print t(\'Welcome visitor! Thank you for visiting.\');
-</pre>') . '</li>';
-    $output .= '<li>' . t('<p>To display the name of a registered user, use this instead:</p>
-<pre>
-global $user;
-if ($user->uid) {
-  print t(\'Welcome @name! Thank you for visiting.\', array(\'@name\' => user_format_name($user)));
-}
-else {
-  print t(\'Welcome visitor! Thank you for visiting.\');
-}
-</pre>') . '</li></ul>';
-    $output .= '<p>' . t('<a href="@drupal">Drupal.org</a> offers <a href="@php-snippets">some example PHP snippets</a>, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/documentation/customization/php-snippets'))) . '</p>';
-    return $output;
-  }
-  else {
-    return t('You may post PHP code. You should include &lt;?php ?&gt; tags.');
-  }
-}
-
-/**
- * Implements hook_filter_info().
- *
- * Provide PHP code filter. Use with care.
- */
-function php_filter_info() {
-  $filters['php_code'] = array(
-    'title' => t('PHP evaluator'),
-    'type' => FILTER_TYPE_MARKUP_LANGUAGE,
-    'description' => t('Executes a piece of PHP code. The usage of this filter should be restricted to administrators only!'),
-    'process callback' => 'php_eval',
-    'tips callback' => '_php_filter_tips',
-    'cache' => FALSE,
-  );
-  return $filters;
-}
