HEX
Server: LiteSpeed
System: Linux cde4.duelhost.dk 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: dmhkjfau (1027)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/dmhkjfau/public_html/wp-content/plugins/datafeedr-api/hooks/admin/interface.php
<?php

defined( 'ABSPATH' ) || exit;

/**
 * Includes HelpScout Beacon if enabled and if on a Datafeedr-specific page.
 *
 * @since 1.0.84
 */
function dfrapi_include_helpscout_beacon() {

	$options = get_option( 'dfrapi_configuration', [] );

	if ( isset( $options['hs_beacon'] ) && 'off' === $options['hs_beacon'] ) {
		return;
	}

	if ( ! dfrapi_is_datafeedr_admin_page() ) {
		return;
	}

	include_once DFRAPI_PATH . 'js/helpscout-beacon.php';
}

add_action( 'admin_footer', 'dfrapi_include_helpscout_beacon' );

/**
 * Add link to Configuration page to action links on Plugins page.
 *
 * @param array $links
 *
 * @return array
 */
function dfrapi_add_plugin_action_links( array $links ): array {
	return array_merge(
		$links,
		[
			'config' => sprintf
			(
				'<a href="%1$s">%2$s</a>',
				dfrapi_configuration_page_url(),
				__( 'Configuration', 'datafeedr-api' )
			)
		]
	);
}

add_filter( 'plugin_action_links_' . DFRAPI_BASENAME, 'dfrapi_add_plugin_action_links' );

/**
 * Add links to Documentation and Contact page to meta row on Plugins page.
 *
 * @param array $links
 * @param string $plugin_file
 *
 * @return array
 */
function dfrapi_add_plugin_row_meta( array $links, string $plugin_file ): array {
	if ( $plugin_file === DFRAPI_BASENAME ) {
		$links[] = sprintf( '<a href="' . DFRAPI_DOCS_URL . '" target="_blank" rel="noopener nofollow">%s</a>', __( 'Documentation', 'datafeedr-api' ) );
		$links[] = sprintf( '<a href="' . DFRAPI_HELP_URL . '" target="_blank" rel="noopener nofollow">%s</a>', __( 'Support', 'datafeedr-api' ) );
	}

	return $links;
}

add_filter( 'plugin_row_meta', 'dfrapi_add_plugin_row_meta', 10, 2 );