WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Featured Post Widget
[resolved] PHP Notices In the Admin Widget Form (12 posts)

  1. helgatheviking
    Member
    Posted 1 year ago #

    Just as a heads up, I am getting a lot of PHP notices in the widget admin area.

    Notice: Undefined variable: fielset_id in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 708

    Notice: Undefined variable: fielset_name in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 709

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined variable: boxes in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 737

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined offset: 4 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 717

    Notice: Undefined offset: 5 in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 732

    Notice: Undefined index: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    Notice: Undefined variable: value in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 94

    Notice: Undefined variable: atts in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/includes/A5_field-functions.php on line 758
    Check, where you want to show the widget. By default, it is showing on the homepage and the category pages:
    Homepage
    Frontpage (e.g. a static page as homepage)
    "Page" pages
    Category pages
    Single post pages
    Archive pages
    Tag pages
    Attachments
    Custom Taxonomy pages (only available, if having a plugin)
    Author pages
    Search Results
    "Not Found"

    Check all
    Here you can finally style the widget. Simply type something like
    border: 2px solid;
    border-color: #cccccc;
    padding: 10px;
    to get just a gray outline and a padding of 10 px. If you leave that section empty, your theme will style the widget.

    Notice: Undefined variable: label in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 28

    Notice: Undefined variable: field_name in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 29

    Notice: Undefined variable: attributes in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 34

    Notice: Undefined variable: attributes in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 44

    Notice: Undefined variable: space in /home/michover/public_html/uat/chingfordelectrical/wp-content/plugins/advanced-featured-post-widget/class-lib/A5_FormFieldClass.php on line 106

    http://wordpress.org/extend/plugins/advanced-featured-post-widget/

  2. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    That's quiet a lot in deed :)

    I will have to check that out, since I didn't have those in my testing environment when updating the plugin.

    I'll be back asap.

  3. helgatheviking
    Member
    Posted 1 year ago #

    Yeah it is. :) If I get a chance I will test a few other things on my own local site... like disabling other plugins and reverting to default theme.

  4. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    I guess, you should turn off the debug mode as well.

  5. helgatheviking
    Member
    Posted 1 year ago #

    Isn't Debug mode on the live server I don't think. Not sure what that is. But I usually leave debug mode on for my local dev server... helps me fix issues in my own plugins.

  6. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    So it would have done in my testing environment. Through your post, I discovered a typo in my framework. Luckily it was something that is not used (yet). :)

    But the rest of all the undefined variables remind me strongly of debug mode. However, I just finished work on another plugin and I will have time today or tomorrow to give it a go and really see, what happens when I run only the Advanced Featured Post Widget.

  7. helgatheviking
    Member
    Posted 1 year ago #

    It is definitely debug mode. I tested this morning on a single install (not MU) and still get a lot of warnings. The warnings are a sign that things are a little whacky with your code... as you shouldn't get any warnings if everything is correct. I am trying to track down the source of the undefined variables.

    function a5_checkgroup($fieldset_id, $fieldset_name, $options, $legend = false, $checkall = false, $attributes = false, $echo = true) {
    
    	$eol = "\r\n";
    
    	if ($fieldset_id) $attributes['id'] = $fieldset_id;
    	if ($fieldset_name) $attributes['name'] = $fieldset_name;
    
    	$legend = ($legend) ? '<legend>'.$legend.'</legend>'.$eol : '';
    
    	if ($attributes) foreach ($attributes as $key => $val) $atts .= ' '.$key.'="'.$val.'"';
    
    	foreach($options as $options) :

    The foreach($options as $options) is strange (to me) but I'm having a hard time deciphering the rest of that function, since it is very reliant on array index numbers.

  8. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry, I forgot to write that in the morning. I have been testing it out in before I left and ment to write it here. Undefined variables are quiet normal to get in debugging mode. If not needed, they are just not defined.

    But the $options as $options thingy works, which astonnished me when I saw it for the first time. At 3 am I don't seem too bright anymore :D

    But it never gave an error.

  9. helgatheviking
    Member
    Posted 1 year ago #

    Shouldn't they always be defined? Even if defined as null or false, just for the sake of cleaner code?

    I know there is this stereotype of coders pulling all-nighters but everything I do at 3am would've taken me half as long to do at 10am. :)

    get some sleep!

  10. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    Same here. But I'm not a coder and simply never have the time to do stuff at 10am.

    But don't worry about my sleep. I get enough of that in the office ;)

  11. helgatheviking
    Member
    Posted 1 year ago #

    You wrote a plugin... that makes you a coder! :) I tried to figure out where the variables were not getting defined, but I was unsuccessful. If you get a chance, it'd be great... if not, it isn't the end of the world.

    Thanks!

  12. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    That's actually quickly solved. Just exchange a couple of false with NULL and work a lot with isset instead of using short coding.

    All the notices have disappeared so far. I'm busy to change the machine a bit and you'll get an update from the repo.

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.