Plugin Directory

Changeset 2093094


Ignore:
Timestamp:
05/22/2019 02:19:54 PM (7 years ago)
Author:
fures
Message:

Commit 2.0.3

Location:
xtra-settings/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • xtra-settings/trunk/readme.txt

    r2051622 r2093094  
    44Tags: WordPress settings, hidden settings, tips and tricks, tweaks, WordPress options
    55Requires at least: 3.7
    6 Tested up to: 5.1
    7 Stable tag: 2.0.2
     6Tested up to: 5.2
     7Stable tag: 2.0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4848== Changelog ==
    4949
     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
    5055= 2.0.2 =
    5156* Compatibility with WP 5.1
     
    359364== Upgrade Notice ==
    360365
    361 = 2.0.2 =
     366= 2.0.3 =
    362367For the best user experience, always upgrade to the latest version.
  • xtra-settings/trunk/xtra.php

    r2051622 r2093094  
    44Plugin URI: https://wordpress.org/plugins/xtra-settings/
    55Description: All useful hidden settings of Wordpress
    6 Version: 2.0.2
     6Version: 2.0.3
    77Author: fures
    88Author URI: http://www.fures.hu/xtra-settings/
     
    2020
    2121//. Defines
    22 define( 'XTRA_VERSION', '2.0.2' );
     22define( 'XTRA_VERSION', '2.0.3' );
    2323define( 'XTRA_PLUGIN', __FILE__ );
    2424define( 'XTRA_PLUGIN_BASENAME', plugin_basename( XTRA_PLUGIN ) );
     
    17261726        if (is_admin()) return $buffer;
    17271727        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 !!!
    17321729        if (get_optionXTRA( 'xtra_remove_double_title_meta', 0 ))       $buffer = xtra_remove_double_title_meta($buffer);
    17331730        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);
    17341734        if (get_optionXTRA( 'xtra_minify_html', 0 ))                    $buffer = xtra_minify_html($buffer);
    17351735
     
    37573757
    37583758function 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
     3782function xtra_hits_do_send_mail() {
    37613783    $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); 
    37873794}
    37883795
Note: See TracChangeset for help on using the changeset viewer.