Make WordPress Core

Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#5316 closed enhancement (wontfix)

Extend options.php to allow deletion, Viewing of Serialized, And grouping options

Reported by: dd32's profile DD32 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:

Description

I floated this idea back in September on wp-hackers: http://comox.textdrive.com/pipermail/wp-hackers/2007-September/thread.html#14425 ([wp-hackers] adding delete/autoload to options.php)

Basically this patch allows options to be deleted from the options.php page(By checking its checkbox - a JS confirmation is done before form submitting to make sure the user intends to delete them), Viewing of Serialized data, And also groups the options by name.

Grouping is achieved by taking the first word in the term, Ie. "test" in "test_plugin_data", If there are more than 2 terms with such a groupname, then they're promoted into their own section, This makes it easier to mass-select a particular 'groups' options to delete.

An invert selection option is also available for each group, So if a user wants to delete all the RSS cache items, They can either select all the cache items to remove, or, Select the items they wish to keep(in the rss section) and click Invert.

I've attached a plugin which is identical to the patch for those not wanting to apply the patch.

The linked wp-hackers thread mentioned also having an option to set autoload, I have not yet done that (As it'll require modifying/creating other functions) yet, But would like to include it, Just not sure how in the UI it could be managed without looking too crowded.

Attachments (6)

5316.diff (8.8 KB) - added by DD32 18 years ago.
patch against trunk options.php
extended-options.php (6.7 KB) - added by DD32 18 years ago.
Patch in Plugin form
5316.2.diff (10.1 KB) - added by DD32 17 years ago.
Rewrite from scratch
5316.3.diff (12.4 KB) - added by DD32 17 years ago.
Some styling changes, styles in wp-admin.css were also combined (Mutliple styles for different ID's with the same code)
5316.4.diff (14.2 KB) - added by DD32 17 years ago.
5316.5.diff (16.3 KB) - added by DD32 17 years ago.

Download all attachments as: .zip

Change History (17)

@DD32
18 years ago

patch against trunk options.php

@DD32
18 years ago

Patch in Plugin form

#1 @DD32
18 years ago

  • Type changed from defect to enhancement

#2 @johnbillion
18 years ago

  • Keywords dev-feedback added

I really, really like this. Very convenient to be able to delete options from here (handy for plugin testing etc) and the grouping by prefix is very sexy.

I can see no reason for this going into core, as because of the relative obscurity of this options page, it won't affect the majority of people who use WordPress, and I'm sure the people who do use this options page from time to time will be in favour of these nice changes.

As its main aim is plugin developers (correct me if I'm wrong), it could just as effectively remain as a plugin though, so I'll give it a +0.75 for core.

#3 @johnbillion
18 years ago

Oh also, it would be ace to be able to edit the serialized data. Can't imagine that would be too easy to do though.

#4 @DD32
18 years ago

Editing serialized data was suggested on wp-hackers, And i've got a idea in my mind for how to achieve that thanks to some suggestions. (Well, Editing at least for Serialised Arrays, Objects are a bit harder).

It could effectivly stay as a plugin, which is why i wrapped it up into a plugin for this ticket, Since the options page is rather obscure, it doesnt affect many users, But most of these are changes which are useful to most people who use the options page(for whatever reason), I know some people who have a couple of thousand options in their WP installs (from playing with plugins over the years) - To them, the ability to delete a group of options from a plugin they no longer use would be great.

Its that reason why i thought as a core feature, It doesnt affect many people, But the options page IS there, Why not allow more control over the options for people who do tinker with their WP installs? (Thats more than just Plugin Developers, Allthough Devs are the main target for these changes)

#5 @ryan
18 years ago

  • Milestone changed from 2.5 to 2.6

#6 @DD32
17 years ago

  • Version changed from 2.5 to 2.6

Been playing around again, And scraped some of the ideas of this ticket.

Last time around when playing with Jeditable i found it wasnt really suited to the job that well, Since most of the fields are editable, it makes sense that the user should see textboxes for editing, rather than having to click to edit.

I'm adding a patch in a moment that allows:

  • Filtering of the table to only show rows matching a certain phrase
  • Allows Deletion of options via checkbox
  • Allows multiple checkbox's to be selected via Shift+select from the admin-forms JS
  • Javascript degrades into normal page reloading.

Things to note:

  • The checkAll() and shift+select range javascripts from admin-forms were modified to only check checkbox's in visible rows
    • Shouldnt affect any other uses of the admin-forms JS as they're only dealing with visible table rows anyway.
  • Added UI Table Filter script from http://gregweber.info/projects/uitablefilter (Dual Licenced under MIT and GPL)
    • I found that the script filtering to an empty phrase could be slow, So i've added a branch in the custom code to use my own routine.
    • Only filters to a search when the phrase is > 2 char in JS mode
  • Inline Javascript from the options page could be moved to an external script
  • No viewing of Serialised data, Yet. Unsure of what to do in those cases as currently it may be too hard to allow editing of such data
    • Simple arrays shouldnt be too hard, But more complex objects and nested arrays can be difficult

@DD32
17 years ago

Rewrite from scratch

@DD32
17 years ago

Some styling changes, styles in wp-admin.css were also combined (Mutliple styles for different ID's with the same code)

#7 @DD32
17 years ago

attachment 5316.3.diff added.

  • Did away with the form-table, and moved over to the widefat table, While the form-table is generally used on the other settings pages, On tabalised data, the widefat class generally looks better. (And supports a check column better without adding extra styling)
  • Streamlined some other code and aligned things better.

The Columns still need to be worked out a bit more, And maybe some button changes need to be made, Some feedback for those would be nice.

@DD32
17 years ago

@DD32
17 years ago

#8 @DD32
17 years ago

attachment 5316.5.diff added.

  • Adds Viewing of Serialised arrays
    • Doesnt allow viewing of Objects as generally they're cache files and rather large.
    • Doesnt support editing arrays.
  • degrades gracefully
  • All previous uses of options.php remain valid and require no changes

#9 @DD32
17 years ago

Unless theres any traction from anyone, I'll close this off as a wontfix in a few days, And think about writing it up in a plugin at some stage.

#10 follow-up: @DD32
17 years ago

  • Keywords has-patch options dev-feedback removed
  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from new to closed
  • Version 2.6 deleted

Might release it as a plugin if i ever get around to it.

Closing as wontfix due to no traction.

#11 in reply to: ↑ 10 @jacobsantos
17 years ago

Replying to DD32:

Might release it as a plugin if i ever get around to it.

Closing as wontfix due to no traction.

That would be sweet.

Note: See TracTickets for help on using tickets.