WP Mail Logging - Version 1.8.2

Version Description

  • Fix: security bug

=

Download this release

Release Info

Developer No3x
Plugin Icon 128x128 WP Mail Logging
Version 1.8.2
Comparing to
See all releases

Code changes from version 1.8.1 to 1.8.2

WPML_Email_Log_List.php CHANGED
@@ -509,7 +509,8 @@ class WPML_Email_Log_List extends \WP_List_Table {
509
  $mailAppend .= apply_filters( WPML_Plugin::HOOK_LOGGING_FORMAT_CONTENT . "_{$format_requested}", $mail->to_array() );
510
  break;
511
  }
512
- echo $mailAppend;
 
513
  wp_die(); // this is required to terminate immediately and return a proper response
514
  }
515
  }
509
  $mailAppend .= apply_filters( WPML_Plugin::HOOK_LOGGING_FORMAT_CONTENT . "_{$format_requested}", $mail->to_array() );
510
  break;
511
  }
512
+
513
+ echo $instance->sanitize_message($mailAppend);
514
  wp_die(); // this is required to terminate immediately and return a proper response
515
  }
516
  }
inc/redux/WPML_Redux_Framework_config.php CHANGED
@@ -1,624 +1,359 @@
1
- <?php
2
-
3
- namespace No3x\WPML\Settings;
4
-
5
- /**
6
- * ReduxFramework Sample Config File
7
- * For full documentation, please visit: http://docs.reduxframework.com/
8
- */
9
-
10
- if (!class_exists('WPML_Redux_Framework_config')) {
11
-
12
- class WPML_Redux_Framework_config {
13
-
14
- public $args = array();
15
- public $sections = array();
16
- public $theme;
17
- public $ReduxFramework;
18
- protected $plugin_meta = array();
19
-
20
- public function __construct( $plugin_meta ) {
21
- $this->plugin_meta = $plugin_meta;
22
-
23
- if ( ! class_exists( 'ReduxFramework' ) ) {
24
- return;
25
- }
26
-
27
- // This is needed. Bah WordPress bugs. ;)
28
- if ( true == \Redux_Helpers::isTheme( __FILE__ ) ) {
29
- $this->initSettings();
30
- } else {
31
- add_action( 'plugins_loaded', array( $this, 'initSettings' ), 10 );
32
- }
33
-
34
- }
35
-
36
- public function initSettings() {
37
-
38
- // Just for demo purposes. Not needed per say.
39
- $this->theme = wp_get_theme();
40
-
41
- // Set the default arguments
42
- $this->setArguments();
43
-
44
- // Set a few help tabs so you can see how it's done
45
- // $this->setHelpTabs();
46
-
47
- // Create the sections and fields
48
- $this->setSections();
49
-
50
- if ( ! isset( $this->args['opt_name'] ) ) { // No errors please
51
- return;
52
- }
53
-
54
- // If Redux is running as a plugin, this will remove the demo notice and links
55
- //add_action( 'redux/loaded', array( $this, 'remove_demo' ) );
56
-
57
- // Function to test the compiler hook and demo CSS output.
58
- // Above 10 is a priority, but 2 in necessary to include the dynamically generated CSS to be sent to the function.
59
- //add_filter('redux/options/'.$this->args['opt_name'].'/compiler', array( $this, 'compiler_action' ), 10, 3);
60
-
61
- // Change the arguments after they've been declared, but before the panel is created
62
- //add_filter('redux/options/'.$this->args['opt_name'].'/args', array( $this, 'change_arguments' ) );
63
-
64
- // Change the default value of a field after it's been set, but before it's been useds
65
- //add_filter('redux/options/'.$this->args['opt_name'].'/defaults', array( $this,'change_defaults' ) );
66
-
67
- // Dynamically add a section. Can be also used to modify sections/fields
68
- //add_filter('redux/options/' . $this->args['opt_name'] . '/sections', array($this, 'dynamic_section'));
69
-
70
- $this->ReduxFramework = new \ReduxFramework( $this->sections, $this->args );
71
- }
72
-
73
- /**
74
- * This is a test function that will let you see when the compiler hook occurs.
75
- * It only runs if a field set with compiler=>true is changed.
76
- * */
77
- function compiler_action( $options, $css, $changed_values ) {
78
- echo '<h1>The compiler hook has run!</h1>';
79
- echo "<pre>";
80
- print_r( $changed_values ); // Values that have changed since the last save
81
- echo "</pre>";
82
- //print_r($options); //Option values
83
- //print_r($css); // Compiler selector CSS values compiler => array( CSS SELECTORS )
84
-
85
- /*
86
- // Demo of how to use the dynamic CSS and write your own static CSS file
87
- $filename = dirname(__FILE__) . '/style' . '.css';
88
- global $wp_filesystem;
89
- if( empty( $wp_filesystem ) ) {
90
- require_once( ABSPATH .'/wp-admin/includes/file.php' );
91
- WP_Filesystem();
92
- }
93
-
94
- if( $wp_filesystem ) {
95
- $wp_filesystem->put_contents(
96
- $filename,
97
- $css,
98
- FS_CHMOD_FILE // predefined mode settings for WP files
99
- );
100
- }
101
- */
102
- }
103
-
104
- /**
105
- * Custom function for filtering the sections array. Good for child themes to override or add to the sections.
106
- * Simply include this function in the child themes functions.php file.
107
- * NOTE: the defined constants for URLs, and directories will NOT be available at this point in a child theme,
108
- * so you must use get_template_directory_uri() if you want to use any of the built in icons
109
- * */
110
- function dynamic_section( $sections ) {
111
- //$sections = array();
112
- $sections[] = array(
113
- 'title' => 'Section via hook',
114
- 'desc' => '<p class="description">This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.</p>',
115
- 'icon' => 'el-icon-paper-clip',
116
- // Leave this as a blank section, no options just some intro text set above.
117
- 'fields' => array()
118
- );
119
-
120
- return $sections;
121
- }
122
-
123
- /**
124
- * Filter hook for filtering the args. Good for child themes to override or add to the args array. Can also be used in other functions.
125
- * */
126
- function change_arguments( $args ) {
127
- //$args['dev_mode'] = true;
128
-
129
- return $args;
130
- }
131
-
132
- /**
133
- * Filter hook for filtering the default value of any given field. Very useful in development mode.
134
- * */
135
- function change_defaults( $defaults ) {
136
- $defaults['str_replace'] = 'Testing filter hook!';
137
-
138
- return $defaults;
139
- }
140
-
141
- // Remove the demo link and the notice of integrated demo from the redux-framework plugin
142
- function remove_demo() {
143
-
144
- // Used to hide the demo mode link from the plugin page. Only used when Redux is a plugin.
145
- if ( class_exists( 'ReduxFrameworkPlugin' ) ) {
146
- remove_filter( 'plugin_row_meta', array(
147
- ReduxFrameworkPlugin::instance(),
148
- 'plugin_metalinks'
149
- ), null, 2 );
150
-
151
- // Used to hide the activation notice informing users of the demo panel. Only used when Redux is a plugin.
152
- remove_action( 'admin_notices', array( ReduxFrameworkPlugin::instance(), 'admin_notices' ) );
153
- }
154
- }
155
-
156
- public function setSections() {
157
-
158
- /**
159
- * Used within different fields. Simply examples. Search for ACTUAL DECLARATION for field examples
160
- * */
161
- // Background Patterns Reader
162
- $sample_patterns_path = \ReduxFramework::$_dir . '../sample/patterns/';
163
- $sample_patterns_url = \ReduxFramework::$_url . '../sample/patterns/';
164
- $sample_patterns = array();
165
-
166
- if ( is_dir( $sample_patterns_path ) ) :
167
-
168
- if ( $sample_patterns_dir = opendir( $sample_patterns_path ) ) :
169
- $sample_patterns = array();
170
-
171
- while ( ( $sample_patterns_file = readdir( $sample_patterns_dir ) ) !== false ) {
172
-
173
- if ( stristr( $sample_patterns_file, '.png' ) !== false || stristr( $sample_patterns_file, '.jpg' ) !== false ) {
174
- $name = explode( '.', $sample_patterns_file );
175
- $name = str_replace( '.' . end( $name ), '', $sample_patterns_file );
176
- $sample_patterns[] = array(
177
- 'alt' => $name,
178
- 'img' => $sample_patterns_url . $sample_patterns_file
179
- );
180
- }
181
- }
182
- endif;
183
- endif;
184
-
185
- ob_start();
186
-
187
- $ct = wp_get_theme();
188
- $this->theme = $ct;
189
- $item_name = $this->theme->get( 'Name' );
190
- $tags = $this->theme->Tags;
191
- $screenshot = $this->theme->get_screenshot();
192
- $class = $screenshot ? 'has-screenshot' : '';
193
-
194
- $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;', 'redux-framework-demo' ), $this->theme->display( 'Name' ) );
195
-
196
- ?>
197
- <div id="current-theme" class="<?php echo esc_attr( $class ); ?>">
198
- <?php if ( $screenshot ) : ?>
199
- <?php if ( current_user_can( 'edit_theme_options' ) ) : ?>
200
- <a href="<?php echo wp_customize_url(); ?>" class="load-customize hide-if-no-customize"
201
- title="<?php echo esc_attr( $customize_title ); ?>">
202
- <img src="<?php echo esc_url( $screenshot ); ?>"
203
- alt="<?php esc_attr_e( 'Current theme preview', 'redux-framework-demo' ); ?>"/>
204
- </a>
205
- <?php endif; ?>
206
- <img class="hide-if-customize" src="<?php echo esc_url( $screenshot ); ?>"
207
- alt="<?php esc_attr_e( 'Current theme preview', 'redux-framework-demo' ); ?>"/>
208
- <?php endif; ?>
209
-
210
- <h4><?php echo $this->theme->display( 'Name' ); ?></h4>
211
-
212
- <div>
213
- <ul class="theme-info">
214
- <li><?php printf( __( 'By %s', 'redux-framework-demo' ), $this->theme->display( 'Author' ) ); ?></li>
215
- <li><?php printf( __( 'Version %s', 'redux-framework-demo' ), $this->theme->display( 'Version' ) ); ?></li>
216
- <li><?php echo '<strong>' . __( 'Tags', 'redux-framework-demo' ) . ':</strong> '; ?><?php printf( $this->theme->display( 'Tags' ) ); ?></li>
217
- </ul>
218
- <p class="theme-description"><?php echo $this->theme->display( 'Description' ); ?></p>
219
- <?php
220
- if ( $this->theme->parent() ) {
221
- printf( ' <p class="howto">' . __( 'This <a href="%1$s">child theme</a> requires its parent theme, %2$s.', 'redux-framework-demo' ) . '</p>', __( 'http://codex.wordpress.org/Child_Themes', 'redux-framework-demo' ), $this->theme->parent()->display( 'Name' ) );
222
- }
223
- ?>
224
-
225
- </div>
226
- </div>
227
-
228
- <?php
229
- $item_info = ob_get_contents();
230
-
231
- ob_end_clean();
232
-
233
- $sampleHTML = '';
234
- if ( file_exists( dirname( __FILE__ ) . '/info-html.html' ) ) {
235
- Redux_Functions::initWpFilesystem();
236
-
237
- global $wp_filesystem;
238
-
239
- $sampleHTML = $wp_filesystem->get_contents( dirname( __FILE__ ) . '/info-html.html' );
240
- }
241
-
242
- // ACTUAL DECLARATION OF SECTIONS
243
- $this->sections[] = array(
244
- 'title' => __('General Settings', 'wp-mail-logging'),
245
- 'desc' => __('', 'wp-mail-logging'),
246
- 'icon' => 'el-icon-cogs',
247
- // 'submenu' => false, // Setting submenu to false on a given section will hide it from the WordPress sidebar menu!
248
- 'fields' => array(
249
-
250
- array(
251
- 'id' => 'delete-on-deactivation',
252
- 'type' => 'switch',
253
- 'title' => __('Cleanup', 'wp-mail-logging' ),
254
- 'subtitle' => __('Delete all data on deactivation? (emails and settings)?', 'wp-mail-logging'),
255
- 'default' => 0,
256
- 'on' => __(__('Enabled', 'wp-mail-logging' ), 'wp-mail-logging' ),
257
- 'off' => __(__('Disabled', 'wp-mail-logging' ), 'wp-mail-logging' ),
258
- ),
259
- array(
260
- 'id' => 'can-see-submission-data',
261
- 'type' => 'select',
262
- 'data' => 'capabilities',
263
- 'default' => 'manage_options',
264
- 'title' => __('Can See Submission data', 'wp-mail-logging'),
265
- 'subtitle' => __('Select the minimum role.', 'wp-mail-logging'),
266
- ),
267
- array(
268
- 'id' => 'datetimeformat-use-wordpress',
269
- 'type' => 'switch',
270
- 'title' => __('WordPress Date Time Format', 'wp-mail-logging' ),
271
- 'subtitle' => sprintf( __( "Use format from WordPress settings (%s)", 'wp-mail-logging' ), date_i18n( $this->wordpress_default_format(), current_time( 'timestamp' ) ) ),
272
- 'default' => 0,
273
- 'on' => __('Enabled', 'wp-mail-logging' ),
274
- 'off' => __('Disabled', 'wp-mail-logging' ),
275
- ),
276
- array(
277
- 'id' => 'preferred-mail-format',
278
- 'type' => 'select',
279
- 'options' => array(
280
- 'html' => 'html',
281
- 'raw' => 'raw',
282
- 'json' => 'json'
283
- ),
284
- 'default' => 'html',
285
- 'title' => __('Default Format for Message', 'wp-mail-logging'),
286
- 'subtitle' => __('Select your preferred display format.', 'wp-mail-logging'),
287
- ),
288
- array(
289
- 'id' => 'display-host',
290
- 'type' => 'switch',
291
- 'title' => __('Display Host', 'wp-mail-logging' ),
292
- 'subtitle' => __('Display host column in list.', 'wp-mail-logging'),
293
- 'hint' => array(
294
- 'title' => 'Host',
295
- 'content' => 'Display the IP of the host WordPress is running on. This is useful when running it on multiple servers at the same time.',
296
- ),
297
- 'default' => 0,
298
- 'on' => __('Enabled', 'wp-mail-logging' ),
299
- 'off' => __('Disabled', 'wp-mail-logging' ),
300
- ),
301
- array(
302
- 'id' => 'section-log-rotation-start',
303
- 'type' => 'section',
304
- 'title' => __('Log Rotation', 'wp-mail-logging' ),
305
- 'subtitle' => __('Save space by deleting logs regularly.', 'wp-mail-logging'),
306
- 'indent' => true, // Indent all options below until the next 'section' option is set.
307
- ),
308
- array(
309
- 'id' => 'log-rotation-limit-amout',
310
- 'type' => 'switch',
311
- 'title' => __('Cleanup by Amount', 'wp-mail-logging' ),
312
- 'subtitle' => __('Setup a automated cleanup routine!', 'wp-mail-logging'),
313
- 'default' => 0,
314
- 'on' => __('Enabled', 'wp-mail-logging' ),
315
- 'off' => __('Disabled', 'wp-mail-logging' ),
316
- ),
317
- array(
318
- 'id' => 'log-rotation-limit-amout-keep',
319
- 'type' => 'slider',
320
- 'required' => array('log-rotation-limit-amout', '=', '1'),
321
- 'title' => __('Amount', 'wp-mail-logging' ),
322
- 'subtitle' => __('When should mails are deleted?', 'wp-mail-logging'),
323
- 'desc' => __('Cleanup when the stored mails exceed...', 'wp-mail-logging'),
324
- 'default' => 75,
325
- 'min' => 25,
326
- 'step' => 50,
327
- 'max' => 3000,
328
- 'display_value' => 'text'
329
- ),
330
- array(
331
- 'id' => 'log-rotation-delete-time',
332
- 'type' => 'switch',
333
- 'title' => __('Cleanup by Time', 'wp-mail-logging' ),
334
- 'subtitle' => __('Setup a automated cleanup routine!', 'wp-mail-logging'),
335
- 'default' => 0,
336
- 'on' => __('Enabled', 'wp-mail-logging' ),
337
- 'off' => __('Disabled', 'wp-mail-logging' ),
338
- ),
339
- array(
340
- 'id' => 'log-rotation-delete-time-days',
341
- 'type' => 'slider',
342
- 'required' => array('log-rotation-delete-time', '=', '1'),
343
- 'title' => __('Time', 'wp-mail-logging' ),
344
- 'subtitle' => __('When should mails are deleted?', 'wp-mail-logging'),
345
- 'desc' => __('Delete mails older than days...', 'wp-mail-logging'),
346
- 'default' => 30,
347
- 'min' => 1,
348
- 'step' => 7,
349
- 'max' => 400,
350
- 'display_value' => 'text'
351
- ),
352
- array(
353
- 'id' => 'section-log-rotation-end',
354
- 'type' => 'section',
355
- 'indent' => false // Indent all options below until the next 'section' option is set.
356
- ),
357
- ),
358
- );
359
- }
360
-
361
- public function wordpress_default_format()
362
- {
363
- $date_format = get_option( 'date_format' );
364
- $time_format = get_option( 'time_format' );
365
- $date_format = empty( $date_format ) ? 'F j, Y' : $date_format;
366
- $time_format = empty( $time_format ) ? 'g:i a' : $time_format;
367
- return "{$date_format} {$time_format}";
368
- }
369
-
370
- public function setHelpTabs() {
371
-
372
- // Custom page help tabs, displayed using the help API. Tabs are shown in order of definition.
373
- $this->args['help_tabs'][] = array(
374
- 'id' => 'redux-help-tab-1',
375
- 'title' => 'Theme Information 1',
376
- 'content' => '<p>This is the tab content, HTML is allowed.</p>'
377
- );
378
-
379
- $this->args['help_tabs'][] = array(
380
- 'id' => 'redux-help-tab-2',
381
- 'title' => 'Theme Information 2', 'redux-framework-demo',
382
- 'content' => '<p>This is the tab content, HTML is allowed.</p>'
383
- );
384
-
385
- // Set the help sidebar
386
- $this->args['help_sidebar'] = '<p>This is the sidebar content, HTML is allowed.</p>';
387
- }
388
-
389
- /**
390
- * All the possible arguments for Redux.
391
- * For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments
392
- * */
393
- public function setArguments() {
394
-
395
- $theme = wp_get_theme(); // For use with some settings. Not necessary.
396
-
397
- $this->args = array(
398
- // TYPICAL -> Change these values as you need/desire
399
- 'opt_name' => 'wpml_settings',
400
- // This is where your data is stored in the database and also becomes your global variable name.
401
- 'display_name' => 'WP Mail Logging Settings',
402
- // Name that appears at the top of your panel
403
- 'display_version' => $this->plugin_meta['version_installed'],
404
- // Version that appears at the top of your panel
405
- 'menu_type' => 'submenu',
406
- //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)
407
- 'allow_sub_menu' => true,
408
- // Show the sections below the admin menu item or not
409
- 'menu_title' => 'Settings',
410
- 'page_title' => $this->plugin_meta['display_name'],
411
- // You will need to generate a Google API key to use this feature.
412
- // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth
413
- 'google_api_key' => '',
414
- // Set it you want google fonts to update weekly. A google_api_key value is required.
415
- 'google_update_weekly' => false,
416
- // Must be defined to add google fonts to the typography module
417
- 'async_typography' => true,
418
- // Use a asynchronous font on the front end or font string
419
- //'disable_google_fonts_link' => true, // Disable this in case you want to create your own google fonts loader
420
- 'admin_bar' => false,
421
- // Show the panel pages on the admin bar
422
- 'admin_bar_icon' => 'dashicons-portfolio',
423
- // Choose an icon for the admin bar menu
424
- 'admin_bar_priority' => 50,
425
- // Choose an priority for the admin bar menu
426
- 'global_variable' => '',
427
- // Set a different name for your global variable other than the opt_name
428
- 'dev_mode' => false,
429
- // Show the time the page took to load, etc
430
- 'update_notice' => true,
431
- // If dev_mode is enabled, will notify developer of updated versions available in the GitHub Repo
432
- 'customizer' => false,
433
- // Enable basic customizer support
434
- //'open_expanded' => true, // Allow you to start the panel in an expanded way initially.
435
- //'disable_save_warn' => true, // Disable the save warning when a user changes a field
436
-
437
- // OPTIONAL -> Give you extra features
438
- 'page_priority' => null,
439
- // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.
440
- 'page_parent' => 'wpml_plugin_log',
441
- // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
442
- 'page_permissions' => 'manage_options',
443
- // Permissions needed to access the options panel.
444
- 'menu_icon' => '',
445
- // Specify a custom URL to an icon
446
- 'last_tab' => '',
447
- // Force your panel to always open to a specific tab (by id)
448
- 'page_icon' => 'icon-themes',
449
- // Icon displayed in the admin panel next to your menu_title
450
- 'page_slug' => 'wpml_plugin_settings',
451
- // Page slug used to denote the panel
452
- 'save_defaults' => true,
453
- // On load save the defaults to DB before user clicks save or not
454
- 'default_show' => false,
455
- // If true, shows the default value next to each field that is not the default value.
456
- 'default_mark' => '*',
457
- // What to print by the field's title if the value shown is default. Suggested: *
458
- 'show_import_export' => true,
459
- // Shows the Import/Export panel when not used as a field.
460
-
461
- // CAREFUL -> These options are for advanced use only
462
- 'transient_time' => 60 * MINUTE_IN_SECONDS,
463
- 'output' => true,
464
- // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
465
- 'output_tag' => true,
466
- // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head
467
- // 'footer_credit' => '', // Disable the footer credit of Redux. Please leave if you can help it.
468
-
469
- // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk.
470
- 'database' => '',
471
- // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning!
472
- 'system_info' => false,
473
- // REMOVE
474
-
475
- // HINTS
476
- 'hints' => array(
477
- 'icon' => 'el el-question-sign',
478
- 'icon_position' => 'right',
479
- 'icon_color' => 'lightgray',
480
- 'icon_size' => 'normal',
481
- 'tip_style' => array(
482
- 'color' => 'light',
483
- 'shadow' => true,
484
- 'rounded' => false,
485
- 'style' => 'bootstrap',
486
- ),
487
- 'tip_position' => array(
488
- 'my' => 'top left',
489
- 'at' => 'bottom right',
490
- ),
491
- 'tip_effect' => array(
492
- 'show' => array(
493
- 'effect' => 'slide',
494
- 'duration' => '500',
495
- 'event' => 'mouseover',
496
- ),
497
- 'hide' => array(
498
- 'effect' => 'slide',
499
- 'duration' => '500',
500
- 'event' => 'click mouseleave',
501
- ),
502
- ),
503
- )
504
- );
505
-
506
- // ADMIN BAR LINKS -> Setup custom links in the admin bar menu as external items.
507
- $this->args['admin_bar_links'][] = array(
508
- 'id' => 'redux-docs',
509
- 'href' => 'http://docs.reduxframework.com/',
510
- 'title' => __( 'Documentation', 'redux-framework-demo' ),
511
- );
512
-
513
- $this->args['admin_bar_links'][] = array(
514
- //'id' => 'redux-support',
515
- 'href' => 'https://github.com/ReduxFramework/redux-framework/issues',
516
- 'title' => __( 'Support', 'redux-framework-demo' ),
517
- );
518
-
519
- $this->args['admin_bar_links'][] = array(
520
- 'id' => 'redux-extensions',
521
- 'href' => 'reduxframework.com/extensions',
522
- 'title' => __( 'Extensions', 'redux-framework-demo' ),
523
- );
524
-
525
- // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons.
526
- $this->args['share_icons'][] = array(
527
- 'url' => 'https://github.com/No3x/wp-mail-logging',
528
- 'title' => 'Visit us on GitHub',
529
- 'icon' => 'el-icon-github'
530
- //'img' => '', // You can use icon OR img. IMG needs to be a full URL.
531
- );
532
- $this->args['share_icons'][] = array(
533
- 'url' => $this->plugin_meta['wp_uri'],
534
- 'title' => 'Visit us on WordPress',
535
- 'icon' => 'el-icon-wordpress'
536
- );
537
-
538
-
539
- // Add content before the form.
540
- // $this->args['intro_text'] = __( '<p>This text is displayed above the options panel. It isn\'t required, but more info is always better! The intro_text field accepts all HTML.</p>', 'redux-framework-demo' );
541
-
542
- // Add content after the form.
543
- // $this->args['footer_text'] = __( '<p>This text is displayed below the options panel. It isn\'t required, but more info is always better! The footer_text field accepts all HTML.</p>', 'redux-framework-demo' );
544
- }
545
-
546
- public function validate_callback_function( $field, $value, $existing_value ) {
547
- $error = true;
548
- $value = 'just testing';
549
-
550
- /*
551
- do your validation
552
-
553
- if(something) {
554
- $value = $value;
555
- } elseif(something else) {
556
- $error = true;
557
- $value = $existing_value;
558
-
559
- }
560
- */
561
-
562
- $return['value'] = $value;
563
- $field['msg'] = 'your custom error message';
564
- if ( $error == true ) {
565
- $return['error'] = $field;
566
- }
567
-
568
- return $return;
569
- }
570
-
571
- public function class_field_callback( $field, $value ) {
572
- print_r( $field );
573
- echo '<br/>CLASS CALLBACK';
574
- print_r( $value );
575
- }
576
-
577
- }
578
-
579
- global $reduxConfig;
580
- //$reduxConfig = new WPML_Redux_Framework_config();
581
- } else {
582
- echo "The class named Redux_Framework_sample_config has already been called. <strong>Developers, you need to prefix this class with your company name or you'll run into problems!</strong>";
583
- }
584
-
585
- /**
586
- * Custom function for the callback referenced above
587
- */
588
- if ( ! function_exists( 'redux_my_custom_field' ) ):
589
- function redux_my_custom_field( $field, $value ) {
590
- print_r( $field );
591
- echo '<br/>';
592
- print_r( $value );
593
- }
594
- endif;
595
-
596
- /**
597
- * Custom function for the callback validation referenced above
598
- * */
599
- if ( ! function_exists( 'redux_validate_callback_function' ) ):
600
- function redux_validate_callback_function( $field, $value, $existing_value ) {
601
- $error = true;
602
- $value = 'just testing';
603
-
604
- /*
605
- do your validation
606
-
607
- if(something) {
608
- $value = $value;
609
- } elseif(something else) {
610
- $error = true;
611
- $value = $existing_value;
612
-
613
- }
614
- */
615
-
616
- $return['value'] = $value;
617
- $field['msg'] = 'your custom error message';
618
- if ( $error == true ) {
619
- $return['error'] = $field;
620
- }
621
-
622
- return $return;
623
- }
624
- endif;
1
+ <?php
2
+
3
+ namespace No3x\WPML\Settings;
4
+
5
+ /**
6
+ * ReduxFramework Sample Config File
7
+ * For full documentation, please visit: http://docs.reduxframework.com/
8
+ */
9
+
10
+ if (!class_exists('WPML_Redux_Framework_config')) {
11
+
12
+ class WPML_Redux_Framework_config {
13
+
14
+ public $args = array();
15
+ public $sections = array();
16
+ public $theme;
17
+ public $ReduxFramework;
18
+ protected $plugin_meta = array();
19
+
20
+ public function __construct( $plugin_meta ) {
21
+ $this->plugin_meta = $plugin_meta;
22
+
23
+ if ( ! class_exists( 'ReduxFramework' ) ) {
24
+ return;
25
+ }
26
+
27
+ // This is needed. Bah WordPress bugs. ;)
28
+ if ( true == \Redux_Helpers::isTheme( __FILE__ ) ) {
29
+ $this->initSettings();
30
+ } else {
31
+ add_action( 'plugins_loaded', array( $this, 'initSettings' ), 10 );
32
+ }
33
+
34
+ }
35
+
36
+ public function initSettings() {
37
+
38
+ // Just for demo purposes. Not needed per say.
39
+ $this->theme = wp_get_theme();
40
+
41
+ // Set the default arguments
42
+ $this->setArguments();
43
+
44
+ // Set a few help tabs so you can see how it's done
45
+ // $this->setHelpTabs();
46
+
47
+ // Create the sections and fields
48
+ $this->setSections();
49
+
50
+ if ( ! isset( $this->args['opt_name'] ) ) { // No errors please
51
+ return;
52
+ }
53
+
54
+ // If Redux is running as a plugin, this will remove the demo notice and links
55
+ //add_action( 'redux/loaded', array( $this, 'remove_demo' ) );
56
+
57
+ // Function to test the compiler hook and demo CSS output.
58
+ // Above 10 is a priority, but 2 in necessary to include the dynamically generated CSS to be sent to the function.
59
+ //add_filter('redux/options/'.$this->args['opt_name'].'/compiler', array( $this, 'compiler_action' ), 10, 3);
60
+
61
+ // Change the arguments after they've been declared, but before the panel is created
62
+ //add_filter('redux/options/'.$this->args['opt_name'].'/args', array( $this, 'change_arguments' ) );
63
+
64
+ // Change the default value of a field after it's been set, but before it's been useds
65
+ //add_filter('redux/options/'.$this->args['opt_name'].'/defaults', array( $this,'change_defaults' ) );
66
+
67
+ // Dynamically add a section. Can be also used to modify sections/fields
68
+ //add_filter('redux/options/' . $this->args['opt_name'] . '/sections', array($this, 'dynamic_section'));
69
+
70
+ $this->ReduxFramework = new \ReduxFramework( $this->sections, $this->args );
71
+ }
72
+
73
+ // Remove the demo link and the notice of integrated demo from the redux-framework plugin
74
+ function remove_demo() {
75
+
76
+ // Used to hide the demo mode link from the plugin page. Only used when Redux is a plugin.
77
+ if ( class_exists( 'ReduxFrameworkPlugin' ) ) {
78
+ remove_filter( 'plugin_row_meta', array(
79
+ ReduxFrameworkPlugin::instance(),
80
+ 'plugin_metalinks'
81
+ ), null, 2 );
82
+
83
+ // Used to hide the activation notice informing users of the demo panel. Only used when Redux is a plugin.
84
+ remove_action( 'admin_notices', array( ReduxFrameworkPlugin::instance(), 'admin_notices' ) );
85
+ }
86
+ }
87
+
88
+ public function setSections() {
89
+
90
+ // ACTUAL DECLARATION OF SECTIONS
91
+ $this->sections[] = array(
92
+ 'title' => __('General Settings', 'wp-mail-logging'),
93
+ 'desc' => __('', 'wp-mail-logging'),
94
+ 'icon' => 'el-icon-cogs',
95
+ // 'submenu' => false, // Setting submenu to false on a given section will hide it from the WordPress sidebar menu!
96
+ 'fields' => array(
97
+
98
+ array(
99
+ 'id' => 'delete-on-deactivation',
100
+ 'type' => 'switch',
101
+ 'title' => __('Cleanup', 'wp-mail-logging' ),
102
+ 'subtitle' => __('Delete all data on deactivation? (emails and settings)?', 'wp-mail-logging'),
103
+ 'default' => 0,
104
+ 'on' => __(__('Enabled', 'wp-mail-logging' ), 'wp-mail-logging' ),
105
+ 'off' => __(__('Disabled', 'wp-mail-logging' ), 'wp-mail-logging' ),
106
+ ),
107
+ array(
108
+ 'id' => 'can-see-submission-data',
109
+ 'type' => 'select',
110
+ 'data' => 'capabilities',
111
+ 'default' => 'manage_options',
112
+ 'title' => __('Can See Submission data', 'wp-mail-logging'),
113
+ 'subtitle' => __('Select the minimum role.', 'wp-mail-logging'),
114
+ ),
115
+ array(
116
+ 'id' => 'datetimeformat-use-wordpress',
117
+ 'type' => 'switch',
118
+ 'title' => __('WordPress Date Time Format', 'wp-mail-logging' ),
119
+ 'subtitle' => sprintf( __( "Use format from WordPress settings (%s)", 'wp-mail-logging' ), date_i18n( $this->wordpress_default_format(), current_time( 'timestamp' ) ) ),
120
+ 'default' => 0,
121
+ 'on' => __('Enabled', 'wp-mail-logging' ),
122
+ 'off' => __('Disabled', 'wp-mail-logging' ),
123
+ ),
124
+ array(
125
+ 'id' => 'preferred-mail-format',
126
+ 'type' => 'select',
127
+ 'options' => array(
128
+ 'html' => 'html',
129
+ 'raw' => 'raw',
130
+ 'json' => 'json'
131
+ ),
132
+ 'default' => 'html',
133
+ 'title' => __('Default Format for Message', 'wp-mail-logging'),
134
+ 'subtitle' => __('Select your preferred display format.', 'wp-mail-logging'),
135
+ ),
136
+ array(
137
+ 'id' => 'display-host',
138
+ 'type' => 'switch',
139
+ 'title' => __('Display Host', 'wp-mail-logging' ),
140
+ 'subtitle' => __('Display host column in list.', 'wp-mail-logging'),
141
+ 'hint' => array(
142
+ 'title' => 'Host',
143
+ 'content' => 'Display the IP of the host WordPress is running on. This is useful when running it on multiple servers at the same time.',
144
+ ),
145
+ 'default' => 0,
146
+ 'on' => __('Enabled', 'wp-mail-logging' ),
147
+ 'off' => __('Disabled', 'wp-mail-logging' ),
148
+ ),
149
+ array(
150
+ 'id' => 'section-log-rotation-start',
151
+ 'type' => 'section',
152
+ 'title' => __('Log Rotation', 'wp-mail-logging' ),
153
+ 'subtitle' => __('Save space by deleting logs regularly.', 'wp-mail-logging'),
154
+ 'indent' => true, // Indent all options below until the next 'section' option is set.
155
+ ),
156
+ array(
157
+ 'id' => 'log-rotation-limit-amout',
158
+ 'type' => 'switch',
159
+ 'title' => __('Cleanup by Amount', 'wp-mail-logging' ),
160
+ 'subtitle' => __('Setup a automated cleanup routine!', 'wp-mail-logging'),
161
+ 'default' => 0,
162
+ 'on' => __('Enabled', 'wp-mail-logging' ),
163
+ 'off' => __('Disabled', 'wp-mail-logging' ),
164
+ ),
165
+ array(
166
+ 'id' => 'log-rotation-limit-amout-keep',
167
+ 'type' => 'slider',
168
+ 'required' => array('log-rotation-limit-amout', '=', '1'),
169
+ 'title' => __('Amount', 'wp-mail-logging' ),
170
+ 'subtitle' => __('When should mails are deleted?', 'wp-mail-logging'),
171
+ 'desc' => __('Cleanup when the stored mails exceed...', 'wp-mail-logging'),
172
+ 'default' => 75,
173
+ 'min' => 25,
174
+ 'step' => 50,
175
+ 'max' => 3000,
176
+ 'display_value' => 'text'
177
+ ),
178
+ array(
179
+ 'id' => 'log-rotation-delete-time',
180
+ 'type' => 'switch',
181
+ 'title' => __('Cleanup by Time', 'wp-mail-logging' ),
182
+ 'subtitle' => __('Setup a automated cleanup routine!', 'wp-mail-logging'),
183
+ 'default' => 0,
184
+ 'on' => __('Enabled', 'wp-mail-logging' ),
185
+ 'off' => __('Disabled', 'wp-mail-logging' ),
186
+ ),
187
+ array(
188
+ 'id' => 'log-rotation-delete-time-days',
189
+ 'type' => 'slider',
190
+ 'required' => array('log-rotation-delete-time', '=', '1'),
191
+ 'title' => __('Time', 'wp-mail-logging' ),
192
+ 'subtitle' => __('When should mails are deleted?', 'wp-mail-logging'),
193
+ 'desc' => __('Delete mails older than days...', 'wp-mail-logging'),
194
+ 'default' => 30,
195
+ 'min' => 1,
196
+ 'step' => 7,
197
+ 'max' => 400,
198
+ 'display_value' => 'text'
199
+ ),
200
+ array(
201
+ 'id' => 'section-log-rotation-end',
202
+ 'type' => 'section',
203
+ 'indent' => false // Indent all options below until the next 'section' option is set.
204
+ ),
205
+ ),
206
+ );
207
+ }
208
+
209
+ public function wordpress_default_format()
210
+ {
211
+ $date_format = get_option( 'date_format' );
212
+ $time_format = get_option( 'time_format' );
213
+ $date_format = empty( $date_format ) ? 'F j, Y' : $date_format;
214
+ $time_format = empty( $time_format ) ? 'g:i a' : $time_format;
215
+ return "{$date_format} {$time_format}";
216
+ }
217
+
218
+ /**
219
+ * All the possible arguments for Redux.
220
+ * For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments
221
+ * */
222
+ public function setArguments() {
223
+
224
+ $theme = wp_get_theme(); // For use with some settings. Not necessary.
225
+
226
+ $this->args = array(
227
+ // TYPICAL -> Change these values as you need/desire
228
+ 'opt_name' => 'wpml_settings',
229
+ // This is where your data is stored in the database and also becomes your global variable name.
230
+ 'display_name' => 'WP Mail Logging Settings',
231
+ // Name that appears at the top of your panel
232
+ 'display_version' => $this->plugin_meta['version_installed'],
233
+ // Version that appears at the top of your panel
234
+ 'menu_type' => 'submenu',
235
+ //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)
236
+ 'allow_sub_menu' => true,
237
+ // Show the sections below the admin menu item or not
238
+ 'menu_title' => 'Settings',
239
+ 'page_title' => $this->plugin_meta['display_name'],
240
+ // You will need to generate a Google API key to use this feature.
241
+ // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth
242
+ 'google_api_key' => '',
243
+ // Set it you want google fonts to update weekly. A google_api_key value is required.
244
+ 'google_update_weekly' => false,
245
+ // Must be defined to add google fonts to the typography module
246
+ 'async_typography' => true,
247
+ // Use a asynchronous font on the front end or font string
248
+ //'disable_google_fonts_link' => true, // Disable this in case you want to create your own google fonts loader
249
+ 'admin_bar' => false,
250
+ // Show the panel pages on the admin bar
251
+ 'admin_bar_icon' => 'dashicons-portfolio',
252
+ // Choose an icon for the admin bar menu
253
+ 'admin_bar_priority' => 50,
254
+ // Choose an priority for the admin bar menu
255
+ 'global_variable' => '',
256
+ // Set a different name for your global variable other than the opt_name
257
+ 'dev_mode' => false,
258
+ // Show the time the page took to load, etc
259
+ 'update_notice' => true,
260
+ // If dev_mode is enabled, will notify developer of updated versions available in the GitHub Repo
261
+ 'customizer' => false,
262
+ // Enable basic customizer support
263
+ //'open_expanded' => true, // Allow you to start the panel in an expanded way initially.
264
+ //'disable_save_warn' => true, // Disable the save warning when a user changes a field
265
+
266
+ // OPTIONAL -> Give you extra features
267
+ 'page_priority' => null,
268
+ // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.
269
+ 'page_parent' => 'wpml_plugin_log',
270
+ // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
271
+ 'page_permissions' => 'manage_options',
272
+ // Permissions needed to access the options panel.
273
+ 'menu_icon' => '',
274
+ // Specify a custom URL to an icon
275
+ 'last_tab' => '',
276
+ // Force your panel to always open to a specific tab (by id)
277
+ 'page_icon' => 'icon-themes',
278
+ // Icon displayed in the admin panel next to your menu_title
279
+ 'page_slug' => 'wpml_plugin_settings',
280
+ // Page slug used to denote the panel
281
+ 'save_defaults' => true,
282
+ // On load save the defaults to DB before user clicks save or not
283
+ 'default_show' => false,
284
+ // If true, shows the default value next to each field that is not the default value.
285
+ 'default_mark' => '*',
286
+ // What to print by the field's title if the value shown is default. Suggested: *
287
+ 'show_import_export' => true,
288
+ // Shows the Import/Export panel when not used as a field.
289
+
290
+ // CAREFUL -> These options are for advanced use only
291
+ 'transient_time' => 60 * MINUTE_IN_SECONDS,
292
+ 'output' => true,
293
+ // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
294
+ 'output_tag' => true,
295
+ // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head
296
+ // 'footer_credit' => '', // Disable the footer credit of Redux. Please leave if you can help it.
297
+
298
+ // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk.
299
+ 'database' => '',
300
+ // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning!
301
+ 'system_info' => false,
302
+ // REMOVE
303
+
304
+ // HINTS
305
+ 'hints' => array(
306
+ 'icon' => 'el el-question-sign',
307
+ 'icon_position' => 'right',
308
+ 'icon_color' => 'lightgray',
309
+ 'icon_size' => 'normal',
310
+ 'tip_style' => array(
311
+ 'color' => 'light',
312
+ 'shadow' => true,
313
+ 'rounded' => false,
314
+ 'style' => 'bootstrap',
315
+ ),
316
+ 'tip_position' => array(
317
+ 'my' => 'top left',
318
+ 'at' => 'bottom right',
319
+ ),
320
+ 'tip_effect' => array(
321
+ 'show' => array(
322
+ 'effect' => 'slide',
323
+ 'duration' => '500',
324
+ 'event' => 'mouseover',
325
+ ),
326
+ 'hide' => array(
327
+ 'effect' => 'slide',
328
+ 'duration' => '500',
329
+ 'event' => 'click mouseleave',
330
+ ),
331
+ ),
332
+ )
333
+ );
334
+
335
+ // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons.
336
+ $this->args['share_icons'][] = array(
337
+ 'url' => 'https://github.com/No3x/wp-mail-logging',
338
+ 'title' => 'Visit us on GitHub',
339
+ 'icon' => 'el-icon-github'
340
+ //'img' => '', // You can use icon OR img. IMG needs to be a full URL.
341
+ );
342
+ $this->args['share_icons'][] = array(
343
+ 'url' => $this->plugin_meta['wp_uri'],
344
+ 'title' => 'Visit us on WordPress',
345
+ 'icon' => 'el-icon-wordpress'
346
+ );
347
+
348
+ // Add content before the form.
349
+ // $this->args['intro_text'] = __( '<p>This text is displayed above the options panel. It isn\'t required, but more info is always better! The intro_text field accepts all HTML.</p>', 'redux-framework-demo' );
350
+
351
+ // Add content after the form.
352
+ // $this->args['footer_text'] = __( '<p>This text is displayed below the options panel. It isn\'t required, but more info is always better! The footer_text field accepts all HTML.</p>', 'redux-framework-demo' );
353
+ }
354
+ }
355
+
356
+ global $reduxConfig;
357
+ } else {
358
+ echo "The class named Redux_Framework_sample_config has already been called. <strong>Developers, you need to prefix this class with your company name or you'll run into problems!</strong>";
359
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -5,8 +5,8 @@ Tags: mail, email, log, logging, debug, list, store, collect, view
5
  License: GPLv3
6
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
7
  Requires at least: 3.0
8
- Tested up to: 4.8.0
9
- Stable tag: 1.8.1
10
 
11
  Logs each email sent by WordPress.
12
 
@@ -50,13 +50,14 @@ The logged email has been sent by WordPress but please note this does NOT mean i
50
  3. The Settings
51
 
52
  == Upgrade Notice ==
53
- = 1.8.1 =
54
- - Fix: Resending mails uses proper headers now
55
- - Fix: Translation: Text domain
56
- - Fix: Prevent error if mail to set error on was not found
57
 
58
  == Changelog ==
59
 
 
 
 
60
  = 1.8.1, June 8, 2017 =
61
  - Fix: Resending mails uses proper headers now
62
  - Fix: Translation: Text domain
5
  License: GPLv3
6
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
7
  Requires at least: 3.0
8
+ Tested up to: 4.8.3
9
+ Stable tag: 1.8.2
10
 
11
  Logs each email sent by WordPress.
12
 
50
  3. The Settings
51
 
52
  == Upgrade Notice ==
53
+ = 1.8.2 =
54
+ - Fix: security bug
 
 
55
 
56
  == Changelog ==
57
 
58
+ = 1.8.2, November 7, 2017 =
59
+ - Fix: security bug
60
+
61
  = 1.8.1, June 8, 2017 =
62
  - Fix: Resending mails uses proper headers now
63
  - Fix: Translation: Text domain
wp-mail-logging.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Mail Logging
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-mail-logging/
5
  Support URI: https://github.com/No3x/wp-mail-logging/issues
6
- Version: 1.8.1
7
  Author: Christian Z&ouml;ller
8
  Author URI: http://no3x.de/
9
  Description: Logs each email sent by WordPress.
3
  Plugin Name: WP Mail Logging
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-mail-logging/
5
  Support URI: https://github.com/No3x/wp-mail-logging/issues
6
+ Version: 1.8.2
7
  Author: Christian Z&ouml;ller
8
  Author URI: http://no3x.de/
9
  Description: Logs each email sent by WordPress.