wpMandrill - Version 1.07

Version Description

  • FIXED: Removing notices in the dashboard widget when there's no open or click data in the last 7 days.
  • FIXED: No having general tags defined were causing a validation error. ** Thanks Max! **
  • FIXED: Daily stats showing some hourly stats.
  • UPDATED: Spanish translation updated.
  • FIXED: Speeding dashboard widget results.
Download this release

Release Info

Developer MC_Will
Plugin Icon wp plugin wpMandrill
Version 1.07
Comparing to
See all releases

Code changes from version 1.06 to 1.07

Files changed (6) hide show
  1. js/mandrill.js +1 -1
  2. lang/wpmandrill-es_ES.mo +0 -0
  3. lang/wpmandrill.po +115 -113
  4. readme.txt +19 -10
  5. stats.php +1 -4
  6. wpmandrill.php +39 -17
js/mandrill.js CHANGED
@@ -78,7 +78,7 @@ function redrawDashboardWidget() {
78
  eval(data);
79
  },
80
  error: function(MLHttpRequest, textStatus, errorThrown){
81
- alert(errorThrown);
82
  jQuery('#mandrill_widget div#filtered_recent').html('');
83
  }
84
  });
78
  eval(data);
79
  },
80
  error: function(MLHttpRequest, textStatus, errorThrown){
81
+ alert(textStatus + ' ' + errorThrown);
82
  jQuery('#mandrill_widget div#filtered_recent').html('');
83
  }
84
  });
lang/wpmandrill-es_ES.mo CHANGED
Binary file
lang/wpmandrill.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: wpMandrill 1.0 rc1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2012-04-26 16:25-0500\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Will Castillo <will@mailchimp.com>\n"
8
  "Language-Team: MailChimp <will@mailchimp.com>\n"
@@ -116,346 +116,346 @@ msgstr "Para usarla, simplemente instancia un objeto pasándole una Clave API y
116
  msgid "&lt;?php $mandrill = Mandrill($my_api_key); echo $mandrill->ping(); ?&gt;"
117
  msgstr "&lt;?php $mandrill = Mandrill($my_api_key); echo $mandrill->ping(); ?&gt;"
118
 
119
- #: wpmandrill.php:81
120
  msgid "API Settings"
121
  msgstr "Configuración de la API"
122
 
123
- #: wpmandrill.php:82
124
  msgid "API Key"
125
  msgstr "Clave API"
126
 
127
- #: wpmandrill.php:88
128
  msgid "Sender Settings"
129
  msgstr "Configuración del Remitente"
130
 
131
- #: wpmandrill.php:89
132
  msgid "FROM Name"
133
  msgstr "Campo De:"
134
 
135
- #: wpmandrill.php:90
136
  msgid "FROM Email"
137
  msgstr "Campo Email:"
138
 
139
- #: wpmandrill.php:93
140
  msgid "General Template"
141
  msgstr "Plantilla General"
142
 
143
- #: wpmandrill.php:94
144
- #: wpmandrill.php:98
145
  msgid "&nbsp;"
146
  msgstr "&nbsp;"
147
 
148
- #: wpmandrill.php:97
149
  msgid "General Tags"
150
  msgstr "Etiquetas Generales"
151
 
152
- #: wpmandrill.php:104
153
  msgid "Send a test email using these settings"
154
  msgstr "Enviar un correo electrónico de prueba usando estas configuraciones"
155
 
156
- #: wpmandrill.php:105
157
  msgid "Send to"
158
  msgstr "Enviar a"
159
 
160
- #: wpmandrill.php:106
161
  msgid "Subject"
162
  msgstr "Asunto"
163
 
164
- #: wpmandrill.php:107
165
  msgid "Message"
166
  msgstr "Mensaje"
167
 
168
- #: wpmandrill.php:119
169
- #: wpmandrill.php:235
170
  msgid "Mandrill Settings"
171
  msgstr "Configuración de Mandrill"
172
 
173
- #: wpmandrill.php:120
174
  msgid "Mandrill"
175
  msgstr "Mandrill"
176
 
177
- #: wpmandrill.php:128
178
- #: wpmandrill.php:129
179
  msgid "Mandrill Reports"
180
  msgstr "Reportes Mandrill"
181
 
182
- #: wpmandrill.php:151
183
  msgid "Mandrill: wp_mail has been declared by another process or plugin, so you won't be able to use Mandrill until the problem is solved."
184
  msgstr "Mandrill: wp?install ha sido declarado por otro proceso o plugin por lo que no podras usar Mandrill hasta que soluciones este inconveniente."
185
 
186
- #: wpmandrill.php:180
187
  msgid "To use this plugin you will need:"
188
  msgstr "Para utilizar este plugin necesitarás:"
189
 
190
- #: wpmandrill.php:182
191
  msgid "Your Mandrill account."
192
  msgstr "Tu cuenta Mandrill"
193
 
194
- #: wpmandrill.php:183
195
- msgid "At least one verified domain."
196
- msgstr "Al menos un dominio verificado."
197
 
198
- #: wpmandrill.php:184
199
- msgid "A valid sender email address specified."
200
  msgstr "Una dirección de correo electrónico de remitente válido."
201
 
202
- #: wpmandrill.php:189
203
  msgid "Once you have properly configured the settings, the plugin will take care of all the emails sent through your WordPress installation."
204
  msgstr "Una vez que hayas completado la configuración, el plugin se hará cargo de todos los correos enviados a través de tu instalación WordPress."
205
 
206
- #: wpmandrill.php:190
207
  msgid "However, if you need to customize any part of the email before sending, you can do so by using the WordPress filter <strong>mandrill_payload</strong>."
208
  msgstr "De cualquier forma, si alguna vez necesitas alterar cualquier parte del email antes de que este sea enviado, lo podrás hacer utilizando el filtro WordPress <strong>mandrill_payload</strong>."
209
 
210
- #: wpmandrill.php:191
211
  msgid "This filter has the same structure as Mandrill's API call <a href=\"http://mandrillapp.com/api/docs/messages.html#method=send\" target=\"_blank\">/messages/send</a>, except that it can have one additional parameter when the email is based on a template. The parameter is called \"<em>template</em>\", which is an associative array of two elements (the first element, a string whose key is \"<em>template_name</em>\", and a second parameter whose key is \"<em>template_content</em>\". Its value is an array with the same structure of the parameter \"<em>template_content</em>\" in the call <a href=\"http://mandrillapp.com/api/docs/messages.html#method=send-template\" target=\"_blank\">/messages/send-template</a>.)"
212
  msgstr "Este filtro tiene la misma estructura de la llamada a la API de Mandrill <a href=\"http://mandrillapp.com/api/docs/messages.html#method=send\" target=\"_blank\">/messages/send</a>, excepto que esta podría tener un parámetro adicional cuando el email está basado en una plantilla. El parametro se llama \"<em>template</em>\", el cual es un arreglo asociativo de dos elementos (el primero, una cadena de caracteres cuya clave es \"<em>template_name</em>\", y un segundo parámetro cuya clave es \"<em>template_content</em>\" y su valor es una arreglo con la misma estructura del parámetro \"<em>template_content</em>\" de la llamada <a href=\"http://mandrillapp.com/api/docs/messages.html#method=send-template\" target=\"_blank\">/messages/send-template</a>.)"
