Plugin Directory

Changeset 3318243


Ignore:
Timestamp:
06/26/2025 12:22:36 PM (9 months ago)
Author:
aryans
Message:
  • New feature memory limit suggestion
  • Optimized timeout events
  • Bug fixes
Location:
site-suggest
Files:
32 added
8 edited

Legend:

Unmodified
Added
Removed
  • site-suggest/trunk/app/ajax-controller.php

    r3316726 r3318243  
    119119            $resp = [];
    120120            if (isset($_POST['_']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_'])), 'stsgt_nonce')) {
    121                 update_option('stsgt_real_cron_obsv_started', false);
    122                 update_option('stsgt_real_cron_obsv_post_page', 1);
    123                 update_option('stsgt_real_cron_obsv_checklists', []);
    124                 update_option('stsgt_real_cron_obsv_post_ids', []);
    125                 update_option('stsgt_cron_progress', 0);
    126                 update_option('stsgt_cron_total_progress', 0);
    127                 update_option('stsgt_checked_schema_markups', []);
     121                $checkname = isset($_POST['checkname']) ? sanitize_text_field(wp_unslash($_POST['checkname'])) : '';
     122                $prev_checklist = get_option('stsgt_real_cron_obsv_checklists', []);
     123                $checkname_index = array_search($checkname, $prev_checklist);
     124                if($checkname_index !== null && isset($prev_checklist[$checkname_index])){
     125                    unset($prev_checklist[$checkname_index]);
     126                }
     127                update_option('stsgt_real_cron_obsv_checklists', $prev_checklist);
     128
     129                if(empty($prev_checklist)){
     130                    update_option('stsgt_real_cron_obsv_started', true);
     131                    update_option('stsgt_real_cron_obsv_post_page', 1);
     132                    update_option('stsgt_real_cron_obsv_post_ids', []);
     133                    update_option('stsgt_cron_progress', 0);
     134                    update_option('stsgt_cron_total_progress', 0);
     135                    update_option('stsgt_checked_schema_markups', []);
     136                }
    128137                $resp = ['status' => 200, 'message' => 'Updated!'];
    129138            } else {
     
    300309                $checklist = isset($_POST['checklist']) ? json_decode(base64_decode(sanitize_text_field(wp_unslash($_POST['checklist']))), true) : [];
    301310                $post_ids = isset($_POST['post_ids']) ? json_decode(base64_decode(sanitize_text_field(wp_unslash($_POST['post_ids']))), true) : [];
    302 
     311                $prev_checklist = get_option('stsgt_real_cron_obsv_checklists', []);
     312
     313                $checklist = array_merge($checklist, $prev_checklist);
     314               
    303315                update_option('stsgt_real_cron_obsv_started', 1);
    304 
    305316                update_option('stsgt_real_cron_obsv_checklists', $checklist);
    306317                update_option('stsgt_real_cron_obsv_post_ids', $post_ids);
     
    675686                update_option('stsgt_cron_progress', $cron_progress);
    676687                $rlcrn_obsv_psts = array_slice($real_cron_obsv_post_ids, ($real_cron_obsv_post_page - 1), 1);
     688
     689                add_filter('http_request_timeout', function (){
     690                    return ceil(floatval(100));
     691                });
    677692
    678693                $resp = [];
     
    10391054                $audit_type = isset($_POST['audit_type']) ? sanitize_text_field(wp_unslash($_POST['audit_type'])) : '';
    10401055
    1041                 $cron_observers = ['http_links', 'h1_checker', 'image_size_checker']; //, 'enabled_reCaptcha'];
     1056                $cron_observers = ['http_links', 'has_broken_links', 'image_size_checker', 'h1_checker']; //, 'enabled_reCaptcha'];
    10421057                $current_cron_observers = get_option('stsgt_cron_observers', []);
    10431058
     
    10571072                    }
    10581073
    1059                     $general_tab_keys =  ['custom_login_url', 'enabled_indexing', 'enabled_SMTP', 'wordpress_version', 'PHP_version', 'PHP_Memory_Limit', 'plugin_security_risk', 'theme', 'ssl_set_up', 'activated_plugins', 'plugin_update', 'enabled_favicon', 'enabled_google_analytics', 'enabled_google_tags', 'has_cookie_banner', 'has_CDNs', 'enabled_reCaptcha', 'lorem_ipsum_checker', 'privacy_policy_page', 'cookie_notice_page'];
     1074                    $general_tab_keys =  ['custom_login_url', 'memory_limit_suggestion', 'enabled_indexing', 'enabled_SMTP', 'wordpress_version', 'PHP_version', 'PHP_Memory_Limit', 'plugin_security_risk', 'theme', 'ssl_set_up', 'activated_plugins', 'plugin_update', 'enabled_favicon', 'enabled_google_analytics', 'enabled_google_tags', 'has_cookie_banner', 'has_CDNs', 'enabled_reCaptcha', 'lorem_ipsum_checker', 'privacy_policy_page', 'cookie_notice_page'];
    10601075                    $performance_tab_keys =  ['desktop_page_speed', 'mobile_page_speed', 'server_response_time', 'accessibility', 'enabled_cache', 'revisions', 'drafts', 'trash', 'spam_comment', 'trash_comment', 'transients', 'Non_webp_images'];
    10611076                    $seo_tab_keys =  ['enabled_seo_plugin', 'admin_username_check', 'html_lang', 'sitemap_exist', 'www_and_non_www_check', 'sitemap_listed_in_robotstxt_file',  'check_canonical_tags', 'check_schema_markup'];
  • site-suggest/trunk/app/cron-controller.php

    r3316726 r3318243  
    2424        public function add_custom_cron_intervals($schedules) {
    2525            $schedules['stsgt_every_sec'] = array(
    26                 'interval' => 60,
     26                'interval' => 1,
    2727                'display'  => esc_html__('Site Suggest Every Sec', 'site-suggest'),
    2828            );
  • site-suggest/trunk/app/info-controller.php

    r3316726 r3318243  
    6565                            $audit_data['custom_login_url'] = $this->check_custom_login_url($this->url);
    6666                            break;
     67                        case 'memory_limit_suggestion':
     68                            $audit_data['memory_limit_suggestion'] = $this->check_memory_limit_suggestion();
     69                            break;
    6770                        case 'PHP_version':
    6871                            $audit_data['PHP_version'] = $this->get_php_version();
     
    202205                    $audit_data['wordpress_version'] = $this->get_wordpress_version($this->url);
    203206                    $audit_data['custom_login_url'] = $this->check_custom_login_url($this->url);
     207                    $audit_data['memory_limit_suggestion'] = $this->check_memory_limit_suggestion();
    204208                    $audit_data['PHP_version'] = $this->get_php_version();
    205209                    $audit_data['PHP_Memory_Limit'] = $this->get_php_memory_limit();
     
    409413        }
    410414
     415        public function ss_convert_to_mb($size) {
     416            $unit = strtoupper(substr($size, -1));
     417            $value = (int) $size;
     418
     419            switch ($unit) {
     420                case 'G': return $value * 1024;
     421                case 'M': return $value;
     422                case 'K': return $value / 1024;
     423                default:  return (int) $size;
     424            }
     425        }
     426
     427        public function check_memory_limit_suggestion(){
     428            $current_limit = ini_get('memory_limit');
     429            $current_mb = $this->ss_convert_to_mb($current_limit);
     430            $recommended = 256;
     431           
     432            $sgst_limit = '';
     433            if($current_mb < $recommended){
     434                $sgst_limit = 'Should increase current memory limit (Current '.$current_mb.')';
     435            }else{
     436                $sgst_limit = 'Current Limit '.$current_mb;
     437            }
     438            return $sgst_limit;
     439        }
     440
    411441        public function get_server_response_time($url, $api_key)
    412442        {
  • site-suggest/trunk/app/main-controller.php

    r3315256 r3318243  
    630630      $all_post_ids = $this->get_all_post_ids();
    631631
    632       $general_check_list =  ['custom_login_url', 'enabled_indexing', 'enabled_SMTP', 'wordpress_version', 'PHP_version', 'PHP_Memory_Limit', 'plugin_security_risk', 'theme', 'ssl_set_up', 'activated_plugins', 'plugin_update', 'enabled_favicon', 'enabled_google_analytics', 'enabled_google_tags', 'has_cookie_banner', 'has_CDNs', 'enabled_reCaptcha', 'lorem_ipsum_checker', 'privacy_policy_page', 'cookie_notice_page'];
     632      $general_check_list =  ['custom_login_url', 'memory_limit_suggestion', 'enabled_indexing', 'enabled_SMTP', 'wordpress_version', 'PHP_version', 'PHP_Memory_Limit', 'plugin_security_risk', 'theme', 'ssl_set_up', 'activated_plugins', 'plugin_update', 'enabled_favicon', 'enabled_google_analytics', 'enabled_google_tags', 'has_cookie_banner', 'has_CDNs', 'enabled_reCaptcha', 'lorem_ipsum_checker', 'privacy_policy_page', 'cookie_notice_page'];
    633633      $performance_check_list =  ['desktop_page_speed', 'mobile_page_speed', 'server_response_time', 'accessibility', 'enabled_cache', 'revisions', 'drafts', 'trash', 'spam_comment', 'trash_comment', 'transients', 'Non_webp_images'];
    634634      $seo_check_list =  ['enabled_seo_plugin', 'admin_username_check', 'html_lang', 'sitemap_exist', 'www_and_non_www_check', 'sitemap_listed_in_robotstxt_file', 'check_canonical_tags', 'check_schema_markup'];
  • site-suggest/trunk/assets/js/script.js

    r3298092 r3318243  
    918918jQuery(document).on('click', '.trigger_single_cron_pause', function () {
    919919  const this_btn = jQuery(this);
     920  const this_check = jQuery(this_btn.parents('li').get(0));
     921  const this_checkname = this_check.attr('stsgt_check_name');
    920922  this_btn.css({
    921923    opacity: 0.6,
     
    927929    data: {
    928930      action: 'reset_scanning_process',
     931      checkname: this_checkname,
    929932      _: stsgt_ajax_object.stsgt_nonce
    930933    }
  • site-suggest/trunk/readme.txt

    r3316726 r3318243  
    44Tested up to:      6.8
    55Requires PHP:      8.0
    6 Stable tag:        1.1.9
     6Stable tag:        1.2.0
    77License:           GPLv2 or later
    88License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    146146== Changelog ==
    147147
     148= 1.2.0 - 2025-06-26 =
     149* New feature memory limit suggestion
     150* Optimized timeout events
     151* Bug fixes
     152
    148153= 1.1.9 - 2025-06-24 =
    149154* Bug fixes
  • site-suggest/trunk/site-suggest.php

    r3316726 r3318243  
    66 * Author: Blurr Studio
    77 * Author URI: https://blurr.it/
    8  * Version: 1.1.9
     8 * Version: 1.2.0
    99 * License: GPL v2 or later
    1010 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3636            define('stsgt_URL', plugin_dir_url(__FILE__));
    3737            define('stsgt_SLUG', 'site-suggest');
    38             define('stsgt_VERSION', '1.1.9');
     38            define('stsgt_VERSION', '1.2.0');
    3939        }
    4040
  • site-suggest/trunk/views/admin/admin-tool-content.php

    r3315158 r3318243  
    139139
    140140                        $is_404_page = false;
    141                         $general_tab_keys =  ['custom_login_url', 'enabled_indexing', 'enabled_SMTP', 'wordpress_version', 'PHP_version', 'PHP_Memory_Limit', 'plugin_security_risk', 'theme', 'ssl_set_up', 'activated_plugins', 'plugin_update', 'enabled_favicon', 'enabled_google_analytics', 'enabled_google_tags', 'has_cookie_banner', 'has_CDNs', 'enabled_reCaptcha', 'lorem_ipsum_checker', 'privacy_policy_page', 'cookie_notice_page'];
     141                        $general_tab_keys =  ['custom_login_url', 'memory_limit_suggestion', 'enabled_indexing', 'enabled_SMTP', 'wordpress_version', 'PHP_version', 'PHP_Memory_Limit', 'plugin_security_risk', 'theme', 'ssl_set_up', 'activated_plugins', 'plugin_update', 'enabled_favicon', 'enabled_google_analytics', 'enabled_google_tags', 'has_cookie_banner', 'has_CDNs', 'enabled_reCaptcha', 'lorem_ipsum_checker', 'privacy_policy_page', 'cookie_notice_page'];
    142142                       
    143143                        $performance_tab_keys =  ['desktop_page_speed', 'mobile_page_speed', 'server_response_time', 'accessibility', 'enabled_cache', 'revisions', 'drafts', 'trash', 'spam_comment', 'trash_comment', 'transients', 'Non_webp_images'];
Note: See TracChangeset for help on using the changeset viewer.