• Hi Alexandre,

    I like your Private Media plugin a lot and would like to provide code updates and bug fixes. This plugin was not updated during the last 4 years and there are some issues with PHP 8.x. I saw you created an empty GitHub repository at https://github.com/froger-me/private-media. Could you please upload your code there to make it easier to provide pull requests. Having access to the full build system would also be great.

    First there is a fatal error in class-private-media-request-handler.php:

    • Fatal error: Uncaught Error: header(): Argument #3 ($response_code) must be of type int, string given
      in?/…/wp-includes/functions.php?on line?1471
    • status_header()
      wp-content/plugins/private-media/inc/class-private-media-request-handler.php:155

    Where the following line fails:

    status_header( $status );

    Your code always uses a string for $status. The workaround for now is:

    status_header( intval( $status ) );

    With this change the plugin runs fine again.

    I would like to add the following changes:

    • Upload private content right away: currently files have to be uploaded, edited and to be changed to private (hotlinking prevention or access roles).
      • This could be activated by a hook. In our case it depends on the upload location.
    • Rename “Prevent hotlinks (even when not limited by role)” this should be named “Always private (prevent hotlinking)”.

    Other than that I could not find any WordPress incompatibilities.

  • The topic ‘Private Media Plugin Updates’ is closed to new replies.