[wp-trac] [WordPress Trac] #6863: Plugin Update Notification incorrectly notifies
WordPress Trac
wp-trac at lists.automattic.com
Tue Dec 8 08:33:07 UTC 2009
#6863: Plugin Update Notification incorrectly notifies
----------------------------------------+-----------------------------------
Reporter: csogilvie | Owner: mdawaffe
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: WordPress.org | Version: 2.5.1
Severity: normal | Resolution: duplicate
Keywords: dev-feedback needs-testing |
----------------------------------------+-----------------------------------
Changes (by mdawaffe):
* status: accepted => closed
* resolution: => duplicate
Comment:
Marking as duplicate of #10814.
The problem is that the API has no unique identifier for plugins.
Currently, the API uses the following heuristics to guess at what plugin
is requested.
{{{
$plugin_url = URL from plugin header of plugin file on your server;
$plugin_dir = santize/normalize( basename( dirname( plugin file on your
server ) ) );
$plugin_name = santize/normalize( Name from plugin header of plugin file
on your server );
A plugin's slug is defined as the last piece of the plugin's URL in the
Plugins Directory: http://wordpress.org/extend/plugins/{slug}/
A plugin's name is the name of the plugin as far as the Plugins Directory
knows: specified in the plugin header of the current stable tag version of
the plugin in the Plugins Directory.
1. Find all plugins that have the given plugin_url.
2a. Find all plugins where slug = $plugin_dir.
2b. Find all plugins where slug = $plugin_name.
3. Find all plugins where sanitize/normalize( name ) = $plugin_name.
Define group 2 = union( group 2a, group 2b );
If there are any plugins that are in all groups, RETURN first such plugin.
Else:
foreach plugin in union( group 1, group 2, group 3 ) {
score[plugin] += 10 if in group 1 (url)
score[plugin] += 8 if in group 2a (slug = directory)
score[plugin] += 5 if in group 2b (slug = name)
}
RETURN plugin with highest score.
}}}
This is super ghetto. Note that the a plugin's score isn't improved by
being in group 3. We've tried that, and we get lots of false matches. It
seems that scoring URL highly gives the best results. We also score group
2a (slug = directory) highly since it matches for all plugins installed
"automatically" via wp-admin/plugins.php.
The heuristics can probably be improved, but the only real solution is to
have a unique ID for each plugin in the Plugins Directory. That unique ID
must be accessible to WordPress. That's what #10814 is about.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/6863#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list