+ wp_die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>');
+
+ if ( $_GET['liveupdate'] ) {
+ check_admin_referer('edit-plugin-test_' . $file);
+ $current = get_option('active_plugins');
+ $plugin = $file;
+ if ( validate_file($plugin) )
+ wp_die(__('Invalid plugin.'));
+ if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) )
+ wp_die(__('Plugin file does not exist.'));
+ if (!in_array($plugin, $current)) {
+ wp_redirect("plugin-editor.php?file=$file&phperror=1"); // we'll override this later if the plugin can be included without fatal error
+ @include(ABSPATH . PLUGINDIR . '/' . $plugin);
+ $current[] = $plugin;
+ sort($current);
+ update_option('active_plugins', $current);
+ }
+ wp_redirect("plugin-editor.php?file=$file&a=te");
+ }
+
+ require_once('admin-header.php');
+
+ update_recently_edited(PLUGINDIR . "/$file");