} // Exit if accessed directly define('WEBDADOS_FB_VERSION', '2.0.4'); define('WEBDADOS_FB_PLUGIN_NAME', 'Facebook Open Graph, Google+ and Twitter Card Tags'); define('WEBDADOS_FB_W', 1200); define('WEBDADOS_FB_H', 630); /* Include core class */ require plugin_dir_path(__FILE__) . 'includes/class-webdados-fb-open-graph.php'; /* Uninstall hook */ register_uninstall_hook(__FILE__, 'webdados_fb_uninstall'); function webdados_fb_uninstall() { $options = get_option('wonderm00n_open_graph_settings'); if (intval($options['fb_keep_data_uninstall']) == 0) { delete_option('wonderm00n_open_graph_settings'); delete_option('wonderm00n_open_graph_version'); global $wpdb; $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '_webdados_fb_open_graph%'"); } } /* Run it */ function webdados_fb_run() { if ($webdados_fb = new Webdados_FB(WEBDADOS_FB_VERSION)) { return $webdados_fb; } else { return false; } } $webdados_fb = webdados_fb_run();
<?php define('WP_USE_THEMES', false); require '../../../wp-blog-header.php'; if ($webdados_fb = webdados_fb_run()) { if (isset($_GET['img']) && trim($_GET['img']) != '') { if ($url = parse_url(trim($_GET['img']))) { if ($url['host'] == $_SERVER['HTTP_HOST']) { if ($image = imagecreatefromfile($_SERVER['DOCUMENT_ROOT'] . $url['path'])) { $thumb_width = intval(WEBDADOS_FB_W); $thumb_height = intval(WEBDADOS_FB_H); $width = imagesx($image); $height = imagesy($image); $original_aspect = $width / $height; $thumb_aspect = $thumb_width / $thumb_height; if ($original_aspect >= $thumb_aspect) { // If image is wider than thumbnail (in aspect ratio sense) $new_height = $thumb_height; $new_width = $width / ($height / $thumb_height); } else { // If the thumbnail is wider than the image $new_width = $thumb_width; $new_height = $height / ($width / $thumb_width); } $thumb = imagecreatetruecolor($thumb_width, $thumb_height); // Resize and crop imagecopyresampled($thumb, $image, 0 - ($new_width - $thumb_width) / 2, 0 - ($new_height - $thumb_height) / 2, 0, 0, $new_width, $new_height, $width, $height); //Barra if (trim($webdados_fb->options['fb_image_overlay_image']) != '') { $barra_url = parse_url(trim($webdados_fb->options['fb_image_overlay_image'])); $barra = imagecreatefromfile($_SERVER['DOCUMENT_ROOT'] . $barra_url['path']);