/**
 *
 * @param $post_id
 * @return unknown_type
 */
function wphp_delete_post($post_id)
{
    wphp_log("called: wphp_delete_post");
    global $wpdb;
    // Delete all post flags from the database table
    $wpdb->query("DELETE FROM " . WPHP_TABLE_NAME . " WHERE post_id = {$post_id} and meta_key like '_wplp_%'");
}
/**
 *
 * @return unknown_type
 */
function wphp_remove_wp_low_profiler()
{
    wphp_log("called: wphp_remove_wp_low_profiler");
    $plugin_list = get_plugins('/wp-low-profiler');
    if (isset($plugin_list['wp-low-profiler.php'])) {
        wphp_log("The 'WP low Profiler' plugin is present. Cleaning it up...");
        $plugins = array('wp-low-profiler/wp-low-profiler.php');
        if (is_plugin_active('wp-low-profiler/wp-low-profiler.php')) {
            wphp_log("The 'WP low Profiler' plugin is active. Deactivating...");
            deactivate_plugins($plugins, true);
            // silent deactivate
        }
        wphp_log("Deleting plugin 'WP low Profiler'...");
        delete_plugins($plugins, '');
    } else {
        wphp_log("The 'WP low Profiler' plugin does not exist.");
    }
}