[wp-trac] [WordPress Trac] #14179: Theme asking to update (theme with same name on WordPress.org)
WordPress Trac
noreply at wordpress.org
Sat Jul 22 10:36:22 UTC 2017
#14179: Theme asking to update (theme with same name on WordPress.org)
----------------------------+----------------------------
Reporter: design_dolphin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: WordPress.org
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
----------------------------+----------------------------
Comment (by dingdang):
@grapplerulrich
Replying to [comment:42 grapplerulrich]:
> The main issue is with the author name. The author name is the style.css
can anything and the theme author could change this text whenever they
wish. WordPress.org knows who the theme belongs to from the uploader
process and not from the `style.css`.
The proposed method does just one thing: '''creates a new single table'''.
That means it is not incompatible with any other parts of the code, even
like in your example that wordpress.org knows the author by other means.
To understand better how it works, here is actually how I came up with
that simple idea - I sniffed back to WP 3.0 its API requests and found
what is common for all of the versions - all of them are sending back to
the API these 3 values (slug, author, author URI). Then we know there are
N themes and M total versions at the SVN that I call "native". All we have
to do is to identify them by a unique string, put that in a table and
that's all. From that point forward the API will know if a request coming
for update check is about a "native" theme or an external one (and so used
for the counting of active themes as well).
To clarify more - the MD5 is there not because it is needed, just for
esthetics. Now after I did more tests (I've downloaded partially 36000
different versions of themes, 3100 unique themes) I can come up with
VERSION 2 of the method which is even simpler.
'''Key factors:'''
- '''MD5 processing is not needed''' (so not at all increasing of CPU time
for API)
- '''author URI is not needed''' to be taken in consideration (and so
lower the chance for a client to lose future updates if he accidentally
changes author's URI line in style.css file after installation) - just the
additional author string is enough for this to work.
'''VERSION 2 UPDATE'''
1. No need of changes in the core even for optimization as there is no MD5
anymore
2. UIDs are composed simpler by just concatenating the
slug+delimiter+author strings
3. No need to attach the second time the slug - it is already in the
concatenated string
3. The invention of the method is the table of UIDs and it is the same -
just a simple list of UIDs
4. Identification of the theme slug is the same (extracting from UID the
string that precedes the delimiter)
5. New uploads to the SVN result in addition (if not present) of a new
entry to the table as in version 1
'''Additional benefits of version 2:'''
- no need for MD5 calculations
- less fields used for identification, the list of UIDs is almost the same
in numbers as the count of the unique themes (as the author field is
almost never changed, the approximate coefficient is 1.17 which means the
table of UIDs will have approx. 5700 entries for 4900 themes, an excess of
just 800)
Cheers
--
Ticket URL: <https://core.trac.wordpress.org/ticket/14179#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list