Changeset 3480862
- Timestamp:
- 03/12/2026 06:53:41 AM (2 weeks ago)
- Location:
- newsletter
- Files:
-
- 16 edited
- 1 copied
-
tags/9.1.7 (copied) (copied from newsletter/trunk)
-
tags/9.1.7/classes/Newsletter/News.php (modified) (1 diff)
-
tags/9.1.7/includes/controls.php (modified) (4 diffs)
-
tags/9.1.7/plugin.php (modified) (2 diffs)
-
tags/9.1.7/readme.txt (modified) (2 diffs)
-
tags/9.1.7/system/delivery.php (modified) (1 diff)
-
tags/9.1.7/system/scheduler.php (modified) (6 diffs)
-
tags/9.1.7/system/system-admin.php (modified) (7 diffs)
-
tags/9.1.7/users/edit.php (modified) (1 diff)
-
trunk/classes/Newsletter/News.php (modified) (1 diff)
-
trunk/includes/controls.php (modified) (4 diffs)
-
trunk/plugin.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/system/delivery.php (modified) (1 diff)
-
trunk/system/scheduler.php (modified) (6 diffs)
-
trunk/system/system-admin.php (modified) (7 diffs)
-
trunk/users/edit.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
newsletter/tags/9.1.7/classes/Newsletter/News.php
r3466966 r3480862 26 26 27 27 $news = json_decode(wp_remote_retrieve_body($response), true); 28 error_log(wp_remote_retrieve_body($response));29 28 30 29 // Firewall returns an invalid response -
newsletter/tags/9.1.7/includes/controls.php
r3401857 r3480862 716 716 function page($name = 'page', $first = null, $language = '', $show_id = false) { 717 717 718 $front_page_id = (int) get_option('page_on_front');719 $blog_page_id = (int) get_option('page_for_posts');718 $front_page_id = (int) get_option('page_on_front'); 719 $blog_page_id = (int) get_option('page_for_posts'); 720 720 $args = array( 721 721 'post_type' => 'page', 722 722 // phpcs:ignore WordPress.WP.PostsPerPage.posts_per_page_posts_per_page 723 'posts_per_page' => 1500,724 'offset' => 0,723 'posts_per_page' => 50, 724 //'offset' => 0, 725 725 'orderby' => 'post_title', 726 726 'order' => 'ASC', 727 727 'post_status' => 'any', 728 'suppress_filters' => true 728 'suppress_filters' => false, 729 'ignore_sticky_posts' => 1 729 730 ); 730 731 731 $page s = get_posts($args);732 $paged = 1; 732 733 $options = []; 733 foreach ($pages as $page) { 734 /* @var $page WP_Post */ 735 $label = $page->post_title; 736 if ($page->post_status != 'publish') { 737 $label .= ' (' . $page->post_status . ')'; 738 } 739 if ($show_id) { 740 $label .= ' [#' . $page->ID . ']'; 741 } 742 743 if ($page->ID == $front_page_id) { 744 $label .= ' (front page)'; 745 } elseif ($page->ID == $blog_page_id) { 746 $label .= ' (post list page)'; 747 } 748 749 $options[$page->ID] = $label; 734 735 while (true) { 736 $args['paged'] = $paged; 737 $paged++; 738 739 $pages = get_posts($args); 740 741 if (!$pages) { 742 break; 743 } 744 745 if ($paged == 30) { 746 break; 747 } 748 749 foreach ($pages as $page) { 750 /* @var $page WP_Post */ 751 $label = $page->post_title; 752 if ($page->post_status != 'publish') { 753 $label .= ' (' . $page->post_status . ')'; 754 } 755 if ($show_id) { 756 $label .= ' [#' . $page->ID . ']'; 757 } 758 759 if ($page->ID == $front_page_id) { 760 $label .= ' (front page)'; 761 } elseif ($page->ID == $blog_page_id) { 762 $label .= ' (post list page)'; 763 } 764 765 $options[$page->ID] = $label; 766 } 767 unset($pages); 768 gc_collect_cycles(); 750 769 } 751 770 $this->select($name, $options, $first); … … 1199 1218 } 1200 1219 1201 1202 1220 /** 1203 1221 * Creates a button with "delete" action. … … 1363 1381 <ul> 1364 1382 <li><a href = "#tabs-a">Default</a></li> 1365 <?php foreach ($languages as $key => $value) {1366 ?>1383 <?php foreach ($languages as $key => $value) { 1384 ?> 1367 1385 <li><a href="#tabs-a-<?php echo esc_attr($key) ?>"><?php echo esc_html($value) ?></a></li> 1368 1386 <?php } ?> … … 1370 1388 1371 1389 <div id="tabs-a"> 1372 <?php $this->wp_editor('confirmation_text'); ?>1390 <?php $this->wp_editor('confirmation_text'); ?> 1373 1391 </div> 1374 <?php foreach ($languages as $key => $value) { ?>1392 <?php foreach ($languages as $key => $value) { ?> 1375 1393 <div id="tabs-a-<?php echo esc_attr($key) ?>"> 1376 <?php $this->wp_editor($key . '_confirmation_text', $settings); ?>1394 <?php $this->wp_editor($key . '_confirmation_text', $settings); ?> 1377 1395 </div> 1378 <?php } ?>1396 <?php } ?> 1379 1397 </div> 1380 <?php } else { ?>1398 <?php } else { ?> 1381 1399 <?php $this->wp_editor('confirmation_text', $settings); ?> 1382 1400 <?php } ?> -
newsletter/tags/9.1.7/plugin.php
r3473322 r3480862 5 5 Plugin URI: https://www.thenewsletterplugin.com 6 6 Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong> 7 Version: 9.1. 67 Version: 9.1.7 8 8 Author: Stefano Lissa & The Newsletter Team 9 9 Author URI: https://www.thenewsletterplugin.com … … 31 31 */ 32 32 33 define('NEWSLETTER_VERSION', '9.1. 6');33 define('NEWSLETTER_VERSION', '9.1.7'); 34 34 35 35 global $wpdb, $newsletter; -
newsletter/tags/9.1.7/readme.txt
r3473322 r3480862 2 2 Tags: newsletter, subscription, email marketing, welcome email, signup forms 3 3 Tested up to: 6.9.1 4 Stable tag: 9.1. 64 Stable tag: 9.1.7 5 5 Contributors: satollo,webagile 6 6 License: GPLv2 or later … … 178 178 179 179 == Changelog == 180 181 = 9.1.7 = 182 183 * Removed a debug log ending on the php error log 184 * Improved the main settings for sites with big number of pages 185 * Added "newsletter_user_saved" event on admin saving 186 * Improved the scheduler help page 180 187 181 188 = 9.1.6 = -
newsletter/tags/9.1.7/system/delivery.php
r3470911 r3480862 689 689 690 690 </td> 691 691 692 </tr> 692 693 <?php } ?> -
newsletter/tags/9.1.7/system/scheduler.php
r3442382 r3480862 12 12 if ($controls->is_action('reset')) { 13 13 $this->reset_cron_stats(); 14 $controls->add_message _done();14 $controls->add_message('Statistics reset, now wait at least one hour to see new valid data'); 15 15 } 16 16 … … 59 59 60 60 <div id="tnp-heading"> 61 62 <!-- <h2><?php esc_html_e('System', 'newsletter') ?></h2>-->63 61 <?php include __DIR__ . '/nav.php' ?> 64 65 62 </div> 66 63 … … 72 69 <form method="post" action=""> 73 70 <?php $controls->init(); ?> 71 72 <p><?php $controls->btn('reset', __('Reset statistics', 'newsletter'), ['confirm' => true, 'secondary' => true]); ?></p> 74 73 75 74 … … 184 183 </td> 185 184 </tr> 185 186 <tr> 187 <td>Scheduler working?</td> 188 <td class="status"> </td> 189 <td> 190 <?php echo get_transient('doing_cron') ? 'Yes':'No'; ?> 191 </td> 192 </tr> 193 186 194 </table> 187 195 </div> … … 241 249 </script> 242 250 243 <p><?php $controls->button_reset() ?></p>244 245 246 251 <?php } ?> 247 252 </div> … … 456 461 </td> 457 462 </tr> 463 464 <?php 465 if (is_plugin_active('litespeed-cache/litespeed-cache.php')) { 466 ?> 467 <tr> 468 <td>LiteSpeed Cache plugin</td> 469 <td class="status"> 470 <?php $this->condition_flag(2); ?> 471 </td> 472 <td> 473 If the Object Cache is active check if the Redis or Memcached parameters are set correctly and 474 the connection is ok, otherwise the scheduler will suffer serious problems (skipped jobs and 475 execution of only one job per run). 476 </td> 477 </tr> 478 <?php } ?> 479 458 480 </table> 459 481 </div> -
newsletter/tags/9.1.7/system/system-admin.php
r3408191 r3480862 12 12 const JOB_SKIPPED = 3; 13 13 const JOB_FAR_FUTURE = 4; 14 15 14 16 15 /** … … 122 121 // If the job is scheduled in the future but too far (yes, we saw even that one...) 123 122 // Should never happen since there is a check and a fix on NewsletterAdmin 124 if ($x > time() + NEWSLETTER_CRON_INTERVAL *2) {123 if ($x > time() + NEWSLETTER_CRON_INTERVAL * 2) { 125 124 return self::JOB_FAR_FUTURE; 126 125 } … … 130 129 // that make the scheduler loop to end prematurely. 131 130 $calls = $this->get_option_array('newsletter_diagnostic_cron_calls'); 132 if (!empty($calls) ) {131 if (!empty($calls) && !get_transient('doing_cron')) { 133 132 $last = end($calls); 134 133 if ($last > $x + 300) { … … 137 136 } 138 137 139 if (time() - $x > NEWSLETTER_CRON_INTERVAL*3) { 140 return self::JOB_LATE; 141 } 138 // If the stats have been reset, we don't know 139 if (!empty($calls)) { 140 if (time() - $x > NEWSLETTER_CRON_INTERVAL * 3) { 141 return self::JOB_LATE; 142 } 143 } 144 142 145 return self::JOB_OK; 143 146 } … … 182 185 183 186 $send_mean = $delta / $send_calls[$i][2]; 184 $send_speed = $send_calls[$i][2] /$delta;187 $send_speed = $send_calls[$i][2] / $delta; 185 188 $stats->means[] = $send_mean; 186 189 $stats->sizes[] = $send_calls[$i][2]; … … 327 330 update_option('newsletter_system_warnings', [], false); 328 331 } 329 330 332 } 331 333 … … 365 367 var $sizes = []; 366 368 var $speeds = []; 367 368 369 } 369 -
newsletter/tags/9.1.7/users/edit.php
r3473322 r3480862 59 59 } 60 60 61 $ user = $this->save_user($controls->data);62 $this->add_user_log($user, 'edit'); 61 $new_user = $this->save_user($controls->data); 62 63 63 //$this->save_user_meta($id, 'ip', $controls->data['ip']); 64 if ($user === false) { 65 $controls->errors = esc_html__('Error. Check the log files.', 'newsletter'); 64 65 if ($new_user === false) { 66 $controls->errors = esc_html__('Database error. Check the log files.', 'newsletter'); 66 67 } else { 68 $this->add_user_log($new_user, 'edit'); 69 70 do_action('newsletter_user_saved', $new_user, $old_user, 'admin'); 71 $user = $new_user; 72 67 73 $controls->add_toast_saved(); 68 74 $controls->data = (array) $user; -
newsletter/trunk/classes/Newsletter/News.php
r3466966 r3480862 26 26 27 27 $news = json_decode(wp_remote_retrieve_body($response), true); 28 error_log(wp_remote_retrieve_body($response));29 28 30 29 // Firewall returns an invalid response -
newsletter/trunk/includes/controls.php
r3401857 r3480862 716 716 function page($name = 'page', $first = null, $language = '', $show_id = false) { 717 717 718 $front_page_id = (int) get_option('page_on_front');719 $blog_page_id = (int) get_option('page_for_posts');718 $front_page_id = (int) get_option('page_on_front'); 719 $blog_page_id = (int) get_option('page_for_posts'); 720 720 $args = array( 721 721 'post_type' => 'page', 722 722 // phpcs:ignore WordPress.WP.PostsPerPage.posts_per_page_posts_per_page 723 'posts_per_page' => 1500,724 'offset' => 0,723 'posts_per_page' => 50, 724 //'offset' => 0, 725 725 'orderby' => 'post_title', 726 726 'order' => 'ASC', 727 727 'post_status' => 'any', 728 'suppress_filters' => true 728 'suppress_filters' => false, 729 'ignore_sticky_posts' => 1 729 730 ); 730 731 731 $page s = get_posts($args);732 $paged = 1; 732 733 $options = []; 733 foreach ($pages as $page) { 734 /* @var $page WP_Post */ 735 $label = $page->post_title; 736 if ($page->post_status != 'publish') { 737 $label .= ' (' . $page->post_status . ')'; 738 } 739 if ($show_id) { 740 $label .= ' [#' . $page->ID . ']'; 741 } 742 743 if ($page->ID == $front_page_id) { 744 $label .= ' (front page)'; 745 } elseif ($page->ID == $blog_page_id) { 746 $label .= ' (post list page)'; 747 } 748 749 $options[$page->ID] = $label; 734 735 while (true) { 736 $args['paged'] = $paged; 737 $paged++; 738 739 $pages = get_posts($args); 740 741 if (!$pages) { 742 break; 743 } 744 745 if ($paged == 30) { 746 break; 747 } 748 749 foreach ($pages as $page) { 750 /* @var $page WP_Post */ 751 $label = $page->post_title; 752 if ($page->post_status != 'publish') { 753 $label .= ' (' . $page->post_status . ')'; 754 } 755 if ($show_id) { 756 $label .= ' [#' . $page->ID . ']'; 757 } 758 759 if ($page->ID == $front_page_id) { 760 $label .= ' (front page)'; 761 } elseif ($page->ID == $blog_page_id) { 762 $label .= ' (post list page)'; 763 } 764 765 $options[$page->ID] = $label; 766 } 767 unset($pages); 768 gc_collect_cycles(); 750 769 } 751 770 $this->select($name, $options, $first); … … 1199 1218 } 1200 1219 1201 1202 1220 /** 1203 1221 * Creates a button with "delete" action. … … 1363 1381 <ul> 1364 1382 <li><a href = "#tabs-a">Default</a></li> 1365 <?php foreach ($languages as $key => $value) {1366 ?>1383 <?php foreach ($languages as $key => $value) { 1384 ?> 1367 1385 <li><a href="#tabs-a-<?php echo esc_attr($key) ?>"><?php echo esc_html($value) ?></a></li> 1368 1386 <?php } ?> … … 1370 1388 1371 1389 <div id="tabs-a"> 1372 <?php $this->wp_editor('confirmation_text'); ?>1390 <?php $this->wp_editor('confirmation_text'); ?> 1373 1391 </div> 1374 <?php foreach ($languages as $key => $value) { ?>1392 <?php foreach ($languages as $key => $value) { ?> 1375 1393 <div id="tabs-a-<?php echo esc_attr($key) ?>"> 1376 <?php $this->wp_editor($key . '_confirmation_text', $settings); ?>1394 <?php $this->wp_editor($key . '_confirmation_text', $settings); ?> 1377 1395 </div> 1378 <?php } ?>1396 <?php } ?> 1379 1397 </div> 1380 <?php } else { ?>1398 <?php } else { ?> 1381 1399 <?php $this->wp_editor('confirmation_text', $settings); ?> 1382 1400 <?php } ?> -
newsletter/trunk/plugin.php
r3473322 r3480862 5 5 Plugin URI: https://www.thenewsletterplugin.com 6 6 Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong> 7 Version: 9.1. 67 Version: 9.1.7 8 8 Author: Stefano Lissa & The Newsletter Team 9 9 Author URI: https://www.thenewsletterplugin.com … … 31 31 */ 32 32 33 define('NEWSLETTER_VERSION', '9.1. 6');33 define('NEWSLETTER_VERSION', '9.1.7'); 34 34 35 35 global $wpdb, $newsletter; -
newsletter/trunk/readme.txt
r3473322 r3480862 2 2 Tags: newsletter, subscription, email marketing, welcome email, signup forms 3 3 Tested up to: 6.9.1 4 Stable tag: 9.1. 64 Stable tag: 9.1.7 5 5 Contributors: satollo,webagile 6 6 License: GPLv2 or later … … 178 178 179 179 == Changelog == 180 181 = 9.1.7 = 182 183 * Removed a debug log ending on the php error log 184 * Improved the main settings for sites with big number of pages 185 * Added "newsletter_user_saved" event on admin saving 186 * Improved the scheduler help page 180 187 181 188 = 9.1.6 = -
newsletter/trunk/system/delivery.php
r3470911 r3480862 689 689 690 690 </td> 691 691 692 </tr> 692 693 <?php } ?> -
newsletter/trunk/system/scheduler.php
r3442382 r3480862 12 12 if ($controls->is_action('reset')) { 13 13 $this->reset_cron_stats(); 14 $controls->add_message _done();14 $controls->add_message('Statistics reset, now wait at least one hour to see new valid data'); 15 15 } 16 16 … … 59 59 60 60 <div id="tnp-heading"> 61 62 <!-- <h2><?php esc_html_e('System', 'newsletter') ?></h2>-->63 61 <?php include __DIR__ . '/nav.php' ?> 64 65 62 </div> 66 63 … … 72 69 <form method="post" action=""> 73 70 <?php $controls->init(); ?> 71 72 <p><?php $controls->btn('reset', __('Reset statistics', 'newsletter'), ['confirm' => true, 'secondary' => true]); ?></p> 74 73 75 74 … … 184 183 </td> 185 184 </tr> 185 186 <tr> 187 <td>Scheduler working?</td> 188 <td class="status"> </td> 189 <td> 190 <?php echo get_transient('doing_cron') ? 'Yes':'No'; ?> 191 </td> 192 </tr> 193 186 194 </table> 187 195 </div> … … 241 249 </script> 242 250 243 <p><?php $controls->button_reset() ?></p>244 245 246 251 <?php } ?> 247 252 </div> … … 456 461 </td> 457 462 </tr> 463 464 <?php 465 if (is_plugin_active('litespeed-cache/litespeed-cache.php')) { 466 ?> 467 <tr> 468 <td>LiteSpeed Cache plugin</td> 469 <td class="status"> 470 <?php $this->condition_flag(2); ?> 471 </td> 472 <td> 473 If the Object Cache is active check if the Redis or Memcached parameters are set correctly and 474 the connection is ok, otherwise the scheduler will suffer serious problems (skipped jobs and 475 execution of only one job per run). 476 </td> 477 </tr> 478 <?php } ?> 479 458 480 </table> 459 481 </div> -
newsletter/trunk/system/system-admin.php
r3408191 r3480862 12 12 const JOB_SKIPPED = 3; 13 13 const JOB_FAR_FUTURE = 4; 14 15 14 16 15 /** … … 122 121 // If the job is scheduled in the future but too far (yes, we saw even that one...) 123 122 // Should never happen since there is a check and a fix on NewsletterAdmin 124 if ($x > time() + NEWSLETTER_CRON_INTERVAL *2) {123 if ($x > time() + NEWSLETTER_CRON_INTERVAL * 2) { 125 124 return self::JOB_FAR_FUTURE; 126 125 } … … 130 129 // that make the scheduler loop to end prematurely. 131 130 $calls = $this->get_option_array('newsletter_diagnostic_cron_calls'); 132 if (!empty($calls) ) {131 if (!empty($calls) && !get_transient('doing_cron')) { 133 132 $last = end($calls); 134 133 if ($last > $x + 300) { … … 137 136 } 138 137 139 if (time() - $x > NEWSLETTER_CRON_INTERVAL*3) { 140 return self::JOB_LATE; 141 } 138 // If the stats have been reset, we don't know 139 if (!empty($calls)) { 140 if (time() - $x > NEWSLETTER_CRON_INTERVAL * 3) { 141 return self::JOB_LATE; 142 } 143 } 144 142 145 return self::JOB_OK; 143 146 } … … 182 185 183 186 $send_mean = $delta / $send_calls[$i][2]; 184 $send_speed = $send_calls[$i][2] /$delta;187 $send_speed = $send_calls[$i][2] / $delta; 185 188 $stats->means[] = $send_mean; 186 189 $stats->sizes[] = $send_calls[$i][2]; … … 327 330 update_option('newsletter_system_warnings', [], false); 328 331 } 329 330 332 } 331 333 … … 365 367 var $sizes = []; 366 368 var $speeds = []; 367 368 369 } 369 -
newsletter/trunk/users/edit.php
r3473322 r3480862 59 59 } 60 60 61 $ user = $this->save_user($controls->data);62 $this->add_user_log($user, 'edit'); 61 $new_user = $this->save_user($controls->data); 62 63 63 //$this->save_user_meta($id, 'ip', $controls->data['ip']); 64 if ($user === false) { 65 $controls->errors = esc_html__('Error. Check the log files.', 'newsletter'); 64 65 if ($new_user === false) { 66 $controls->errors = esc_html__('Database error. Check the log files.', 'newsletter'); 66 67 } else { 68 $this->add_user_log($new_user, 'edit'); 69 70 do_action('newsletter_user_saved', $new_user, $old_user, 'admin'); 71 $user = $new_user; 72 67 73 $controls->add_toast_saved(); 68 74 $controls->data = (array) $user;
Note: See TracChangeset
for help on using the changeset viewer.