WordPress.org

Ready to get started?Download WordPress

Forums

Fatal error: call to member function has_cap on a non-object (8 posts)

  1. dwmoller
    Member
    Posted 4 years ago #

    Hi all. Caveat: I have only had a couple of weeks with WordPress and do not code php.

    Fatal error: call to member function has_cap on a non-object /home/.../capa.php on line 990

    While this relates to an error I receive when I activate a (would-be perfect) plugin (CaPa Protect), it is more of a general question regarding the function has_cap() and function calls in php, in general. While doing some searching for the function has_cap(), I have found what appears to be the function in two places: 1) wp-includes/capabilities.php and 2)wp-includes/wp-db.php. Just looking at the code, they seem to be different functions with the same name - both at the same hierarchical level, folder-wise.

    My questions:
    1. Are they, in fact, different? I think so, since one seems to relate to user roles-capabilities and the other seems to relate to SQL database "stuff", but I may be confused.
    2. Is there a (php for dummies) way to set up some sort of path within a file (e.g. capa.php) which would direct the has_cap() function call to the correct place? Assuming that would be the correct approach.
    3. Or, is one (or a portion of one) of the two listed php files some sort of legacy code that should be deleted?
    4. Or am I way off track? Most likely answer is "yes".

    Any advice for any of the above questions would be greatly appreciated and new knowledge to me. Thanks, in advance.

  2. Inspired2Write
    Member
    Posted 4 years ago #

    One thing that would be helpful is if you indicate what version of WP you're using. Also, did you make sure that the plugin you selected is compatible with the version of WP that you're using?

  3. dwmoller
    Member
    Posted 4 years ago #

    It appears that I have "Admin Version 2.9.2" according to the Dashboard footer. The plugin is listed as WP 2.7.1 and compatible up to 2.9.2. (Not sure if that is "to" or "through").

  4. Inspired2Write
    Member
    Posted 4 years ago #

    From what you're indicating it appears the plugin should be compatible with your WP version, however that doesn't mean you might not run into other compatibility issues with other plugins you have installed, and or theme issues.

    For starters, did you install the plugin in the correct location?
    /wp-content/plugins/
    Double check that first. You might try and disable the plugin from your dashboard, and revert back to the default WP theme, if you're using a different theme. Test to see if that resolves the issue. You may also need to disable other plugins to determine if another one is creating a conflict.

    Other than those suggestions, and in regards to your specific question above, I'm not able to answer what you're asking, so someone else may need to help you if neither of those suggestions are of help.

  5. dwmoller
    Member
    Posted 4 years ago #

    I have installed in the location you suggested. Actually, as soon as I activate the plugin on the Dashboard, I get a white screen with the Fatal error message...
    The only way I have been able to get back to a functional browsing experience is to delete the plugin folder via ftp.

    I have chosen the suffusion theme, and have been afraid to totally mess everything up by changing the theme now that I've got a lot of content and "styling". Is it an easy, reversible process? Or will I need to rework a great deal to get it back to its current state? The plugin would be great, but, wow, I would hate to have to redo everything I've done. I just don't know how this all works.

  6. dwmoller
    Member
    Posted 4 years ago #

    Not delete the whole plugin folder, just that particular plugin's folder

  7. Inspired2Write
    Member
    Posted 4 years ago #

    I have installed in the location you suggested. Actually, as soon as I activate the plugin on the Dashboard, I get a white screen with the Fatal error message...
    The only way I have been able to get back to a functional browsing experience is to delete the plugin folder via ftp.

    As much as we all like plugins, sometimes they're problematic depending on what all we have going on with our site.

    I have chosen the suffusion theme, and have been afraid to totally mess everything up by changing the theme now that I've got a lot of content and "styling". Is it an easy, reversible process? Or will I need to rework a great deal to get it back to its current state?

    Before I change templates I have all my codes saved in a file such as a Notepad document. (Don't use something like MS Word because it will add formatting that you won't see later when you paste it back in).

    For example, if you have meta tags in the header, save those in a document, saved links or other codes in a widget, save those in another document etc., or somehow clearly label the codes within one document you can retrieve after you change themes. Then you just have to copy and paste the correct codes into your new theme. And, before you switch themes it's a good idea to move the widgets out of the active area first, but again copy your codes prior to changing themes in case of any errors with the widgets, or human error. :o

    In regards to the plugin itself, I don't have an answer for you on that, but maybe someone else does if you really want to get it to work.

  8. dwmoller
    Member
    Posted 4 years ago #

    Thanks so much for your diligence and help. I will give it a try!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags