Example #1
0
function wpgplus_logout()
{
    wpgplus_debug("\nLogging out: \n");
    // do we need to send cookies on logout?
    $my_args = array('method' => 'GET', 'user-agent' => 'Mozilla/4.0 (compatible; MSIE 5.0; S60/3.0 NokiaN73-1/2.0(2.0617.0.0.7) Profile/MIDP-2.0 Configuration/CLDC-1.1)', 'blocking' => false, 'redirection' => 0);
    $buf = wp_remote_request('https://www.google.com/m/logout', $my_args);
    if (is_wp_error($buf)) {
        wp_die($buf);
    }
    // should we kill cookies here or just let the transients expire?
}
Example #2
0
function wpgplus_publish_to_gplus($post)
{
    $wpgplus_debug_file = WP_PLUGIN_DIR . '/wpgplus/debug.txt';
    if (!version_compare(PHP_VERSION, '5.0.0', '<')) {
        include_once WP_PLUGIN_DIR . '/wpgplus/gplus.php';
        wpgplus_debug(date("Y-m-d H:i:s", time()) . " : publish_to_gplus running, included wpgplus.php\n");
    } else {
        wp_die("Sorry, but you can't run this plugin, it requires PHP 5 or higher.");
    }
    $publish_meta = get_post_meta($post->ID, 'wpgplus_publish', true);
    if ($publish_meta == 'no') {
        // user chose not to post this one
        wpgplus_debug(date("Y-m-d H:i:s", time()) . " : Post_meta was set to not publish, postID is " . $my_post_id . "\n");
        return;
    }
    $my_post_id = $post->ID;
    wpgplus_debug(date("Y-m-d H:i:s", time()) . " : publish_to_gplus running, postID is " . $my_post_id . "\n");
    if ($my_post_id && $my_post_id != '') {
        wpgplus_safe_post_google($my_post_id);
    }
    wpgplus_debug(date("Y-m-d H:i:s", time()) . " : publish_to_gplus done running\n");
}