Plugin info

Total downloads: 38,220
Active installs: 5,000
Total reviews: 8
Average rating: 5
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 3 language(s)
Contributors: 1
Last updated: 7/28/2021 (1617 days ago)
Added to WordPress: 1/16/2016 (9 years old)
Minimum WordPress version: 4.6
Tested up to WordPress version: 5.8.12
Minimum PHP version: 5.3

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 1617 days ago • 8 reviews

22/100

Is DCO Insert Analytics Code abandoned?

Possibly abandoned (last update 1617 days ago).

Compatibility

Requires WordPress: 4.6
Tested up to: 5.8.12
Requires PHP: 5.3

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Komito Analytics
Rating 5.0/5 (7 reviews)Active installs 100
Multi Counter
Rating 0.0/5 (0 reviews)Active installs 10
JSON-LD Schema for Yandex Metrica
Rating 0.0/5 (0 reviews)Active installs 10

Description

DCO Insert Analytics Code is a WordPress plugin is intended for insert analytics code(or any custom code) before or after or before

Usage

After installation and activation, you can insert the necessary code to the respective fields on the plugin settings page.
GitHub

Settings

  • Before code
  • After code
  • Before code

Filters list

dco_iac_get_options

Filter for hardcoding override plugin settings. You won’t be able to edit them on the settings page anymore when using this filter.

dco_iac_insert_before_head

Filter to change the code is inserted before

dco_iac_insert_before_head_show

Filter to change show the code is inserted before

dco_iac_insert_after_body

Filter to change the code is inserted after

dco_iac_insert_after_body_show

Filter to change show the code is inserted after

dco_iac_insert_before_body

Filter to change the code is inserted before

dco_iac_insert_before_body_show

Filter to change show the code is inserted before

dco_iac_disable_do_shortcode

Filter to disable shortcode processing in inserted codes

Examples of using filters

Hardcoding override plugin settings

/*
* $current - current plugin settings
*
* $options - plugin settings from database
*
* $default - default plugin settings
*/

function custom_get_options($current, $options, $default) {
    $array = array(
        'before_head' => '',
        'before_head_show' => '0',
        'after_body' => '',
        'after_body_show' => '1',
        'before_body' => '',
        'before_body_show' => '2'
    );

    return $array;
}

add_filter('dco_iac_get_options', 'custom_get_options', 10, 3);

Change before code

/*
* $code - value from "before " setting
*/

function custom_before_head_code( $code ) {
    return $code . '' . "\n";
}

add_filter( 'dco_iac_insert_before_head', 'custom_before_head_code' );

Change before code show

/*
* $value - value from "before  show" setting
*/

function custom_before_head_code( $value ) {
    return '2';
}

add_filter( 'dco_iac_insert_before_body_show', 'custom_before_body_show' );

Disable shortcode processing in insert codes

add_filter('dco_iac_disable_do_shortcode', '__return_true');

Installation

  1. Upload dco-insert-analytics-code folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Frequently Asked Questions

I put the code on the plugin settings page, but it does not appear on the site. What could be the reason?

Review feed

No reviews available

Screenshots

  1. Settings page

    Settings page

  2. Example page

    Example page

Changelog

1.1.3

  • Add settings link to Plugins page
  • Correct plugin description

1.1.2

  • Constant DCO_IAC_DO_SHORTCODE replaced with dco_iac_disable_do_shortcode filter. Use add_filter('dco_iac_disable_do_shortcode', '__return_true'); to disable shortcodes support.

1.1.1

  • Added feature to hide the code
  • Added shortcodes support (add constant define('DCO_IAC_DO_SHORTCODE', false); to wp-config.php for disable)

1.1.0

  • Fixed Text Domain
  • Added the ability to adjust the show code for logged / not logged users
  • Restricted direct access to plugin files

1.0.0

  • Initial Release