213
 
214
- #: wpmandrill.php:192
215
  msgid "Note that if you're sending additional headers in your emails, the only valid headers are <em>From:</em>, <em>Reply-To:</em>, and <em>X-*:</em>. <em>Bcc:</em> is also valid, but Mandrill will send the blind carbon copy to only the first address, and the remaining will be silently discarted."
216
  msgstr "Ten en cuenta que si estás intentando enviar cabeceras adicionales en tus correos, las únicas cabeceras válidas serán <em>From:</em>, <em>Reply-To:</em> y <em>X-*:</em>. <em>Bcc:</em> también es válido, pero Mandrill sólo enviará la copia oculta a la primera dirección, descartando silenciosamente el resto de las direcciones especificadas en el campo Bcc: que envíes."
217
 
218
- #: wpmandrill.php:193
219
  msgid "Also note that if any error occurs while sending the email, the plugin will try to send the message again using the native WordPress mailing capabilities."
220
  msgstr "También ten presente que si ocurre cualquier error durante el envío del correo, el plugin intentará enviar el mensaje otra vez, utilizando las capacidades de envío de correo nativas de WordPress."
221
 
222
- #: wpmandrill.php:194
223
  msgid "Confirm that any change you made to the payload is in line with the <a href=\"http://mandrillapp.com/api/docs/\" target=\"_blank\">Mandrill's API's documentation</a>. Also, the <em>X-*:</em> headers, must be in line with the <a href=\"http://help.mandrill.com/customer/portal/articles/456744-smtp-headers-api\" target=\"_blank\">SMTP API documentation</a>. By using this plugin, you agree that you and your website will adhere to <a href=\"http://mandrill.com/legal/terms/\" target=\"_blank\">Mandrill's Terms of Use</a>."
224
  msgstr "Asegúrate que cualquier cambio que hagas en el payload esté cónsono con la <a href=\"http://mandrillapp.com/api/docs/\" target=\"_blank\">Documentacion de la API de Mandrill</a>. También, las cabeceras <em>X-*:</em> deben estar en línea con la <a href=\"http://help.mandrill.com/customer/portal/articles/456744-smtp-headers-api\" target=\"_blank\">Documentación de la API SMTP</a>. Al utilizar este plugin estás aceptando adherirte tu y tu sitio web a los <a href=\"http://mandrill.com/legal/terms/\" target=\"_blank\">Términos y Condiciones de Mandrill</a>."
225
 
226
- #: wpmandrill.php:195
227
  msgid "if you have any question about Mandrill or this plugin, visit the <a href=\"http://help.mandrill.com/\" target=\"_blank\">Mandrill's Support Center</a>."
228
  msgstr "Si tienes alguna pregunta sobre mandrill o este plugin, visita el <a href=\"http://help.mandrill.com/\" target=\"_blank\">Centro de Soporte de Mandrill</a>."
229
 
230
- #: wpmandrill.php:213
231
  msgid "Settings"
232
  msgstr "Configuraciones"
233
 
234
- #: wpmandrill.php:214
235
  msgid "Reports"
236
  msgstr "Reportes"
237
 
238
- #: wpmandrill.php:226
239
  #: stats.php:1
240
  msgid "You do not have sufficient permissions to access this page."
241
  msgstr "No tienes suficiente permisología para acceder a esta página."
242
 
243
- #: wpmandrill.php:256
244
  msgid "Send Email"
245
  msgstr "Campo Email:"
246
 
247
- #: wpmandrill.php:274
248
  msgid "Latest from Mandrill..."
249
  msgstr "Lo último de Mandrill..."
250
 
251
- #: wpmandrill.php:288
252
  msgid "News from MailChimp..."
253
  msgstr "Noticias de MailChimp"
254
 
255
- #: wpmandrill.php:315
256
  msgid "Mandrill How-Tos"
257
  msgstr "Mandrill: ¿Cómo hago?"
258
 
259
- #: wpmandrill.php:342
260
  msgid "You must define a valid sender email."
261
  msgstr "Debes definir un correo electrónico de remitente válido."
262
 
263
- #: wpmandrill.php:592
264
  msgid "Test email send failed. "
265
  msgstr "El correo electrónico de prueba falló."
266
 
267
- #: wpmandrill.php:602
268
  #, php-format
269
  msgid "Test executed: %d emails sent, %d emails queued and %d emails rejected"
270
  msgstr "Prueba ejecutada: %d emails enviados, %d emails encolados y %d emails rechazados"
271
 
272
- #: wpmandrill.php:617
273
  msgid "To get your API key, please visit your <a href=\"http://mandrillapp.com/settings/index\" target=\"_blank\">Mandrill Settings</a>"
274
  msgstr "Para obtener tu Clave API, por favor visita tu <a href=\"http://mandrillapp.com/settings/index\" target=\"_blank\">Configuración Mandrill</a>"
275
 
276
- #: wpmandrill.php:619
277
  msgid "We are connected to your Mandrill Account."
278
  msgstr "Estamos conectados a tu cuenta Mandrill."
279
 
280
- #: wpmandrill.php:621
281
  msgid "Sorry, invalid API key."
282
  msgstr "Lo siento, Clave API inválida."
283
 
284
- #: wpmandrill.php:637
285
- msgid "No verified domains found."
286
- msgstr "No se encontraros dominios verificados."
287
 
288
- #: wpmandrill.php:649
289
  msgid "This address will be used as the sender of the outgoing emails:"
290
  msgstr "Esta dirección será utilizada como el remitente para los correos salientes:"
291
 
292
- #: wpmandrill.php:655
293
- msgid "Only verified domains are displayed here. If you need to verify a new domain, please visit your <a href=\"https://mandrillapp.com/settings/sending-domains\" target=\"_blank\">Mandrill Settings</a>"
294
- msgstr "Aquí sólo se mostrarán dominios verificados. Si necesitas verificar un nuevo dominio, por favor visita tu <a href=\"https://mandrillapp.com/settings/sending-domains\" target=\"_blank\">Configuracipón Mandrill</a>"
295
 
296
- #: wpmandrill.php:665
297
  msgid "Name the recipients will see in their email clients:"
298
  msgstr "Nombre que los destinatarios verán en sus clientes de correo:"
299
 
300
- #: wpmandrill.php:676
301
- #: wpmandrill.php:686
302
  msgid "No templates found."
303
  msgstr "No se encontraron plantillas."
304
 
305
- #: wpmandrill.php:695
306
  msgid "Select the template to use:"
307
  msgstr "Seleccione la plantilla a utilizar:"
308
 
