I am getting an error in the newsletter plugin

When clicking on the "Create newsletter" link, I get the following:

Notice: Undefined index: return in /xxxxxxxx/xxxx/xxxxx/wp-content/plugins/e-newsletter/email-newsletter-files/builder/class.builder.php on line 113

  • Ash

    Hello there

    I hope you are well today and thanks for asking the question.

    As you are seeing a notice, notice is not any harmful for your project. It just for returning an empty index. That is not a problem. You can easily turn off notice using following code in your wp-config.php

    define('WP_DEBUG', false);

    Also, you should be able to create and use the newsletter. Are you having any problem to create newsletter?

    Please let me know.

    Cheers
    Ash

  • natebald

    While I agree that your answer will cause the plugin to function, I do question the philosophy behind it. I find it interesting that you feel it is acceptable to have an error of any kind that is forseeable and preventable.

    As a developer, I work on sites with debugging enabled to ensure there are no errors. When debugging is enabled, your plugin causes the site to stop responding due to a redirect not being able to function because headers have already been sent with the error notice.

    Line 113 of class.builder.php: $return = ($_REQUEST['return']) ? $_GET['return'] : '';

    could simply be changed to :

    $return = isset( $_REQUEST['return'] ) && $_REQUEST['return'] ? $_GET['return'] : '';

    to avoid this error.

    Unfortunately, there are other instances in your code where you fail to take steps to ensure a particular variable is set before attempting to access the variable's value. This will cause anyone attempting to use your plugin in a development environment with debugging enabled to be unable to function.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.