chore(2meet-data-optimizer): address the 2.1 audit notes
- The four public REST routes say why they are public (viewable posts only, show_in_rest fields only, per_page cap, one view per IP per post per hour).
- Admin ternary echoes of literal strings are escaped for their context: esc_attr() in attributes, esc_html() for text; the object-cache badge is an if/else and aria-current is always printed ("false" off the current tab).
- Exceptions in the migration engine and the health cron go to TMDO_Logger instead of error_log().
- Verify: audit greps (ternary echoes 23 → 0, error_log outside the logger 0); dev36 renders 8 admin tabs with the change, no PHP notice, one aria-current="page" each.
- PR: PR-078
This commit is contained in:
@@ -144,13 +144,14 @@ final class TMDO_Entity_Migration_Engine {
|
||||
}
|
||||
} catch ( \Throwable $e ) {
|
||||
++$stats['errors'];
|
||||
error_log(
|
||||
sprintf(
|
||||
'[UAE Migration] Error %s/%s ID=%d: %s',
|
||||
$entity_type,
|
||||
$group_name,
|
||||
$entity_id,
|
||||
$e->getMessage()
|
||||
TMDO_Logger::error(
|
||||
'migration_engine',
|
||||
'migrate_group',
|
||||
$e->getMessage(),
|
||||
array(
|
||||
'entity_type' => $entity_type,
|
||||
'group' => $group_name,
|
||||
'entity_id' => $entity_id,
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -383,7 +384,16 @@ final class TMDO_Entity_Migration_Engine {
|
||||
++$batch_migrated;
|
||||
}
|
||||
} catch ( \Throwable $e ) {
|
||||
error_log( sprintf( '[UAE Migration Batch] Error %s/%s ID=%d: %s', $entity_type, $group_name, $entity_id, $e->getMessage() ) );
|
||||
TMDO_Logger::error(
|
||||
'migration_engine',
|
||||
'migrate_group_batch',
|
||||
$e->getMessage(),
|
||||
array(
|
||||
'entity_type' => $entity_type,
|
||||
'group' => $group_name,
|
||||
'entity_id' => $entity_id,
|
||||
)
|
||||
);
|
||||
}
|
||||
$last_id = $entity_id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user