• Resolved michent1


    Getting the following warning & notice in the CFIX admin page on local install running php 5.6:

    Warning: Illegal string offset '' in E:\***\wp-content\plugins\category-featured-images-extended\settings.php on line 49

    Notice: Uninitialized string offset: 0 in E:\***\wp-content\plugins\category-featured-images-extended\settings.php on line 49

    After some additional debugging, it occurs when the global fallbacks aren’t defined in the settings. The errors no longer display once the global fallback image, category & tag is set.

    Other than that, works like charm 🙂 Thanks for the awesome plugin!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author CK MacLeod


    Thanks, michent1. Those pesky offset warnings will sneak up on you when you least expect it – and have a way of clogging up a debug log even when the underlying problem does not actually affect functionality.

    I’ve just pushed out an update that should take care of them. If you get a chance, I hope that after you’ve updated, you’ll be able confirm on your end that they’re gone.

    Please let me know if it’s still a problem, or if you run into any others. I also hope that you’ll take the time to give the plug-in a high rating, as it or I am still working back from an ill-considered 1-star rating/review!

    Some folks just don’t appreciate the time/work that goes into dev & maintenance with this stuff.

    I’d like to submit a feature request for the future dev roadmap.

    – Random featured images based on taxonomy. Allowing users to add multiple images per taxonomy term. Posts would then grab a random image from it’s category/tag set as a featured image.
    – Would work well in instances where archive views pull thumbs, allowing a mix of featured image thumbs vs the same image repeating for each post in a category.

    Plugin Author CK MacLeod


    Thanks for the suggestion (and for the rating and review!).

    I had another user make a similar request a while back, and have seen why it makes sense in archives at my own sites, though I can also think of several ways in addition to the group/random option to address the underlying problem. Anyway, please feel free to use the contact link at the bottom of the plug-in settings page if you’d like to discuss the feature or alternatives further. Either way, I’ll certainly add your alternative to the roadmap.

    Sure. I found another plugin that has the random featured image functionality, but it’s not a stable version (throwing quite a few errors affecting functionality). Submitted a bug report to the developer, so we’ll see if she looks into it.

    But after digging through the code, the logic for the random image function is pretty straight forward. Something along the lines of:

    function get_random_image() {
    	$all_images = apply_filters( 'all_images', array() );
    	// Get out if the user didn't upload any random images
    	if ( ! is_array($all_images) || empty($all_images) )
    		return false;
    	// If there is only 1 image, return that single image
    	if ( count($all_images) === 1 && !empty($all_images[0]) )
    		return $all_images[0];
    	// Grab a random image and return it
        $random_image = array_rand($all_images, 1);
        return $random_image;

    *Note: unchecked code. Just a guess.

    Plugin Author CK MacLeod


    Yeah, randomizing the images in a returned array and selecting one isn’t the hard or time-consuming part. Constructing the user interface and options might be. Also not sure whether to expect performance problems. Anyway, like I said, this discussion would probably be more appropriate via email than in this support forum, but thanks again for the suggestion. If I weren’t in the middle of some other projects, I’d get right on it today, because in addition to suggesting an improvement in the plugin it’s interesting!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Errors’ is closed to new replies.