309
- #: wpmandrill.php:701
310
  msgid "<small>The selected template must have a <strong><em>mc:edit=\"main\"</em></strong> placeholder defined. The message will be shown there.</small>"
311
  msgstr "<small>La plantilla seleccionada debe tener una sección <strong><em>mc:edit=\"main\"</em></strong> definida. El mensaje será mostrado ahí.</small>"
312
 
313
- #: wpmandrill.php:711
314
  msgid "If there are tags that you want appended to every call, list them here, one per line:"
315
  msgstr "Si hay etiquetas que quieras agregar a cada llamada, lístalas aquí, una por línea."
316
 
317
- #: wpmandrill.php:713
318
  msgid "Also keep in mind that you can add or remove tags using the <em><a href=\"#\" onclick=\"jQuery('a#contextual-help-link').trigger('click');return false;\">mandrill_payload</a></em> WordPress filter."
319
  msgstr "También recuerda que puedes agregar o eliminar etiquetas utilizando el filtro WordPress <em><a href=\"#\" onclick=\"jQuery('a#contextual-help-link').trigger('click');return false;\">mandrill_payload</a></em>."
320
 
321
- #: wpmandrill.php:921
322
  msgid "Mandrill Recent Statistics"
323
  msgstr "Estadistas Recientes de Mandrill"
324
 
325
- #: wpmandrill.php:943
326
- #: wpmandrill.php:1159
327
  #: stats.php:8
328
  msgid "There was a problem retrieving statistics."
329
  msgstr "Hubo un problema recuperando las estadísticas."
330
 
331
- #: wpmandrill.php:1001
332
- #: wpmandrill.php:1256
333
  msgid "Sending Volume"
334
  msgstr "Volumen de Envío"
335
 
336
- #: wpmandrill.php:1002
337
- #: wpmandrill.php:1257
338
  msgid " emails"
339
  msgstr " emails"
340
 
341
- #: wpmandrill.php:1003
342
- #: wpmandrill.php:1258
343
  msgid "Total Volume per Day"
344
  msgstr "Volumen Total por Período"
345
 
346
- #: wpmandrill.php:1005
347
- #: wpmandrill.php:1260
348
  msgid "in the last few days"
349
  msgstr "en los últimos días"
350
 
351
- #: wpmandrill.php:1006
352
- #: wpmandrill.php:1261
353
  msgid "in the last few months"
354
  msgstr "en los últimos meses"
355
 
356
- #: wpmandrill.php:1007
357
- #: wpmandrill.php:1262
358
  msgid "Today"
359
  msgstr "Hoy"
360
 
361
- #: wpmandrill.php:1008
362
- #: wpmandrill.php:1263
363
  msgid "Last 7 Days"
364
  msgstr "Últimos 7 Días"
365
 
366
- #: wpmandrill.php:1009
367
- #: wpmandrill.php:1264
368
  msgid "Last 30 Days"
369
  msgstr "Últimos 30 Días"
370
 
371
- #: wpmandrill.php:1010
372
- #: wpmandrill.php:1265
373
  msgid "Last 60 Days"
374
  msgstr "Últimos 60 Días"
375
 
376
- #: wpmandrill.php:1011
377
- #: wpmandrill.php:1266
378
  msgid "Last 90 Days"
379
  msgstr "Últimos 90 Días"
380
 
381
- #: wpmandrill.php:1012
382
- #: wpmandrill.php:1267
383
  msgid "Periods"
384
  msgstr "Períodos"
385
 
386
- #: wpmandrill.php:1013
387
- #: wpmandrill.php:1268
388
  #: stats.php:30
389
  msgid "Volume"
390
  msgstr "Volumen"
391
 
392
- #: wpmandrill.php:1014
393
- #: wpmandrill.php:1269
394
  msgid "Total:"
395
  msgstr "Cuota:"
396
 
397
- #: wpmandrill.php:1015
398
- #: wpmandrill.php:1270
399
  msgid "Unopened"
400
  msgstr "No abiertos"
401
 
402
- #: wpmandrill.php:1016
403
- #: wpmandrill.php:1271
404
  msgid "Bounced or Rejected"
405
  msgstr "Rebotes o Rechazos"
406
 
407
- #: wpmandrill.php:1017
408
- #: wpmandrill.php:1272
409
  msgid "Opened"
410
  msgstr "Abiertos"
411
 
412
- #: wpmandrill.php:1020
413
- #: wpmandrill.php:1275
414
  msgid "Average Sending Volume"
415
  msgstr "Volumen de Envío Promedio"
416
 
417
- #: wpmandrill.php:1021
418
- #: wpmandrill.php:1276
419
  msgid "/day"
420
  msgstr "/día"
421
 
422
- #: wpmandrill.php:1022
423
- #: wpmandrill.php:1277
424
  msgid "Average Volume per Day"
425
  msgstr "Volumen Promedio por Período"
426
 
427
- #: wpmandrill.php:1188
428
  #: stats.php:57
429
  msgid "Filter by:"
430
  msgstr "Filtrar por:"
431
 
432
- #: wpmandrill.php:1190
433
  #: stats.php:59
434
  msgid "No filter"
435
  msgstr "Sin Filtro"
436
 
437
- #: wpmandrill.php:1191
438
  #: stats.php:60
439
  msgid "Sender:"
440
  msgstr "Remitente:"
441
 
442
- #: wpmandrill.php:1198
443
  #: stats.php:67
444
  msgid "Tag:"
445
  msgstr "Etiqueta:"
446
 
447
- #: wpmandrill.php:1206
448
- #: stats.php:75
449
  msgid "Display:"
450
  msgstr "Mostrar:"
451
 
452
- #: wpmandrill.php:1208
453
- #: stats.php:77
454
  msgid "Total Volume per Period"
455
  msgstr "Volumen Total por Período"
456
 
457
- #: wpmandrill.php:1209
458
- #: stats.php:78
459
  msgid "Average Volume per Period"
460
  msgstr "Volumen Promedio por Período"
461
 
@@ -556,10 +556,12 @@ msgstr "Backlog actual:"
556
  msgid "Filtered statistics:"
557
  msgstr "Estadísticas filtradas:"
558
 
559
- #: stats.php:353
560
  msgid "For more detailed statistics, please visit your Mandrill Dashboard"
561
  msgstr "Para estadísticas más detalladas, por favor visita tu Tablero Mandrill"
562
 
 
 
563
  #~ msgid "Mandrill Test"
564
  #~ msgstr "Prueba Mandrill"
565
  #~ msgid "Mandrill How-tos"
2
  msgstr ""
3
  "Project-Id-Version: wpMandrill 1.0 rc1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-05-08 11:56-0500\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Will Castillo <will@mailchimp.com>\n"
8
  "Language-Team: MailChimp <will@mailchimp.com>\n"
116
  msgid "&lt;?php $mandrill = Mandrill($my_api_key); echo $mandrill->ping(); ?&gt;"
117
  msgstr "&lt;?php $mandrill = Mandrill($my_api_key); echo $mandrill->ping(); ?&gt;"
118
 
