Plugin Directory

Changeset 3319745


Ignore:
Timestamp:
06/30/2025 07:49:51 AM (8 months ago)
Author:
smackcoders
Message:

Version 1.3 - WP Compatibility & Bug fixes

Location:
all-in-one-performance-accelerator
Files:
499 added
23 edited

Legend:

Unmodified
Added
Removed
  • all-in-one-performance-accelerator/trunk/Admin.php

    r3005752 r3319745  
    262262   
    263263    public function get_tabs_and_page(){
     264        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     265            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     266            return;
     267        }
    264268        $tab = sanitize_text_field($_POST['tab']);
    265269        $page = sanitize_text_field($_POST['page']);
  • all-in-one-performance-accelerator/trunk/Query-moniter/query-info.php

    r3005752 r3319745  
    5555
    5656    public function set_query_display(){
     57        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     58            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     59            return;
     60        }
     61
    5762        global $wpdb;
    5863        $displayQueryAdmin=sanitize_text_field($_POST['displayAdmin']);
     
    7580
    7681    public function get_query_selected_tab(){
     82        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     83            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     84            return;
     85        }
     86
    7787        $tab = sanitize_text_field($_POST['tab']);
    7888        if($tab === 'undefined'){
  • all-in-one-performance-accelerator/trunk/Query-moniter/query-moniter.php

    r3005752 r3319745  
    177177    }
    178178    public function get_query_info(){
    179        
     179       if (!is_user_logged_in() || !current_user_can('manage_options')) {
     180            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     181            return;
     182        }
     183
    180184        $this->data['total_qs']   = 0;
    181185        $this->data['total_time'] = 0;
  • all-in-one-performance-accelerator/trunk/Readme.txt

    r3005752 r3319745  
    22Contributors: smackcoders, smacksupport
    33Requires at least: 5.0 or higher
    4 Tested up to: 6.4.1
    5 Stable tag: 1.2
    6 Version: 1.2
     4Tested up to: 6.8
     5Stable tag: 1.3
     6Version: 1.3
    77Requires PHP: 7.4
    88Author: smackcoders
     
    176176
    177177== Changelog ==
     178
     179= 1.3 =
     180* Upgrade to get compatibility with WordPress 6.8
     181* Bug fixes
     182
    178183= 1.2 =
    179184* Added: Extra graphs Profiler section
     
    200205
    201206== Upgrade Notice ==
     207= 1.3 =
     208* Added: Upgrade now to get the latest WordPress compatibility.
     209
    202210= 1.2 =
    203211* Upgrade to receive a thoroughly redesigned plugin in this latest release.
  • all-in-one-performance-accelerator/trunk/all-in-one-performance-accelerator.php

    r3005752 r3319745  
    1111 * Plugin URI:        https://smackcoders.com
    1212 * Description:       All-in-one Performance Accelerator
    13  * Version:           1.2
     13 * Version:           1.3
    1414 * Author:            Smackcoders
    1515 * Author URI:        https://smackcoders.com
  • all-in-one-performance-accelerator/trunk/cachePreload/preload-cache.php

    r2840972 r3319745  
    4242
    4343    public function get_preload_selected_tab(){
     44        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     45            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     46            return;
     47        }
     48
    4449        $tab = sanitize_text_field($_POST['tab']);
    4550        if($tab === 'undefined'){
     
    6267
    6368    public function preload_options(){
    64        
     69        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     70            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     71            return;
     72        }
     73
    6574        if(isset($_POST)){
    6675            $activate_preloading = sanitize_text_field($_POST['activate_preloading']);
     
    8392
    8493    public function send_preload_options(){
     94        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     95            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     96            return;
     97        }
     98
    8599        $activate_preloading=get_option('smack_activate_preloading');
    86100        $preload_error=get_option('smack_preload_error');
  • all-in-one-performance-accelerator/trunk/cdn/enable-CDN.php

    r3005752 r3319745  
    5151
    5252    public static function cdn_Options() {
    53        
     53    if (!is_user_logged_in() || !current_user_can('manage_options')) {
     54            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     55            return;
     56        }
     57   
    5458        if(isset($_POST)){
    5559           
     
    140144
    141145    public static function send_cdn_options(){
     146        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     147            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     148            return;
     149        }
     150
    142151        $result['enable_cdn']=get_option('smack_enable_cdn')=== 'true'? true: false;
    143152        $result['domain_json']=get_option('smack_cdn_domain_input');
  • all-in-one-performance-accelerator/trunk/classes/adminbarFunction.php

    r3005752 r3319745  
    3636
    3737    public function smack_clear_cache_dashboard(){
     38        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     39            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     40            return;
     41        }
     42
    3843       $this->smack_clean_domain('');
    3944       $result['success'] = true;
     
    4348
    4449    public function smack_preload_dashboard(){
     50        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     51            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     52            return;
     53        }
     54
    4555        $this->run_smack_bot( 'cache-preload', '' );
    4656        update_option('smack_preload_status','success');
     
    5161
    5262    public function smack_purge_opcache_dashboard(){
     63        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     64            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     65            return;
     66        }
     67
    5368        $reset_opcache = $this->smack_reset_opcache();
    5469        if ( ! $reset_opcache ) {
  • all-in-one-performance-accelerator/trunk/cloudfare/cloudfare.php

    r2840972 r3319745  
    2727
    2828    function smack_cloudflare_purge() {
     29        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     30            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     31            return;
     32        }
     33
    2934        $cloudflare_info=get_option('smack_cloudflare_info');
    3035            $smack_cache = new \Cloudflare\Zone\Cache($cloudflare_info->auth );
     
    8489
    8590    public function get_cloudfare(){
     91        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     92            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     93            return;
     94        }
     95
    8696        if(isset($_POST)){
    8797            $cloudfare_email=filter_var($_POST['emailvalues'], FILTER_SANITIZE_EMAIL);
     
    99109
    100110    public function get_cloudfare_info(){
    101        
     111        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     112            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     113            return;
     114        }
     115
    102116        if(isset($_POST)){
    103117            $cloudfare_email=filter_var($_POST['emailvalues'], FILTER_SANITIZE_EMAIL);
     
    153167
    154168    public function send_cloudfare_info(){
     169        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     170            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     171            return;
     172        }
     173
    155174        if(empty(get_option('smack_cloudfare_email'))||get_option('smack_cloudfare_email')=== 'false'){
    156175            $result['email_value']='';
  • all-in-one-performance-accelerator/trunk/database-cleanup/database-cleanup.php

    r2840972 r3319745  
    4040
    4141    function delete_single_table(){
     42        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     43            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     44            return;
     45        }
     46
    4247        global $wpdb;
    4348        $db_name = DB_NAME;
     
    5156
    5257    function delete_all_table(){
     58        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     59            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     60            return;
     61        }
     62
    5363        global $wpdb;
    5464        $db_name = DB_NAME;
     
    183193
    184194    function scan_results() {
     195        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     196            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     197            return;
     198        }
     199
    185200        $get_plugin_list = $this->get_plugin_list();
    186201        $plugin_name_version = $this->plugin_name_version();
  • all-in-one-performance-accelerator/trunk/database/database-optimization.php

    r3005752 r3319745  
    4141
    4242    public function get_data_selected_tab(){
     43        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     44            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     45            return;
     46        }
     47
    4348        $tab = sanitize_text_field($_POST['tab']);
    4449        if($tab === 'undefined'){
     
    6166   
    6267    public function get_count(){
     68        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     69            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     70            return;
     71        }
    6372
    6473        global $wpdb;
     
    110119   
    111120    public function get_db_options(){
     121        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     122            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     123            return;
     124        }
     125
    112126            if(isset($_POST)){
    113127                $revisions = sanitize_text_field($_POST['revisions']);
  • all-in-one-performance-accelerator/trunk/database/orphan-tables.php

    r2840972 r3319745  
    4545
    4646    public function get_orphant_selected_tab(){
     47        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     48            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     49            return;
     50        }
     51
    4752        $tab = sanitize_text_field($_POST['tab']);
    4853        if($tab === 'undefined'){
     
    6570
    6671    public function get_orphan_count(){
     72        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     73            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     74            return;
     75        }
    6776
    6877        global $wpdb;
     
    98107   
    99108    public function get_orphan_view_list(){
     109        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     110            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     111            return;
     112        }
     113
    100114        global $wpdb;
    101115
     
    179193
    180194    public function delete_orphan_list(){
     195        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     196            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     197            return;
     198        }
     199
    181200        global $wpdb;
    182201        $list=$_POST['delete_list'];
     
    373392
    374393    public function get_modified_tables(){
     394         if (!is_user_logged_in() || !current_user_can('manage_options')) {
     395            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     396            return;
     397        }
    375398
    376399        global $wpdb;
  • all-in-one-performance-accelerator/trunk/heartbeat/control-heartbeat.php

    r3005752 r3319745  
    4444
    4545    public function disable_heartbeat(){
     46if (!is_user_logged_in() || !current_user_can('manage_options')) {
     47            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     48            return;
     49        }
    4650
    4751        if(isset($_POST)){
     
    7983   
    8084    function heartbeat_options(){
     85        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     86            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     87            return;
     88        }
     89
    8190        $disable_auto_start=get_option('disable_auto_start_heart_beat');
    8291        $heart_beat_frequency=get_option('control_heart_beat_frequency');
  • all-in-one-performance-accelerator/trunk/image-optimization/image-optimization.php

    r3005752 r3319745  
    4545   
    4646    public function get_image_selected_tab(){
     47        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     48            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     49            return;
     50        }
     51
    4752        $tab = sanitize_text_field($_POST['tab']);
    4853        if($tab === 'undefined'){
     
    6570
    6671    public static function get_image_options(){
     72        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     73            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     74            return;
     75        }
     76
    6777        $result['compress_image']=get_option('smack_compress_image')=== 'true'? true: false;
    6878        $result['auto_compress_images']=get_option('smack_auto_compress_images')=== 'true'? true: false;
     
    8292
    8393    public static function get_processing_records(){
     94        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     95            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     96            return;
     97        }
     98
    8499        $stop_processing=get_option('smack_stop_compression');
    85100        $total_records=(int)get_option('smack_total_images');
     
    111126
    112127
    113     public static function compress_image(){   
     128    public static function compress_image(){
     129        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     130            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     131            return;
     132        }
     133   
    114134        if(isset($_POST)){
    115135            $stop_processing = sanitize_text_field($_POST['stop_processing_records']); 
     
    251271
    252272    public static function maximum_image_width (){
     273        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     274            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     275            return;
     276        }
     277
    253278        $query_images_args = array(
    254279            'post_type'      => 'attachment',
     
    338363
    339364    public static function do_media_url_modification($attachment_url){
     365        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     366            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     367            return;
     368        }
     369
    340370        $compress_image=get_option('smack_compress_image');
    341371        if($compress_image == 'true'){
  • all-in-one-performance-accelerator/trunk/includes/browser-cache.php

    r2840972 r3319745  
    7676       
    7777        public function get_advancerule_selected_tab(){
     78            if (!is_user_logged_in() || !current_user_can('manage_options')) {
     79            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     80            return;
     81        }
     82
    7883            $tab = sanitize_text_field($_POST['tab']);
    7984            if($tab === 'undefined'){
     
    96101
    97102        public function advanced_rules_options(){
    98            
     103            if (!is_user_logged_in() || !current_user_can('manage_options')) {
     104            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     105            return;
     106        }
     107
    99108            if(isset($_POST)){
    100109                $never_cache_path = sanitize_text_field($_POST['excluded_page_paths']);
     
    116125
    117126        public function send_advanced_rules_options(){
     127            if (!is_user_logged_in() || !current_user_can('manage_options')) {
     128            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     129            return;
     130        }
     131
    118132            $never_cache_path=get_option('smack_never_cache_path');
    119133            $never_cache_ids=get_option('smack_never_cache_ids');
  • all-in-one-performance-accelerator/trunk/includes/clear-cache.php

    r2840972 r3319745  
    9090         
    9191        public function get_cache_selected_tab(){
     92            if (!is_user_logged_in() || !current_user_can('manage_options')) {
     93            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     94            return;
     95        }
     96
    9297            $tab = sanitize_text_field($_POST['tab']);
    9398            if($tab === 'undefined'){
     
    110115
    111116        function cache_options(){
    112          
     117         if (!is_user_logged_in() || !current_user_can('manage_options')) {
     118            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     119            return;
     120        }
     121
    113122            if(isset($_POST)){
    114123               
     
    138147
    139148        public function send_cache_options(){
     149            if (!is_user_logged_in() || !current_user_can('manage_options')) {
     150            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     151            return;
     152        }
     153
    140154            $complete_cache=get_option('smack_complete_cache');
    141155            $comments_cache=get_option('smack_enable_comments_cache');
  • all-in-one-performance-accelerator/trunk/lazyload/lazy-load.php

    r3005752 r3319745  
    4646
    4747    public function get_media_selected_tab(){
     48        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     49            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     50            return;
     51        }
     52
    4853        $tab = sanitize_text_field($_POST['tab']);
    4954        if($tab === 'undefined'){
     
    6671
    6772    public function media_options(){
     73        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     74            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     75            return;
     76        }
     77
    6878        if(isset($_POST)){
    6979            $enable_lazyload = sanitize_text_field($_POST['enable_lazy_load']);
     
    8494
    8595    public function send_media_options(){
     96        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     97            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     98            return;
     99        }
     100
    86101        global $wpdb;
    87102        $enable_lazyload=get_option('smack_lazyload_enable');
     
    102117
    103118    public function get_page_count(){
     119        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     120            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     121            return;
     122        }
     123
    104124        global $wpdb;
    105125        $totalPage=get_option('total_page_count');
     
    230250
    231251    public function delete_orphan_images(){
     252        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     253            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     254            return;
     255        }
     256
    232257        if(isset($_POST)){
    233258            global $wpdb;
     
    243268
    244269    public function delete_all_orphan_images(){
     270        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     271            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     272            return;
     273        }
     274
    245275        global $wpdb;
    246276        $get_orphan_images= $wpdb->get_results("SELECT
  • all-in-one-performance-accelerator/trunk/minify/minify-css.php

    r3005752 r3319745  
    112112
    113113    public function get_file_selected_tab(){
     114        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     115            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     116            return;
     117        }
     118
    114119        $tab = sanitize_text_field($_POST['tab']);
    115120        if($tab === 'undefined'){
     
    156161   
    157162    public function minify_options(){
     163        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     164            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     165            return;
     166        }
     167
    158168        if($_POST){
    159169            $need_to_preload = false;
     
    222232
    223233    public function send_minify_options(){
    224        
     234        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     235            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     236            return;
     237        }
     238
    225239        $result['minify_html']=get_option('smack_minify_html')=== 'true'? true: false;
    226240        $result['disable_google_fonts']=get_option('smack_google_fonts')=== 'true'? true: false;
     
    263277
    264278    public function check_gzip_enabled(){
     279        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     280            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     281            return;
     282        }
     283
    265284        if($_POST){
    266285           
  • all-in-one-performance-accelerator/trunk/profiler/profiler.php

    r3005752 r3319745  
    6565   
    6666    public function get_profile_selected_tab(){
     67        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     68            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     69            return;
     70        }
     71
    6772        $tab = sanitize_text_field($_POST['tab']);
    6873        if($tab === 'undefined'){
     
    8590
    8691    public function send_debug_value(){
     92        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     93            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     94            return;
     95        }
     96
    8797        $debug_value = sanitize_text_field($_POST['value']);
    8898        update_option('debug_value',$debug_value);
     
    93103   
    94104    public function get_hardware_details(){
     105        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     106            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     107            return;
     108        }
     109
    95110        $cpu_data=$this->get_cpu_data();
    96111        $ram_total=$this->get_ram_total();
     
    222237
    223238    public static function get_scanning_pages() {
     239        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     240            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     241            return;
     242        }
     243
    224244        $filename = sanitize_file_name( basename( $_POST['scanName'] ) );
    225245        define( 'PROFILER_PATH', WP_CONTENT_DIR . '/cache/profiles' );
     
    290310
    291311    public function stop_scanning_pages(){
     312        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     313            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     314            return;
     315        }
     316
    292317        $stop_profiling=sanitize_text_field($_POST['stop_profiling']);
    293318        if($stop_profiling =='true'){
     
    306331   
    307332    public function get_latest_profiles(){
     333        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     334            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     335            return;
     336        }
     337
    308338        self::$scan = $this->get_latest_profile();
    309339       
     
    410440
    411441    public function send_email_report_content(){
     442        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     443            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     444            return;
     445        }
     446
    412447        $user = wp_get_current_user();
    413448        $response['from']=$user->user_email;
     
    422457
    423458    public function send_email(){
     459        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     460            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     461            return;
     462        }
     463
    424464       
    425465        if($_POST){
     
    444484
    445485    public function get_all_profiles() {
     486        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     487            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     488            return;
     489        }
     490
    446491        $profile_dir = WP_CONTENT_DIR . '/cache/profiles';
    447492        $files          = list_files( $profile_dir );
     
    482527   
    483528    public function clear_debug_log(){
     529        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     530            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     531            return;
     532        }
     533
    484534        update_option( 'debug_log_value', array() );
    485535        $response['success']='true';
     
    489539     
    490540    public function view_scan_details(){
     541        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     542            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     543            return;
     544        }
     545
    491546        if(isset($_POST)){
    492547            $profile_name=sanitize_text_field($_POST['scanName']);
     
    529584
    530585    public function delete_scan_details(){
     586        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     587            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     588            return;
     589        }
     590
    531591        if(isset($_POST)){
    532592            $profile_name=sanitize_text_field($_POST['scanName']);
     
    546606
    547607    public function delete_all_scan_details(){
     608        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     609            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     610            return;
     611        }
     612
    548613        $path=WP_CONTENT_DIR . '/cache/profiles/';
    549614   
     
    565630
    566631    public function download_error_log(){
     632        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     633            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     634            return;
     635        }
    567636
    568637        $log = get_option( 'debug_log_value' );
  • all-in-one-performance-accelerator/trunk/reduce-code/reduce-code.php

    r3005752 r3319745  
    4343
    4444    public function get_asset_selected_tab(){
     45        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     46            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     47            return;
     48        }
     49
    4550        $tab = sanitize_text_field($_POST['tab']);
    4651        if($tab === 'undefined'){
     
    6368
    6469    public function dequeue_styles(){
     70        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     71            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     72            return;
     73        }
     74
    6575        global $wpdb;       
    6676        $dequeue_name = sanitize_text_field($_POST['scriptname']);
     
    109119
    110120    public function get_collect_assets(){
     121        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     122            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     123            return;
     124        }
     125
    111126        $plugin_count = 0;
    112127        $plugin_size = 0;
  • all-in-one-performance-accelerator/trunk/siteinfo/site-recommendations.php

    r3005752 r3319745  
    4747   
    4848    public function get_sitestatus_selected_tab(){
     49        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     50            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     51            return;
     52        }
     53
    4954        $tab = sanitize_text_field($_POST['tab']);
    5055        if($tab === 'undefined'){
     
    6772
    6873    public function get_status_details(){
     74        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     75            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     76            return;
     77        }
     78
    6979        $result['critical_error']=$this->get_all_errors('critical');
    7080        $result['recommended_warnings']=$this->get_all_errors('recommended');
  • all-in-one-performance-accelerator/trunk/siteinfo/siteinfo.php

    r3005752 r3319745  
    4343
    4444    public function get_siteinfo_selected_tab(){
     45        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     46            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     47            return;
     48        }
     49
    4550        // require_once('../Query-moniter/queryInfo.php');
    4651        require_once(__DIR__ . '/../Query-moniter/queryInfo.php');
     
    6671
    6772    public function get_site_info(){
     73        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     74            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     75            return;
     76        }
     77
    6878        $wordpress_info=$this->get_wordpress_info();
    6979        $server_info=$this->get_server_info();
  • all-in-one-performance-accelerator/trunk/tools/download-settings.php

    r2840972 r3319745  
    3737   
    3838    public function doHooks(){
     39
    3940        add_action('wp_ajax_get_json_details', array($this,'send_json_details'));
    4041        add_action('wp_ajax_send_json_file', array($this,'get_json_details'));
     
    4647   
    4748    public function get_tools_selected_tab(){
     49        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     50            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     51            return;
     52        }
     53
    4854        $tab = sanitize_text_field($_POST['tab']);
    4955        if($tab === 'undefined'){
     
    6672
    6773    public function get_optimized_details(){
     74        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     75            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     76            return;
     77        }
     78
    6879        $enable_lazyload=get_option('smack_lazyload_enable');
    6980       $result['combine_css']=get_option('smack_combine_css')=== 'true'? true: false;
     
    7990   
    8091   public function send_json_details(){
     92    if (!is_user_logged_in() || !current_user_can('manage_options')) {
     93            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     94            return;
     95        }
     96
    8197    @wp_mkdir_p(WP_CONTENT_DIR . '/cache/backup-json',0755);
    8298    $enable_lazyload=get_option('smack_lazyload_enable');
     
    167183   
    168184    public function get_json_details(){
    169        
     185       if (!is_user_logged_in() || !current_user_can('manage_options')) {
     186            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     187            return;
     188        }
     189
    170190        if(isset($_POST)){
    171191           
     
    311331   
    312332    public function drop_option_details(){
     333        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     334            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     335            return;
     336        }
     337
    313338        if(isset($_POST)){
    314339            $drop_table_option = sanitize_text_field($_POST['drop_options_table']);
     
    321346
    322347    public function set_option_details(){
     348        if (!is_user_logged_in() || !current_user_can('manage_options')) {
     349            wp_send_json_error(['message' => 'Unauthorized access.'], 403);
     350            return;
     351        }
     352
    323353        $result['drop_options_table']=get_option('smack_drop_options')=== 'true'? true: false; 
    324354        $result['success'] = true;
Note: See TracChangeset for help on using the changeset viewer.