Plugin Directory

Changeset 3437331


Ignore:
Timestamp:
01/12/2026 02:58:06 AM (6 weeks ago)
Author:
rermis
Message:

v6.1.0 = * Add option to disable admin email types. Workaround for running page_hit process on small servers.

Location:
admin-toolbox/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • admin-toolbox/trunk/atb_admin.php

    r3290715 r3437331  
    9696    if($row->option_name=='atb_hide_item_id') $hide_item_id=$row->option_value;
    9797    if($row->option_name=='atb_hide_item_all') $hide_item_all=$row->option_value;
     98
     99    if($row->option_name=='atb_admin_email') $admin_email=$row->option_value;
     100    if($row->option_name=='atb_admin_email_type') $admin_email_type=$row->option_value;
    98101
    99102    if($row->option_name=='atb_redirect_hp') $redirect_hp=$row->option_value;
     
    201204if(!isset($hide_item_id)) $hide_item_id='';
    202205if(!isset($hide_item_all)) $hide_item_all='';
     206
     207if(!isset($admin_email)) $admin_email=0;
     208if(!isset($admin_email_type)) $admin_email_type='';
    203209
    204210if(!isset($redirect_hp)) $redirect_hp=0;
     
    293299      Error Reports: <?php echo $err_rpt;?>, path <?php echo $err_rpt_path;?>, exclude <?php echo $err_rpt_exclude;?><br>
    294300      Hide Items: <?php echo $hide_item;?>, role <?php echo $hide_item_role;?>, role_exclude <?php echo $hide_item_role_exclude;?>, items <?php echo $hide_item_id;?>, all roles <?php echo $hide_item_all;?><br>
     301      Disable Emails: <?php echo $admin_email;?>, types <?php echo $admin_email_type;?><br>
    295302      Redirect to HP: <?php echo $redirect_hp;?>, role <?php echo $redirect_hp_role;?>, role_exclude <?php echo $redirect_hp_role_exclude;?>, pages <?php echo $redirect_hp_page;?><br>
    296303      Redirect to WP Admin: <?php echo $redirect_db;?>, role <?php echo $redirect_db_role;?>, role_exclude <?php echo $redirect_db_role_exclude;?>, pages <?php echo $redirect_db_page;?><br>
     
    633640          <b style='color:#000'>Based on Role</b><br>
    634641          <textarea name='option_value[]' style='width:100%;min-height:70px' title='IDs or Classes' placeholder='IDs or Classes'><?php echo str_replace(' ','&#10;',$hide_item_id); ?></textarea>
    635           <select style='display:block' onchange="previousElementSibling.innerHTML=previousElementSibling.innerHTML+','+this.value;this.value='';">
     642          <select style='display:block' onchange="atb_add_to_list(this)">
    636643            <option selected value=''>Select ID/Class
    637644            <option value='#wpadminbar'>Admin Bar
     
    655662          <b style='color:#000'>For Everyone</b><br>
    656663          <textarea name='option_value[]' style='width:100%;min-height:70px' title='IDs or Classes' placeholder='IDs or Classes'><?php echo str_replace(' ','&#10;',$hide_item_all); ?></textarea>
    657           <select style='display:block' onchange="previousElementSibling.innerHTML=previousElementSibling.innerHTML+','+this.value;this.value='';">
     664          <select style='display:block' onchange="atb_add_to_list(this)">
    658665            <option selected value=''>Select ID/Class
    659666            <option value='#wpadminbar'>Admin Bar
     
    674681        </td>
    675682      </tr>
     683     
    676684
    677685      <tr style='background:#F5F5F5'>
     686        <td><span class='atb_title'><span class="dashicons dashicons-list-view"></span>Admin Emails</span> <br>Disable Admin Emails by Type.<br>
     687        <td nowrap>
     688          <input type='hidden' name='option_name[]' value='admin_email'>
     689          <select name='option_value[]' id='admin_email' onchange="atb_change('atb_config',this.id,this.selectedIndex);">
     690            <option value='' disabled  <?php if($atb_setup_mode>0) echo 'selected';?>>Enable Emails
     691            <option value='1' <?php if($admin_email==1) echo 'selected';?>>Disable Emails
     692            <option value='0' <?php if($admin_email==0 && $atb_setup_mode==0) echo 'selected';?>>Enable Emails (WP Default)
     693          </select>
     694          <span id='admin_email-sel' class='sel_status'><?php echo $not_set;?></span>
     695        </td>
     696
     697        <td></td>
     698
     699        <td nowrap id='admin_email_type_td'>
     700          <input type='hidden' name='option_name[]' value='admin_email_type'>
     701          Disable these Emails<br><br>
     702          <textarea name='option_value[]' style='width:100%;min-height:70px' title='Email Types' placeholder='Email Types'><?php echo str_replace(' ','&#10;',$admin_email_type); ?></textarea>
     703          <select style='display:block' onchange="atb_add_to_list(this)">
     704            <option selected value=''>Select Email Type
     705            <option value='auto_plugin_update_send_email'>auto_plugin_update_send_email</option>
     706            <option value='auto_theme_update_send_email'>auto_theme_update_send_email</option>
     707            <option value='auto_core_update_send_email'>auto_core_update_send_email</option>
     708            <option value='send_password_change_email'>send_password_change_email</option>
     709            <option value='send_email_change_email'>send_email_change_email</option>
     710            <option value='wp_password_change_notification_email'>wp_password_change_notification_email</option>
     711            <option value='wp_new_user_notification_email_admin'>wp_new_user_notification_email_admin</option>
     712            <option value='woocommerce_low_stock_notification'>woocommerce_low_stock_notification</option>
     713            <option value='woocommerce_no_stock_notification'>woocommerce_no_stock_notification</option>
     714            <option value='woocommerce_product_on_backorder_notification'>woocommerce_product_on_backorder_notification</option>
     715            <option value='woocommerce_email_recipient_new_order'>woocommerce_email_recipient_new_order</option>
     716            <option value='woocommerce_email_recipient_cancelled_order'>woocommerce_email_recipient_cancelled_order</option>
     717            <option value='woocommerce_email_recipient_failed_order'>woocommerce_email_recipient_failed_order</option>
     718            <option value='woocommerce_email_enabled'>woocommerce_email_enabled</option>
     719          </select>
     720        </td>
     721      </tr>
     722
     723      <tr style='background:#FFF'>
    678724        <td><span class='atb_title'><span class="dashicons dashicons-redo"></span>Redirect to Homepage</span> <br>Redirect home based on URL.<br>
    679725        <td nowrap>
     
    714760      </tr>
    715761
    716       <tr style='background:#FFF'>
     762      <tr style='background:#F5F5F5'>
    717763        <td><span class='atb_title'><span class="dashicons dashicons-redo"></span>Redirect to Dashboard</span> <br>Redirect to /wp-admin based on role.<br>
    718764        <td nowrap>
     
    748794          Redirect to /wp-admin from these pages<br>
    749795          <textarea name='option_value[]' style='width:100%;min-height:70px' title='Separate Pages by new line' placeholder='Separate Pages by new line'><?php echo str_replace(' ','&#10;',$redirect_db_page); ?></textarea>
    750           <select style='display:block' onchange="previousElementSibling.innerHTML=previousElementSibling.innerHTML+','+this.value;this.value='';">
     796          <select style='display:block' onchange="atb_add_to_list(this)">
    751797            <option selected value=''>Select Page
    752798            <option value='edit.php'>Edit Post/Page
     
    769815      </tr>
    770816
    771       <tr style='background:#F5F5F5'>
     817      <tr style='background:#FFF'>
    772818        <td><span class='atb_title'><span class="dashicons dashicons-format-chat"></span> Disable Notices</span><br>Disable all update-related notifications in WordPress.</td>
    773819        <td nowrap>
     
    801847      </tr>
    802848
    803       <tr style='background:#FFF'>
     849      <tr style='background:#F5F5F5'>
    804850        <td><span class='atb_title'><span class="dashicons dashicons-list-view"></span> Search Post Meta</span><br>Search posts by post meta in wp-admin.</td>
    805851        <td nowrap>
     
    853899      </tr>
    854900
    855       <tr style='background:#F5F5F5'>
     901      <tr style='background:#FFF'>
    856902        <td><span class='atb_title'><span class="dashicons dashicons-list-view"></span> Hide Bulk Actions</span><br>Hide list bulk actions, quick edit, and delete options. This features hides these actions only in lists, it does not remove functionality.</td>
    857903        <td nowrap>
     
    905951      </tr>
    906952
    907       <tr style='background:#FFF'>
     953      <tr style='background:#F5F5F5'>
    908954        <td><span class='atb_title'><span class="dashicons dashicons-plus-alt"></span>Hide New Post Button</span><br>Hide new post buttons. This visually hides the button, it does not remove functionality.</td>
    909955        <td nowrap>
     
    9571003      </tr>
    9581004
    959       <tr style='background:#F5F5F5'>
     1005      <tr style='background:#FFF'>
    9601006        <td><span class='atb_title'><span class="dashicons dashicons-admin-users"></span> Hide Roles</span><br>Select roles to hide in the user editor. Limit roles that have access to other roles.</td>
    9611007        <td nowrap>
     
    10021048      </tr>
    10031049
    1004       <tr style='background:#FFF'>
     1050      <tr style='background:#F5F5F5'>
    10051051        <td><span class='atb_title'><span class="dashicons dashicons-images-alt2"></span> Limit Media Size</span><br>Set the maximum size for new images uploaded via the media library.</td>
    10061052        <td nowrap>
     
    10461092      </tr>
    10471093
    1048       <tr style='background:#F5F5F5'>
     1094      <tr style='background:#FFF'>
    10491095        <td><span class='atb_title'><span class="dashicons dashicons-media-code"></span>Disable XML-RPC</span> <br>XML-RPC can be used to enable a brute force attack on your site.</a>.</td>
    10501096        <td nowrap colspan='3'>
     
    11041150  }
    11051151  function atb_getE(e) {return document.getElementById(e);}
     1152
     1153  function atb_add_to_list(el){
     1154    var ta=el.previousElementSibling;
     1155    if(!ta||!el.value)return;
     1156    var v=el.value;
     1157    var list=ta.value?ta.value.split(/[\r\n,]+/):[];
     1158    var out=[];
     1159    var found=false;
     1160    for(var i=0;i<list.length;i++){
     1161      var x=list[i].trim();
     1162      if(!x)continue;
     1163      if(x===v){found=true;continue;}
     1164      out.push(x);
     1165    }
     1166    if(!found)out.push(v);
     1167    ta.value=out.join("\n");
     1168    el.value='';
     1169  }
    11061170
    11071171  var rolemultiselect_Interval=setInterval(function() {
  • admin-toolbox/trunk/atb_functions.php

    r3429279 r3437331  
    66Author: RLDD
    77Author URI: https://richardlerma.com/contact/
    8 Version: 6.0.36
     8Version: 6.1.0
    99Text Domain: admin-toolbox
    1010Copyright: (c) 2017-2026 rldd.net - All Rights Reserved
     
    1313*/
    1414
    15 global $atb_version; $atb_version='6.0.36';
     15global $atb_version; $atb_version='6.1.0';
    1616if(!defined('ABSPATH')) exit;
    1717
     
    529529// PageHit Summary
    530530function atb_view_summary($atb_version_type) {
     531  $k='atb_view_summary_init';
     532  if(get_transient($k))return;
     533  set_transient($k,1,5*MINUTE_IN_SECONDS);
    531534  if(get_transient('limit_img_size_kb_'.atb_cui())!==false) delete_transient('limit_img_size_kb_'.atb_cui());
    532535
     
    688691    }
    689692  </script><?php
     693  delete_transient('atb_view_summary_init');
    690694}
    691695
     
    747751}
    748752add_filter('admin_email_check_interval','atb_admin_email_check');
     753
     754
     755function atb_admin_email_rules(){
     756    $on=get_option('atb_admin_email');
     757    if($on!=1&&$on!='1')return;
     758    $types=get_option('atb_admin_email_type');
     759    if(!$types)return;
     760    $list=preg_split("/[\r\n,]+/",$types);
     761    if(!$list||!is_array($list))return;
     762    $wc_map=['woocommerce_product_on_backorder_notification'=>'backorder','woocommerce_low_stock_notification'=>'low_stock','woocommerce_no_stock_notification'=>'no_stock'];
     763    foreach($list as $t){
     764        $t=trim($t);
     765        if($t==='')continue;
     766        if(stripos($t,'woocommerce')===0){
     767            if(isset($wc_map[$t])){
     768                add_action('woocommerce_email',function($email)use($t,$wc_map){remove_action($t,[$email,$wc_map[$t]]);});
     769            }else{
     770                add_filter($t,'__return_false');
     771            }
     772        }else add_filter($t,'__return_false');
     773    }
     774}
     775add_action('init','atb_admin_email_rules');
  • admin-toolbox/trunk/readme.txt

    r3429279 r3437331  
    22Contributors: rermis
    33Tags: admin, 2FA, roles, track, hide role
     4License: GPLv3 or later
     5License URI: http://www.gnu.org/licenses/gpl-3.0.html
    46Requires at least: 6.0
    57Tested up to: 6.9
    6 Stable tag: 6.0.36
     8Stable tag: 6.1.0
    79
    810Manage an array of administrative options improving user control and resource management.
     
    4648
    4749== Changelog ==
    48 = 6.0.36 = * Minor aesthetic improvements
     50= 6.1.0 = * Add option to disable admin email types. Workaround for running page_hit process on small servers.
     51= 6.0.37 = * Minor aesthetic improvements
    4952= 6.0.35 = * Bug fix for hide class feature
    5053= 6.0.34 = * Minor aesthetic improvements
Note: See TracChangeset for help on using the changeset viewer.