WordPress.org

Ready to get started?Download WordPress

Forums

WPGPlus
[resolved] error notices (6 posts)

  1. thomask
    Member
    Posted 1 year ago #

    Please, can you resolve the problem with error notices, from this perspective it is the worst plugin i know. Please use WP_DEBUG when creating/testing plugin

    E.g.

    Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/seo-konzultant.cz/httpdocs/wp-content/plugins/wpgplus/WPGPlus.php on line 140

    Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/seo-konzultant.cz/httpdocs/wp-content/plugins/wpgplus/WPGPlus.php on line 151

    Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/seo-konzultant.cz/httpdocs/wp-content/plugins/wpgplus/gplus.php on line 24

    Warning: touch() [function.touch]: Unable to create file /var/www/vhosts/seo-konzultant.cz/httpdocs/wp-content/plugins/wpgplus/cookies.txt because Permission denied in /var/www/vhosts/seo-konzultant.cz/httpdocs/wp-content/plugins/wpgplus/gplus.php on line 27

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /var/www/vhosts/seo-konzultant.cz/httpdocs/wp-content/plugins/wpgplus/gplus.php on line 63

    Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/seo-konzultant.cz/httpdocs/wp-content/plugins/wpgplus/gplus.php on line 68

    Fatal error: Call to a member function getAttribute() on a non-object in /var/www/vhosts/seo-konzultant.cz/httpdocs/wp-content/plugins/wpgplus/gplus.php on line 83

    http://wordpress.org/extend/plugins/wpgplus/

  2. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Well, it is a pre 1.0 version, in development. I suspect by 1.0 the notices will be gone, but for now they are helpful to have in order to investigate what's gone wrong.

    For example from what you've posts here I can see that your host permissions are not allowing wpgplus to create files where it needs to, resulting in the fwrite errors and the touch error - wpgplus needs to be able to create and edit the cookies.txt file, and needs to be able to write a debug.txt in its own directory.

    Further, the curl error lets me know that this won't work for you because of the way safe mode is configured by your PHP.

    Obviously the plugin could do a better job of determining this and just stopping, but like I said, it is a development version . . .

  3. thomask
    Member
    Posted 1 year ago #

    I just want to point to this problem, because it makes your plugin unusable by anyone, who takes care of security. E.g. about the problem with permissions - first imo it should be possible to use wp way of writing to plugins folder, which works normaly when installing plugins. Or maybe even better - you should use wp-content.
    about the curl - again wp contains it's own HTTP API (http://codex.wordpress.org/HTTP_API) which should be used
    ...
    Your plugin idea is great, so please do not take my comments any bad, i just want to help it improve

  4. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    If by the "wp way of writing to plugins folder" you mean http://codex.wordpress.org/Filesystem_API, I'd rather not have to ask the user for ftp credentials to their hosting provider just to set a cookie.

    I will look into using wp-content/uploads/ instead, though personally I'd prefer plugins keep their files in their own directories.

    Using the wp HTTP API rather than cUrl is definitely an option as the plugin matures (and I have used it in other plugins) but in development stages I prefer to use curl directly as it keeps the code more portable outside WordPress.

    This plugin started as a port of a non-WordPress specific PHP script (as noted in the readme and in the code itself). It's going to be much easier to keep up with updates of that script if I stay in curl than if I migrate to the wp HTTP API.

  5. thomask
    Member
    Posted 1 year ago #

    re: If by the "wp way of writing to plugins folder" you mean http://codex.wordpress.org/Filesystem_API, I'd rather not have to ask the user for ftp credentials to their hosting provider just to set a cookie.

    and you are asked for creentials when your are installing or updating plugin (i'm not)? It depends on the settings of the web probably, but maybe if you would create the file and then just update it, it would not need the credentials. Or maybe (I'm not sure) it could be possible to create this file during instalation with some writable attributes.

    anyway thank you for working on the improvements

  6. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    thomas - check out version 0.8 - I've migrated to WordPress HTTP API, using transients for cookies, and made the debug file optional.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic