PluginProbe
Active Campaign & Contact Form 7 / trunk
Active Campaign & Contact Form 7 vtrunk
1.2.5 trunk 1.0.0 1.0.1 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 26 releases
wpop-accf / wpop-accf.php

wpop-accf.php in Active Campaign & Contact Form 7 trunk, at wpop-accf.php

91 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Active Campaign & Contact Form 7
4 * Description: Add Contact Form 7 Data to Active Campiagn Contact lists.
5 * Author: WPoperation
6 * Plugin URI: https://wordpress.org/plugins/wpop-accf
7 * Author URI: https://wpoperation.com
8 * Version: 1.2.5
9 * Tested up to: 7.1
10 * Text Domain: wpop-accf
11 * Domain Path: /languages/
12 **/
13 // Exit if accessed directly
14 if (!defined('ABSPATH'))
15 exit;
16 if (!class_exists('ACCF7_Integration')) {
17 class ACCF7_Integration
18 {
19 public function __construct(){
20
21 /**
22 * check for contact form 7
23 */
24 add_action('init', array($this,'accf7_plugin_dependencies'));
25 add_action( 'admin_enqueue_scripts',array($this,'accf7_register_backend_assets') );
26 add_action('init', array(&$this,'init'));
27 add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array($this,'accf7_pro_plugin_action_links') );
28 add_action( 'admin_notices', array($this,'accf7_upgrade_notice') );
29 }
30 public function init(){
31 load_plugin_textdomain('wpop-accf', false, dirname(plugin_basename(__FILE__)) . '/languages/');
32 }
33 public function accf7_plugin_dependencies() {
34 define("ACCF7_PATH", plugin_dir_path(__FILE__));
35 define("ACCF7_URL", plugin_dir_url(__FILE__));
36 if (!class_exists('WPCF7')) {
37 add_action('admin_notices', array($this, 'cf7s_admin_notices'));
38 } else {
39 /**
40 * include settings
41 */
42 require_once( ACCF7_PATH . 'includes/accf7-settings.php' );
43
44 /**
45 * contact form 7 Subscribe class
46 */
47 require_once( ACCF7_PATH . 'includes/accf7-subscribe.php' );
48 }
49 }
50 //Registering of backend js and css
51 public function accf7_register_backend_assets() {
52 wp_enqueue_script( 'accf7-admin-js', ACCF7_URL.'assets/admin.js', array( 'jquery' ), '1.0', true );
53 wp_enqueue_style( 'accf7-admin-css', ACCF7_URL.'assets/admin.css');
54 }
55
56 public function cf7s_admin_notices() {
57 $class = 'notice notice-error';
58 $message = __('Active Campaign & Contact Form 7 requires Contact form 7 to be installed and active.', 'wpop-accf');
59 printf('<div class="%1$s"><p>%2$s</p></div>', $class, $message);
60 }
61
62 public function accf7_upgrade_notice() {
63 if ( ! current_user_can( 'manage_options' ) ) {
64 return;
65 }
66 $message = __( 'Upgrade to premium version of ActiveCampaign & Contact Form 7 to unlock powerful features. Get up to 30% off for limited time.', 'wpop-accf' );
67 $cta_url = 'https://wpoperation.com/plugins/active-campaign-contact-form-7-pro/';
68 $cta_label = __( 'Upgrade Now', 'wpop-accf' );
69 ?>
70 <div class="notice accf7-upgrade-notice is-dismissible">
71 <div class="accf7-upgrade-notice__icon" aria-hidden="true">
72 <span class="dashicons dashicons-star-filled"></span>
73 </div>
74 <div class="accf7-upgrade-notice__body">
75 <p><?php echo esc_html( $message ); ?></p>
76 </div>
77 <a href="<?php echo esc_url( $cta_url ); ?>" target="_blank" rel="noopener noreferrer" class="accf7-upgrade-notice__cta">
78 <?php echo esc_html( $cta_label ); ?> &rarr;
79 </a>
80 </div>
81 <?php
82 }
83
84 function accf7_pro_plugin_action_links( $links ) {
85
86 $links[] = '<a href="https://wpoperation.com/plugins/active-campaign-contact-form-7-pro/" target="_blank" style="color:#05c305; font-weight:bold;">'.esc_html__('Go Pro','wpop-accf').'</a>';
87 return $links;
88 }
89 }
90 new ACCF7_Integration();
91 }