| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/prosvasi/wp-content/plugins/wp-statistics/src/Traits/ |
Upload File : |
<?php
namespace WP_Statistics\Traits;
use WP_Statistics\Option;
use WP_Statistics\User;
use WP_Statistics\Menus;
/**
* Trait: MigrationAccess
*
* Minimal, stateless check used by migration-related classes to validate the
* access context. It only verifies capability (from the option
* `manage_capability`, defaulting to `manage_options`) and that the current
* admin page belongs to the WP Statistics plugin.
*
* Note: Nonce/CSRF validation and other context rules should be handled
* separately (e.g., in controllers or managers) to keep this trait focused.
*/
trait MigrationAccess
{
/**
* True if the current request is allowed to run migration operations.
*
* @return bool
*/
protected function isValidContext()
{
if (! User::checkUserCapability(Option::get('manage_capability', 'manage_options'))) {
return false;
}
return Menus::in_plugin_page();
}
}