eck' ) );
//Image sizes - After PRO is loaded
add_action( 'plugins_loaded', array( $this, 'set_image_sizes' ), 12 );
//Add excerpts to pages
add_action( 'init', array( $this, 'add_excerpts_to_pages' ) );
}
/* Admin hooks */
private function call_admin_hooks() {
$plugin_admin = new Webdados_FB_Admin( $this->options, $this->version );
// Menu
add_action( 'admin_menu', array( $plugin_admin, 'create_admin_menu' ) );
// Register settings
add_action( 'admin_init', array( $plugin_admin, 'options_init' ) );
// WPML - Translate options
add_action( 'update_option_wonderm00n_open_graph_settings', array( $plugin_admin, 'options_wpml' ), 10, 3 );
// Settings link on the Plugins list
add_filter( 'plugin_action_links_wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php', array( $plugin_admin, 'place_settings_link' ) );
// User Facebook, Google+ and Twitter profiles
add_action( 'user_contactmethods', array( $plugin_admin, 'user_contactmethods' ) );
// Add metabox to posts
add_action( 'add_meta_boxes', array( $plugin_admin, 'add_meta_boxes' ) );
add_action( 'save_post', array( $plugin_admin, 'save_meta_boxes' ) );
// Admin notices
add_action( 'admin_notices', array( $plugin_admin, 'admin_notices' ) );
// Admin link to manually update cache
add_action( 'post_updated_messages', array( $plugin_admin, 'post_updated_messages' ) );
// Session start so we can know if the cache was cleared on Facebook
//if(!session_id())
//@session_start(); //We use @ because some other plugin could previously sent something to the browser
}
/* Public hooks */
private function call_public_hooks() {
//Create public object
$plugin_public = new Webdados_FB_Public( $this->options, $this->version );
// Get Post as soon as he's set, because some plugins, like BDP usally mess with it
add_action( 'the_post', array( $plugin_public, 'get_post' ), 0 );
// hook to upate plugin db/options based on version
add_action( 'wp_head', array( $plugin_public, 'insert_meta_tags' ), 99999 );
// hook to add Open Graph Namespace
add_filter( 'language_attributes', array( $plugin_public, 'add_open_graph_namespace' ), 99999 );
// Add Schema.org itemtype
add_filter( 'language_attributes', array( $plugin_public, 'add_schema_itemtype' ), 99999 );
// RSS
add_action( 'rss2_ns', array( $plugin_public, 'images_on_feed_yahoo_media_tag') );
add_action( 'rss_item', array( $plugin_public, 'images_on_feed_image') );
add_action( 'rss2_item', array( $plugin_public, 'images_on_feed_image') );
}
/* Update database */
public function update_db_check() {
$upgrade = false;
//Upgrade from 0.5.4 - Last version with individual settings
if ( !$v = get_option('wonderm00n_open_graph_version') ) {
//No version because it's a new install or because it's 0.5.4 or less?
if ( $this->version <= '0.5.4' ) {
} else {
//A new install - set the default data on the database
$upgrade = true;
update_option( 'wonderm00n_open_graph_settings', $this->options );
}
} else {
if ( $v < $this->version ) {
//Any version upgrade
$upgrade=true;
//We should do any upgrade we need, right here
if ( $v < '2.0.8' ) {
$this->options['fb_declaration_method'] = 'xmlns';
update_option( 'wonderm00n_open_graph_settings', $this->options );
}
}
}
//Set version on database
if ($upgrade) {
update_option( 'wonderm00n_open_graph_version', $this->version );
}
}
/* Set image sizes */
public function set_image_sizes() {
$size = apply_filters( 'fb_og_image_size', array( $this->img_w, $this->img_h ) );
$this->img_w = $size[0];
$this->img_h = $size[1];
}
/* Add excerpt to pages */
public function add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
/* WPML */
public function is_wpml_active() {
if ( function_exists( 'icl_object_id' ) && function_exists( 'icl_register_string' ) ) {
global $sitepress;
if ( is_object($sitepress) ) {
return true;
} else {
return false;
}
}
return false;
}
/* WordPress Locale */
public function get_locale() {
$locale = get_locale();
// Facebook doesn't has all the WordPress locales
$locale_mappings = array(
'af' => 'af_ZA',
'ar' => 'ar_AR',
'ary' => 'ar_AR',
'as' => 'as_IN',
'az' => 'az_AZ',
'azb' => 'az_AZ',
'bel' => 'be_BY',
'bn_BD' => 'bn_IN',
'bo' => 'bp_IN',
'ca' => 'ca_ES',
'ceb' => 'cx_PH',
'ckb' => 'cb_IQ',
'cy' => 'cy_GB',
'de_CH' => 'de_DE',
'de_CH_informal' => 'de_DE',
'de_DE_formal' => 'de_DE',
'el' => 'el_GR',
'en_AU' => 'en_GB',
'en_CA' => 'en_US',
'en_NZ' => 'en_GB',
'en_ZA' => 'en_GB',
'eo' => 'eo_EO',
'es_AR' => 'es_ES',
'es_CL' => 'es_ES',
'es_CO' => 'es_ES',
'es_GT' => 'es_ES',
'es_PE' => 'es_ES',
'es_VE' => 'es_ES',
'et' => 'et_EE',
'eu' => 'eu_ES',
'fi' => 'fi_FI',
'fr_BE' => 'fr_FR',
'gd' => 'ga_IE',
'gu' => 'gu_IN',
'hr' => 'hr_HR',
'hy' => 'hy_AM',
'ja' => 'ja_JP',
'km' => 'km_KH',
'lo' => 'lo_LA',
'lv' => 'lv_LV',
'mn' => 'mn_MN',
'mr' => 'mr_IN',
'nl_NL_formal' => 'nl_NL',
'ps' => 'ps_AF',
'pt_PT_ao90' => 'pt_PT',
'sah' => 'ky_KG',
'sq' => 'sq_AL',
'te' => 'te_IN',
'th' => 'th_TH',
'tl' => 'tl_PH',
'uk' => 'uk_UA',
'ur' => 'ur_PK',
'vi' => 'vi_VN',
);
if ( isset($locale_mappings[$locale]) ) $locale = $locale_mappings[$locale];
return trim($locale);
}
/* 3rd Party - Yoast SEO */
public function is_yoast_seo_active() {
if ( defined( 'WPSEO_VERSION' ) ) {
return true;
}
return false;
}
/* 3rd Party - All in One SEO Pack */
public function is_aioseop_active() {
if ( defined( 'AIOSEOP_VERSION' ) ) {
return true;
}
return false;
}
/* 3rd Party - WooCommerce */
public function is_woocommerce_active() {
return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
}
/* 3rd Party - Subheading */
public function is_subheading_plugin_active() {
if ( class_exists( 'SubHeading' ) && function_exists( 'get_the_subheading' ) ) {
return true;
}
return false;
}
/* 3rd Party - Business Directory Plugin */
public function is_business_directory_active() {
@include_once(ABSPATH . 'wp-admin/includes/plugin.php');
if ( is_plugin_active( 'business-directory-plugin/business-directory-plugin.php' ) ) {
return true;
}
return false;
}
}
Fatal error: Uncaught Error: Class 'Webdados_FB' not found in /home/sportuga/public_html/wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php:47
Stack trace:
#0 /home/sportuga/public_html/wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php(55): webdados_fb_run()
#1 /home/sportuga/public_html/wp-settings.php(473): include_once('/home/sportuga/...')
#2 /home/sportuga/public_html/wp-config.php(100): require_once('/home/sportuga/...')
#3 /home/sportuga/public_html/wp-load.php(50): require_once('/home/sportuga/...')
#4 /home/sportuga/public_html/wp-blog-header.php(13): require_once('/home/sportuga/...')
#5 /home/sportuga/public_html/index.php(17): require('/home/sportuga/...')
#6 {main}
thrown in /home/sportuga/public_html/wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php on line 47