Changeset 3482178
- Timestamp:
- 03/13/2026 05:24:42 PM (2 weeks ago)
- Location:
- rc-site-manager-optimization/trunk
- Files:
-
- 2 added
- 11 edited
-
assets/scripts/script.js (modified) (1 diff)
-
assets/styles/style.css (modified) (1 diff)
-
crons/index.php (modified) (1 diff)
-
crons/pagespeed.php (added)
-
includes/database.php (modified) (17 diffs)
-
includes/functions/index.php (modified) (1 diff)
-
includes/functions/pagespeed.php (added)
-
plugins/wp_rocket/tab_used_css.php (modified) (1 diff)
-
plugins/wp_rocket/wp_rocket_function.php (modified) (3 diffs)
-
rc-site-manager-optimization.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
-
top_url/index.php (modified) (1 diff)
-
top_url/top_url_function.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rc-site-manager-optimization/trunk/assets/scripts/script.js
r3477320 r3482178 863 863 }); 864 864 }); 865 }); 866 867 868 jQuery(function ($) { 869 870 // ─── PageSpeed Modal ────────────────────────────────────────────────────────── 871 872 $(document).on('click', '.rc_sm_ps_tab', function () { 873 const $tab = $(this); 874 const target = $tab.data('tab'); 875 $tab.siblings().removeClass('rc_sm_ps_tab_active'); 876 $tab.addClass('rc_sm_ps_tab_active'); 877 $tab.closest('.rc_sm_modal_content').find('.rc_sm_ps_tab_content').hide(); 878 $tab.closest('.rc_sm_modal_content').find('.rc_sm_ps_tab_content[data-tab="' + target + '"]').show(); 879 }); 880 881 $(document).on('click', '.rc_sm_modal_pagespeed', function () { 882 const url = $(this).data('url'); 883 if (!url) return; 884 885 const psTitle = (typeof rc_sm_ros_localized !== 'undefined' && rc_sm_ros_localized.i18n && rc_sm_ros_localized.i18n.rc_sm_ros_text_pagespeed) 886 ? rc_sm_ros_localized.i18n.rc_sm_ros_text_pagespeed : 'Page Speed'; 887 888 $('.rc_sm_modal_title').text(psTitle); 889 $('.rc_sm_modal_content').html('<div class="rc_sm_loader_modal"></div>'); 890 $('#rc_sm_modal_record').fadeIn(200); 891 892 $.post(rc_sm_ajax.ajax_url, { 893 action: 'rc_sm_pagespeed_modal', 894 nonce: rc_sm_ajax.nonce, 895 url: url 896 }, function (res) { 897 if (res.success) { 898 $('.rc_sm_modal_content').html(res.data); 899 } else { 900 $('.rc_sm_modal_content').html('<p class="rc_sm_color_error">' + (res.data || 'Error') + '</p>'); 901 } 902 }).fail(function () { 903 $('.rc_sm_modal_content').html('<p class="rc_sm_color_error">Server error.</p>'); 904 }); 905 }); 906 865 907 }); 866 908 -
rc-site-manager-optimization/trunk/assets/styles/style.css
r3479301 r3482178 1212 1212 border-color: #333 !important; 1213 1213 } 1214 1215 /* ─── PageSpeed ────────────────────────────────────────────────────────────── */ 1216 1217 .rc_sm_pagespeed_score { 1218 display: inline-flex; 1219 align-items: center; 1220 justify-content: center; 1221 width: 36px; 1222 height: 36px; 1223 border-radius: 50%; 1224 border: 2px solid currentColor; 1225 font-weight: bold; 1226 background: #ffffff; 1227 cursor: default; 1228 } 1229 1230 .rc_sm_modal_pagespeed.rc_sm_pagespeed_score { 1231 cursor: pointer; 1232 } 1233 1234 /* ─── PageSpeed Modal ──────────────────────────────────────────────────────── */ 1235 1236 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_tabs { 1237 display: flex; 1238 gap: 4px; 1239 margin-bottom: 20px; 1240 justify-content: center; 1241 } 1242 1243 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_tab { 1244 padding: 6px 18px; 1245 background: none; 1246 border: none; 1247 border-bottom: 2px solid transparent; 1248 margin-bottom: -2px; 1249 cursor: pointer; 1250 font-size: 20px; 1251 } 1252 1253 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_tab_active { 1254 border-bottom-color: var(--rc-uv-color-primary); 1255 color: var(--rc-uv-color-primary); 1256 } 1257 1258 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_scores { 1259 display: flex; 1260 gap: 24px; 1261 justify-content: center; 1262 padding: 20px 0; 1263 border-bottom: 1px solid #eee; 1264 margin-bottom: 20px; 1265 font-weight: normal; 1266 } 1267 1268 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_score_item { 1269 display: flex; 1270 flex-direction: column; 1271 align-items: center; 1272 gap: 8px; 1273 } 1274 1275 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_score_label { 1276 text-align: center; 1277 } 1278 1279 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_vitals { 1280 display: grid; 1281 grid-template-columns: 1fr 1fr; 1282 gap: 12px 24px; 1283 padding: 0 8px; 1284 margin-left: 25%; 1285 margin-right: 15%; 1286 } 1287 1288 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_vital_item { 1289 display: flex; 1290 flex-direction: column; 1291 gap: 2px; 1292 } 1293 1294 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_vital_label { 1295 margin: 0; 1296 } 1297 1298 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_vital_value { 1299 margin-top: 10px; 1300 } 1301 1302 #rc_sm_modal_record.rc_sm_modal .rc_sm_ps_history_title { 1303 margin-top: 24px; 1304 } -
rc-site-manager-optimization/trunk/crons/index.php
r3438010 r3482178 5 5 include 'wp_rocket_rucss_clean.php'; 6 6 include 'wp_rocket_cache_rules.php'; 7 include 'pagespeed.php'; 7 8 include 'media_trash.php'; 8 9 -
rc-site-manager-optimization/trunk/includes/database.php
r3472200 r3482178 7 7 $charset_collate = $wpdb->get_charset_collate(); 8 8 $tables = []; 9 10 // 📌 Tabella: rc_sm_tb_control 9 11 10 $rc_sm_check_table_control = RC_SM_TABLE_CONTROL; 12 11 $tables[$rc_sm_check_table_control] = " … … 22 21 ) $charset_collate; 23 22 "; 24 25 // 📌 Tabella: rc_sm_tb_settings 23 26 24 $rc_sm_settings_table = RC_SM_TABLE_SETTINGS; 27 25 $tables[$rc_sm_settings_table] = " … … 35 33 "; 36 34 37 // 📌 Tabella: rc_sm_tb_premium_ultra_speed38 35 $rc_sm_premium_ultra_speed_table = RC_SM_TABLE_PREMIUM_ULTRA_SPEED; 39 36 $tables[$rc_sm_premium_ultra_speed_table] = " … … 48 45 "; 49 46 50 // 📌 Tabella: rc_sm_tb_premium_custom_software51 47 $rc_sm_premium_custom_software_table = RC_SM_TABLE_PREMIUM_CUSTOM_SOFTWARE; 52 48 $tables[$rc_sm_premium_custom_software_table] = " … … 61 57 ) $charset_collate; 62 58 "; 63 64 // 📌 Tabella: rc_sm_tb_agency_control (solo per Rocket Comunicazione) 59 65 60 if (RC_SM_SITE_URL === 'https://www.rocketcomunicazione.com') { 66 61 $rc_sm_agency_control_table = RC_SM_TABLE_AGENCY_CONTROL; … … 79 74 "; 80 75 } 81 76 77 $rc_sm_pagespeed_table = RC_SM_TABLE_PAGESPEED; 78 $tables[$rc_sm_pagespeed_table] = " 79 CREATE TABLE {$rc_sm_pagespeed_table} ( 80 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, 81 url TEXT NOT NULL, 82 is_external TINYINT(1) NOT NULL DEFAULT 0, 83 history LONGTEXT NULL, 84 last_check DATETIME NULL, 85 date DATETIME DEFAULT CURRENT_TIMESTAMP, 86 PRIMARY KEY (id) 87 ) $charset_collate; 88 "; 89 82 90 require_once ABSPATH . 'wp-admin/includes/upgrade.php'; 83 91 foreach ($tables as $table_name => $create_sql) { … … 98 106 $table_name = esc_sql(RC_SM_TABLE_SETTINGS); 99 107 100 // Recupera dati esistenti101 108 $existing_data = rc_sm_tb_settings_get_value('user_permissions'); 102 109 103 110 if (empty($existing_data)) { 104 // Non esiste: crea tutti i default105 111 $defaults = array(); 106 112 foreach ($sections as $section) { … … 110 116 ); 111 117 } 112 113 // Add default anonymous statistics114 118 $defaults['anonim_statistics'] = 'on'; 115 119 116 120 $wpdb->insert($table_name, array( 117 121 'action' => 'user_permissions', 118 'value' => wp_json_encode($defaults),119 'date' => current_time('mysql')122 'value' => wp_json_encode($defaults), 123 'date' => current_time('mysql') 120 124 )); 121 125 } else { 122 // Esiste: verifica sezioni mancanti123 126 $updated = false; 124 127 foreach ($sections as $section) { … … 131 134 } 132 135 } 133 134 // Check if anonim_statistics is missing135 136 if (!isset($existing_data['anonim_statistics'])) { 136 137 $existing_data['anonim_statistics'] = 'on'; 137 138 $updated = true; 138 139 } 139 140 140 if ($updated) { 141 $wpdb->update($table_name, 141 $wpdb->update($table_name, 142 142 array('value' => wp_json_encode($existing_data)), 143 143 array('action' => 'user_permissions') … … 153 153 $table_name = esc_sql(RC_SM_TABLE_PREMIUM_ULTRA_SPEED); 154 154 155 $control = 'settings_wp_rocket';155 $control = 'settings_wp_rocket'; 156 156 $existing_data = rc_sm_ultra_speed_get_value($control); 157 157 … … 159 159 $defaults = array( 160 160 'preload_change_parameters' => 'on', 161 'rucss_change_parameters' => 'on'161 'rucss_change_parameters' => 'on' 162 162 ); 163 164 163 $wpdb->insert($table_name, array( 165 164 'control' => $control, 166 'value' => wp_json_encode($defaults),167 'date' => current_time('mysql')165 'value' => wp_json_encode($defaults), 166 'date' => current_time('mysql') 168 167 )); 169 168 } … … 176 175 177 176 $result = $wpdb->get_var($wpdb->prepare( 178 "SELECT value FROM $table_name WHERE action = %s", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Safe: table name escaped with esc_sql(), user input sanitized with placeholders via rc_security_* functions177 "SELECT value FROM $table_name WHERE action = %s", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 179 178 $action 180 179 )); … … 201 200 202 201 $result = $wpdb->get_var($wpdb->prepare( 203 "SELECT value FROM $table_name WHERE control = %s", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Safe: table name escaped with esc_sql(), user input sanitized with placeholders202 "SELECT value FROM $table_name WHERE control = %s", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 204 203 $control 205 204 )); … … 217 216 return $wpdb->insert($table_name, array( 218 217 'control' => $control, 219 'value' => wp_json_encode($value),220 'date' => current_time('mysql')218 'value' => wp_json_encode($value), 219 'date' => current_time('mysql') 221 220 )) !== false; 222 221 } else { 223 return $wpdb->update($table_name, 222 return $wpdb->update($table_name, 224 223 array( 225 224 'value' => wp_json_encode($value), 226 'date' => current_time('mysql')225 'date' => current_time('mysql') 227 226 ), 228 227 array('control' => $control) … … 232 231 233 232 234 // ─── Custom Software (tabella condivisa per tutti i moduli)───────────────────233 // ─── Custom Software ────────────────────────────────────────────────────────── 235 234 236 235 function rc_sm_custom_software_get_value($software, $control) { … … 239 238 240 239 $result = $wpdb->get_var($wpdb->prepare( 241 "SELECT value FROM $table_name WHERE software = %s AND control = %s", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Safe: table name escaped with esc_sql()240 "SELECT value FROM $table_name WHERE software = %s AND control = %s", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 242 241 $software, 243 242 $control … … 273 272 } 274 273 } 274 275 276 // ─── PageSpeed ──────────────────────────────────────────────────────────────── 277 278 function rc_sm_pagespeed_get_all() { 279 global $wpdb; 280 $table_name = esc_sql(RC_SM_TABLE_PAGESPEED); 281 282 $results = $wpdb->get_results( 283 "SELECT * FROM {$table_name} ORDER BY date DESC" // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 284 ); 285 286 if (!$results) return []; 287 288 foreach ($results as &$row) { 289 $row->history = $row->history ? json_decode($row->history, true) : []; 290 } 291 292 return $results; 293 } 294 295 function rc_sm_pagespeed_get_by_id($id) { 296 global $wpdb; 297 $table_name = esc_sql(RC_SM_TABLE_PAGESPEED); 298 299 $result = $wpdb->get_row($wpdb->prepare( 300 "SELECT * FROM {$table_name} WHERE id = %d", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 301 $id 302 )); 303 304 if (!$result) return null; 305 306 $result->history = $result->history ? json_decode($result->history, true) : []; 307 308 return $result; 309 } 310 311 function rc_sm_pagespeed_insert($url, $is_external = 0) { 312 global $wpdb; 313 $table_name = esc_sql(RC_SM_TABLE_PAGESPEED); 314 315 return $wpdb->insert( 316 $table_name, 317 [ 318 'url' => esc_url_raw($url), 319 'is_external' => (int) $is_external, 320 'history' => wp_json_encode([]), 321 'date' => current_time('mysql'), 322 ], 323 ['%s', '%d', '%s', '%s'] 324 ); 325 } 326 327 function rc_sm_pagespeed_delete($id) { 328 global $wpdb; 329 $table_name = esc_sql(RC_SM_TABLE_PAGESPEED); 330 331 return $wpdb->delete( 332 $table_name, 333 ['id' => (int) $id], 334 ['%d'] 335 ); 336 } 337 338 function rc_sm_pagespeed_save_history($id, $data) { 339 global $wpdb; 340 $table_name = esc_sql(RC_SM_TABLE_PAGESPEED); 341 342 $record = rc_sm_pagespeed_get_by_id($id); 343 if (!$record) return false; 344 345 $history = is_array($record->history) ? $record->history : []; 346 347 $entry = array_merge( 348 ['date' => current_time('mysql')], 349 $data 350 ); 351 352 $history[] = $entry; 353 $history = array_slice($history, -10); // mantieni solo ultimi 10 354 355 return $wpdb->update( 356 $table_name, 357 [ 358 'history' => wp_json_encode($history), 359 'last_check' => current_time('mysql'), 360 ], 361 ['id' => (int) $id], 362 ['%s', '%s'], 363 ['%d'] 364 ); 365 } -
rc-site-manager-optimization/trunk/includes/functions/index.php
r3438010 r3482178 6 6 include 'wp_rocket_cache_rules.php'; 7 7 include 'tracker.php'; 8 include 'pagespeed.php'; 8 9 include 'premium.php'; -
rc-site-manager-optimization/trunk/plugins/wp_rocket/tab_used_css.php
r3438010 r3482178 84 84 'status' => ['label' => __('Status', 'rc-site-manager-optimization'), 'class' => 'rc_sm_width_1'], 85 85 'error_message' => ['label' => __('Error', 'rc-site-manager-optimization'), 'class' => 'rc_sm_width_2'], 86 'pagespeed' => ['label' => 'Page Speed', 'class' => 'rc_sm_width_1'], 86 87 'modified' => ['label' => __('Date', 'rc-site-manager-optimization'), 'class' => 'rc_sm_width_1'], 87 88 'azione' => ['label' => __('Action', 'rc-site-manager-optimization'), 'class' => 'rc_sm_width_1'], 88 89 ]; 89 90 90 $non_sortable_columns = ['azione', 'error_message' ];91 $non_sortable_columns = ['azione', 'error_message', 'pagespeed']; 91 92 92 93 foreach ($columns as $key => $column) { -
rc-site-manager-optimization/trunk/plugins/wp_rocket/wp_rocket_function.php
r3479301 r3482178 54 54 55 55 if (empty($results)) { 56 echo "<tr><td colspan=' 7'>" . esc_html__('No results found.', 'rc-site-manager-optimization') . "</td></tr>";56 echo "<tr><td colspan='8'>" . esc_html__('No results found.', 'rc-site-manager-optimization') . "</td></tr>"; 57 57 } else { 58 58 foreach ($results as $row) { … … 77 77 $date_txt = esc_html($row->modified); 78 78 79 // Retrieve last PageSpeed data 80 $ps_html = rc_sm_pagespeed_performance_html($row->url, $row->is_mobile); 81 79 82 echo '<tr>'; 80 83 echo '<td>' . esc_html($url_id) . '</td>'; … … 85 88 echo '<td><span class="' . esc_attr('rc_sm_badge ' . $class) . '">' . esc_html($row->status) . '</span></td>'; 86 89 echo '<td>' . esc_html($error_txt) . '</td>'; 90 echo '<td>' . wp_kses_post($ps_html) . '</td>'; 87 91 echo '<td>' . esc_html($date_txt) . '</td>'; 88 92 echo '<td>'; -
rc-site-manager-optimization/trunk/rc-site-manager-optimization.php
r3480548 r3482178 3 3 * Plugin Name: RC Site Manager & Optimization 4 4 * Description: All-in-one Wordpress manager: control WooCommerce, SEO, caching, media, and multilingual tools from one dashboard. 5 * Version: 2.4. 25 * Version: 2.4.3 6 6 * Author: Rocket Comunicazione 7 7 * Author URI: https://www.rocketcomunicazione.com … … 18 18 19 19 20 define('RC_SM_PLUGIN_VERSION', '2.4. 2');20 define('RC_SM_PLUGIN_VERSION', '2.4.3'); 21 21 22 22 define( 'RC_SM_SITE_URL', home_url() ); … … 51 51 define('RC_SM_TABLE_PREMIUM_ULTRA_SPEED', $wpdb->prefix . 'rc_sm_tb_premium_ultra_speed'); 52 52 define('RC_SM_TABLE_PREMIUM_CUSTOM_SOFTWARE', $wpdb->prefix . 'rc_sm_tb_premium_custom_software'); 53 define('RC_SM_TABLE_PAGESPEED', $wpdb->prefix . 'rc_sm_tb_pagespeed'); 54 define('RC_SM_PAGESPEED_API_KEY', 'AIzaSyAou3gnyHfrzOQeXNin-vG7KGDXLRmHxT4'); 53 55 54 56 if (RC_SM_SITE_URL === 'https://www.rocketcomunicazione.com') { … … 311 313 'rc_sm_ros_text_help_not_available' => __('Help not available.', 'rc-site-manager-optimization'), 312 314 'rc_sm_ros_text_history' => __('History', 'rc-site-manager-optimization'), 315 'rc_sm_ros_text_pagespeed' => __('Page Speed', 'rc-site-manager-optimization'), 313 316 ) 314 317 )); -
rc-site-manager-optimization/trunk/readme.txt
r3480548 r3482178 5 5 Tested up to: 6.9 6 6 Requires PHP: 8.1 7 Stable tag: 2.4. 27 Stable tag: 2.4.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 160 160 == Changelog == 161 161 162 163 = 2.4.3 - March 13, 2026 = 164 * Minor bug fixes and improvement 162 165 163 166 = 2.4.2 - March 11, 2026 = … … 304 307 == Upgrade Notice == 305 308 309 = 2.4.3 - March 13, 2026 = 310 Minor bug fixes. 311 306 312 = 2.4.2 - March 11, 2026 = 307 313 Minor bug fixes. -
rc-site-manager-optimization/trunk/top_url/index.php
r3438010 r3482178 108 108 'info' => ['label' => __('Informations', 'rc-site-manager-optimization') . ' (post_id)', 'class' => 'rc_sm_width_2'], 109 109 'rucss' => ['label' => 'WP-Rocket / ' . __('Used CSS', 'rc-site-manager-optimization'), 'class' => 'rc_sm_width_2'], 110 'pagespeed' => ['label' => 'Page Speed', 'class' => 'rc_sm_width_2'], 110 111 'azione' => ['label' => __('Action', 'rc-site-manager-optimization'), 'class' => 'rc_sm_width_2'], 111 112 ]; 112 113 113 $non_sortable_columns = ['id', 'info', 'rucss', ' azione'];114 $non_sortable_columns = ['id', 'info', 'rucss', 'pagespeed', 'azione']; 114 115 115 116 foreach ($columns as $key => $column) { -
rc-site-manager-optimization/trunk/top_url/top_url_function.php
r3438010 r3482178 30 30 } 31 31 32 // Count total results - FIXED32 // Count total results 33 33 if ($search) { 34 34 $count = (int) $wpdb->get_var( … … 49 49 $pages = (int) ceil($count / $per_page); 50 50 51 // Retrieve paginated results - FIXED51 // Retrieve paginated results 52 52 if ($search) { 53 53 $results = $wpdb->get_results( … … 87 87 : "<span class='rc_sm_bold rc_sm_color_warning'>" . esc_html($status) . "</span>"; 88 88 89 // Retrieve data from WP Rocket table - FIXED89 // Retrieve data from WP Rocket table 90 90 $rucss_table = $wpdb->prefix . 'wpr_rucss_used_css'; 91 91 $rucss_rows = $wpdb->get_results( … … 109 109 return "<span class='rc_sm_bold rc_sm_color_warning'>" . esc_html($status) . "</span>"; 110 110 }; 111 112 // Retrieve last PageSpeed data 113 $ps_html = rc_sm_pagespeed_performance_html($url); 111 114 112 115 $url_view = rc_sm_url_slash($url); … … 120 123 echo '<td>' . esc_html('ID: ') . esc_html($post_id) . '<br>' . esc_html(__('Status:', 'rc-site-manager-optimization')) . wp_kses_post(' ' . $status_html) . '</td>'; 121 124 echo '<td>' . esc_html('Desktop: ') . wp_kses_post($label($rucss_map[0])) . '<br>' . esc_html('Mobile: ') . wp_kses_post($label($rucss_map[1])) . '</td>'; 125 echo '<td>' . wp_kses_post($ps_html) . '</td>'; 122 126 echo "<td><button class='rc_sm_modal_confirm rc_sm_button rc_sm_bg_warning' 123 127 data-id='" . esc_attr($row->id) . "' … … 146 150 147 151 148 149 150 151 152 152 function rc_sm_url_new_add() { 153 153 global $wpdb; … … 171 171 $table = RC_SM_TABLE_CONTROL; 172 172 173 // Check for duplicates - FIXED173 // Check for duplicates 174 174 $exists = $wpdb->get_var( 175 175 $wpdb->prepare( … … 187 187 188 188 if (!$post_id) { 189 // Fallback on GUID - FIXED189 // Fallback on GUID 190 190 $post_id = $wpdb->get_var( 191 191 $wpdb->prepare( … … 208 208 'action' => 'top_url', 209 209 ], 210 [ 211 '%d', 212 '%s', 213 '%s', 214 ] 210 ['%d', '%s', '%s'] 215 211 ); 216 212 217 213 if ($inserted) { 214 rc_sm_pagespeed_sync_add($clean_url); 218 215 return '<div class="rc_sm_notice_success">' . esc_html(__('URL added successfully.', 'rc-site-manager-optimization')) . '</div>'; 219 216 } … … 221 218 return '<div class="rc_sm_notice_error">' . esc_html(__('Error during insertion.', 'rc-site-manager-optimization')) . '</div>'; 222 219 } 223 224 225 220 226 221 … … 239 234 } 240 235 241 $table = RC_SM_TABLE_CONTROL; 236 $table = RC_SM_TABLE_CONTROL; 237 238 // Recupera URL prima di cancellare 239 $url = $wpdb->get_var( 240 $wpdb->prepare( 241 "SELECT url FROM " . esc_sql($table) . " WHERE id = %d", 242 $id 243 ) 244 ); 245 242 246 $deleted = $wpdb->delete( 243 247 $table, … … 247 251 248 252 if ($deleted) { 253 if ($url) { 254 rc_sm_pagespeed_sync_delete($url); 255 } 249 256 wp_send_json_success(['msg' => __('URL excluded successfully.', 'rc-site-manager-optimization')]); 250 257 } else {
Note: See TracChangeset
for help on using the changeset viewer.