activation(); } ); register_deactivation_hook( __FILE__, static function () use ( $get_child ) { $get_child()->deactivation(); } ); add_action( 'plugins_loaded', function () use ( $get_child ) { if ( ! is_admin() && ! wp_doing_ajax() && ! ( defined( 'REST_REQUEST' ) && REST_REQUEST ) && ! wp_doing_cron() && ! defined( 'WP_CLI' ) && ! isset( $_REQUEST['mainwpsignature'] ) // phpcs:ignore WordPress.Security.NonceVerification ) { // For frontend requests, use lightweight initialization. $get_child()->init_frontend_only(); } else { // For admin, AJAX, REST, cron, CLI, or API requests, use full initialization. $get_child()->init_full(); } } ); $changes_logs_mod_file = MAINWP_CHILD_PLUGIN_DIR . 'modules' . DIRECTORY_SEPARATOR . 'changes-logs' . DIRECTORY_SEPARATOR . 'changes-logs.php'; if ( file_exists( $changes_logs_mod_file ) ) { include_once $changes_logs_mod_file; // NOSONAR - ok. }