Darren & Otto thanks ... I just took a look at the line Otto referenced and will address making a change. What I also found odd was that I somehow had inadvertently added an extra semi-colon at the end of that line. Either way, I will make a change and resubmit the theme. <br>
<br clear="all"><b style="color: rgb(0, 102, 0);"><span style="font-family: trebuchet ms,sans-serif;">Best Regards</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">Tom Matteson</span></b><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;"></span><span style="font-family: trebuchet ms,sans-serif;">----------------------------------------------------------------------------------------</span><font style="font-family: trebuchet ms,sans-serif;" size="2"><span style="color: rgb(79, 98, 40);"></span></font><span style="font-family: trebuchet ms,sans-serif;"><br>
</span><br>
<br><br><div class="gmail_quote">On Sat, Jul 16, 2011 at 4:18 PM, Otto <span dir="ltr"><<a href="mailto:otto@ottodestruct.com">otto@ottodestruct.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Yep. In <a href="http://themes.svn.wordpress.org/wordsmith-anvil/1.6.7/functions/anvil-options.php" target="_blank">http://themes.svn.wordpress.org/wordsmith-anvil/1.6.7/functions/anvil-options.php</a>.<br>
<br>
This is wrong:<br>
<br>
$anvil_themedata = get_theme_data( $stylesheet_uri );<br>
<br>
You should be using the STYLESHEETPATH define or the<br>
get_stylesheet_directory() function to get the full path to the<br>
stylesheet instead. You'll want to add style.css to the end of that,<br>
as it's a path, not the full name of the stylesheet.<br>
<br>
Better yet, don't. Do something else like hardcoding those values or<br>
something. get_theme_data takes a lot of processor power to parse and<br>
such, it's not worth it for an options page.<br>
<font color="#888888"><br>
-Otto<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
On Sat, Jul 16, 2011 at 6:12 PM, Otto <<a href="mailto:otto@ottodestruct.com">otto@ottodestruct.com</a>> wrote:<br>
> What about get_theme_data? Are you using that anywhere? Are you doing<br>
> anything with a URL anywhere?<br>
><br>
> The core code itself doesn't pass URLs for filenames, so the fact that<br>
> url fopen is disabled is fine.<br>
><br>
> -Otto<br>
><br>
><br>
><br>
> On Sat, Jul 16, 2011 at 5:42 PM, Tom Matteson<br>
> <<a href="mailto:perspectivevision@gmail.com">perspectivevision@gmail.com</a>> wrote:<br>
>> Darren ... I am pretty sure they were both using 3.1.x ... and in response<br>
>> to your other question, my theme does not call get_file_data() anywhere.<br>
>><br>
>> Best Regards<br>
>> Tom Matteson<br>
>> ----------------------------------------------------------------------------------------<br>
>><br>
>><br>
>><br>
>> On Sat, Jul 16, 2011 at 2:23 PM, Darren Slatten <<a href="mailto:darrenslatten@gmail.com">darrenslatten@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> I'm guessing 3.1.x, since wp-includes/functions.php has an fopen() on line<br>
>>> 4284 (whereas WP 3.2 has only a line break).<br>
>>><br>
>>> The WP function calling fopen() is get_file_data(). Does your theme call<br>
>>> this function directly?<br>
>>><br>
>>> Here's the code:<br>
>>><br>
>>> /**<br>
>>> * Retrieve metadata from a file.<br>
>>> *<br>
>>> * Searches for metadata in the first 8kiB of a file, such as a plugin or<br>
>>> theme.<br>
>>> * Each piece of metadata must be on its own line. Fields can not span<br>
>>> multple<br>
>>> * lines, the value will get cut at the end of the first line.<br>
>>> *<br>
>>> * If the file data is not within that first 8kiB, then the author should<br>
>>> correct<br>
>>> * their plugin file and move the data headers to the top.<br>
>>> *<br>
>>> * @see <a href="http://codex.wordpress.org/File_Header" target="_blank">http://codex.wordpress.org/File_Header</a><br>
>>> *<br>
>>> * @since 2.9.0<br>
>>> * @param string $file Path to the file<br>
>>> * @param array $default_headers List of headers, in the format<br>
>>> array('HeaderKey' => 'Header Name')<br>
>>> * @param string $context If specified adds filter hook<br>
>>> "extra_{$context}_headers"<br>
>>> */<br>
>>> function get_file_data( $file, $default_headers, $context = '' ) {<br>
>>> // We don't need to write to the file, so just open for reading.<br>
>>> $fp = fopen( $file, 'r' );<br>
>>><br>
>>> // Pull only the first 8kiB of the file in.<br>
>>> $file_data = fread( $fp, 8192 );<br>
>>><br>
>>> // PHP will close file handle, but we are good citizens.<br>
>>> fclose( $fp );<br>
>>><br>
>>> if ( $context != '' ) {<br>
>>> $extra_headers = apply_filters( "extra_{$context}_headers",<br>
>>> array() );<br>
>>><br>
>>> $extra_headers = array_flip( $extra_headers );<br>
>>> foreach( $extra_headers as $key=>$value ) {<br>
>>> $extra_headers[$key] = $key;<br>
>>> }<br>
>>> $all_headers = array_merge( $extra_headers, (array)<br>
>>> $default_headers );<br>
>>> } else {<br>
>>> $all_headers = $default_headers;<br>
>>> }<br>
>>><br>
>>> foreach ( $all_headers as $field => $regex ) {<br>
>>> preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) .<br>
>>> ':(.*)$/mi', $file_data, ${$field});<br>
>>> if ( !empty( ${$field} ) )<br>
>>> ${$field} = _cleanup_header_comment( ${$field}[1] );<br>
>>> else<br>
>>> ${$field} = '';<br>
>>> }<br>
>>><br>
>>> $file_data = compact( array_keys( $all_headers ) );<br>
>>><br>
>>> return $file_data;<br>
>>> }<br>
>>><br>
>>><br>
>>> On Sat, Jul 16, 2011 at 4:14 PM, Darren Slatten <<a href="mailto:darrenslatten@gmail.com">darrenslatten@gmail.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> What version of WP are they using?<br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Sat, Jul 16, 2011 at 3:49 PM, Tom Matteson<br>
>>>> <<a href="mailto:perspectivevision@gmail.com">perspectivevision@gmail.com</a>> wrote:<br>
>>>>><br>
>>>>> Darren ... the first one switched to using a different theme because<br>
>>>>> they could not resolve this. However, his WordPress installation was in a<br>
>>>>> subdirectory (see the errors below **with the user's domain and subdirectory<br>
>>>>> edited**) I do know the first user's site was hosted by surpasshosting dot<br>
>>>>> com and per their security settings they would not enable allow_url_fopen<br>
>>>>> ... other than that I am unaware of their php.ini settings<br>
>>>>><br>
>>>>><br>
>>>>> Warning:<br>
>>>>><br>
>>>>> fopen(<a href="http://primarydomain.com/sub-directory/wp-content/themes/wordsmith-anvil/style.css" target="_blank">http://primarydomain.com/sub-directory/wp-content/themes/wordsmith-anvil/style.css</a>)<br>
>>>>> [function.fopen]: failed to open stream: no suitable wrapper could be<br>
>>>>> found in<br>
>>>>> /home/primaryd/public_html/sub-directory/wp-includes/functions.php on<br>
>>>>> line<br>
>>>>> 4284<br>
>>>>><br>
>>>>> Warning: fread(): supplied argument is not a valid stream resource in<br>
>>>>> /home/primaryd/public_html/sub-directory/wp-includes/functions.php on<br>
>>>>> line<br>
>>>>> 4287<br>
>>>>><br>
>>>>> Warning: fclose(): supplied argument is not a valid stream resource in<br>
>>>>> /home/primaryd/public_html/sub-directory/wp-includes/functions.php on<br>
>>>>> line<br>
>>>>> 4290"<br>
>>>>><br>
>>>>> One thing I had read somewhere is that using absolute paths (direct<br>
>>>>> links) as opposed to relative paths could cause these errors to appear. In<br>
>>>>> the Wordsmith Anvil theme the only direct links are:<br>
>>>>><br>
>>>>> Developer and WordPress.org credit links (common with most all themes)<br>
>>>>> Link to FAQ and Theme Home page in Admin Theme Options Page (fairly<br>
>>>>> common)<br>
>>>>> Various license links (common with all themes)<br>
>>>>> Direct links assigned to Social Media variables for Twitter, FB, Flickr,<br>
>>>>> YouTube ...[eg $flickrurl = '<a href="http://www.flickr.com/photos/%27" target="_blank">http://www.flickr.com/photos/'</a>;] (common to<br>
>>>>> themes with these options)<br>
>>>>><br>
>>>>> The second user's site is hosted with <a href="http://secureserver.net" target="_blank">secureserver.net</a> (there apparently<br>
>>>>> have been some errors with that host server and WordPress in the past see:<br>
>>>>> <a href="http://wordpress.org/support/topic/defaultsecureservernet" target="_blank">http://wordpress.org/support/topic/defaultsecureservernet</a>)<br>
>>>>><br>
>>>>> The errors on the second user's site were the same. The user has<br>
>>>>> currently deactivated the theme and has an under construction page<br>
>>>>> displayed. I have emailed her to ask that she re-activate to get addtional<br>
>>>>> feedback. I imagine it will be re-activated at some point today. For<br>
>>>>> reference, the url to that site is: <a href="http://homesweethomerescue.org/" target="_blank">http://homesweethomerescue.org/</a><br>
>>>>><br>
>>>>> As I discover additional details I will provide them.<br>
>>>>><br>
>>>>> Best Regards<br>
>>>>> Tom Matteson<br>
>>>>><br>
>>>>> ---------------------------------------------------------------------------------------<br>
>>>>><br>
>>>>><br>
>>>>> On Sat, Jul 16, 2011 at 12:37 PM, Darren Slatten<br>
>>>>> <<a href="mailto:darrenslatten@gmail.com">darrenslatten@gmail.com</a>> wrote:<br>
>>>>>><br>
>>>>>> This would be a lot easier to diagnose if you could provide information<br>
>>>>>> like:<br>
>>>>>><br>
>>>>>> hosting environment<br>
>>>>>> php.ini settings<br>
>>>>>> full text of error messages<br>
>>>>>> what types of pages/requests generate the errors<br>
>>>>>><br>
>>>>>> If the errors are only showing in 2:10,000 installations, then there's<br>
>>>>>> a good chance that those 2 users have an unusual server configuration or<br>
>>>>>> file/URL structure. Could be caused by something like trying to open/include<br>
>>>>>> a file or image that isn't in the typical location, relative to your theme.<br>
>>>>>><br>
>>>>>><br>
>>>>>> On Sat, Jul 16, 2011 at 3:47 AM, Tom Matteson<br>
>>>>>> <<a href="mailto:perspectivevision@gmail.com">perspectivevision@gmail.com</a>> wrote:<br>
>>>>>>><br>
>>>>>>> Greetings All Concerned ...<br>
>>>>>>><br>
>>>>>>> I have a theme on the Repository--Wordsmith Anvil--which does not use<br>
>>>>>>> fopen, fgets or freads functions. It has been downloaded close to 10,000<br>
>>>>>>> times and I have just received a comment from the second user who is<br>
>>>>>>> receiving errors referencing "failed to open stream: no suitable wrapper<br>
>>>>>>> could be found in ...", or "supplied argument is not a valid stream resource<br>
>>>>>>> in ..." with this theme. The errors all point to various lines of<br>
>>>>>>> wp-includes/functions.php, except one file reference to the theme default<br>
>>>>>>> css file, style.css. The first user told me they disabled all plugins. Also,<br>
>>>>>>> they performed a fresh WordPress install and did not see the errors using<br>
>>>>>>> TwentyTen and a number of other themes. The second user who contacted me<br>
>>>>>>> yesterday told me they do not have any plugins installed and when they<br>
>>>>>>> activated the Wordsmith Anvil theme, these errors display at the top of the<br>
>>>>>>> page.<br>
>>>>>>><br>
>>>>>>> Knowing that these functions are not used in this theme; yet the<br>
>>>>>>> errors seem to be theme specific, and each user experiencing these errors<br>
>>>>>>> have WordPress installations hosted on entirely different servers I am more<br>
>>>>>>> uncertain as to why these errors are being displayed. I was hoping someone<br>
>>>>>>> on this list may have experienced this with another theme and could shed<br>
>>>>>>> some light on why these errors would occur when the theme does not use those<br>
>>>>>>> functions. In fact, if these functions had been used in my theme, I am<br>
>>>>>>> fairly certain it would not have been approved anyway.<br>
>>>>>>><br>
>>>>>>> Otto, Nathan, Chip, Justin, Emil, Cais, etc ... any thoughts or<br>
>>>>>>> feedback on this. I would like to address this so that users in the future<br>
>>>>>>> do not see these errors.<br>
>>>>>>><br>
>>>>>>> Best Regards<br>
>>>>>>> Tom Matteson<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> _______________________________________________<br>
>>>>>>> theme-reviewers mailing list<br>
>>>>>>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>>>>>>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>> --<br>
>>>>>> Darren Slatten<br>
>>>>>><br>
>>>>>><br>
>>>>>> _______________________________________________<br>
>>>>>> theme-reviewers mailing list<br>
>>>>>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>>>>>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>>>>>><br>
>>>>><br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> theme-reviewers mailing list<br>
>>>>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>>>>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> --<br>
>>>> Darren Slatten<br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Darren Slatten<br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> theme-reviewers mailing list<br>
>>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> theme-reviewers mailing list<br>
>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>><br>
>><br>
><br>
_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</div></div></blockquote></div><br>