Changeset 3319383
- Timestamp:
- 06/29/2025 09:43:53 AM (9 months ago)
- Location:
- wp-stats-manager
- Files:
-
- 2 edited
-
tags/7.9/includes/wsm_init.php (modified) (5 diffs)
-
trunk/includes/wsm_init.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-stats-manager/tags/7.9/includes/wsm_init.php
r3319378 r3319383 1375 1375 static function wsm_viewError() 1376 1376 { 1377 $action_ = isset($_GET['action']) ? $_GET['action'] : ''; 1378 $page_ = isset($_GET['page']) ? $_GET['page'] : ''; 1379 1380 if($page_ == 'wsm_traffic' or $action_ == 'fixed_db_issue') 1381 { 1377 1382 global $missing_views; 1378 1383 ?> … … 1385 1390 <?php 1386 1391 } else { 1387 if ($missing_views) { 1388 1389 $dbUser = defined('DB_USER') ? DB_USER : 'UNKNOWN_USER'; 1392 1393 $dbUser = defined('DB_USER') ? DB_USER : 'UNKNOWN_USER'; 1390 1394 $dbName = defined('DB_NAME') ? DB_NAME : 'UNKNOWN_DB'; 1391 1395 … … 1401 1405 echo '<p><strong>Note:</strong> Only a server administrator or someone with GRANT permissions can apply this fix.</p>'; 1402 1406 echo '</div>'; 1407 1408 if ($missing_views) { 1403 1409 ?> 1404 1410 <p><?php echo sprintf(__('There is still %d tables are missing. Please click on below button to fix the issue.', 'wphr'), esc_html($missing_views)); ?></p> … … 1409 1415 1410 1416 1411 $dbUser = defined('DB_USER') ? DB_USER : 'UNKNOWN_USER'; 1412 $dbName = defined('DB_NAME') ? DB_NAME : 'UNKNOWN_DB'; 1413 1414 echo '<div style="border:1px solid #e00; padding:15px; background:#fff3f3; color:#a00; font-family:sans-serif; margin-top:20px;">'; 1415 echo '<h3>⚠️ Database Privileges Issue</h3>'; 1416 echo '<p>Your current database user <strong>' . esc_html($dbUser) . '</strong> does not have permission to create views.</p>'; 1417 echo '<p>This is required by the plugin or feature you are trying to use. To resolve this issue, you have two options:</p>'; 1418 echo '<ol>'; 1419 echo '<li><strong>Recommended:</strong> Ask your hosting provider to run the following SQL command:</li>'; 1420 echo '<pre style="background:#f9f9f9; padding:10px; border:1px dashed #ccc;">GRANT CREATE VIEW, SHOW VIEW ON `' . esc_html($dbName) . '`.* TO \'' . esc_html($dbUser) . '\'@\'localhost\';</pre>'; 1421 echo '<li>Alternatively, switch to a MySQL user that already has <code>CREATE VIEW</code> privileges.</li>'; 1422 echo '</ol>'; 1423 echo '<p><strong>Note:</strong> Only a server administrator or someone with GRANT permissions can apply this fix.</p>'; 1424 echo '</div>'; 1417 1425 1418 ?> 1426 1419 … … 1434 1427 </div> 1435 1428 <?php 1429 } 1436 1430 } 1437 1431 static function wsm_adminIncludeScripts() -
wp-stats-manager/trunk/includes/wsm_init.php
r3319378 r3319383 1375 1375 static function wsm_viewError() 1376 1376 { 1377 $action_ = isset($_GET['action']) ? $_GET['action'] : ''; 1378 $page_ = isset($_GET['page']) ? $_GET['page'] : ''; 1379 1380 if($page_ == 'wsm_traffic' or $action_ == 'fixed_db_issue') 1381 { 1377 1382 global $missing_views; 1378 1383 ?> … … 1385 1390 <?php 1386 1391 } else { 1387 if ($missing_views) { 1388 1389 $dbUser = defined('DB_USER') ? DB_USER : 'UNKNOWN_USER'; 1392 1393 $dbUser = defined('DB_USER') ? DB_USER : 'UNKNOWN_USER'; 1390 1394 $dbName = defined('DB_NAME') ? DB_NAME : 'UNKNOWN_DB'; 1391 1395 … … 1401 1405 echo '<p><strong>Note:</strong> Only a server administrator or someone with GRANT permissions can apply this fix.</p>'; 1402 1406 echo '</div>'; 1407 1408 if ($missing_views) { 1403 1409 ?> 1404 1410 <p><?php echo sprintf(__('There is still %d tables are missing. Please click on below button to fix the issue.', 'wphr'), esc_html($missing_views)); ?></p> … … 1409 1415 1410 1416 1411 $dbUser = defined('DB_USER') ? DB_USER : 'UNKNOWN_USER'; 1412 $dbName = defined('DB_NAME') ? DB_NAME : 'UNKNOWN_DB'; 1413 1414 echo '<div style="border:1px solid #e00; padding:15px; background:#fff3f3; color:#a00; font-family:sans-serif; margin-top:20px;">'; 1415 echo '<h3>⚠️ Database Privileges Issue</h3>'; 1416 echo '<p>Your current database user <strong>' . esc_html($dbUser) . '</strong> does not have permission to create views.</p>'; 1417 echo '<p>This is required by the plugin or feature you are trying to use. To resolve this issue, you have two options:</p>'; 1418 echo '<ol>'; 1419 echo '<li><strong>Recommended:</strong> Ask your hosting provider to run the following SQL command:</li>'; 1420 echo '<pre style="background:#f9f9f9; padding:10px; border:1px dashed #ccc;">GRANT CREATE VIEW, SHOW VIEW ON `' . esc_html($dbName) . '`.* TO \'' . esc_html($dbUser) . '\'@\'localhost\';</pre>'; 1421 echo '<li>Alternatively, switch to a MySQL user that already has <code>CREATE VIEW</code> privileges.</li>'; 1422 echo '</ol>'; 1423 echo '<p><strong>Note:</strong> Only a server administrator or someone with GRANT permissions can apply this fix.</p>'; 1424 echo '</div>'; 1417 1425 1418 ?> 1426 1419 … … 1434 1427 </div> 1435 1428 <?php 1429 } 1436 1430 } 1437 1431 static function wsm_adminIncludeScripts()
Note: See TracChangeset
for help on using the changeset viewer.