WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/27/2017 02:58:02 AM (6 months ago)
Author:
dd32
Message:

Theme/Plugin Editor: Remove the caching added in [41806] as it causes more problems than it fixes.

While caching here seemed like a good idea in theory, in practice the cache would be often stale causing development issues.
We exclude common folders (such as node_modules) from the scanning to avoid directories which are not useful to the end-user, so as long as those exclusion lists are held up this shouldn't cause too much of a degredation in the future.
We may consider adding caching here again in the future if it's determined that it is really needed.

Props precies, ibenic, mariovalney, schlessera, and all the others who commented on the ticket(s).
This partually reverts [41806].
See #6531.
Fixes #42573.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r41819 r42242  
    195195    $dir = dirname( $plugin_file );
    196196
    197     $data = get_plugin_data( $plugin_file );
    198     $label = isset( $data['Version'] )
    199         ? sanitize_key( 'files_' . $plugin . '-' . $data['Version'] )
    200         : sanitize_key( 'files_' . $plugin );
    201     $transient_key = substr( $label, 0, 29 ) . md5( $label );
    202 
    203     $plugin_files = get_transient( $transient_key );
    204     if ( false !== $plugin_files ) {
    205         return $plugin_files;
    206     }
    207 
    208197    $plugin_files = array( plugin_basename( $plugin_file ) );
    209198
     
    225214        $plugin_files = array_values( array_unique( $plugin_files ) );
    226215    }
    227 
    228     set_transient( $transient_key, $plugin_files, HOUR_IN_SECONDS );
    229216
    230217    return $plugin_files;
Note: See TracChangeset for help on using the changeset viewer.