Simon,<br>After your statement last week about prioritization I was hoping to see some activity regarding the approval of Suffusion. However I was quite disappointed to see that let alone being approved, the Trac ticket wasn't even assigned to anyone. It has now been almost 20 days since I submitted version 3.5.4 and 5 days since I submitted 3.5.5.<br>
<br>In any case I cleaned up all the NOTICE statements that I could find and resubmitted 3.5.6. I hope this at least gets assigned to someone - it is quite irritating when users ask for bug-fixes that have been submitted weeks ahead but not approved. This is the new Trac ticket: <a href="http://themes.trac.wordpress.org/ticket/324">http://themes.trac.wordpress.org/ticket/324</a><br>
<br>Sayontan.<br><br><div class="gmail_quote">On Sun, Jul 4, 2010 at 12:39 PM, Dave Jesch <span dir="ltr"><<a href="mailto:davejesch@gmail.com">davejesch@gmail.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;">
<br><br><div class="gmail_quote"><div class="im">On Sat, Jul 3, 2010 at 6:52 PM, Sayontan Sinha <span dir="ltr"><<a href="mailto:sayontan@gmail.com" target="_blank">sayontan@gmail.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;">
Simon,<br>This is exactly what I am trying to explain to you - the big picture.<br><br>Take the options loop for example:<div><br>
foreach ($options as $value) {<br>
if (!isset($suffusion_options[$<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">value['id']])) {<br>
$$value['id'] = $value['std'];<br>
}<br>
else {<br>
$$value['id'] = $suffusion_options[$value['id']];<br>
}<br>
}<br>
<br>
</blockquote><br></div>$options is a very big array that comes from theme-options.php, where <b>each</b> of the 400 odd elements with an id has an "std" value. The entire options framework is predicated upon this foundation (for the last 10 months). You will never get the so-called error. Having your extra condition will cause it no difference - your example is more lines of code that will give you no advantage. You approach this from the angle that if $value['std'] is not set (which will never happen in that array), $$value['id'] will not get set, while the code in theme-options.php ensures that $value['std'] will be present for anything with an id. If it isn't, my theme will have bigger problems to handle than a debug message. <br>
<br>You are trying to split hairs between isset and is_null. I am simply making use of the fact that if something is not set, its value is still null (though that will give you a notice, but only if you have debug turned on - never otherwise). It doesn't damage the code in any way and it surely doesn't affect how the theme runs. All these arrays that you are asking me to write conditions around, these are arrays that I control, not something that a user defines. Hence I know what is in them - checks such as this will only increase cycle times in so many cases without adding value. The next thing you know, you will ask me to check for isset around different global variables, because all my global variables are initiated through the above code and if I have an "isset" around $$value['id'], there is a high likelihood that a global variable will not be initialized according to you - a condition, which according to me will never occur in the theme.<br>
</blockquote></div><div><br>I get what you're trying to do. But checking for the existence of an array element does not take up that much additional time. Stop and consider what happens when the array element doesn't exist. PHP raises an error condition. It then writes something to the Apache log files (this happens whether or not WordPress has WP_DEBUG turned on) and then attempts to recover. The recovery mechanism is to evaluate the value as NULL. So yes, it has the desired effect within your code, but the amount of overhead to get there (raising error condition and especially writing to a log file) takes far more cycles than checking to see if the array element exists beforehand. And then once you've determined whether or not the array element exists, you're copying it. This takes up more time and a lot more memory (as opposed to using a reference). If you're really concerned about performance, try both methods and benchmark them.<br>
<br>The other problem with the errors is that it's filling up the Apache log files with a bunch of messages that don't serve any real purpose. Now if you need to look in the logs, there are thousands of error messages that you need to wade through that are just a distraction, making it very difficult to find anything else that might be important. It's just good manners to make your code as "quiet" as possible in the log files since you never know what else is going on with the machine.<br>
<br>As far as the globals go, if there is a problem checking any unassigned global values, that would also show up in the log file. If there are no such messages in the logs, then the condition you're mentioning doesn't exists and therefore doesn't need to be addressed: the globals are being initialized before any reference to them, which is all that you need be concerned about.<br>
<br></div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I don't know how else to explain this - it is such a simple concept that should raise no eyebrows, yet you seem to be bent upon trying to find flaws in it.<br></blockquote></div><div><br>No one is trying to find flaws in your system. But errors are being written to log files, which means that something potentially bad is happening. It doesn't take much to change your code to remove the errors. No one is telling you that your system needs to be changed, only that it should be enhanced. If all theme and plugin authors make their code as robust and error free as possible, then WordPress itself will perform better -- which is what we all want.<br>
<br></div><div><div></div><div class="h5"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><font color="#888888"><br>Sayontan.</font><div><div>
</div><div><br><br>
<div class="gmail_quote">On Sat, Jul 3, 2010 at 6:12 PM, Simon Prosser <span dir="ltr"><<a href="mailto:pross@pross.org.uk" target="_blank">pross@pross.org.uk</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;"><div>On 04/07/2010 01:09, Sayontan Sinha wrote:<br>
> Pick the very first one for example, which says that there is no index<br>
> called "#horizontal-outer-widgets-1 a:hover/color" in<br>
> theme-definitions.php. That is incorrect information and you really need<br>
> to see the code to see how it works. This particular index has been<br>
> defined multiple times, and there is an inheritance array defined, so if<br>
> the variable is not defined in one place it picks it from the parent etc.<br>
</div>first few examples:<br>
if ($style_settings[$mapped_style] != null) {<br>
$style_settings[$mapped_style] is not defined so you get the Notice.<br>
<br>
if ( isset($style_settings[$mapped_style]) ) {<br>
does the same thing with no errors.<br>
<br>
<br>
else {<br>
$parent = $style_settings["parent"];<br>
$style_settings["parent"] is empty and causing the Notice, so again we<br>
check:<br>
<br>
<br>
else {<br>
<br>
if ( isset( $style_settings["parent"] ) ) { $parent =<br>
$style_settings["parent"]; }<br>
<br>
Most of the admin section errors come from this section:<br>
<br>
foreach ($options as $value) {<br>
if (!isset($suffusion_options[$value['id']])) {<br>
$$value['id'] = $value['std'];<br>
}<br>
else {<br>
$$value['id'] = $suffusion_options[$value['id']];<br>
}<br>
}<br>
<br>
which can be written as:<br>
<br>
foreach ($options as $value) {<br>
if ( isset( $value['id'] ) ) {<br>
if (!isset($suffusion_options[$value['id']])) {<br>
if ( isset( $value['std'] ) ) {<br>
$$value['id'] = $value['std'];<br>
}<br>
}<br>
else {<br>
$$value['id'] = $suffusion_options[$value['id']];<br>
}<br>
}<br>
}<br>
<br>
The snippet above is used in numerous files to get the theme options and<br>
is responsible for 99% of the notices displayed.<br>
<font color="#888888"><br>
--<br>
MyBlog : <a href="http://www.pross.org.uk/" target="_blank">http://www.pross.org.uk/</a><br>
</font><div><div></div><div>Plugins : <a href="http://www.pross.org.uk/plugins/" target="_blank">http://www.pross.org.uk/plugins/</a><br>
Themes: <a href="http://wordpress.org/extend/themes/profile/pross" target="_blank">http://wordpress.org/extend/themes/profile/pross</a><br></div></div></blockquote></div></div></div></blockquote></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Sayontan Sinha<br><a href="http://mynethome.net">http://mynethome.net</a> | <a href="http://mynethome.net/blog">http://mynethome.net/blog</a><br>--<br>Lake Chargoggagoggmanchauggagoggchaubunagungamaugg - 45-letter Native American name for Lake Webster, Webster, Massachusetts, meaning "You fish on your side; I fish on my side; nobody fish in the middle."<br>