119
+ #: wpmandrill.php:94
120
  msgid "API Settings"
121
  msgstr "Configuración de la API"
122
 
123
+ #: wpmandrill.php:95
124
  msgid "API Key"
125
  msgstr "Clave API"
126
 
127
+ #: wpmandrill.php:101
128
  msgid "Sender Settings"
129
  msgstr "Configuración del Remitente"
130
 
131
+ #: wpmandrill.php:102
132
  msgid "FROM Name"
133
  msgstr "Campo De:"
134
 
135
+ #: wpmandrill.php:103
136
  msgid "FROM Email"
137
  msgstr "Campo Email:"
138
 
139
+ #: wpmandrill.php:106
140
  msgid "General Template"
141
  msgstr "Plantilla General"
142
 
143
+ #: wpmandrill.php:107
144
+ #: wpmandrill.php:111
145
  msgid "&nbsp;"
146
  msgstr "&nbsp;"
147
 
148
+ #: wpmandrill.php:110
149
  msgid "General Tags"
150
  msgstr "Etiquetas Generales"
151
 
152
+ #: wpmandrill.php:117
153
  msgid "Send a test email using these settings"
154
  msgstr "Enviar un correo electrónico de prueba usando estas configuraciones"
155
 
156
+ #: wpmandrill.php:118
157
  msgid "Send to"
158
  msgstr "Enviar a"
159
 
160
+ #: wpmandrill.php:119
161
  msgid "Subject"
162
  msgstr "Asunto"
163
 
164
+ #: wpmandrill.php:120
165
  msgid "Message"
166
  msgstr "Mensaje"
167
 
168
+ #: wpmandrill.php:132
169
+ #: wpmandrill.php:254
170
  msgid "Mandrill Settings"
171
  msgstr "Configuración de Mandrill"
172
 
173
+ #: wpmandrill.php:133
174
  msgid "Mandrill"
175
  msgstr "Mandrill"
176
 
177
+ #: wpmandrill.php:141
178
+ #: wpmandrill.php:142
179
  msgid "Mandrill Reports"
180
  msgstr "Reportes Mandrill"
181
 
182
+ #: wpmandrill.php:164
183
  msgid "Mandrill: wp_mail has been declared by another process or plugin, so you won't be able to use Mandrill until the problem is solved."
184
  msgstr "Mandrill: wp?install ha sido declarado por otro proceso o plugin por lo que no podras usar Mandrill hasta que soluciones este inconveniente."
185
 
186
+ #: wpmandrill.php:193
187
  msgid "To use this plugin you will need:"
188
  msgstr "Para utilizar este plugin necesitarás:"
189
 
190
+ #: wpmandrill.php:195
191
  msgid "Your Mandrill account."
192
  msgstr "Tu cuenta Mandrill"
193
 
194
+ #: wpmandrill.php:196
195
+ msgid "At least one domain defined in your Mandrill account."
196
+ msgstr "Mandrill: ¿Cómo decirle a WordPress que utilice wpMandrill?"
197
 
198
+ #: wpmandrill.php:197
199
+ msgid "A valid sender email address."
200
  msgstr "Una dirección de correo electrónico de remitente válido."
201
 
202
+ #: wpmandrill.php:202
203
  msgid "Once you have properly configured the settings, the plugin will take care of all the emails sent through your WordPress installation."
204
  msgstr "Una vez que hayas completado la configuración, el plugin se hará cargo de todos los correos enviados a través de tu instalación WordPress."
205
 
206
+ #: wpmandrill.php:203
207
  msgid "However, if you need to customize any part of the email before sending, you can do so by using the WordPress filter <strong>mandrill_payload</strong>."
208
  msgstr "De cualquier forma, si alguna vez necesitas alterar cualquier parte del email antes de que este sea enviado, lo podrás hacer utilizando el filtro WordPress <strong>mandrill_payload</strong>."
209
 
210
+ #: wpmandrill.php:204
211
  msgid "This filter has the same structure as Mandrill's API call <a href=\"http://mandrillapp.com/api/docs/messages.html#method=send\" target=\"_blank\">/messages/send</a>, except that it can have one additional parameter when the email is based on a template. The parameter is called \"<em>template</em>\", which is an associative array of two elements (the first element, a string whose key is \"<em>template_name</em>\", and a second parameter whose key is \"<em>template_content</em>\". Its value is an array with the same structure of the parameter \"<em>template_content</em>\" in the call <a href=\"http://mandrillapp.com/api/docs/messages.html#method=send-template\" target=\"_blank\">/messages/send-template</a>.)"
212
  msgstr "Este filtro tiene la misma estructura de la llamada a la API de Mandrill <a href=\"http://mandrillapp.com/api/docs/messages.html#method=send\" target=\"_blank\">/messages/send</a>, excepto que esta podría tener un parámetro adicional cuando el email está basado en una plantilla. El parametro se llama \"<em>template</em>\", el cual es un arreglo asociativo de dos elementos (el primero, una cadena de caracteres cuya clave es \"<em>template_name</em>\", y un segundo parámetro cuya clave es \"<em>template_content</em>\" y su valor es una arreglo con la misma estructura del parámetro \"<em>template_content</em>\" de la llamada <a href=\"http://mandrillapp.com/api/docs/messages.html#method=send-template\" target=\"_blank\">/messages/send-template</a>.)"
213
 
214
+ #: wpmandrill.php:205
215
  msgid "Note that if you're sending additional headers in your emails, the only valid headers are <em>From:</em>, <em>Reply-To:</em>, and <em>X-*:</em>. <em>Bcc:</em> is also valid, but Mandrill will send the blind carbon copy to only the first address, and the remaining will be silently discarted."
216
  msgstr "Ten en cuenta que si estás intentando enviar cabeceras adicionales en tus correos, las únicas cabeceras válidas serán <em>From:</em>, <em>Reply-To:</em> y <em>X-*:</em>. <em>Bcc:</em> también es válido, pero Mandrill sólo enviará la copia oculta a la primera dirección, descartando silenciosamente el resto de las direcciones especificadas en el campo Bcc: que envíes."
217
 
218
+ #: wpmandrill.php:206
219
  msgid "Also note that if any error occurs while sending the email, the plugin will try to send the message again using the native WordPress mailing capabilities."
220
  msgstr "También ten presente que si ocurre cualquier error durante el envío del correo, el plugin intentará enviar el mensaje otra vez, utilizando las capacidades de envío de correo nativas de WordPress."
221
 
222
+ #: wpmandrill.php:207
223
  msgid "Confirm that any change you made to the payload is in line with the <a href=\"http://mandrillapp.com/api/docs/\" target=\"_blank\">Mandrill's API's documentation</a>. Also, the <em>X-*:</em> headers, must be in line with the <a href=\"http://help.mandrill.com/customer/portal/articles/456744-smtp-headers-api\" target=\"_blank\">SMTP API documentation</a>. By using this plugin, you agree that you and your website will adhere to <a href=\"http://mandrill.com/legal/terms/\" target=\"_blank\">Mandrill's Terms of Use</a>."
