Changeset 2093094
- Timestamp:
- 05/22/2019 02:19:54 PM (7 years ago)
- Location:
- xtra-settings/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
xtra.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xtra-settings/trunk/readme.txt
r2051622 r2093094 4 4 Tags: WordPress settings, hidden settings, tips and tricks, tweaks, WordPress options 5 5 Requires at least: 3.7 6 Tested up to: 5. 17 Stable tag: 2.0. 26 Tested up to: 5.2 7 Stable tag: 2.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 48 48 == Changelog == 49 49 50 = 2.0.3 = 51 * Compatibility with WP 5.2 52 * Fixed Hits Counter daily mail sent multiple times 53 * Fixed wrong share button links caused by output buffer order 54 50 55 = 2.0.2 = 51 56 * Compatibility with WP 5.1 … … 359 364 == Upgrade Notice == 360 365 361 = 2.0. 2=366 = 2.0.3 = 362 367 For the best user experience, always upgrade to the latest version. -
xtra-settings/trunk/xtra.php
r2051622 r2093094 4 4 Plugin URI: https://wordpress.org/plugins/xtra-settings/ 5 5 Description: All useful hidden settings of Wordpress 6 Version: 2.0. 26 Version: 2.0.3 7 7 Author: fures 8 8 Author URI: http://www.fures.hu/xtra-settings/ … … 20 20 21 21 //. Defines 22 define( 'XTRA_VERSION', '2.0. 2' );22 define( 'XTRA_VERSION', '2.0.3' ); 23 23 define( 'XTRA_PLUGIN', __FILE__ ); 24 24 define( 'XTRA_PLUGIN_BASENAME', plugin_basename( XTRA_PLUGIN ) ); … … 1726 1726 if (is_admin()) return $buffer; 1727 1727 if (xtra_is_customize_preview()) return $buffer; 1728 //reverse order !!! 1729 if (get_optionXTRA( 'xtra_related_posts', 0 )) $buffer = xtra_related_posts($buffer); 1730 if (get_optionXTRA( 'xtra_share2_buttons', 0 )) $buffer = xtra_share2_buttons($buffer); 1731 if (get_optionXTRA( 'xtra_share_buttons', 0 )) $buffer = xtra_share_buttons($buffer); 1728 //spec order !!! 1732 1729 if (get_optionXTRA( 'xtra_remove_double_title_meta', 0 )) $buffer = xtra_remove_double_title_meta($buffer); 1733 1730 if (get_optionXTRA( 'xtra_img_alt', 0 )) $buffer = xtra_img_alt($buffer); 1731 if (get_optionXTRA( 'xtra_share_buttons', 0 )) $buffer = xtra_share_buttons($buffer); 1732 if (get_optionXTRA( 'xtra_share2_buttons', 0 )) $buffer = xtra_share2_buttons($buffer); 1733 if (get_optionXTRA( 'xtra_related_posts', 0 )) $buffer = xtra_related_posts($buffer); 1734 1734 if (get_optionXTRA( 'xtra_minify_html', 0 )) $buffer = xtra_minify_html($buffer); 1735 1735 … … 3757 3757 3758 3758 function xtra_hits_send_mail($force="") { 3759 global $xtra_options; 3760 if (!get_optionXTRA('xtra_hits_send_mail', 0) && $force != 'sendnow') return; 3759 if ($force == 'sendnow') { 3760 xtra_hits_do_send_mail(); 3761 return; 3762 } 3763 if (!get_optionXTRA('xtra_hits_send_mail', 0)) return; 3764 if ($force == 'daychange') { 3765 xtra_hits_do_send_mail(); 3766 update_optionXTRA('xtra_hits_send_mail_last', time() ); 3767 return; 3768 } 3769 $last = get_optionXTRA('xtra_hits_send_mail_last', 0); 3770 $around = get_optionXTRA('xtra_hits_send_mail_num', 0); 3771 if (!$around) return; 3772 $around_ts = strtotime("today ".$around); 3773 if ($around_ts === FALSE) $around_ts = time(); 3774 $last_day = date( "j", $last ); 3775 $today = date( "j", time() ); 3776 if ( $last_day != $today && time()-$around_ts >= 0 ) { 3777 xtra_hits_do_send_mail(); 3778 update_optionXTRA('xtra_hits_send_mail_last', time() ); 3779 } 3780 } 3781 3782 function xtra_hits_do_send_mail() { 3761 3783 $addr = get_optionXTRA('xtra_hits_send_mail_text', ''); 3762 if ($addr) { 3763 $last = get_optionXTRA('xtra_hits_send_mail_last', 0); 3764 $around = get_optionXTRA('xtra_hits_send_mail_num', 0); 3765 if (!$around && !$force) return; 3766 $around_ts = strtotime("today ".$around); 3767 if ($around_ts === FALSE) $around_ts = time(); 3768 //if ( $force || ( time()-$last > (24*60*60) && get_optionXTRA('xtra_hits_send_mail') ) ) { 3769 $last_day = date( "j", $last ); 3770 $today = date( "j", time() ); 3771 if ( $force || ( $last_day != $today && time()-$around_ts >= 0 ) ) { 3772 $subject = "". esc_html__('Today hits', 'xtra-settings') .": ".str_ireplace( array("http://","https://"), "", home_url() ).""; 3773 $body = xtra_hits_show(); 3774 if (get_optionXTRA('xtra_hits_show_ips',0)) $body .= xtra_hits_show("IPs",get_optionXTRA('xtra_hits_show_ips_num',10),"mail"); 3775 if (get_optionXTRA('xtra_hits_show_geo',0)) $body .= xtra_hits_show("Countries",10,"mail"); 3776 if (get_optionXTRA('xtra_hits_show_pages',0)) $body .= xtra_hits_show("Pages",10,"mail"); 3777 if (get_optionXTRA('xtra_hits_show_pages',0)) $body .= xtra_hits_show("IPc",10,"mail"); 3778 if (get_optionXTRA('xtra_hits_show_hitsdata',0)) $body .= xtra_hits_show("HITs",get_optionXTRA('xtra_hits_show_hitsdata_num',50),"mail"); 3779 $headers = array('Content-Type: text/html; charset=UTF-8'); 3780 wp_mail($addr, $subject, $body, $headers); 3781 if ($force != 'sendnow') { 3782 update_optionXTRA('xtra_hits_send_mail_last', time() ); 3783 $xtra_options['xtra_hits_send_mail_last'] = time(); 3784 } 3785 } 3786 } 3784 if (!$addr) return; 3785 $subject = "". esc_html__('Today hits', 'xtra-settings') .": ".str_ireplace( array("http://","https://"), "", home_url() ).""; 3786 $body = xtra_hits_show(); 3787 if (get_optionXTRA('xtra_hits_show_ips',0)) $body .= xtra_hits_show("IPs",get_optionXTRA('xtra_hits_show_ips_num',10),"mail"); 3788 if (get_optionXTRA('xtra_hits_show_geo',0)) $body .= xtra_hits_show("Countries",10,"mail"); 3789 if (get_optionXTRA('xtra_hits_show_pages',0)) $body .= xtra_hits_show("Pages",10,"mail"); 3790 if (get_optionXTRA('xtra_hits_show_pages',0)) $body .= xtra_hits_show("IPc",10,"mail"); 3791 if (get_optionXTRA('xtra_hits_show_hitsdata',0)) $body .= xtra_hits_show("HITs",get_optionXTRA('xtra_hits_show_hitsdata_num',50),"mail"); 3792 $headers = array('Content-Type: text/html; charset=UTF-8'); 3793 wp_mail($addr, $subject, $body, $headers); 3787 3794 } 3788 3795
Note: See TracChangeset
for help on using the changeset viewer.