[wp-trac] [WordPress Trac] #12324: Broken .htaccess File Created By WP 2.9.2
WordPress Trac
wp-trac at lists.automattic.com
Mon Feb 22 19:49:50 UTC 2010
#12324: Broken .htaccess File Created By WP 2.9.2
--------------------------+-------------------------------------------------
Reporter: magblogapi | Owner: ryan
Type: defect (bug) | Status: reopened
Priority: normal | Milestone:
Component: Permalinks | Version: 2.9.2
Severity: normal | Resolution:
Keywords: |
--------------------------+-------------------------------------------------
Changes (by kevinB):
* cc: kevinB (added)
* status: closed => reopened
* resolution: invalid =>
Comment:
It does appear that Role Scoper triggers redundant calls to
$wp_rewrite->flush_rules, though this is the first I've heard of it
through 36,000 downloads. I do have some legitimate reasons to update the
.htaccess file, and can describe those if you want. I am treating this as
a potential misuse of the WP API on my end, and looking into it.
However, I would like to clarify my usage and argue that the symptoms
suggest that there is also a WordPress defect here.
* The WP_Rewrite::flush_rules is documented as a public method, and Role
Scoper is not the only plugin which "screws with it". NextGEN Gallery is
another.
* $hard = TRUE is the default argument value for
$wp_rewrite->flush_rules(). It is also used in wp-admin/options-
permalink.php, and by other plugins (such as NextGEN) that need to force
an update to .htaccess. By passing the $hard=TRUE explictly, I just guard
against future changes to the default value.
* The explicit file.php include is there mainly because I ran into some
situations where WP had loaded misc.php but not file.php. The result was
that save_mod_rewrite_rules() failed with a bad get_home_path() call.
Since I couldn't pin down the exact conditions, I added those includes
rather than annoy you with a plugin-related symptom. In most wp-admin
situations, those files are both already loaded. I don't think a harmless
/ needless file inclusion makes a subsequent $wp_rewrite->flush_rules()
call illegitimate.
* Is $wp_rewrite->flush_rules() supported API or not? Even if I call
flush_rules() too many times, WP's internal functions are ultimately
responsible for the duplicate # BEGIN WordPress ... #END WordPress blocks.
At least, as miqrogroove suggested for #11903, skip the .htaccess
modification (or temp file generation) if the live .htaccess contents are
the same as current. That would make this ticket a duplicate report of a
legitimate WP defect.
* I will admit some ignorance of what multi-threading is being done that
pertains to this. Can someone link some info on that for the benefit of
me and any other plugin devs who tend to exercise the lesser-used portions
of the API?
So I'm lobbying to modify the conclusion of this ticket from "inept and
dangerous plugin developer" to (a) "ambitious plugin developer has really
exercised the API but pushed this button too many times" and (b) WordPress
devs admit some small weakness in the API and fix that to handle
unexpected calls without catastrophic system failure.
nacin, if you have observed specific problems with Role Scoper, please
submit them to the [http://agapetry.net/forum/ Role Scoper support forum]
or wordpress.org. Your "may be doing more damage" speculation here isn't
relevant or helpful.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12324#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list