224
  msgstr "Asegúrate que cualquier cambio que hagas en el payload esté cónsono con la <a href=\"http://mandrillapp.com/api/docs/\" target=\"_blank\">Documentacion de la API de Mandrill</a>. También, las cabeceras <em>X-*:</em> deben estar en línea con la <a href=\"http://help.mandrill.com/customer/portal/articles/456744-smtp-headers-api\" target=\"_blank\">Documentación de la API SMTP</a>. Al utilizar este plugin estás aceptando adherirte tu y tu sitio web a los <a href=\"http://mandrill.com/legal/terms/\" target=\"_blank\">Términos y Condiciones de Mandrill</a>."
225
 
226
+ #: wpmandrill.php:208
227
  msgid "if you have any question about Mandrill or this plugin, visit the <a href=\"http://help.mandrill.com/\" target=\"_blank\">Mandrill's Support Center</a>."
228
  msgstr "Si tienes alguna pregunta sobre mandrill o este plugin, visita el <a href=\"http://help.mandrill.com/\" target=\"_blank\">Centro de Soporte de Mandrill</a>."
229
 
230
+ #: wpmandrill.php:226
231
  msgid "Settings"
232
  msgstr "Configuraciones"
233
 
234
+ #: wpmandrill.php:229
235
  msgid "Reports"
236
  msgstr "Reportes"
237
 
238
+ #: wpmandrill.php:245
239
  #: stats.php:1
240
  msgid "You do not have sufficient permissions to access this page."
241
  msgstr "No tienes suficiente permisología para acceder a esta página."
242
 
243
+ #: wpmandrill.php:275
244
  msgid "Send Email"
245
  msgstr "Campo Email:"
246
 
247
+ #: wpmandrill.php:293
248
  msgid "Latest from Mandrill..."
249
  msgstr "Lo último de Mandrill..."
250
 
251
+ #: wpmandrill.php:307
252
  msgid "News from MailChimp..."
253
  msgstr "Noticias de MailChimp"
254
 
255
+ #: wpmandrill.php:334
256
  msgid "Mandrill How-Tos"
257
  msgstr "Mandrill: ¿Cómo hago?"
258
 
259
+ #: wpmandrill.php:361
260
  msgid "You must define a valid sender email."
261
  msgstr "Debes definir un correo electrónico de remitente válido."
262
 
263
+ #: wpmandrill.php:611
264
  msgid "Test email send failed. "
265
  msgstr "El correo electrónico de prueba falló."
266
 
267
+ #: wpmandrill.php:628
268
  #, php-format
269
  msgid "Test executed: %d emails sent, %d emails queued and %d emails rejected"
270
  msgstr "Prueba ejecutada: %d emails enviados, %d emails encolados y %d emails rechazados"
271
 
272
+ #: wpmandrill.php:643
273
  msgid "To get your API key, please visit your <a href=\"http://mandrillapp.com/settings/index\" target=\"_blank\">Mandrill Settings</a>"
274
  msgstr "Para obtener tu Clave API, por favor visita tu <a href=\"http://mandrillapp.com/settings/index\" target=\"_blank\">Configuración Mandrill</a>"
275
 
276
+ #: wpmandrill.php:645
277
  msgid "We are connected to your Mandrill Account."
278
  msgstr "Estamos conectados a tu cuenta Mandrill."
279
 
280
+ #: wpmandrill.php:647
281
  msgid "Sorry, invalid API key."
282
  msgstr "Lo siento, Clave API inválida."
283
 
284
+ #: wpmandrill.php:663
285
+ msgid "No domains found."
286
+ msgstr "No se encontraros dominios."
287
 
288
+ #: wpmandrill.php:675
289
  msgid "This address will be used as the sender of the outgoing emails:"
290
  msgstr "Esta dirección será utilizada como el remitente para los correos salientes:"
291
 
292
+ #: wpmandrill.php:681
293
+ msgid "If you need to add a new domain, please visit your <a href=\"https://mandrillapp.com/settings/sending-domains\" target=\"_blank\">Mandrill Settings</a>"
294
+ msgstr "Si necesita agregar un nuevo dominio, por favor visita tu <a href=\"https://mandrillapp.com/settings/sending-domains\" target=\"_blank\">Configuracipón Mandrill</a>"
295
 
296
+ #: wpmandrill.php:691
297
  msgid "Name the recipients will see in their email clients:"
298
  msgstr "Nombre que los destinatarios verán en sus clientes de correo:"
299
 
300
+ #: wpmandrill.php:702
301
+ #: wpmandrill.php:712
302
  msgid "No templates found."
303
  msgstr "No se encontraron plantillas."
304
 
305
+ #: wpmandrill.php:721
306
  msgid "Select the template to use:"
307
  msgstr "Seleccione la plantilla a utilizar:"
308
 
309
+ #: wpmandrill.php:727
310
  msgid "<small>The selected template must have a <strong><em>mc:edit=\"main\"</em></strong> placeholder defined. The message will be shown there.</small>"
311
  msgstr "<small>La plantilla seleccionada debe tener una sección <strong><em>mc:edit=\"main\"</em></strong> definida. El mensaje será mostrado ahí.</small>"
312
 
313
+ #: wpmandrill.php:737
314
  msgid "If there are tags that you want appended to every call, list them here, one per line:"
315
  msgstr "Si hay etiquetas que quieras agregar a cada llamada, lístalas aquí, una por línea."
316
 
317
+ #: wpmandrill.php:739
318
  msgid "Also keep in mind that you can add or remove tags using the <em><a href=\"#\" onclick=\"jQuery('a#contextual-help-link').trigger('click');return false;\">mandrill_payload</a></em> WordPress filter."
319
  msgstr "También recuerda que puedes agregar o eliminar etiquetas utilizando el filtro WordPress <em><a href=\"#\" onclick=\"jQuery('a#contextual-help-link').trigger('click');return false;\">mandrill_payload</a></em>."
320
 
321
+ #: wpmandrill.php:963
322
  msgid "Mandrill Recent Statistics"
323
  msgstr "Estadistas Recientes de Mandrill"
324
 
325
+ #: wpmandrill.php:985
326
+ #: wpmandrill.php:1201
327
  #: stats.php:8
328
  msgid "There was a problem retrieving statistics."
329
  msgstr "Hubo un problema recuperando las estadísticas."
330
 
331
+ #: wpmandrill.php:1043
332
+ #: wpmandrill.php:1298
333
  msgid "Sending Volume"
334
  msgstr "Volumen de Envío"
335
 
336
+ #: wpmandrill.php:1044
337
+ #: wpmandrill.php:1299
338
  msgid " emails"
339
  msgstr " emails"
340
 
341
+ #: wpmandrill.php:1045
342
+ #: wpmandrill.php:1300
343
  msgid "Total Volume per Day"
344
  msgstr "Volumen Total por Período"
345
 
