• Resolved Pierre.Toulmonde

    (@pierretoulmonde)


    Hello,
    The last update has crashed my site.

    In the admin, i can’t access my Posts anymore.
    I got the following message.

    I had to disable AND delete the plugin to fix this.

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘custom_editor_counts’ not found or invalid function name in /wp-includes/class-wp-hook.php on line 286

    Fatal error: Uncaught TypeError: Argument 1 passed to WPSEO_Abstract_Post_Filter::add_filter_link() must be of the type array, null given, called in /wp-includes/class-wp-hook.php on line 286 and defined in /public_html/wp-content/plugins/wordpress-seo/admin/filters/class-abstract-post-filter.php:101 Stack trace: #0 /public_html/wp-includes/class-wp-hook.php(286): WPSEO_Abstract_Post_Filter->add_filter_link(NULL) #1 /public_html/wp-includes/plugin.php(208): WP_Hook->apply_filters(NULL, Array) #2 /public_html/wp-admin/includes/class-wp-list-table.php(403): apply_filters(‘views_edit-post’, Array) #3public_html/wp-admin/edit.php(399): WP_List_Table->views() #4 {main} thrown in /wp-content/plugins/wordpress-seo/admin/filters/class-abstract-post-filter.php on line 101
    s.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Same Issue here

    [03-Oct-2019 17:02:28 UTC] PHP Fatal error: Uncaught Error: Class ‘WPSEO_Courses_Overview’ not found in /home/s1738/html/wp-content/plugins/wordpress-seo/wp-seo-main.php:336
    Stack trace:
    #0 /home/s1738/html/wp-includes/class-wp-hook.php(286): wpseo_init(”)
    #1 /home/s1738/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
    #2 /home/s1738/html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #3 /home/s1738/html/wp-settings.php(394): do_action(‘plugins_loaded’)
    #4 /home/s1738/html/wp-config.php(109): require_once(‘/home/s1738/htm…’)
    #5 /home/s1738/html/wp-load.php(37): require_once(‘/home/s1738/htm…’)
    #6 /home/s1738/html/wp-admin/admin-ajax.php(22): require_once(‘/home/s1738/htm…’)
    #7 {main}
    thrown in /home/s1738/html/wp-content/plugins/wordpress-seo/wp-seo-main.php on line 336

    Plugin Support amboutwe

    (@amboutwe)

    These types of errors typically mean that your server cannot find certain files. This could be due to cache and will go away on their own. Otherwise, there may be a missing or corrupt file after updating the plugin. If the error doesn’t go away after clearing cache (server, site, your local browser), please uninstall and re-install the plugin. The database contains all plugin settings and data so there is little risk of losing any entered information; however, we recommend making a backup before uninstalling any plugin.

    @hirejordansmith If you have a similar issue and the above information does not resolve the issue, please open a new request. That way it’s easier to track issues and provide assistance. Thanks!

    No error messages and no Yoast settings available for me on any of the Yoast screens… have rolled-back from 12.2 to version 12.0, no change, disabled & deleted then re-installed, no change. Please advise ASAP please!

    Opened new thread…

    • This reply was modified 5 years, 5 months ago by artoftheworld. Reason: Opened new thread
    Thread Starter Pierre.Toulmonde

    (@pierretoulmonde)

    Hello,
    I have added this code in function.php in order to hide Draft from other Editors.
    it apperas to be the conflict zone

    
    add_action('pre_get_posts', 'query_set_only_author' );
    
    function query_set_only_author( $wp_query ) {
    
     global $current_user;
    
     if(!current_user_can('edit_others_posts') ) {
    
        $wp_query->set( 'author', $current_user->ID );
    
        add_filter('views_edit-post', 'fix_post_counts');
        add_filter('views_upload', 'fix_media_counts');
    
     }
    
    }
    
    add_filter("views_edit-post", 'custom_editor_counts', 10, 1);
    

    Any suggestions ?

    Plugin Support amboutwe

    (@amboutwe)

    The error says that a parameter fails to return a valid callback. If I had to guess, I’d start with the last line as the first parameter uses double quotes instead of single quotes. Coding is pretty particular so a minor thing like this could cause unexpected behavior.

    If that doesn’t resolve the error, you’d probably want to have a developer take a look at the custom code to locate the issue. You can try posting directly in the WordPress core support forum. Or you can hire a developer to fix the custom code. We highly recommend checking out?Code Poet?or?Codeable.io?for available freelance WordPress developers and?Human Made?for development & consultancy.

    Thread Starter Pierre.Toulmonde

    (@pierretoulmonde)

    Thanks for your support.

    Just for you to know that

    add_filter(“views_edit-post”, ‘custom_editor_counts’, 10, 1);
    + Yoast plugin did break my site.

    FYI, i have recoded the function to have

    function mine_published_only($views) {
    
      unset($views['all']);
      unset($views['draft']);
      unset($views['pending']);
    
      return $views;
    }
    
    function only_own_posts_parse_query( $wp_query ) {
        if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) {
          global $current_user;
          $wp_query->set( 'author', $current_user->id );
         }
    }
    
    if (current_user_can('Redacteur') || current_user_can('author')) {
      add_filter('views_edit-post', 'mine_published_only');
      add_filter('parse_query', 'only_own_posts_parse_query' );
    }

    Now it woks like a charm.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Last Yoast Update Crashed my site’ is closed to new replies.