[theme-reviewers] Theme Scan Failing

Andrew Nacin wp at andrewnacin.com
Thu Dec 2 09:41:32 UTC 2010


On Thu, Dec 2, 2010 at 4:02 AM, Sayontan Sinha <sayontan at gmail.com> wrote:

> There's no good reason to use fopen in a theme. Any reason you can
>> think of has better ways of doing it.
>>
>
> I am curious as to what qualifies as a better way of doing things. E.g. I
> have code where depending on selections certain stylesheets are grouped
> together, then either they are compressed and/or minified. This requires a
> call to fopen to spit out all the contents of a local file into a buffer,
> then operate on that buffer. I cannot think of a way other than the one
> implemented for this purpose. Functions like include or get_template_part
> will fail to do what is intended because the contents of the files need to
> be altered on the fly. And if you are loading a collection of CSS files
> through PHP using the "link" tag, the PHP goes out of WP's context, so
> native WP functions will not be available in that PHP, unless you use
> wp-load.php, which is absolutely not recommended (I did read your post on
> wp-load, BTW).


That's for a plugin to do, not a theme.


> I also checked WP's native loader files - they incidentally use
> file_get_contents(), which is another function apparently blacklisted as
> "fishy code" by the theme upload checker.
>

Yes. It has the potential to be fishy. There's no reason for a theme to use
it. If they need to do an external request, they should use the HTTP API. If
they need to do an internal request, well, they shouldn't be doing any
internal requests.

Nacin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20101202/49447f9c/attachment.htm>


More information about the theme-reviewers mailing list