Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Chris Taylor

    (@mrwiblog)

    This is almost always because another plugin has sent some content (even just whitespace) to the browser before the voucher has been created.

    Try turning off all plugins except VoucherPress and making sure you can download your voucher. Then turn your plugins back on one-by-one and seeing at what point it breaks.

    I have ran this problem also. The corrupted pdf file contains a simple message:

    <strong>TCPDF ERROR: </strong>Some data has already been output, can't send PDF file

    Chris, I tried your suggestion, but didn’t work. If only VoucherPress is turned on, the pdf doesn’t generated also. Even if I delete all plugin, and setup VP again and alone.

    In my page the problem occured, wen I activated the Advanced Access Manager 2.0Beta3 plugin, and I am not able to do it back.

    Have you any idea?

    Hi guys,
    My suggestion is to install WP Error Fix plugin. This will silence any errors and will show you which plugin causes issues.

    Regards,
    Vasyl

    Hi Guys!

    The bug didnt occured from the AAM plugin! I tried a lot to track down the reason, don’t want to write a novel here, but the substance is in the wp-config.php file. I compared the old one, wich hat let working the VoucherPress with the now used one (I was migrating the page to an other hoster, and I was setting up a new WordPress), and look what I’ve found! Here are the two wp-config.php code (the logins and passwords are marked with *****):

    The new, not working (sorry for the hungarian explanations, it’s a translated WP 3.8):

    <?php
    /**
     * A WordPress fő konfigurációs állománya
     *
     * Ebben a fájlban a következő beállításokat lehet megtenni: MySQL beállítások
     * tábla előtagok, titkos kulcsok, a WordPress nyelve, és ABSPATH.
     * További információ a fájl lehetséges opcióiról angolul itt található:
     * {@link http://codex.wordpress.org/Editing_wp-config.php Editing wp-config.php}
     *  A MySQL beállításokat a szolgáltatónktól kell kérni.
     *
     * Ebből a fájlból készül el a telepítési folyamat közben a wp-config.php
     * állomány. Nem kötelező a webes telepítés használata, elegendő átnevezni
     * "wp-config.php" névre, és kitölteni az értékeket.
     *
     * @package WordPress
     */
    
    // ** MySQL beállítások - Ezeket a szolgálatótól lehet beszerezni ** //
    /** Adatbázis neve */
    define('DB_NAME', '*****');
    
    /** MySQL felhasználónév */
    define('DB_USER', '*****');
    
    /** MySQL jelszó. */
    define('DB_PASSWORD', '*****');
    
    /** MySQL  kiszolgáló neve */
    define('DB_HOST', '*****');
    
    /** Az adatbázis karakter kódolása */
    define('DB_CHARSET', 'utf8');
    
    /** Az adatbázis egybevetése */
    define('DB_COLLATE', '');
    
    /**#@+
     * Bejelentkezést tikosító kulcsok
     *
     * Változtassuk meg a lenti konstansok értékét egy-egy tetszóleges mondatra.
     * Generálhatunk is ilyen kulcsokat a {@link http://api.wordpress.org/secret-key/1.1/ WordPress.org titkos kulcs szolgáltatásával}
     * Ezeknek a kulcsoknak a módosításával bármikor kiléptethető az összes bejelentkezett felhasználó az oldalról.
     *
     * @since 2.6.0
     */
    define('AUTH_KEY', '*****');
    define('SECURE_AUTH_KEY', '*****');
    define('LOGGED_IN_KEY', '*****');
    define('NONCE_KEY', '*****');
    define('AUTH_SALT',        '*****');
    define('SECURE_AUTH_SALT', '*****');
    define('LOGGED_IN_SALT',   '*****');
    define('NONCE_SALT',       '*****');
    
    /**#@-*/
    
    /**
     * WordPress-adatbázis tábla előtag.
     *
     * Több blogot is telepíthetünk egy adatbázisba, ha valamennyinek egyedi
     * előtagot adunk. Csak számokat, betűket és alulvonásokat adhatunk meg.
     */
    $table_prefix  = 'wp_';
    
    /**
     * WordPress nyelve. Ahhoz, hogy magyarul működjön az oldal, ennek az értéknek
     * 'hu_HU'-nak kell lennie. Üresen hagyva az oldal angolul fog megjelenni.
     *
     * A beállított nyelv .mo fájljának telepítve kell lennie a wp-content/languages
     * könyvtárba, ahogyan ez a magyar telepítőben alapértelmezetten benne is van.
     *
     * Például: be kell másolni a hu_HU.mo fájlokat a wp-content/languages könyvtárba,
     * és be kell állítani a WPLANG konstanst 'hu_HU'-ra,
     * hogy a magyar nyelvi támogatást bekapcsolásra kerüljön.
     */
    
    define ('WPLANG', 'hu_HU');
    
    /**
     * Fejlesztőknek: WordPress hibakereső mód.
     *
     * Engedélyezzük ezt a megjegyzések megjelenítéséhez a fejlesztés során.
     * Erősen ajánlott, hogy a bővítmény- és sablonfejlesztők használják a WP_DEBUG
     * konstansot.
     */
    define('WP_DEBUG', false);
    
    /* Ennyi volt, kellemes blogolást! */
    
    /** A WordPress könyvtár abszolút elérési útja. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Betöltjük a WordPress változókat és szükséges fájlokat. */
    require_once(ABSPATH . 'wp-settings.php');

    And the old, what was working:

    <?php
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, WordPress Language, and ABSPATH. You can find more information by
     * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
     * wp-config.php} Codex page. You can get the MySQL settings from your web host.
     *
     * This file is used by the wp-config.php creation script during the
     * installation. You don't have to use the web site, you can just copy this file
     * to "wp-config.php" and fill in the values.
     *
     * @package WordPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', '*****');
    
    /** MySQL database username */
    define('DB_USER', '*****');
    
    /** MySQL database password */
    define('DB_PASSWORD', '*****');
    
    /** MySQL hostname */
    define('DB_HOST', '*****');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**#@+
     * Authentication Unique Keys.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link http://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
     *
     * @since 2.6.0
     */
    define('AUTH_KEY',         '*****');
    define('SECURE_AUTH_KEY',  '*****');
    define('LOGGED_IN_KEY',    '*****');
    define('NONCE_KEY',        '*****');
    define('AUTH_SALT',        '*****');
    define('SECURE_AUTH_SALT', '*****');
    define('LOGGED_IN_SALT',   '*****');
    define('NONCE_SALT',       '*****');
    /**#@-*/
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'wp_';
    
    /**
     * WordPress Localized Language, defaults to English.
     *
     * Change this to localize WordPress.  A corresponding MO file for the chosen
     * language must be installed to wp-content/languages. For example, install
     * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
     * language support.
     */
    define ('WPLANG', 'hu_HU');
    
    define ('FS_METHOD', 'direct');
    
    define('WP_DEBUG', false);
    
    /* That's all, stop editing! Happy blogging. */
    
    /** WordPress absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    
    //--- disable auto upgrade
    define( 'AUTOMATIC_UPDATER_DISABLED', true );
    
    ?>

    So I found these differences between the two:

    define ('FS_METHOD', 'direct');
    require_once(ABSPATH . 'wp-settings.php');
    define( 'AUTOMATIC_UPDATER_DISABLED', true );
    ?>

    I think the bug is in these somewhere, but I am not an expert, and not able to find out the truth, don’t know even what these lines do in WP. I know only whith the old wp-config.php file my site works, so I’m happy now, and going on to build it. Have you any explanations to learn? Chris, helps you these codes?

    Greetings:
    SGS

    Those are new settings for 3.7.

    Both are related to the new automatic point updates. Yours are disabled.

    If I had to guess, I’d say the issue is the closing ?> – WordPress typically leaves this out to prevent problems with unwanted white space after it. WHich would produce exactly what you are getting.

    Hi Jeff!

    I tried the wrong wp-config.php with the ending ?> sign, but the VoucherPress also not working with this change. I tried now inserting all the plus lines to the wrong code, and this is not working also. So not that was the solution, what I guessed, and also not, what you. Good mind-breaker, isn’t it?

    🙂

    Plugin Author Chris Taylor

    (@mrwiblog)

    Thanks for investigating this problem so thoroughly. I don’t have a clue what is causing the problem, but I think it’s clear that the issue is whitespace being sent to the browser before VoucherPress has chance to generate the PDF.

    I’ll see if there’s anything I can do to fix this, but my guess is that there’s something in your system which needs to be found and fixed.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Voucherpress – PDF Is Damaged – Doesn't Open’ is closed to new replies.