psuba
Forum Replies Created
-
Forum: Plugins
In reply to: [Harrys Gravatar Cache] Warnings and avatar display issues when not logged inHi Harry,
thanks for keeping with it.
Unfortunately, this seems to be a partial fix.The good news is that it seems like the correct avatars are now returned.
However, I am still getting a lot of error notices and warnings:
When activating the updated plugin, I am in fact getting slightly MORE errors:
[16-Jan-2017 11:41:39 UTC] PHP Notice: Undefined offset: 1 in /[basedir]/public_html/wp-content/plugins/harrys-gravatar-cache/harrys-gravatar-cache.php on line 212 [16-Jan-2017 11:41:39 UTC] PHP Notice: Undefined offset: 1 in /[basedir]/public_html/wp-content/plugins/harrys-gravatar-cache/harrys-gravatar-cache.php on line 212 [16-Jan-2017 11:41:39 UTC] PHP Notice: Undefined offset: 1 in /[basedir]/public_html/wp-content/plugins/harrys-gravatar-cache/harrys-gravatar-cache.php on line 212 [16-Jan-2017 11:41:39 UTC] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /[basedir]/public_html/wp-content/plugins/harrys-gravatar-cache/harrys-gravatar-cache.php on line 220 [16-Jan-2017 11:41:39 UTC] PHP Notice: Undefined variable: avatar_size in /[basedir]/public_html/wp-content/plugins/harrys-gravatar-cache/harrys-gravatar-cache.php on line 222
Also, whilst you may not be seeing the error notices I quoted before for the avatar displays, they are still there for me.
They are all triggered when I execute the following line in my code:
$avatar = get_avatar($userID,400);
I have confirmed this by triggering an error log before and after this line to make sure, and now this is the debug log for each user where I am calling the above line:
[16-Jan-2017 11:42:46 UTC] Attempting to get Avatar for user ID 5 [16-Jan-2017 11:42:47 UTC] PHP Notice: Trying to get property of non-object in /[basedir]/public_html/wp-includes/comment-template.php on line 97 [16-Jan-2017 11:42:47 UTC] PHP Notice: Trying to get property of non-object in /[basedir]/public_html/wp-includes/comment-template.php on line 97 [16-Jan-2017 11:42:47 UTC] PHP Notice: Trying to get property of non-object in /[basedir]/public_html/wp-includes/comment-template.php on line 28 [16-Jan-2017 11:42:47 UTC] PHP Notice: Trying to get property of non-object in /[basedir]/public_html/wp-includes/comment-template.php on line 46 [16-Jan-2017 11:42:47 UTC] Avatar call complete
Of course, the first and last lines are my logs enclosing the get_avatar call.
These are all gone as soon as I disable your plugin.Forum: Plugins
In reply to: [Harrys Gravatar Cache] Warnings and avatar display issues when not logged inHi,
For each user avatar I am trying to display I am getting this sequence of errors:
Notice: Trying to get property of non-object in /[basedir]/public_html/wp-includes/comment-template.php on line 97
Notice: Trying to get property of non-object in /[basedir]/public_html/wp-includes/comment-template.php on line 97
Notice: Trying to get property of non-object in /[basedir]/public_html/wp-includes/comment-template.php on line 28
Notice: Trying to get property of non-object in /[basedir]/public_html/wp-includes/comment-template.php on line 46As you can see they are all within the get_comment() function definition, trying to use properties of a base class which is obviously not set but get_comments assumes it is.
Note that when I am activating the plugin, I am also now getting the message:
The plugin generated 700 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.This is what was captured in the debug.log whilst activating:
[14-Jan-2017 11:24:02 UTC] PHP Notice: Undefined offset: 1 in /[basedir]/public_html/wp-content/plugins/harrys-gravatar-cache/harrys-gravatar-cache.php on line 212
[14-Jan-2017 11:24:02 UTC] PHP Notice: Undefined offset: 1 in /[basedir]/public_html/wp-content/plugins/harrys-gravatar-cache/harrys-gravatar-cache.php on line 212
[14-Jan-2017 11:24:02 UTC] PHP Notice: Undefined offset: 1 in /[basedir]/public_html/wp-content/plugins/harrys-gravatar-cache/harrys-gravatar-cache.php on line 212
[14-Jan-2017 11:24:02 UTC] PHP Notice: Undefined variable: avatar_size in /[basedir]/public_html/wp-content/plugins/harrys-gravatar-cache/harrys-gravatar-cache.php on line 220Yes, the plugin you included the link to is the one I am using. Also, I have followed the instructions described on that plugin’s page to add and set a new custom default avatar for complete disclosure.
In terms of you having a look – we are working now on adding content from an old site getting ready to launch with several people working on it so I hope you can resolve it without having to activate your plugin and triggering these errors. I doubt you would see much because the way I coded the page, the only thing you see is that all these users avatars are replaced by the custom default avatar – that is a fallback position, so other than the error messages I copied above I doubt this would be of any use. If you insist, let me know and we can try over Email to set a time period where I let our editor community know to expect these issues, and enable your plugin for you to be able to look at it and troubleshoot.
Forum: Plugins
In reply to: [Event Organiser] Date not showing outside loopSomething similar is happening in my case.
I have a custom template to display search results and it crashes when I am trying to output search results that are event type. I get the following in the error log:PHP Fatal error: Uncaught Exception: Error in formating DateTime object. Expected DateTime, but instead given boolean in /[siteroot]/public_html/wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php:31 Stack trace: #0 /[siteroot]/public_html/wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php(164): eo_format_datetime(false, 'jS F Y g:i a') #1 /[themeroot]/eo-loop-single-event.php(32): eo_format_event_occurrence()
Note that I am actually calling the same template display that works perfectly when displayed as part of the main loop (e.g. when I am displaying a list of events in the same category).
However this crashes within the search results page when I am trying to display the event date, i.e. as I am calling
echo eo_format_event_occurrence();
I a guessing (not an expert) that the search query is constructed in a different way, and the eo core assumes that the query have extracted all the information needed for EO to pull together its metadata. However the search query may not have done this.
It may have to do with how EO implements its hooks.In your case, the interesting question is whether you are getting the page object itself through a standard WP_Query (even if you are not iterating through the loop), or a different way (such as, in my case the Search query)?
Forum: Plugins
In reply to: [NIX Gravatar Cache] nginx requests flooding error logsI can see a very similar effect.
I have an error in my error log file every time any page is viewed – it looks like the default (custom) avatar is being queried, the plugin tries to cache it but fails.
The line in the logfile is below (I have redacted the bits that are irrelevant):PHP Warning: copy( https://redacted_url_path/filename.png
): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in /irrelevant_path/plugins/nix-gravatar-cache/nf-gravatar-cache.php on line 184The URL it is complaining about is actually valid and I can retrieve an image in a browser by copy/paste, so it looks like the problem is with how the copy function tries to retrieve a file.
I actually had to manually place copies (with resize) of the avatar in the Gravatar cache folder location to avoid errors on my client side.
It may be the same issue or something different but either way we are talking about a 400 error in the logfile caused by the plugin.