Make WordPress Core


Ignore:
Timestamp:
11/27/2017 02:59:27 AM (7 years 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].
Merges [42242] to the 4.9 branch.
See #6531.
Fixes #42573 for 4.9.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/plugin.php

    r41819 r42243  
    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.