<?php
/**
 * Plugin Name: auto making JSON-LD
 * Plugin URI: https://richynokurashi.com/lp/jsonld_setting/
 * Description: 構造化データを自動生成します。（最終更新日時：2025/05/05)
 * Version: 4.5.3
 * Author: Richeal
 * Author URI:  https://richynokurashi.com
 * License: GPLv2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 */
if ( ! defined( 'ABSPATH' ) ) exit;

// error handling
if (defined('WP_DEBUG')) {
    @ini_set('display_errors', 0); // no error
    @ini_set('log_errors', 1);      // -> log
    @ini_set('error_log', WP_CONTENT_DIR . '/auto-making-json-ld.log'); // log file dir
}

if (!function_exists('amJL_define_path')){
    function amJL_define_path(){
        $base_dir = plugin_dir_path(__FILE__);
        $base_url = plugin_dir_url(__FILE__);

        return [
            'autoMakingJSONLD'      => $base_dir,
            'autoMakingJSONLD_url'  => $base_url,
            'structure'             => $base_dir . 'structure/',
            'breadcrumb'            => $base_dir . 'structure/breadcrumb/',
            'article'               => $base_dir . 'structure/article/',
            'video'                 => $base_dir . 'structure/video/',
            'sitelink'              => $base_dir . 'structure/sitelink/',
            'recipe'                => $base_dir . 'structure/recipe/',
            'faq'                   => $base_dir . 'structure/FAQ/',
            'howto'                 => $base_dir . 'structure/howto/',
            'review'                => $base_dir . 'structure/review/',
            'event'                 => $base_dir . 'structure/event/',
            'settings'              => $base_dir . 'settings/',
            'include'               => $base_dir . 'include/',
            'img'                   => $base_url . 'img/',   // URL
            'js'                    => $base_dir . 'src/js/',
            'contents'              => $base_dir . 'contents/',
            'api_url'               => 'https://api.richynokurashi.com',
            'detailed_page_link'    => 'https://richynokurashi.com',
        ];
    }
}

$plugin_path = amJL_define_path();
require_once( $plugin_path['autoMakingJSONLD'].'initialize.php');
