Skip to content

Commit f35e795

Browse files
author
Wow-Company
committed
Add a new code 'Email Marketing Services Integration'
1 parent 18728ad commit f35e795

File tree

102 files changed

+13965
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+13965
-2
lines changed

README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,44 @@
1-
# emsi-for-wordpress
2-
Easy Wordpress integration with email marketing services.
1+
Email Marketing Services Integration for WordPress
2+
======================
3+
4+
Description
5+
----
6+
Plugin Email Marketing Services Integration gives the opportunity to integrate your site on Wordpress with popular email marketing services. This plugin helps to add subscribers to the lists of e-mail services.
7+
8+
**Features:**
9+
* integration with popular email marketing services;
10+
* integration with plugins for collecting subscribers;
11+
* subscription when registering and adding comments.
12+
13+
**Integration with the following plugins:**
14+
* [Easy Digital Downloads](https://wordpress.org/plugins/easy-digital-downloads/)
15+
* [WooCommerce](https://wordpress.org/plugins/woocommerce/)
16+
* [Users Activity](https://wordpress.org/plugins/users-activity/)
17+
18+
**Integration with the following email marketing services:**
19+
* [MailChimp](https://mailchimp.com/)
20+
* [AWeber](https://www.aweber.com)
21+
* [ActiveCampaign](https://www.activecampaign.com/)
22+
* [SendinBlue](https://www.sendinblue.com/)
23+
* [GetResponse](https://www.getresponse.com/)
24+
25+
26+
27+
Bugs
28+
----
29+
If you think you've found a bug, [please raise an issue here](https://github.com/dmytrolobov/emsi-for-wordpress/issues?state=open)!
30+
31+
32+
Support
33+
-------
34+
Please visit the
35+
[Email Marketing Services Integration for WordPress support forum on WordPress.org](https://wordpress.org/support/plugin/email-marketing-services-integration/).
36+
37+
38+
Contributions
39+
-------------
40+
Anyone is welcome to contribute to the plugin. There are various ways you can contribute:
41+
42+
* [Raise an issue](https://github.com/dmytrolobov/emsi-for-wordpress/issues) on GitHub.
43+
* Send us a Pull Request with your bug fixes and/or new features.
44+
* Provide feedback and [suggestions on enhancements](https://github.com/dmytrolobov/emsi-for-wordpress/issues?direction=desc&labels=Enhancement&page=1&sort=created&state=open).

Readme.txt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
=== Email Marketing Services Integration ===
2+
Contributors: Wpcalc, lobov
3+
Donate link: https://wow-estore.com/
4+
Tags: email integration, email services, email marketing, email subscribe, mailchimp, aweber, activecampaign, sendinblue, getresponse,
5+
Requires at least: 4.5
6+
Tested up to: 4.8
7+
Stable tag: trunk
8+
License: GPLv2 or later
9+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10+
11+
Easy Wordpress integration with email marketing services.
12+
13+
== Description ==
14+
Plugin Email Marketing Services Integration gives the opportunity to integrate your site on Wordpress with popular email marketing services. This plugin helps to add subscribers to the lists of e-mail services.
15+
16+
= Features: =
17+
* integration with popular email marketing services;
18+
* integration with plugins for collecting subscribers;
19+
* subscription when registering and adding comments.
20+
21+
= Integration with the following plugins: =
22+
* [Easy Digital Downloads](https://wordpress.org/plugins/easy-digital-downloads/)
23+
* [WooCommerce](https://wordpress.org/plugins/woocommerce/)
24+
* [Wow Forms](https://wordpress.org/plugins/mwp-forms/)
25+
* [Users Activity](https://wordpress.org/plugins/users-activity/)
26+
27+
= Integration with the following email marketing services: =
28+
* [MailChimp](https://mailchimp.com/)
29+
* [AWeber](https://www.aweber.com)
30+
* [ActiveCampaign](https://www.activecampaign.com/)
31+
* [SendinBlue](https://www.sendinblue.com/)
32+
* [GetResponse](https://www.getresponse.com/)
33+
34+
= To increase the number of subscribers and attract attention of users we recommend to use it together with such plugins: =
35+
* [Modal Window – create a simple popup & insert any content](https://wordpress.org/plugins/modal-window/)
36+
* [Countdowns – create any counter, timer and coundown](https://wordpress.org/plugins/mwp-countdown/)
37+
* [Float menu – awesome floating side menu](https://wordpress.org/plugins/float-menu/)
38+
* [Bubble Menu – awesome custom circle menu](https://wordpress.org/plugins/bubble-menu/)
39+
* [Herd Effects – fake notifications to motivate users to take action](https://wordpress.org/plugins/mwp-herd-effect/)
40+
41+
42+
== Screenshots ==
43+
1. Integration
44+
2. Email Services
45+
46+
47+
== Changelog ==
48+
49+
= 1.0 =
50+
* Initial release

admin/class-admin.php

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<?php if ( ! defined( 'ABSPATH' ) ) exit;
2+
/**
3+
* Admin Page Class
4+
*
5+
* @package WOW_EMS_Integration_ADMIN
6+
* @subpackage
7+
* @copyright Copyright (c) 2017, Dmytro Lobov
8+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9+
* @since 1.0
10+
*/
11+
12+
class WOW_EMS_Integration_ADMIN {
13+
14+
private $arg;
15+
16+
public function __construct( $arg ) {
17+
$this->plugin_name = $arg['plugin_name'];
18+
$this->plugin_menu = $arg['plugin_menu'];
19+
$this->version = $arg['version'];
20+
$this->pref = $arg['pref'];
21+
$this->slug = $arg['slug'];
22+
$this->plugin_dir = $arg['plugin_dir'];
23+
$this->plugin_url = $arg['plugin_url'];
24+
$this->plugin_home_url = $arg['plugin_home_url'];
25+
$this->shortcode = $arg['shortcode'];
26+
27+
28+
// admin pages
29+
add_action( 'admin_menu', array($this, 'add_menu_page') );
30+
add_action( 'admin_init', array($this, 'update_option') );
31+
32+
}
33+
function add_menu_page() {
34+
add_submenu_page('wow-company', $this->plugin_name, $this->plugin_menu, 'manage_options', $this->slug, array( $this, 'plugin_admin' ));
35+
}
36+
37+
function plugin_admin() {
38+
global $wow_company_plugin;
39+
$wow_company_plugin = true;
40+
include_once( $this->plugin_dir.'admin/partials/index.php' );
41+
self:: plugin_admin_style_script();
42+
}
43+
function plugin_admin_style_script() {
44+
// plugin sctyle & script
45+
wp_enqueue_style( $this->slug.'-style', $this->plugin_url . 'admin/css/style.css',false, $this->version);
46+
wp_enqueue_style( $this->slug.'-icon', $this->plugin_url . 'asset/font-awesome/css/font-awesome.min.css', array(), '4.7.0' );
47+
wp_enqueue_script($this->slug.'-script', $this->plugin_url . 'admin/js/script.js', array('jquery'), $this->version);
48+
}
49+
50+
// Update an option
51+
public function update_option(){
52+
if ( !empty($_POST['wow_'.$this->pref.'_nonce_field']) && wp_verify_nonce($_POST['wow_'.$this->pref.'_nonce_field'],'wow_'.$this->pref.'_update') ){
53+
$new_option = wp_unslash($_POST[''.$this->pref.'']);
54+
$options = get_option( $this->pref );
55+
if (empty($options)){
56+
$result = $new_option;
57+
}
58+
else {
59+
$result = array_merge($options, $new_option);
60+
}
61+
update_option( $this->pref, $result );
62+
$reffer = $_POST['_wp_http_referer'];
63+
$url = add_query_arg( array('ua-message' => 'update'), $reffer );
64+
wp_redirect($url);
65+
exit;
66+
}
67+
}
68+
69+
function create_option ($arg){
70+
$id = isset($arg['id']) ? $arg['id'] : null;
71+
$name = isset($arg['name']) ? $arg['name'] : '';
72+
$type = isset($arg['type']) ? $arg['type'] : '';
73+
$func = !empty($arg['func']) ? ' onchange="'.$arg['func'].'();"' : '';
74+
$options = isset($arg['option']) ? $arg['option'] : '';
75+
$val = $arg['val'];
76+
$separator = isset($arg['sep']) ? $arg['sep'] : '';
77+
// create radio fields
78+
if ($type == 'radio'){
79+
$option = '';
80+
foreach ($options as $key => $value){
81+
$select = ($key == $val) ? 'checked="checked"' : '';
82+
$option .= '<input name="'.$this->pref.'['.$name.']" type="radio" value="'.$key.'" id="wow_'.$id.'_'.$key.'" '.$select.'><label for="wow_'.$id.'_'.$key.'"> '.$value.'</label>'.$separator;
83+
}
84+
$field = $option;
85+
}
86+
87+
// create checkbox field
88+
if ($type == 'checkbox'){
89+
$select = !empty($val) ? 'checked="checked"' : '';
90+
$field = '<input type="checkbox" '.$select.$func.' id="wow_'.$id.'">'.$separator;
91+
}
92+
93+
// create text field
94+
if ($type == 'text'){
95+
$field = '<input name="'.$this->pref.'['.$name.']" type="text" value="'.$val.'" id="wow_'.$id.'"'.$func.'>'.$separator;
96+
}
97+
98+
// create number field
99+
if ($type == 'number'){
100+
$field = '<input name="'.$this->pref.'['.$name.']" type="number" value="'.$val.'" id="wow_'.$id.'"'.$func.'>'.$separator;
101+
}
102+
103+
// create color field
104+
if ($type == 'color'){
105+
$field = '<input name="'.$this->pref.'['.$name.']" type="text" value="'.$val.'" class="wp-color-picker-field" data-alpha="true">'.$separator;
106+
}
107+
108+
// create select field
109+
if ($type == 'select'){
110+
$option = '';
111+
foreach ($options as $key => $value){
112+
$select = ($key == $val) ? 'selected="selected"' : '';
113+
$option .= '<option value="'.$key.'" '.$select.'>'.$value.'</option>';
114+
}
115+
$field = '<select name="'.$this->pref.'['.$name.']"'.$func.' id="wow_'.$id.'">';
116+
$field .= $option;
117+
$field .= '</select>';
118+
}
119+
120+
// create editor field
121+
if ($type == 'editor'){
122+
$settings = array(
123+
'textarea_name' => ''.$this->pref.'['.$name.']',
124+
);
125+
$field = wp_editor( $val, $id, $settings );
126+
127+
}
128+
129+
// create textarea field
130+
if ($type == 'textarea'){
131+
$field = '<textarea name="'.$this->pref.'['.$name.']" id="wow_'.$id.'">'.$val.'</textarea>'.$separator;
132+
}
133+
return $field;
134+
}
135+
136+
}

admin/css/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php // Silence is golden

0 commit comments

Comments
 (0)