Email Log - Version 1.7.4

Version Description

Handle cases where date_format or time_format are empty

Download this release

Release Info

Developer sudar
Plugin Icon 128x128 Email Log
Version 1.7.4
Comparing to
See all releases

Code changes from version 1.7.3 to 1.7.4

email-log.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://sudarmuthu.com/wordpress/email-log
5
  Description: Logs every email sent through WordPress
6
  Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
7
  Author: Sudar
8
- Version: 1.7.3
9
  Author URI: http://sudarmuthu.com/
10
  Text Domain: email-log
11
  Domain Path: languages/
5
  Description: Logs every email sent through WordPress
6
  Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
7
  Author: Sudar
8
+ Version: 1.7.4
9
  Author URI: http://sudarmuthu.com/
10
  Text Domain: email-log
11
  Domain Path: languages/
include/class-email-log-list-table.php CHANGED
@@ -5,7 +5,7 @@
5
  * Based on Custom List Table Example by Matt Van Andel
6
  *
7
  * @package Email Log
8
- * @author Sudar
9
  */
10
  class Email_Log_List_Table extends WP_List_Table {
11
 
@@ -20,13 +20,13 @@ class Email_Log_List_Table extends WP_List_Table {
20
  parent::__construct( array(
21
  'singular' => 'email-log', //singular name of the listed records
22
  'plural' => 'email-logs', //plural name of the listed records
23
- 'ajax' => false //does this table support ajax?
24
  ) );
25
  }
26
 
27
-
28
  /**
29
  * Add extra markup in the toolbars before or after the list
 
30
  * @param string $which, helps you decide if you add the markup after (bottom) or before (top) the list
31
  */
32
  function extra_tablenav( $which ) {
@@ -69,19 +69,12 @@ class Email_Log_List_Table extends WP_List_Table {
69
  }
70
  }
71
 
72
- /** ************************************************************************
73
- * REQUIRED! This method dictates the table's columns and titles. This should
74
- * return an array where the key is the column slug (and class) and the value
75
- * is the column's title text. If you need a checkbox for bulk actions, refer
76
- * to the $columns array below.
77
- *
78
- * The 'cb' column is treated differently than the rest. If including a checkbox
79
- * column in your table you must create a column_cb() method. If you don't need
80
- * bulk actions or checkboxes, simply leave the 'cb' entry out of your array.
81
  *
82
  * @see WP_List_Table::::single_row_columns()
83
  * @return array An associative array containing column information: 'slugs'=>'Visible Titles'
84
- **************************************************************************/
85
  function get_columns(){
86
  $columns = array(
87
  'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
@@ -93,20 +86,11 @@ class Email_Log_List_Table extends WP_List_Table {
93
  return apply_filters( EmailLog::HOOK_LOG_COLUMNS, $columns );
94
  }
95
 
96
- /** ************************************************************************
97
- * Optional. If you want one or more columns to be sortable (ASC/DESC toggle),
98
- * you will need to register it here. This should return an array where the
99
- * key is the column that needs to be sortable, and the value is db column to
100
- * sort by. Often, the key and value will be the same, but this is not always
101
- * the case (as the value is a column name from the database, not the list table).
102
- *
103
- * This method merely defines which columns should be sortable and makes them
104
- * clickable - it does not handle the actual sorting. You still need to detect
105
- * the ORDERBY and ORDER querystring variables within prepare_items() and sort
106
- * your data accordingly (usually by modifying your query).
107
  *
108
  * @return array An associative array containing all the columns that should be sortable: 'slugs'=>array('data_values',bool)
109
- **************************************************************************/
110
  function get_sortable_columns() {
111
  $sortable_columns = array(
112
  'sent_date' => array('sent_date',TRUE), //true means it's already sorted
@@ -116,47 +100,16 @@ class Email_Log_List_Table extends WP_List_Table {
116
  return $sortable_columns;
117
  }
118
 
119
- /** ************************************************************************
120
- * Recommended. This method is called when the parent class can't find a method
121
- * specifically build for a given column. Generally, it's recommended to include
122
- * one method for each column you want to render, keeping your package class
123
- * neat and organized. For example, if the class needs to process a column
124
- * named 'title', it would first see if a method named $this->column_title()
125
- * exists - if it does, that method will be used. If it doesn't, this one will
126
- * be used. Generally, you should try to use custom column methods as much as
127
- * possible.
128
- *
129
- * Since we have defined a column_title() method later on, this method doesn't
130
- * need to concern itself with any column with a name of 'title'. Instead, it
131
- * needs to handle everything else.
132
- *
133
- * For more detailed insight into how columns are handled, take a look at
134
- * WP_List_Table::single_row_columns()
135
- *
136
- * @param array $item A singular item (one full row's worth of data)
137
- * @param array $column_name The name/slug of the column to be processed
138
- * @return string Text or HTML to be placed inside the column <td>
139
- **************************************************************************/
140
  function column_default( $item, $column_name ){
141
  do_action( EmailLog::HOOK_LOG_DISPLAY_COLUMNS, $column_name, $item );
142
  }
143
 
144
- /** ************************************************************************
145
- * Recommended. This is a custom column method and is responsible for what
146
- * is rendered in any column with a name/slug of 'title'. Every time the class
147
- * needs to render a column, it first looks for a method named
148
- * column_{$column_title} - if it exists, that method is run. If it doesn't
149
- * exist, column_default() is called instead.
150
- *
151
- * This example also illustrates how to implement rollover actions. Actions
152
- * should be an associative array formatted as 'slug'=>'link html' - and you
153
- * will need to generate the URLs yourself. You could even ensure the links
154
- *
155
- *
156
- * @see WP_List_Table::::single_row_columns()
157
- * @param array $item A singular item (one full row's worth of data)
158
- * @return string Text to be placed inside the column <td>
159
- **************************************************************************/
160
  function column_sent_date($item){
161
 
162
  //Build row actions
@@ -172,7 +125,10 @@ class Email_Log_List_Table extends WP_List_Table {
172
  ),
173
  );
174
 
175
- $email_date = mysql2date(sprintf(__('%s @ %s', 'email-log'), get_option('date_format'), get_option('time_format')), $item->sent_date);
 
 
 
176
 
177
  return sprintf('%1$s <span style="color:silver">[<a href="#" class="email_content" id="email_content_%2$s">%3$s</a>] (id:%4$s)</span>%5$s',
178
  /*$1%s*/ $email_date,
@@ -197,15 +153,9 @@ class Email_Log_List_Table extends WP_List_Table {
197
  return stripslashes( $item->subject );
198
  }
199
 
200
- /** ************************************************************************
201
- * REQUIRED if displaying checkboxes or using bulk actions! The 'cb' column
202
- * is given special treatment when columns are processed. It ALWAYS needs to
203
- * have it's own method.
204
- *
205
- * @see WP_List_Table::::single_row_columns()
206
- * @param array $item A singular item (one full row's worth of data)
207
- * @return string Text to be placed inside the column <td> (movie title only)
208
- **************************************************************************/
209
  function column_cb($item){
210
  return sprintf(
211
  '<input type="checkbox" name="%1$s[]" value="%2$s" />',
5
  * Based on Custom List Table Example by Matt Van Andel
6
  *
7
  * @package Email Log
8
+ * @author Sudar
9
  */
10
  class Email_Log_List_Table extends WP_List_Table {
11
 
20
  parent::__construct( array(
21
  'singular' => 'email-log', //singular name of the listed records
22
  'plural' => 'email-logs', //plural name of the listed records
23
+ 'ajax' => false //does this table support ajax?
24
  ) );
25
  }
26
 
 
27
  /**
28
  * Add extra markup in the toolbars before or after the list
29
+ *
30
  * @param string $which, helps you decide if you add the markup after (bottom) or before (top) the list
31
  */
32
  function extra_tablenav( $which ) {
69
  }
70
  }
71
 
72
+ /**
73
+ * Return the list of column and title names
 
 
 
 
 
 
 
74
  *
75
  * @see WP_List_Table::::single_row_columns()
76
  * @return array An associative array containing column information: 'slugs'=>'Visible Titles'
77
+ */
78
  function get_columns(){
79
  $columns = array(
80
  'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
86
  return apply_filters( EmailLog::HOOK_LOG_COLUMNS, $columns );
87
  }
88
 
89
+ /**
90
+ * Return the list of columns
 
 
 
 
 
 
 
 
 
91
  *
92
  * @return array An associative array containing all the columns that should be sortable: 'slugs'=>array('data_values',bool)
93
+ */
94
  function get_sortable_columns() {
95
  $sortable_columns = array(
96
  'sent_date' => array('sent_date',TRUE), //true means it's already sorted
100
  return $sortable_columns;
101
  }
102
 
103
+ /**
104
+ * Return values for default columns
105
+ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  function column_default( $item, $column_name ){
107
  do_action( EmailLog::HOOK_LOG_DISPLAY_COLUMNS, $column_name, $item );
108
  }
109
 
110
+ /**
111
+ * Display sent date column
112
+ */
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  function column_sent_date($item){
114
 
115
  //Build row actions
125
  ),
126
  );
127
 
128
+ $email_date = mysql2date(
129
+ sprintf( __( '%s @ %s', 'email-log' ), get_option( 'date_format', 'F j, Y' ), get_option( 'time_format', 'g:i A' ) ),
130
+ $item->sent_date
131
+ );
132
 
133
  return sprintf('%1$s <span style="color:silver">[<a href="#" class="email_content" id="email_content_%2$s">%3$s</a>] (id:%4$s)</span>%5$s',
134
  /*$1%s*/ $email_date,
153
  return stripslashes( $item->subject );
154
  }
155
 
156
+ /**
157
+ * Markup for action column
158
+ */
 
 
 
 
 
 
159
  function column_cb($item){
160
  return sprintf(
161
  '<input type="checkbox" name="%1$s[]" value="%2$s" />',
languages/email-log.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Email Log package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Email Log 1.7.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/email-log\n"
7
- "POT-Creation-Date: 2014-05-14 05:41:56+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -16,8 +16,6 @@ msgstr ""
16
  msgid "Buy Addons"
17
  msgstr ""
18
 
19
- #. #-#-#-#-# email-log.pot (Email Log 1.7.3) #-#-#-#-#
20
- #. Plugin Name of the plugin/theme
21
  #: email-log.php:110
22
  msgid "Email Log"
23
  msgstr ""
@@ -45,9 +43,7 @@ msgid "About Plugin"
45
  msgstr ""
46
 
47
  #: email-log.php:174 tmp_addon/email-log-forward-email.php:154
48
- msgid ""
49
- "Email Log WordPress Plugin, allows you to log all emails that are sent "
50
- "through WordPress."
51
  msgstr ""
52
 
53
  #: email-log.php:181 tmp_addon/email-log-forward-email.php:162
@@ -95,9 +91,7 @@ msgid "Buy Now"
95
  msgstr ""
96
 
97
  #: include/class-email-log-list-table.php:49
98
- msgid ""
99
- "The following are the list of pro addons that are currently available for "
100
- "purchase."
101
  msgstr ""
102
 
103
  #: include/class-email-log-list-table.php:55
@@ -105,9 +99,7 @@ msgid "Email Log - Forward Email"
105
  msgstr ""
106
 
107
  #: include/class-email-log-list-table.php:56
108
- msgid ""
109
- "This addon allows you to send a copy of all emails send from WordPress to "
110
- "another email address"
111
  msgstr ""
112
 
113
  #: include/class-email-log-list-table.php:57
@@ -125,41 +117,40 @@ msgid "Email Log - More fields"
125
  msgstr ""
126
 
127
  #: include/class-email-log-list-table.php:63
128
- msgid ""
129
- "Adds more fields (From, CC, BCC, Reply To, Attachment) to the logs page."
130
  msgstr ""
131
 
132
- #: include/class-email-log-list-table.php:88
133
  msgid "Sent at"
134
  msgstr ""
135
 
136
- #: include/class-email-log-list-table.php:89
137
  #: tmp_addon/email-log-forward-email.php:180
138
  msgid "To"
139
  msgstr ""
140
 
141
- #: include/class-email-log-list-table.php:90
142
  msgid "Subject"
143
  msgstr ""
144
 
145
- #: include/class-email-log-list-table.php:171
146
- #: include/class-email-log-list-table.php:224
147
  msgid "Delete"
148
  msgstr ""
149
 
150
- #: include/class-email-log-list-table.php:175
151
  msgid "%s @ %s"
152
  msgstr ""
153
 
154
- #: include/class-email-log-list-table.php:180
155
  msgid "View Content"
156
  msgstr ""
157
 
158
- #: include/class-email-log-list-table.php:225
159
  msgid "Delete All Logs"
160
  msgstr ""
161
 
162
- #: include/class-email-log-list-table.php:331
163
  msgid "Your email log is empty"
164
  msgstr ""
165
 
@@ -203,6 +194,9 @@ msgstr ""
203
  #: tmp_addon/email-log-more-fields.php:84
204
  msgid "Attachment"
205
  msgstr ""
 
 
 
206
 
207
  #. Plugin URI of the plugin/theme
208
  msgid "http://sudarmuthu.com/wordpress/email-log"
2
  # This file is distributed under the same license as the Email Log package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Email Log 1.7.4\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/email-log\n"
7
+ "POT-Creation-Date: 2014-07-24 14:57:36+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
16
  msgid "Buy Addons"
17
  msgstr ""
18
 
 
 
19
  #: email-log.php:110
20
  msgid "Email Log"
21
  msgstr ""
43
  msgstr ""
44
 
45
  #: email-log.php:174 tmp_addon/email-log-forward-email.php:154
46
+ msgid "Email Log WordPress Plugin, allows you to log all emails that are sent through WordPress."
 
 
47
  msgstr ""
48
 
49
  #: email-log.php:181 tmp_addon/email-log-forward-email.php:162
91
  msgstr ""
92
 
93
  #: include/class-email-log-list-table.php:49
94
+ msgid "The following are the list of pro addons that are currently available for purchase."
 
 
95
  msgstr ""
96
 
97
  #: include/class-email-log-list-table.php:55
99
  msgstr ""
100
 
101
  #: include/class-email-log-list-table.php:56
102
+ msgid "This addon allows you to send a copy of all emails send from WordPress to another email address"
 
 
103
  msgstr ""
104
 
105
  #: include/class-email-log-list-table.php:57
117
  msgstr ""
118
 
119
  #: include/class-email-log-list-table.php:63
120
+ msgid "Adds more fields (From, CC, BCC, Reply To, Attachment) to the logs page."
 
121
  msgstr ""
122
 
123
+ #: include/class-email-log-list-table.php:81
124
  msgid "Sent at"
125
  msgstr ""
126
 
127
+ #: include/class-email-log-list-table.php:82
128
  #: tmp_addon/email-log-forward-email.php:180
129
  msgid "To"
130
  msgstr ""
131
 
132
+ #: include/class-email-log-list-table.php:83
133
  msgid "Subject"
134
  msgstr ""
135
 
136
+ #: include/class-email-log-list-table.php:124
137
+ #: include/class-email-log-list-table.php:174
138
  msgid "Delete"
139
  msgstr ""
140
 
141
+ #: include/class-email-log-list-table.php:129
142
  msgid "%s @ %s"
143
  msgstr ""
144
 
145
+ #: include/class-email-log-list-table.php:136
146
  msgid "View Content"
147
  msgstr ""
148
 
149
+ #: include/class-email-log-list-table.php:175
150
  msgid "Delete All Logs"
151
  msgstr ""
152
 
153
+ #: include/class-email-log-list-table.php:281
154
  msgid "Your email log is empty"
155
  msgstr ""
156
 
194
  #: tmp_addon/email-log-more-fields.php:84
195
  msgid "Attachment"
196
  msgstr ""
197
+ #. Plugin Name of the plugin/theme
198
+ msgid "Email Log"
199
+ msgstr ""
200
 
201
  #. Plugin URI of the plugin/theme
202
  msgid "http://sudarmuthu.com/wordpress/email-log"
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: sudar
3
  Tags: email, log, multisite
4
  Requires at least: 3.3
5
  Tested up to: 3.9.1
6
- Stable tag: 1.7.3
7
 
8
  Logs every email sent through WordPress. Works with WordPress Multisite as well
9
 
@@ -118,6 +118,10 @@ wpmandrill plugin has a bug that prevents this plugin from logging the content o
118
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
119
  == Changelog ==
120
 
 
 
 
 
121
  = v1.7.3 (2014-05-14) - (Dev time: 0.5 hours) =
122
  - Fix: Fixed a compatibility issue with wpmandrill plugin (issue #20)
123
 
@@ -215,6 +219,9 @@ This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/
215
 
216
  == Upgrade Notice ==
217
 
 
 
 
218
  = 1.7.2 =
219
  Fix the bug that was introduced in v1.7
220
 
3
  Tags: email, log, multisite
4
  Requires at least: 3.3
5
  Tested up to: 3.9.1
6
+ Stable tag: 1.7.4
7
 
8
  Logs every email sent through WordPress. Works with WordPress Multisite as well
9
 
118
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
119
  == Changelog ==
120
 
121
+ = v1.7.4 (2014-07-24) - (Dev time: 0.5 hours) =
122
+ - Fix: Handle cases where `date_format` or `time_format` are empty (issue #23)
123
+ - Tweak: Remove excessive comments from include/class-email-log-list-table.php (issue #10)
124
+
125
  = v1.7.3 (2014-05-14) - (Dev time: 0.5 hours) =
126
  - Fix: Fixed a compatibility issue with wpmandrill plugin (issue #20)
127
 
219
 
220
  == Upgrade Notice ==
221
 
222
+ = 1.7.4 =
223
+ Handle cases where `date_format` or `time_format` are empty
224
+
225
  = 1.7.2 =
226
  Fix the bug that was introduced in v1.7
227