'3054', 'slug' => 'pctags-pinterest-conversion-tags', 'premium_slug' => 'pctags-pinterest-conversion-tag-premium', 'type' => 'plugin', 'public_key' => 'pk_7f3d162827e52ef0e6f8e46b2725f', 'is_premium' => false, 'premium_suffix' => 'Pinterest tag for events', 'has_addons' => false, 'has_paid_plans' => true, 'trial' => array( 'days' => 7, 'is_require_payment' => true, ), 'menu' => array( 'slug' => 'pctag', 'override_exact' => true, 'first-path' => 'options-general.php?page=pctag', 'support' => false, 'parent' => array( 'slug' => 'options-general.php', ), ), 'is_live' => true, ) ); } return $pctag_fs; } // Init Freemius. pctag_fs(); // Signal that SDK was initiated. do_action( 'pctag_fs_loaded' ); function pctag_fs_settings_url() { return admin_url( 'options-general.php?page=pctag&tab=pctag-settings' ); } pctag_fs()->add_filter( 'connect_url', 'pctag_fs_settings_url' ); pctag_fs()->add_filter( 'after_skip_url', 'pctag_fs_settings_url' ); pctag_fs()->add_filter( 'after_connect_url', 'pctag_fs_settings_url' ); pctag_fs()->add_filter( 'after_pending_connect_url', 'pctag_fs_settings_url' ); } // freemius opt-in function pctag_fs_custom_connect_message( $message, $user_first_name, $product_title, $user_login, $site_link, $freemius_link ) { $break = "

"; return sprintf( esc_html__( 'Hey %1$s, %2$s Click on Allow & Continue to activate PCTAGs andtrack conversions on your website :)! The Pinterest tag (with base & event codes) allows you to track actions people take on your website after viewing your Promoted Pin, measure return on ad spend (RoAS) and create audiences to target on your Promoted Pins. %2$s Never miss an important update -- opt-in to our security and feature updates notifications. %2$s See you on the other side.', 'pctag' ), $user_first_name, $break ); } pctag_fs()->add_filter( 'connect_message', 'pctag_fs_custom_connect_message', 10, 6 ); class pctag { function __construct() { // making sure we have the right paths... // making sure we have the right paths... if ( !defined( 'WP_PLUGIN_URL' ) ) { if ( !defined( 'WP_CONTENT_DIR' ) ) { define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); } if ( !defined( 'WP_CONTENT_URL' ) ) { define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); } if ( !defined( 'WP_PLUGIN_DIR' ) ) { define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); } define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); } // end if // stuff to do on plugin activation/deactivation //register_activation_hook(__FILE__, array(&$this, 'pctag_activate')); register_deactivation_hook( __FILE__, array( &$this, 'pctag_deactivate' ) ); //add quick links to plugin settings $plugin = plugin_basename( __FILE__ ); if ( is_admin() ) { add_filter( "plugin_action_links_{$plugin}", array( &$this, 'pctag_setting_link' ) ); } } // end function __construct() // quick setting link in plugin section function pctag_setting_link( $links ) { $settings_link = 'Settings'; array_unshift( $links, $settings_link ); return $links; } // end function setting_link() // register options function pctag_options() { $pctag_options = get_option( 'pctag' ); return $pctag_options; } // end function pctag_options() // removed settings (if checked) on plugin deactivation function pctag_deactivate() { $pctag_options = $this->pctag_options(); if ( $pctag_options['pctag_remove_settings'] ) { delete_option( 'pctag' ); } } } // end class $pctag = new pctag(); function pctag_wp_head() { global $pctag ; $pctag_options = $pctag->pctag_options(); if ( isset( $pctag_options['enable_pctag'] ) && !empty($pctag_options['enable_pctag']) && isset( $pctag_options['pctag_id'] ) && !empty($pctag_options['pctag_id']) ) { if ( isset( $pctag_options['pctag_meta'] ) && !empty($pctag_options['pctag_meta']) ) { echo trim( $pctag_options['pctag_meta'] ) ; } $tag_id = stripslashes( $pctag_options['pctag_id'] ); $pin_base = << PINBASE; echo $pin_base . "\n" ; //echo "
"; } } add_action( 'wp_head', 'pctag_wp_head' ); // admin notifications include_once dirname( __FILE__ ) . '/inc/notices.php'; add_action( 'init', 'pctag_textdomain' ); function pctag_textdomain() { load_plugin_textdomain( 'pctag', false, basename( dirname( __FILE__ ) ) . '/languages' ); } if ( is_admin() ) { include_once dirname( __FILE__ ) . '/pinterest-conversion-tag-admin.php'; }