PluginProbe
Yatra – Travel Booking & Tour Operator Software / trunk
Yatra – Travel Booking & Tour Operator Software vtrunk
3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 2.0.11 All 82 releases
← All changes | app/Controllers/SampleDataController.php +5 -4 3.0.2.6trunk View file →
@@ -64,13 +64,16 @@
64 64 ]);
65 65 }
66 66
67 67 /**
68 - * Check user permissions
68 + * Sample-data import / cleanup — gated on the settings cap.
69 + * Installing or removing sample content is a one-time setup
70 + * task with the same risk profile as other settings changes.
71 + * WP admins pass via the Team module's admin-fallback filter.
69 72 */
70 73 public function check_permissions()
71 74 {
72 - return current_user_can('manage_options');
75 + return current_user_can('yatra_manage_settings');
73 76 }
74 77
75 78 /**
76 79 * Handle import actions from admin forms
@@ -193,9 +196,8 @@
193 196 'message' => $result['message'] ?? __('Import failed.', 'yatra')
194 197 ];
195 198 }
196 199 } catch (\Exception $e) {
197 - error_log('Yatra Sample Data Import Error: ' . $e->getMessage());
198 200 return [
199 201 'success' => false,
200 202 'message' => __('An error occurred during import. Please check the error logs.', 'yatra')
201 203 ];
@@ -228,9 +230,8 @@
228 230 'message' => $result['message'] ?? __('Cleanup failed.', 'yatra')
229 231 ];
230 232 }
231 233 } catch (\Exception $e) {
232 - error_log('Yatra Sample Data Cleanup Error: ' . $e->getMessage());
233 234 return [
234 235 'success' => false,
235 236 'message' => __('An error occurred during cleanup. Please check the error logs.', 'yatra')
236 237 ];