| 1 |
<?php |
| 2 |
|
| 3 |
namespace Cookiez\Modules\Scanner; |
| 4 |
|
| 5 |
use Cookiez\Classes\Module_Base; |
| 6 |
use Cookiez\Modules\Scanner\Database\{ |
| 7 |
Scan_Table, |
| 8 |
Scan_Url_Table, |
| 9 |
}; |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Module `Scanner` |
| 17 |
* Manages cookie scanning functionality and scan data storage |
| 18 |
*/ |
| 19 |
class Module extends Module_Base { |
| 20 |
/** |
| 21 |
* Get module name |
| 22 |
* @return string |
| 23 |
*/ |
| 24 |
public function get_name(): string { |
| 25 |
return 'Scanner'; |
| 26 |
} |
| 27 |
|
| 28 |
public static function component_list(): array { |
| 29 |
return [ |
| 30 |
'Scanner', |
| 31 |
]; |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Get REST route list |
| 36 |
* @return array |
| 37 |
*/ |
| 38 |
public static function routes_list(): array { |
| 39 |
return [ |
| 40 |
'Create_Scan', |
| 41 |
'Get_Scan', |
| 42 |
'Get_Scans', |
| 43 |
'Scan_Webhook', |
| 44 |
'Cancel_Scan', |
| 45 |
]; |
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* Install database tables |
| 50 |
* Called on plugin activation |
| 51 |
*/ |
| 52 |
public static function install_tables(): void { |
| 53 |
Scan_Table::install(); |
| 54 |
Scan_Url_Table::install(); |
| 55 |
} |
| 56 |
|
| 57 |
/** |
| 58 |
* Constructor |
| 59 |
*/ |
| 60 |
public function __construct() { |
| 61 |
$this->install_tables(); |
| 62 |
$this->register_routes(); |
| 63 |
} |
| 64 |
} |
| 65 |
|