PluginProbe ʕ •ᴥ•ʔ
Brevo – Email, SMS, Web Push, Chat, and more. / 1.0
Brevo – Email, SMS, Web Push, Chat, and more. v1.0
2.9.13 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.9 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.2 3.1.20 3.1.21 3.1.22 3.1.23 3.1.24 3.1.25 3.1.26 3.1.27 3.1.28 3.1.29 3.1.3 3.1.30 3.1.31 3.1.32 3.1.33 3.1.34 3.1.35 3.1.36 3.1.37 3.1.38 3.1.39 3.1.4 3.1.40 3.1.41 3.1.42 3.1.43 3.1.44 3.1.45 3.1.46 3.1.47 3.1.48 3.1.49 3.1.5 3.1.50 3.1.51 3.1.52 3.1.53 3.1.54 3.1.55 3.1.56 3.1.57 3.1.58 3.1.59 3.1.6 3.1.60 3.1.61 3.1.62 3.1.63 3.1.64 3.1.65 3.1.66 3.1.67 3.1.68 3.1.69 3.1.7 3.1.70 3.1.71 3.1.72 3.1.73 3.1.74 3.1.75 3.1.76 3.1.77 3.1.78 3.1.79 3.1.8 3.1.80 3.1.81 3.1.82 3.1.83 3.1.84 3.1.85 3.1.86 3.1.87 3.1.88 3.1.89 3.1.9 3.1.90 3.1.91 3.1.92 3.1.93 3.1.94 3.1.95 3.1.96 3.1.97 3.1.98 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 trunk 1.0 1.5 2.0.8 2.9.10 2.9.11 2.9.12
mailin / cron.php
mailin Last commit date
css 13 years ago js 13 years ago lang 13 years ago api_form.php 13 years ago compatibility.php 13 years ago cron.php 13 years ago listings.php 13 years ago mailin.php 13 years ago mailin_widget.php 13 years ago mailinapi.class.php 13 years ago readme.txt 13 years ago
cron.php
141 lines
1 <?php
2 /**
3 * Dummy CLI script that loads the WordPress environment
4 * Author: Thorsten Ott
5 * Author URI: http://hitchhackerguide.com
6 */
7 set_time_limit( 0 );
8 ini_set( "memory_limit", "64M" );
9 $_SERVER['HTTP_HOST'] = 'wp_trunk'; // set this to the apache vhost name of your WordPress install
10
11 ob_start();
12 $wp_load = '../../../wp-load.php';
13
14 //STOP CRON EXECUTION WHEN WORDPRESS IS NOT LOADED ON THIS FILE
15 if(!is_file($wp_load)){
16 exit;
17 }
18
19 require_once($wp_load); // you need to adjust this to your path
20 require_once( ABSPATH . 'wp-admin/includes/admin.php' );
21 ob_end_clean();
22
23
24 function curl_request($data) {
25
26 $url = 'http://ws.mailin.fr/'; //WS URL
27 $ch = curl_init();
28
29 $ndata='';
30
31 if(is_array($data)){
32
33 foreach($data AS $key=>$value){
34 $ndata .=$key.'='.urlencode($value).'&';
35 }
36
37 }else{
38
39 $ndata=$data;
40
41 }
42
43 curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
44 curl_setopt($ch, CURLOPT_POST ,1);
45 curl_setopt ($ch, CURLOPT_POSTFIELDS,$ndata);
46 curl_setopt($ch, CURLOPT_HEADER, 0);
47 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
48 curl_setopt($ch, CURLOPT_URL, $url);
49 $data = curl_exec($ch);
50 curl_close($ch);
51 return $data;
52 }
53
54 $api_key = get_option('mailin_apikey');
55
56 if($api_key == ''){
57 exit;
58 }
59
60
61 function call_server($email, $api_key){
62
63 $data = array();
64 $data['webaction']='DISPLAYUSERDETAIL';
65 $data['key']= $api_key;
66 $data['email'] = $email;
67
68 $return = json_encode(curl_request($data));
69 $return = json_decode($return);
70 return $return;
71
72 }
73
74 function getListUsers($api_key, $list_ids){
75
76 if($api_key == '') {
77 return ;
78 }
79
80 $data = array();
81 $data['webaction']='DISPLAYLISTDATABLACK';
82 $data['key']=$api_key;
83
84 $data['listids']= $list_ids;
85
86 $return = curl_request($data);
87 $return = json_decode($return);
88
89 return $return;
90
91 }
92
93
94 global $wpdb;
95 $table = $wpdb->prefix."mailin_subscribers ";
96
97
98 $api_key = get_option('mailin_apikey');
99
100 $lists = get_option('mailin_lists');
101 $lists = unserialize($lists);
102
103 $final_data = array();
104 foreach($lists as $data){
105 $final_data[] = $data->id;
106 }
107
108 $list_ids = '';
109 if(!empty($final_data)){
110 $list_ids = implode('|' , $final_data);
111 }
112
113 if($list_ids == ''){
114 return ;
115 }
116
117 $list_users = getListUsers($api_key , $list_ids);
118
119
120 if(!empty($list_users->result)){
121
122 foreach($list_users->result as $key=>$lists){
123
124 if(!empty($lists)){
125
126 foreach($lists as $users){
127
128 if(isset($users->blacklisted)){
129
130 if($users->blacklisted == '1'){
131 $sql = "UPDATE ".$table." SET subscribed = '0' WHERE email = '".strtolower(trim($users->email))."' " ;
132 }else{
133 $sql = "UPDATE ".$table." SET subscribed = '1' WHERE email = '".strtolower(trim($users->email))."' " ;
134 }
135 $myrows = $wpdb->query($sql);
136 }
137 }
138 }
139 }
140 }
141