Display name] * */ public static function supported_model_names() { return require plugin_dir_path(dirname( __FILE__ )) . 'admin/config/ai-models.php'; } /** * Retrieves a mapping of language codes to their display names [lang_code => Display name] * */ public static function supported_languages() { return require plugin_dir_path(dirname( __FILE__ )) . 'admin/config/languages.php'; } /** * Retrieves the API key that has been configured for the plugin. * */ public static function get_api_key() { $api_key = get_option( 'alttextlab_api_key' ); return apply_filters( 'alttextlab_api_key', $api_key ); } public static function is_publicly_accessible() { $local_ips = array( '127.0.0.1', '::1' ); return isset($_SERVER['REMOTE_ADDR']) && !in_array($_SERVER['REMOTE_ADDR'], $local_ips); } /** * Returns the URL where users can purchase additional credits * */ public static function get_credits_url() { $base_url = "https://app.alttextlab.com/settings/subscription?utm_medium=integration&utm_source=wordpress&utm_campaign=internal_use&utm_content=get_credits"; return $base_url; } /** * Returns the URL where users can leave a plugin review * */ public static function get_review_url() { $base_url = "https://wordpress.org/support/plugin/alttextlab/reviews/#new-post"; return $base_url; } /** * Returns the URL where users can share feedback * */ public static function get_feedback_url() { $base_url = "https://wordpress.org/support/plugin/alttextlab/"; return $base_url; } /** * Returns the URL where users can contact support * */ public static function get_support_url() { $base_url = "https://www.alttextlab.com/contact"; return $base_url; } /** * Checks whether the WooCommerce plugin is installed and activated * */ public static function has_woocommerce() { return is_plugin_active('woocommerce/woocommerce.php'); } /** * Determine if Yoast is installed/active: * */ public static function has_yoast() { return is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php'); } /** * Determine if AllInOne SEO is installed/active: * */ public static function has_aioseo() { return is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php'); } /** * Determine if RankMath is installed/active: * */ public static function has_rankmath() { return is_plugin_active('seo-by-rank-math/rank-math.php'); } /** * Determine if SEOPress is installed/active: * */ public static function has_seopress() { return is_plugin_active('wp-seopress/seopress.php'); } /** * Determine if SquirrlySEO is installed/active: * */ public static function has_squirrly() { return is_plugin_active('squirrly-seo/squirrly.php'); } /** * Determine if The SEO Framework is installed/active: * */ public static function has_theseoframework() { return defined('THE_SEO_FRAMEWORK_PRESENT') && THE_SEO_FRAMEWORK_PRESENT; } /** * Determine if SmartCrawl is installed/active. * */ public static function has_smartcrawl() { include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); return in_array( 'smartcrawl-seo/wpmu-dev-seo.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ); } /** * Determine if WPML is installed/active. */ public static function is_wpml_active() { return defined('ICL_LANGUAGE_CODE'); } /** * Get WPML language for given attachment. */ public static function get_wpml_attachment_language( $attachment_id ) { $language_details = apply_filters( 'wpml_post_language_details', null, $attachment_id ); if ( ! is_array( $language_details ) || empty( $language_details['language_code'] ) ) { return null; } return $language_details['language_code']; } }