\n"; echo "\n"; echo "\n"; } function get_matomo_url() { $matomo_url = get_option('matomo_url'); if( substr_compare( $matomo_url, '/', -1, 1 ) == 0 ) { $matomo_url = substr( $matomo_url, 0, -1 ); } if( substr_compare( $matomo_url, 'https://', 0, 8 ) == 0 ) { $matomo_url = substr( $matomo_url, 8 ); } if( substr_compare( $matomo_url, 'http://', 0, 7 ) == 0 ) { $matomo_url = substr( $matomo_url, 7 ); } return $matomo_url; } // TODO: Only include if this should be used add_filter( 'the_permalink_rss', 'add_matomo_campaign_to_rss' ); function add_matomo_campaign_to_rss($guid) { global $post; $get_vars = array( 'pk_campaign=' . urlencode( get_option('matomo_rss_campaign') ), 'pk_source=' . urlencode( get_option('matomo_rss_source') ) ); return $guid . '?' . implode( '&', $get_vars ); } add_action('admin_menu', 'include_matomo_menu'); function include_matomo_menu() { add_submenu_page('options-general.php', 'Include Matomo - Settings', 'Include Matomo', 'administrator', 'include-matomo-settings', 'include_matomo_settings_page'); } add_action( 'admin_init', 'my_plugin_settings' ); function my_plugin_settings() { register_setting( 'include-matomo-settings-group', 'matomo_url' ); register_setting( 'include-matomo-settings-group', 'matomo_site_id' ); register_setting( 'include-matomo-settings-group', 'matomo_rss_campaign' ); register_setting( 'include-matomo-settings-group', 'matomo_rss_source' ); register_setting( 'include-matomo-settings-group', 'matomo_disable_cookies' ); } function include_matomo_settings_page() { ?>