Title: Oops… page
Last modified: August 22, 2021

---

# Oops… page

 *  Resolved [Xonnext](https://wordpress.org/support/users/xonnext/)
 * (@xonnext)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/oops-page-2/)
 * Hi,
 * About 2 years ago I wrote to you about the ugly Oops:
 * “Could you please add something like this in the sdm-download-request-handler.
   php.”
 * Your reply was:
 * “I will add two action hooks for password-protected downloads (when a download
   request is submitted without a password or incorrect password). You can then 
   use those action hooks to do your redirection from your custom code. It will 
   be available in the next release of the plugin.”
 * But still with every update I have to rewrite the code in the file sdm-download-
   request-handler.php
 * Did I miss the promised hooks or did I not understand what your solution is?
 * Best regards,
 * Xonnext
    -  This topic was modified 4 years, 8 months ago by [Xonnext](https://wordpress.org/support/users/xonnext/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Foops-page-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [mra13](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/oops-page-2/#post-14794386)
 * That action hook was added a long time ago. The name of the action hooks that
   were added are the following:
 *     ```
       sdm_process_download_request_no_password
       sdm_process_download_request_incorrect_password
       ```
   
 * If you read that file’s code (sdm-download-request-handler.php) and you will 
   see the hooks there so you can customize it.
 * Please note that we cannot offer code customization as part of the free support.
   That is beyond the scope of this plugin’s free support capability unfortunately.
   If you are not a coder, you will need to hire a coder to make code customization.
 *  Thread Starter [Xonnext](https://wordpress.org/support/users/xonnext/)
 * (@xonnext)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/oops-page-2/#post-14800241)
 * I am just a novice, I understand and I changed the code into what is below. But
   after every update it is overwritten. My wish was that you changed YOUR code 
   into something similar that creates a /not-found page that people can design 
   themselves. Would be a lot easier and nicer then the ugly error messages. But
   thanks anyway… 😉
 * Line 29:
    $dl_post_url = get_permalink( $download_id );
 * // Change start
    header(‘Location: /not-found’); // Change exit; } // Change
 * // Change end
 * // $error_msg = __( ‘Error! This download requires a password.’, ‘simple-download-
   monitor’ );
    // $error_msg .= ‘<p>’; // $error_msg .= ‘[‘ . __( ‘Click here’, ‘simple-download-monitor’ ) . ‘](https://wordpress.org/support/topic/oops-page-2/&apos; . $dl_post_url . &apos;?output_format=md)‘;//
   $error_msg .= __( ‘ and enter a valid password for this item’, ‘simple-download-
   monitor’ ); // $error_msg .= ‘</p>’; // wp_die( $error_msg ); // } if ( $post_pass!
   = $pass_val ) { //Incorrect password submitted.
 * // Change start
 *  header(‘Location: /not-found’); // Change
    exit; // Change
 * // Change end
 * // do_action( ‘sdm_process_download_request_incorrect_password’ );
 * // wp_die( __( ‘Error! Incorrect password. This download requires a valid password.’,‘
   simple-download-monitor’ ) );
    } else { //Password is valid. Go ahead with the
   download } } //End of password check
 *  Thread Starter [Xonnext](https://wordpress.org/support/users/xonnext/)
 * (@xonnext)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/oops-page-2/#post-14802630)
 * Or in short:
 * Line 29:
 * $dl_post_url = get_permalink( $download_id );
 * header(‘Location: /not-found’);
    exit; }
 * if ( $post_pass != $pass_val ) {
    //Incorrect password submitted.
 * header(‘Location: /not-found’);
    exit;
 * } else {
    //Password is valid. Go ahead with the download } } //End of password
   check
 *  Plugin Author [mra13](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/oops-page-2/#post-14803111)
 * I understand what you are saying but remember that our plugin is used by many
   users. So we cannot make a global change to the plugin’s output based on what
   one project’s customization requirements are. There are always other users who
   may or may not like that change. So the best way to handle a customization is
   to override things on your site using action or filter hooks. That way the customization
   is local to your site and you are not modifying the core plugin’s files.
 * The following is an example snippet of code that shows how you can use the action
   hook to override the output from your custom plugin or your theme’s functions.
   php:
 *     ```
       add_action('sdm_process_download_request_no_password','my_customization_on_no_pass');
       function my_customization_on_no_pass(){
           //Output what and how you want to handle this event
       }
       add_action('sdm_process_download_request_incorrect_password','my_customization_on_incorrect_pass');
       function my_customization_on_incorrect_pass(){
           //Output what and how you want to handle this event
       }
       ```
   
 * If you want to do customization yourself, you need to read about how hooks work
   in WordPress. That information will help you understand how you can use hooks
   to override certain behavior of the plugin and apply customization. Or you need
   to hire a wp coder who can help you with your customization requirements. Or 
   you can try to find an alternative plugin that has all the customization options
   that your project needs.
 *  Thread Starter [Xonnext](https://wordpress.org/support/users/xonnext/)
 * (@xonnext)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/oops-page-2/#post-14809062)
 * Thanks for your reply..! I look into it. Best regards.
    -  This reply was modified 4 years, 8 months ago by [Xonnext](https://wordpress.org/support/users/xonnext/).

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

The topic ‘Oops… page’ is closed to new replies.

 * ![](https://ps.w.org/simple-download-monitor/assets/icon-128x128.png?rev=973803)
 * [Simple Download Monitor](https://wordpress.org/plugins/simple-download-monitor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-download-monitor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-download-monitor/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-download-monitor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-download-monitor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-download-monitor/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Xonnext](https://wordpress.org/support/users/xonnext/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/oops-page-2/#post-14809062)
 * Status: resolved