346
+ #: wpmandrill.php:1047
347
+ #: wpmandrill.php:1302
348
  msgid "in the last few days"
349
  msgstr "en los últimos días"
350
 
351
+ #: wpmandrill.php:1048
352
+ #: wpmandrill.php:1303
353
  msgid "in the last few months"
354
  msgstr "en los últimos meses"
355
 
356
+ #: wpmandrill.php:1049
357
+ #: wpmandrill.php:1304
358
  msgid "Today"
359
  msgstr "Hoy"
360
 
361
+ #: wpmandrill.php:1050
362
+ #: wpmandrill.php:1305
363
  msgid "Last 7 Days"
364
  msgstr "Últimos 7 Días"
365
 
366
+ #: wpmandrill.php:1051
367
+ #: wpmandrill.php:1306
368
  msgid "Last 30 Days"
369
  msgstr "Últimos 30 Días"
370
 
371
+ #: wpmandrill.php:1052
372
+ #: wpmandrill.php:1307
373
  msgid "Last 60 Days"
374
  msgstr "Últimos 60 Días"
375
 
376
+ #: wpmandrill.php:1053
377
+ #: wpmandrill.php:1308
378
  msgid "Last 90 Days"
379
  msgstr "Últimos 90 Días"
380
 
381
+ #: wpmandrill.php:1054
382
+ #: wpmandrill.php:1309
383
  msgid "Periods"
384
  msgstr "Períodos"
385
 
386
+ #: wpmandrill.php:1055
387
+ #: wpmandrill.php:1310
388
  #: stats.php:30
389
  msgid "Volume"
390
  msgstr "Volumen"
391
 
392
+ #: wpmandrill.php:1056
393
+ #: wpmandrill.php:1311
394
  msgid "Total:"
395
  msgstr "Cuota:"
396
 
397
+ #: wpmandrill.php:1057
398
+ #: wpmandrill.php:1312
399
  msgid "Unopened"
400
  msgstr "No abiertos"
401
 
402
+ #: wpmandrill.php:1058
403
+ #: wpmandrill.php:1313
404
  msgid "Bounced or Rejected"
405
  msgstr "Rebotes o Rechazos"
406
 
407
+ #: wpmandrill.php:1059
408
+ #: wpmandrill.php:1314
409
  msgid "Opened"
410
  msgstr "Abiertos"
411
 
412
+ #: wpmandrill.php:1062
413
+ #: wpmandrill.php:1317
414
  msgid "Average Sending Volume"
415
  msgstr "Volumen de Envío Promedio"
416
 
417
+ #: wpmandrill.php:1063
418
+ #: wpmandrill.php:1318
419
  msgid "/day"
420
  msgstr "/día"
421
 
422
+ #: wpmandrill.php:1064
423
+ #: wpmandrill.php:1319
424
  msgid "Average Volume per Day"
425
  msgstr "Volumen Promedio por Período"
426
 
427
+ #: wpmandrill.php:1230
428
  #: stats.php:57
429
  msgid "Filter by:"
430
  msgstr "Filtrar por:"
431
 
432
+ #: wpmandrill.php:1232
433
  #: stats.php:59
434
  msgid "No filter"
435
  msgstr "Sin Filtro"
436
 
437
+ #: wpmandrill.php:1233
438
  #: stats.php:60
439
  msgid "Sender:"
440
  msgstr "Remitente:"
441
 
442
+ #: wpmandrill.php:1240
443
  #: stats.php:67
444
  msgid "Tag:"
445
  msgstr "Etiqueta:"
446
 
447
+ #: wpmandrill.php:1248
448
+ #: stats.php:80
449
  msgid "Display:"
450
  msgstr "Mostrar:"
451
 
452
+ #: wpmandrill.php:1250
453
+ #: stats.php:82
454
  msgid "Total Volume per Period"
455
  msgstr "Volumen Total por Período"
456
 
457
+ #: wpmandrill.php:1251
458
+ #: stats.php:83
459
  msgid "Average Volume per Period"
460
  msgstr "Volumen Promedio por Período"
461
 
556
  msgid "Filtered statistics:"
557
  msgstr "Estadísticas filtradas:"
558
 
559
+ #: stats.php:358
560
  msgid "For more detailed statistics, please visit your Mandrill Dashboard"
561
  msgstr "Para estadísticas más detalladas, por favor visita tu Tablero Mandrill"
562
 
563
+ #~ msgid "At least one verified domain."
564
+ #~ msgstr "Al menos un dominio verificado."
565
  #~ msgid "Mandrill Test"
566
  #~ msgstr "Prueba Mandrill"
567
  #~ msgid "Mandrill How-tos"
readme.txt CHANGED
@@ -6,7 +6,6 @@ Tested up to: 3.3.2
6
  Stable tag: trunk
7
 
8
  The wpMandrill plugin sends emails that are generated by WordPress through Mandrill, a transactional email service powered by MailChimp.
9
- ** SE HABLA ESPAÑOL **
10
 
11
  == Description ==
12
 
@@ -27,6 +26,8 @@ There are a few levels of integrations between your WordPress installation and t
27
 
28
  This plugin is currently released as **beta** for early adopter evaluation and finalizing of the initial feature set.
29
 
 
 
30
  == Installation ==
31
 
32
  1. Upload `wpMandrill` to the `/wp-content/plugins/` directory
@@ -61,20 +62,28 @@ If the sending fails for any reason, the plugin will try to send it again using
61
  * Public release
62
 
63
  = 1.01 =
64
- * Removing How-To Plugin
65
- * Adding How-To page
66
 
67
  = 1.02 =
68
- * Fixed: Dashboard widget title was displaying incorrectly when a filter was defined.
69
 
70
  = 1.03 =
71
- * Fixed: Test email were using an old function.
72
- * Fixed: Some data type checking to avoid PHP warnings.
73
 
74
  = 1.05 =
75
- * Fixed: Contextual help tab getting open in all admin pages when plugin was not configured correctly.
76
- * Fixed: Some references to verified domains. All domains are now verified in Mandrill.
77
- * Fixed: Mandrill Class was returning Exceptions in two places (not throwing them).
78
 
79
  = 1.06 =
80
- * Fixed: Some installations were reporting valid API keys as invalid due to a restrictive server configuration regarding Time-Out.
 
 
 
 
 
 
 
 
6
  Stable tag: trunk
7
 
8
  The wpMandrill plugin sends emails that are generated by WordPress through Mandrill, a transactional email service powered by MailChimp.
 
9
 
10
  == Description ==
11
 
26
 
27
  This plugin is currently released as **beta** for early adopter evaluation and finalizing of the initial feature set.
28
 
29
+ Spanish translation available.
30
+
31
  == Installation ==
32
 
33
  1. Upload `wpMandrill` to the `/wp-content/plugins/` directory
62
  * Public release
63
 
64
  = 1.01 =
65
+ * REMOVED: How-To Plugin
66
+ * ADDED: How-To page
67
 
68
  = 1.02 =
