• Hi WP Job Manager Team,

    I am writing this public report to expose a critical design flaw in how WP Job Manager handles company logo uploads via the frontend submission form. This issue has bloated our Media Library with over 20,000 duplicate images and is actively magnifying database corruption.

    Please note that this website does NOT use any caching plugins, server caching, or CDNs. This is a pure database and core logic flaw within WP Job Manager.

    THE CORE ISSUE: INFINITE FILE DUPLICATION
    Every single time an employer submits a new job listing and includes their logo, the plugin processes the upload as a brand-new file in the WordPress Media Library. Even if the exact same company has already uploaded the exact same file 40 times before, it creates endless duplicates like logo-1 and logo-2. The architectural flaw is that the submission form logic handles the company logo payload as an isolated file upload instance instead of checking if the Company Entity or User Meta already holds a valid, identical Attachment ID to reuse.

    THE CASCADE FAILURE: ORPHANED METADATA AND BROKEN IMAGES
    When we attempted to manually clean up this mess by deleting just one of the 40 identical logo duplicates from the WordPress Admin Media section, the entire system collapsed for that company. Deleting the attachment physically removes the file and destroys its corresponding ID in wp_posts. However, the database logic ties the metadata of all previous and current job posts for that company in a way that breaking one reference invalidates the rest. Even though 39 identical copies of the logo still exist in the Media Library, they are completely ignored by the plugin logic.

    THE EMPLOYER FRONTEND TRAP: AUTOMATIC BROKEN IMAGES
    When the affected company attempts to post a new job, the frontend form still displays their company logo visually on the screen. The system allows them to complete the submission without any warnings. However, the moment they click Publish, the plugin attempts to map the new job post to the missing or destroyed Attachment ID. The result is that the job listing is published instantly with a corrupted or broken image icon. The employer has no idea during the submission process, and our job board gets flooded with broken image errors.

    THE RISK: SERVER VULNERABILITY (POTENTIAL DoS)
    Leaving this unaddressed means any malicious user could automate job submissions with the same logo file, generating tens of thousands of server files and completely filling up disk space, leading to a server-side Denial of Service due to storage exhaustion.

    EXPECTED RESOLUTION (SMART ASSET MANAGEMENT):
    The plugin must implement a strict verification check during the submission process based on the unique asset file rather than just the user account, supporting employers who manage multiple distinct businesses:

    • Case A (Identical Asset): If an employer submits a job with a logo file that has already been uploaded and exists in the Media Library, the plugin should reuse that existing Attachment ID instead of creating a duplicate file.
    • Case B (New Unique Asset): If the employer uploads a genuinely different logo file (for a different business or a rebranding), the plugin should process it as a new upload, without affecting or deleting other distinct logos previously uploaded by that user.

    We look forward to a technical response regarding how your team plans to patch this core asset-handling flaw. Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Yikes. Sorry that’s happening. Please check when did these duplicates start appearing. Go to your media library and click on the list icon to view the upload dates, or just click on any of the images going back and see when they were created.

    There’s a fix in https://github.com/Automattic/WP-Job-Manager/pull/3064

    Copy includes/forms/class-wp-job-manager-form-submit-job.php from the zip file there and overwrite it in your install. That will stop further dupes happening. It won’t clean up the duplicates though.

    Test it by submitting a job and uploading a new logo. That one won’t be caught, but repeat it and the dupe will not be uploaded.

    Thread Starter ibiza69

    (@ibiza69)

    Hi @donncha,

    Wow, that was incredibly fast! Thank you and the engineering team for treating this asset-handling issue with such high priority and releasing the patch in version 2.4.5 so quickly.

    To give you the exact technical timeline you requested, as well as the undeniable visual proof of what this bug does, please take a look at the attached screenshot (https://snipboard.io/F5WJCN.jpg). This is just one single company logo out of our database, completely flooding the library with identical assets. Regarding our diagnostics:

    • Database (phpMyAdmin): The automated attachment duplication issues started registering consistently in the database (wp_posts) from July 2018 onwards.

    • Server (FTP Storage): Physically, some older modified assets reside in earlier directories (like /uploads/2015/), but the continuous frontend duplication pattern has been actively flooding the database tables since mid-2018.

    The real challenge we face now is the scale of the aftermath. I run three separate, highly-trafficked job boards that have been ranked #1 on Google since 2015, each receiving over 200,000 monthly visits.

    Because of this silent duplication logic running since 2018, we currently have over 20,000 duplicate images on EACH site, translating to a massive block of 60,000+ unmanageable redundant files in our production hosting environments.

    Due to database references, live employer accounts, and our high traffic volume, we cannot simply delete these via FTP or standard media plugins without completely breaking existing job listings (as mentioned in my initial cascade failure report).

    Since the team successfully patched the upload logic for future submissions, is there any recommended safe SQL script, WP-CLI command, or official cleanup routine the WP Job Manager team suggests to safely merge these 60,000+ duplicate attachments back into single parent IDs without breaking old job posts or affecting our live users?

    Thank you again for the amazing, lightning-fast support!

    Yeah, we’ll get a WP CLI command you can use. It’ll do a dry run first and tell you what it’s going to do before you do the actual delete since this is destructive.

    Thread Starter ibiza69

    (@ibiza69)

    Hi @donncha,

    Thank you for your reply and for working on the WP-CLI command. While we completely understand that a CLI tool with a dry-run mode is the standard approach for enterprise-grade deployments, we must highlight a major bottleneck regarding the wider WordPress ecosystem.

    The reality for the vast majority of WordPress site administrators worldwide is that they operate on standard commercial hosting environments where terminal and SSH access are strictly disabled or heavily restricted (as is the case in our cPanel environments). Providing only a command-line solution means that about 99% of the users facing this exact server bloat won’t be able to fix their historical data.

    Furthermore, using alternative workarounds like web-based console plugins is technically inviable for a case of this magnitude. Due to this duplication bug running for years, just one of our regional sites has a database size of nearly 700 MB. Running a massive data-cleanup query over a 700 MB database via a browser-based console interface would instantly hit HTTP timeouts, exhaust the allocated 4 GB of server RAM, and crash the live site.

    That being said, we have already successfully deployed and tested your previous code patch (PR #3064) on our staging environments. We verified it with 3 distinct frontend job submissions, and it successfully stopped the duplicate file generation in the Media Library. The future upload leak is officially frozen on our end!

    We will stand by for your update on the WP-CLI tool code. Once you publish it, we will extract your database-handling logic to adapt it into a safe, background PHP routine that can process the unifications in very small chunks directly via a browser interface—making the solution accessible and safe for standard hosting users who cannot access a native terminal.

    Thank you again to you and the team for the lightning-fast patch.

    You’re right about wp cli. I think a small wp-admin page that dedupes in batches will probably be effective too.

    Thread Starter ibiza69

    (@ibiza69)

    Hi @donncha,

    That is fantastic news! An admin-facing deduplication tool that processes the cleanup in background batches would be the absolute perfect solution. It completely bypasses HTTP timeouts, protects server memory, and ensures that every single WordPress administrator—regardless of their hosting environment—can safely reclaim their disk space.

    Since we are running three live platforms with over 60,000 combined duplicate assets and a ~700 MB databases, we would be more than happy to thoroughly test your batch-processing script or plugin update in our staging environments. A database of our scale will provide an excellent real-world benchmark to ensure the background processing logic is rock-solid before it gets rolled out to the public.

    We will keep an eye out for your next update or PR link for the cleanup tool. Thank you again for your incredible openness to feedback and for tailoring this solution to benefit the entire WordPress community!

    Best regards and have a nice weekend.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.