Function Reference: geodir_diagnose_ratings

Summary

Checks ratings for correct location and content settings.

Global Values

$wpdb
(object) (required) WordPress Database object.

Default: None

Package

GeoDirectory

Change Log

Since: 1.0.0

Source File

geodir_diagnose_ratings() is located in geodirectory-admin/admin_hooks_actions.php [Line: 1426]

Source Code

function geodir_diagnose_ratings()
{
    global $wpdb;
    $fix = isset($_POST['fix']) ? true : false;

    //if($fix){echo 'true';}else{echo 'false';}
    $is_error_during_diagnose = false;
    $output_str = '';

    // check review locations
    if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE post_city='' OR post_city IS NULL OR post_latitude='' OR post_latitude IS NULL")) {
        $output_str .= "
  • " . __('Review locations missing or broken', 'geodirectory') . "
  • "; $is_error_during_diagnose = true; if ($fix) { if (geodir_fix_review_location()) { $output_str .= "
  • " . __('-->FIXED: Review locations fixed', 'geodirectory') . "
  • "; } else { $output_str .= "
  • " . __('-->FAILED: Review locations fix failed', 'geodirectory') . "
  • "; } } } else { $output_str .= "
  • " . __('Review locations ok', 'geodirectory') . "
  • "; } // check review content if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_content IS NULL")) { $output_str .= "
  • " . __('Review content missing or broken', 'geodirectory') . "
  • "; $is_error_during_diagnose = true; if ($fix) { if (geodir_fix_review_content()) { $output_str .= "
  • " . __('-->FIXED: Review content fixed', 'geodirectory') . "
  • "; } else { $output_str .= "
  • " . __('-->FAILED: Review content fix failed', 'geodirectory') . "
  • "; } } } else { $output_str .= "
  • " . __('Review content ok', 'geodirectory') . "
  • "; } if ($is_error_during_diagnose) { $info_div_class = "geodir_problem_info"; $fix_button_txt = ""; } else { $info_div_class = "geodir_noproblem_info"; $fix_button_txt = ''; } echo "
      "; echo $output_str; echo $fix_button_txt; echo "
    "; }