Title: Error on Statistics Page
Last modified: August 31, 2016

---

# Error on Statistics Page

 *  Resolved [lebo69](https://wordpress.org/support/users/lebo69/)
 * (@lebo69)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/)
 * Hi Antoine,
 * I am getting an error on the statistics page.
 * [http://www.pollapolla.com/statistics/?view=matchpredictions&match=107](http://www.pollapolla.com/statistics/?view=matchpredictions&match=107)
 * Warning: Missing argument 6 for Football_Pool_Pool::calc_score(), called in /
   home/content/p3pnexwpnas14_data01/47/3068447/html/wp-content/plugins/hide-zero-
   predictions.php on line 39 and defined in /home/content/p3pnexwpnas14_data01/
   47/3068447/html/wp-content/plugins/football-pool/classes/class-football-pool-
   pool.php on line 58
 * Please let me know what i need to change or fix.
 * Thanks
 * [https://wordpress.org/plugins/football-pool/](https://wordpress.org/plugins/football-pool/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/#post-7427132)
 * calc_score was changed in the latest version. You should edit your extension 
   Plugin and add the extra variable in the function call or callback.
 * See calc_score function for the last parameter. I think it was the match_id. 
   Don’t have the code at hand. So can’t check it now.
 *  Thread Starter [lebo69](https://wordpress.org/support/users/lebo69/)
 * (@lebo69)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/#post-7427170)
 * Thanks Antoine.
 * When you have the code or updated extension please share so i can fix this.
 * Thank you.
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/#post-7427226)
 * It was the match ID. You will have to supply that value as the last parameter.
   See function declaration below:
 *     ```
       public function calc_score( $home, $away, $user_home, $user_away, $joker, $match_id ) {
       ```
   
 * But since you are not doing anything with this value (I only added it to make
   it accessible in a hook), you might as well always send the same value (could
   be anything).
 *  Thread Starter [lebo69](https://wordpress.org/support/users/lebo69/)
 * (@lebo69)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/#post-7427290)
 * Thanks Antoine, but I am not a PHP programmer and do not understand exactly what
   to do. Could you please let me know what to insert or change on the plugin file?
 * Thanks in advance.
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/#post-7427295)
 * Not sure what the hide-zero-predictions.php file looks like, so can’t really 
   help you if you don’t post the line that’s giving the error.
 *  Thread Starter [lebo69](https://wordpress.org/support/users/lebo69/)
 * (@lebo69)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/#post-7427308)
 * Hi Antoine,
 * Here is the hide-zero-predictions.php file i have installed. I would appreciate
   your help when you can. Thanks.
 * <?php
    /** * Plugin Name: Football Pool Match Predictions Extension * Description:
   Order match predictions by score and don’t show users without predictions. * 
   Version: 1.0 * Author: Antoine Hurkmans * Author URI: mailto:wordpressfootballpool@
   gmail.com * License: MIT */
 * // Save this plugin in the wp-content/plugins folder and activate it //
 * class FootballPoolExtensionMatchPredictions {
    public static function init_extension(){
   if ( ! is_admin() ) { add_filter( ‘footballpool_statistics_matchpredictions’,
   array( __CLASS__, ‘change_matchpredictions’ ), null, 2 ); } }
 *  public static function change_matchpredictions( $predictions, $match_info ) {
   //
   add score array_walk( $predictions, array( __CLASS__, ‘add_score’ ), $match_info);//
   remove users without predictions $predictions = array_filter( $predictions, array(
   __CLASS__, ‘remove_inactive_users’ ) ); // sort by score usort( $predictions,
   array( __CLASS__, ‘sort_table’ ) );
 *  return $predictions;
    }
 *  public static function add_score( &$prediction, $key, $match_info ) {
    $pool
   = new Football_Pool_Pool; $prediction[‘score’] = $pool->calc_score( $match_info[‘
   home_score’], $match_info[‘away_score’], $prediction[‘home_score’], $prediction[‘
   away_score’], $prediction[‘has_joker’] ); }
 *  public static function remove_inactive_users( $prediction ) {
    return ! is_null(
   $prediction[‘home_score’] ) && ! is_null( $prediction[‘away_score’] ); }
 *  public static function sort_table( $a, $b ) {
    if ( $a[‘score’] == $b[‘score’])
   return 0; return ( $a[‘score’] < $b[‘score’] ) ? 1 : -1; } }
 * add_filter( ‘plugins_loaded’, array( ‘FootballPoolExtensionMatchPredictions’,‘
   init_extension’ ) );
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/#post-7427310)
 * I didn’t test it, but I think [this](https://dl.dropboxusercontent.com/u/397845/wordpressfootballpool/extension-plugins/football-pool-matchpredictions-order.php)
   should be it.
 *  Thread Starter [lebo69](https://wordpress.org/support/users/lebo69/)
 * (@lebo69)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/#post-7427312)
 * Worked great. Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)

 The topic ‘Error on Statistics Page’ is closed to new replies.

 * ![](https://ps.w.org/football-pool/assets/icon-256x256.png?rev=983880)
 * [Football Pool](https://wordpress.org/plugins/football-pool/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/football-pool/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/football-pool/)
 * [Active Topics](https://wordpress.org/support/plugin/football-pool/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/football-pool/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/football-pool/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [lebo69](https://wordpress.org/support/users/lebo69/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/error-on-statistics-page/#post-7427312)
 * Status: resolved