<?php
declare(strict_types=1);

namespace RankingCoach\Inc\Modules\ModuleLibrary\Social;

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

use RankingCoach\Inc\Modules\ModuleBase\BaseModule;
use RankingCoach\Inc\Modules\ModuleManager;
use ReflectionException;

/**
 * Class SocialMedia
 */
class SocialMedia extends BaseModule {

	/**
	 * SocialMedia constructor.
	 *
	 * @param ModuleManager $moduleManager
	 *
	 * @throws ReflectionException
	 */
    public function __construct(ModuleManager $moduleManager) {
        $initialization = [
            'title' => 'Social Media Integration',
            'description' => 'Enhances social media sharing and visibility by integrating social media meta tags (Open Graph, Twitter Cards, etc.) into pages and posts.  Allows customization of meta data for different platforms.',
            'version' => '1.1.0',
            'name' => 'socialMedia',
            'priority' => 29,
            'dependencies' => [],
            'settings' => [['key' => 'enable_facebook_og', 'type' => 'boolean', 'default' => True, 'description' => 'Enable Open Graph meta tags for Facebook and other platforms that use Open Graph (e.g., LinkedIn).'], ['key' => 'enable_twitter_cards', 'type' => 'boolean', 'default' => True, 'description' => 'Enable Twitter Card meta tags for enhanced display on Twitter.'], ['key' => 'default_social_image', 'type' => 'string', 'default' => '', 'description' => 'The default image URL to use for social media shares if no featured image is set.  Leave blank to use the website logo.']],
            'explain' => 'When a user shares a blog post on Facebook, this module ensures that a rich preview is displayed, including the post title, description, featured image, and website URL, pulled from the meta tags generated by this module using the data and settings from the \'Meta Tags\' module.  Similarly, when shared on Twitter, the module generates appropriate Twitter Card tags to create an engaging preview.  If a post does not have a featured image, the module uses the default social image specified in the settings or falls back to the website logo.',
        ];
        parent::__construct($moduleManager, $initialization);
    }

    /**
     * Registers the hooks for the module.
     * @return void
     */
	public function initializeModule(): void {
		parent::initializeModule();
    }

	/**
	 * Create necessary SQL tables if they don't already exist.
	 * @param string $table_name
	 * @param string $charset_collate
	 * @return string
	 * @noinspection SqlNoDataSourceInspection
	 */
	protected function getTableSchema(string $table_name, string $charset_collate): string {
		return '';
	}
}
