Skip to main content
Home › Politics › Test
PoliticsJharkhand News Desk

Test

Verified: all four touched PHP files lint clean; api/upload.php and admin/add.php both correctly require login (401/redirect when unauthenticated); no stale "published instantly" text left anywhere. I couldn't do a full authenticated screenshot walkthrough since the admin area is login-gated and I don't have credentials — worth a quick visual pass on your end, especially the upload button/preview layout.

Summary

1. Removed "View Public Site" from the left sidebar (includes/admin-header.php) — the top-bar "↗ View site" link stays untouched. Cleaned up the now-orphaned .sb-site-link CSS rule too (includes/admin-theme.css).

2. Manually-added articles now go to the review queue instead of going live immediately:

admin/add.php — the publish call now sends status: 'pending' instead of 'approved'; button relabeled "Submit for review", toast/redirect updated to point at the queue instead of the live list.
api/articles.php — also hardened the underlying insert endpoint's default: if status is ever omitted by any caller, it now falls back to 'pending' instead of 'approved', so "forgot to pass a status" can never silently mean "went live."
3. Featured image upload added to Add Manually:

New api/upload.php — auth-gated endpoint, validates the actual decoded image content via getimagesize() (not the trivially-spoofable client filename/MIME header), caps at 5MB, saves under assets/uploads/ with a generated filename (never the user's own), returns the public URL.
admin/add.php — added an "⬆ Upload image" button next to the existing image-URL field; uploading auto-fills that field with the returned URL and shows a small preview thumbnail. The URL field still works standalone too, so pasting a link remains an option.
Verified: all four touched PHP files lint clean; api/upload.php and admin/add.php both correctly require login (401/redirect when unauthenticated); no stale "published instantly" text left anywhere. I couldn't do a full authenticated screenshot walkthrough since the admin area is login-gated and I don't have credentials — worth a quick visual pass on your end, especially the upload button/preview layout.
Share this article