Support » Fixing WordPress » call_user_func_array() expects parameter 1 to be a valid callback

  • Resolved raghavendrakallapiran

    (@raghavendrakallapiran)


    I get below errors

    <b>Warning</b>: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in <b>\wp-includes\plugin.php</b> on line <b>505</b><br />

    Below is the line at line 505
    call_user_func_array($the_[‘function’], array_slice($args, 0, (int) $the_[‘accepted_args’]));

    Notice: Undefined variable: this in \wp-content\plugins\feed-json\feed-json.php on line 82

    Below is the line at line 82
    add_feed(‘json’, array($this, ‘do_feed_json’));

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 16 through 22 (of 22 total)
  • raghavendrakallapiran

    (@raghavendrakallapiran)

    Hi Sam,
    Below is the content of wp-content\plugins\feed-json\readme.txt

    === Feed JSON ===
    Contributors: wokamoto
    Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
    Tags: feed, feeds, json, jsonp
    Requires at least: 3.0
    Tested up to: 3.9
    Stable tag: 1.0.9

    Adds a new type of feed you can subscribe to. http://example.com/feed/json or http://example.com/?feed=json to anywhere you get a JSON form.

    == Description ==

    Adds a new type of feed you can subscribe to.
    http://example.com/feed/json or http://example.com/?feed=json to anywhere you get a JSON form.
    http://example.com/feed/json?callback=callback or http://example.com/?feed=json&callback=callback to anywhere you get a JSONP.

    == Installation ==

    1. Upload the entire feed-json folder to the /wp-content/plugins/ directory.
    2. Activate the plugin through the ‘Plugins’ menu in WordPress.

    == Changelog ==

    **1.0.9 April 28, 2014**

    Source code refactoring.

    **1.0.7 November 13**

    Add caching for JSON feed, fix no tags/categories notice.
    thx tlovett1 !

    **1.0.6 August 9, 2013**

    add template filter hook

    **1.0.5 August 9, 2013**

    Bug fix.

    **1.0.4 July 11, 2013**

    source code refactoring

    **1.0.3 June 10, 2013**

    source code refactoring

    **1.0.2 February 17, 2012**

    Bug fix.

    **1.0.1 July 28, 2011**

    Bug fix.

    **1.0.0 February 15, 2011**

    Initial release.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Wow. Even the latest version of that plugin in our directory is 4 years old, and the version you’re running is older than that.

    Yeah, sometimes, things change. That plugin probably no longer works properly. You may need to rethink what it is that you’re using that plugin to actually do, and come up with a better solution.

    Why do you need that feed to work, exactly? What is its purpose?

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    You might be running into https://wordpress.org/support/topic/error-in-feed-7/

    There’s a fix posted there.

    But yeah, I agree that relying on a 6-year-old plugin to do your heavy lifting is not a good idea. It would be better to seek out an alternative which is supported and not abandoned.

    raghavendrakallapiran

    (@raghavendrakallapiran)

    Hi James,
    I get below error message even after roll back of change by below steps

    ERROR: This is not a valid feed template

    1. renamed the folder wp-content\themes\risk-solutions-temp to wp-content\themes\risk-solutions
    2. executed below update statements
    UPDATE wp_options SET option_value=’risk-solutions’ WHERE option_name=’template’;
    UPDATE wp_options SET option_value=’risk-solutions’ WHERE option_name=’stylesheet’;

    Can I get back the earlier error
    <b>Warning</b>: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in <b>\wp-includes\plugin.php</b> on line <b>505</b><br />

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    1. Did you update to the latest version of the plugin yet, version 1.0.10?

    2. If that didn’t fix it, did you try the fix recommended at https://wordpress.org/support/topic/error-in-feed-7/#post-6279214 ?

    3. If yes, and it didn’t work, I recommend reporting the problem at https://wordpress.org/support/plugin/feed-json/ so the plugin’s developers and support community can help you with this.

    4. However, they haven’t replied to anyone there (or touched the plugin) for four years, and we’re not equipped to support someone else’s plugin here. It would be better to seek out an alternative which is supported and not abandoned.

    raghavendrakallapiran

    (@raghavendrakallapiran)

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Excellent, now that it’s working, you might want to investigate alternatives which haven’t been abandoned for 4 years. 😉

    In particular, WordPress has had its own built-in API for years now: https://developer.wordpress.org/rest-api/

Viewing 7 replies - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.