69
+ * FIXED: Dashboard widget title was displaying incorrectly when a filter was defined.
70
 
71
  = 1.03 =
72
+ * FIXED: Test email were using an old function.
73
+ * FIXED: Some data type checking to avoid PHP warnings.
74
 
75
  = 1.05 =
76
+ * FIXED: Contextual help tab getting open in all admin pages when plugin was not configured correctly.
77
+ * FIXED: Some references to verified domains. All domains are now verified in Mandrill.
78
+ * FIXED: Mandrill Class was returning Exceptions in two places (not throwing them).
79
 
80
  = 1.06 =
81
+ * FIXED: Some installations were reporting valid API keys as invalid due to a restrictive server configuration regarding Time-Out.
82
+
83
+ = 1.07 =
84
+ * FIXED: Removing notices in the dashboard widget when there's no open or click data in the last 7 days.
85
+ * FIXED: No having general tags defined were causing a validation error. ** Thanks Max! **
86
+ * FIXED: Daily stats showing some hourly stats.
87
+ * UPDATED: Spanish translation updated.
88
+ * FIXED: Speeding dashboard widget results.
89
+
stats.php CHANGED
@@ -355,12 +355,9 @@ jQuery(function () {
355
  </script>
356
  <div id="hourly_report_canvas"></div><br/><br/>
357
  <div id="daily_report_canvas"></div>
358
- <h3><a href="http://mandrillapp.com/" target="_target"><?php _e('For more detailed statistics, please visit your Mandrill Dashboard',self::WPDOMAIN); ?></a>.
359
- <?php // echo str_replace(' ','&nbsp;&nbsp;&nbsp;&nbsp;',nl2br(print_r($graph_data,true))); ?></h3>
360
  </div>
361
  <?php
362
-
363
- // echo "<div style=\"display:none;\">\n".print_r($stats,true) . "\n</div>";
364
  wpMandrill::$stats = $stats;
365
 
366
  ?>
355
  </script>
356
  <div id="hourly_report_canvas"></div><br/><br/>
357
  <div id="daily_report_canvas"></div>
358
+ <h3><a href="http://mandrillapp.com/" target="_target"><?php _e('For more detailed statistics, please visit your Mandrill Dashboard',self::WPDOMAIN); ?></a>.</h3>
 
359
  </div>
360
  <?php
 
 
361
  wpMandrill::$stats = $stats;
362
 
363
  ?>
wpmandrill.php CHANGED
@@ -5,7 +5,7 @@ Description: wpMandrill sends emails, generated by WordPress using Mandrill.
5
  Author: Mandrill
6
  Author URI: http://mandrillapp.com/
7
  Plugin URI: http://connect.mailchimp.com/integrations/wpmandrill
8
- Version: 1.06
9
  Text Domain: wpmandrill
10
  */
11
 
@@ -510,7 +510,16 @@ jQuery(document).bind( 'ready', function() {
510
  static function findTags($tags) {
511
 
512
  // Getting general tags
513
- $gtags = explode("\n",self::getTags());
 
 
 
 
 
 
 
 
 
514
 
515
  // Finding tags based on WP Backtrace
516
  $trace = debug_backtrace();
@@ -880,9 +889,10 @@ jQuery(document).bind( 'ready', function() {
880
  if ( !isset($graph_data['hourly']['delivered'][$hour]) ) $graph_data['hourly']['delivered'][$hour] = 0;
881
  if ( !isset($graph_data['hourly']['opens'][$hour]) ) $graph_data['hourly']['opens'][$hour] = 0;
882
  if ( !isset($graph_data['hourly']['clicks'][$hour]) ) $graph_data['hourly']['clicks'][$hour] = 0;
883
- if ( !isset($graph_data['daily']['delivered'][$hour]) ) $graph_data['daily']['delivered'][$hour] = 0;
884
- if ( !isset($graph_data['daily']['opens'][$hour]) ) $graph_data['daily']['opens'][$hour] = 0;
885
- if ( !isset($graph_data['daily']['clicks'][$hour]) ) $graph_data['daily']['clicks'][$hour] = 0;
 
886
 
887
  $graph_data['hourly']['delivered'][$hour] += $data['sent'] - $data['hard_bounces'] - $data['soft_bounces'] - $data['rejects'];
888
  $graph_data['hourly']['opens'][$hour] += $data['unique_opens'];
@@ -896,7 +906,11 @@ jQuery(document).bind( 'ready', function() {
896
  }
897
 
898
  foreach (array_keys($graph_data['hourly']['delivered']) as $hour ) {
 
899
  if ($graph_data['hourly']['delivered'][$hour]) {
 
 
 
900
  $graph_data['hourly']['open_rate'][$hour] = number_format($graph_data['hourly']['opens'][$hour] * 100 / $graph_data['hourly']['delivered'][$hour],2);
901
  $graph_data['hourly']['click_rate'][$hour] = number_format($graph_data['hourly']['clicks'][$hour] * 100 / $graph_data['hourly']['delivered'][$hour],2);
902
  }
@@ -904,6 +918,9 @@ jQuery(document).bind( 'ready', function() {
904
 
905
  foreach (array_keys($graph_data['daily']['delivered']) as $day ) {
906
  if ($graph_data['daily']['delivered'][$day]) {
 
 
 
907
  $graph_data['daily']['open_rate'][$day] = number_format($graph_data['daily']['opens'][$day] * 100 / $graph_data['daily']['delivered'][$day],2);
908
  $graph_data['daily']['click_rate'][$day] = number_format($graph_data['daily']['clicks'][$day] * 100 / $graph_data['daily']['delivered'][$day],2);
909
  }
@@ -971,15 +988,6 @@ jQuery(document).bind( 'ready', function() {
971
 
972
  static function showDashboardWidget() {
973
  $isAjaxCall = isset($_POST['ajax']) && $_POST['ajax'] ? true : false;
974
-
975
- $stats = self::getCurrentStats();
976
- if ( empty($stats) ) {
977
- echo '<p>' . __('There was a problem retrieving statistics.', self::WPDOMAIN) . '</p>';
978
-
979
- if ( !$isAjaxCall) return;
980
- else exit();
981
- }
982
-
983
 
984
  $widget_id = 'mandrill_widget';
985
  $widget_options = get_option('dashboard_widget_options');
@@ -993,16 +1001,30 @@ jQuery(document).bind( 'ready', function() {
993
  $display = $widget_options[$widget_id]['display'];
994
  }
995
 
 
996
  if ( $filter == 'none' ) {
997
  $filter_type = 'account';
998
  $filter_used = '';
 
 
 
 
 
999
  } elseif ( substr($filter,0,2) == 's:' ) {
1000
  $filter_type = 'senders';
1001
  $filter = substr($filter,2);
1002
  $filter_used = 'Filtering by sender: '.$filter;
 
 
 
 
1003
  } else {
1004
  $filter_type = 'tags';
1005
- $filter_used = 'Filtering by tag: '.$tag;
 
 
 
 
1006
  }
1007
 
1008
  $data = array();
@@ -1688,7 +1710,7 @@ JS;
1688
  if ( !is_array($message['tags']['user']) ) $message['tags']['user'] = array();
1689
  if ( !is_array($message['tags']['general']) ) $message['tags']['general'] = array();
1690
  if ( !is_array($message['tags']['automatic']) ) $message['tags']['automatic'] = array();
1691
-
1692
  $message['tags'] = array_merge( $message['tags']['user'], $message['tags']['general'], $message['tags']['automatic'] );
1693
 
1694
  // Sending the message
@@ -1700,7 +1722,7 @@ JS;
1700
  unset($message['template']);
1701
 
1702
  return self::$mandrill->messages_send_template($template, $template_content, $message);
1703
- }
1704
 
1705
  } catch ( Exception $e) {
1706
  return new WP_Error( $e->getMessage() );
5
  Author: Mandrill
6
  Author URI: http://mandrillapp.com/
7
  Plugin URI: http://connect.mailchimp.com/integrations/wpmandrill
8
+ Version: 1.07
9
  Text Domain: wpmandrill
10
  */
11
 
510
  static function findTags($tags) {
511
 
512
  // Getting general tags
513
+ $gtags = array();
514
+
515
+ $general_tags = self::getTags();
516
+ if ( !empty( $general_tags ) ) {
517
+ $gtags = explode("\n",$general_tags);
518
+ foreach ( $gtags as $index => $gtag ) {
519
+ if ( empty($gtag) ) unset($gtags[$index]);
520
+ }
521
+ $gtags = array_values($gtags);
522
+ }
523
 
524
  // Finding tags based on WP Backtrace
525
  $trace = debug_backtrace();
889
  if ( !isset($graph_data['hourly']['delivered'][$hour]) ) $graph_data['hourly']['delivered'][$hour] = 0;
890
  if ( !isset($graph_data['hourly']['opens'][$hour]) ) $graph_data['hourly']['opens'][$hour] = 0;
891
  if ( !isset($graph_data['hourly']['clicks'][$hour]) ) $graph_data['hourly']['clicks'][$hour] = 0;
892
+
893
+ if ( !isset($graph_data['daily']['delivered'][$day]) ) $graph_data['daily']['delivered'][$day] = 0;
894
+ if ( !isset($graph_data['daily']['opens'][$day]) ) $graph_data['daily']['opens'][$day] = 0;
895
+ if ( !isset($graph_data['daily']['clicks'][$day]) ) $graph_data['daily']['clicks'][$day] = 0;
896
 
897
  $graph_data['hourly']['delivered'][$hour] += $data['sent'] - $data['hard_bounces'] - $data['soft_bounces'] - $data['rejects'];
898
  $graph_data['hourly']['opens'][$hour] += $data['unique_opens'];
906
  }
907
 
908
  foreach (array_keys($graph_data['hourly']['delivered']) as $hour ) {
909
+
910
  if ($graph_data['hourly']['delivered'][$hour]) {
911
+ if ( !isset($graph_data['hourly']['opens'][$hour]) ) $graph_data['hourly']['opens'][$hour] = 0;
912
+ if ( !isset($graph_data['hourly']['clicks'][$hour]) ) $graph_data['hourly']['clicks'][$hour] = 0;
913
+
914
  $graph_data['hourly']['open_rate'][$hour] = number_format($graph_data['hourly']['opens'][$hour] * 100 / $graph_data['hourly']['delivered'][$hour],2);
915
  $graph_data['hourly']['click_rate'][$hour] = number_format($graph_data['hourly']['clicks'][$hour] * 100 / $graph_data['hourly']['delivered'][$hour],2);
916
  }
918
 
919
  foreach (array_keys($graph_data['daily']['delivered']) as $day ) {
920
  if ($graph_data['daily']['delivered'][$day]) {
921
+ if ( !isset($graph_data['daily']['opens'][$day]) ) $graph_data['daily']['opens'][$day] = 0;
922
+ if ( !isset($graph_data['daily']['clicks'][$day]) ) $graph_data['daily']['clicks'][$day] = 0;
923
+
924
  $graph_data['daily']['open_rate'][$day] = number_format($graph_data['daily']['opens'][$day] * 100 / $graph_data['daily']['delivered'][$day],2);
925
  $graph_data['daily']['click_rate'][$day] = number_format($graph_data['daily']['clicks'][$day] * 100 / $graph_data['daily']['delivered'][$day],2);
926
  }
988
 
989
  static function showDashboardWidget() {
990
  $isAjaxCall = isset($_POST['ajax']) && $_POST['ajax'] ? true : false;
 
 
 
 
 
 
 
 
 
991
 
992
  $widget_id = 'mandrill_widget';
993
  $widget_options = get_option('dashboard_widget_options');
1001
  $display = $widget_options[$widget_id]['display'];
1002
  }
1003
 
1004
+ $stats = array();
1005
  if ( $filter == 'none' ) {
1006
  $filter_type = 'account';
1007
  $filter_used = '';
1008
+
1009
+ $data = self::$mandrill->users_info();
1010
+ $stats['stats']['periods']['account']['today'] = $data['stats']['today'];
1011
+ $stats['stats']['periods']['account']['last_7_days'] = $data['stats']['last_7_days'];
1012
+
1013
  } elseif ( substr($filter,0,2) == 's:' ) {
1014
  $filter_type = 'senders';
1015
  $filter = substr($filter,2);
1016
  $filter_used = 'Filtering by sender: '.$filter;
1017
+
1018
+ $data = self::$mandrill->senders_info($filter);
1019
+ $stats['stats']['periods']['senders']['today'][$filter] = $data['stats']['today'];
1020
+ $stats['stats']['periods']['senders']['last_7_days'][$filter] = $data['stats']['last_7_days'];
1021
  } else {
1022
  $filter_type = 'tags';
1023
+ $filter_used = 'Filtering by tag: '.$filter;
1024
+
1025
+ $data = self::$mandrill->tags_info($filter);
1026
+ $stats['stats']['periods']['tags']['today'][$filter] = $data['stats']['today'];
1027
+ $stats['stats']['periods']['tags']['last_7_days'][$filter] = $data['stats']['last_7_days'];
1028
  }
1029
 
1030
  $data = array();
1710
  if ( !is_array($message['tags']['user']) ) $message['tags']['user'] = array();
1711
  if ( !is_array($message['tags']['general']) ) $message['tags']['general'] = array();
1712
  if ( !is_array($message['tags']['automatic']) ) $message['tags']['automatic'] = array();
1713
+
1714
  $message['tags'] = array_merge( $message['tags']['user'], $message['tags']['general'], $message['tags']['automatic'] );
1715
 
1716
  // Sending the message
1722
  unset($message['template']);
1723
 
1724
  return self::$mandrill->messages_send_template($template, $template_content, $message);
1725
+ }
1726
 
1727
  } catch ( Exception $e) {
1728
  return new WP_Error( $e->getMessage() );