Title: Plugin suddenly stopped working
Last modified: August 21, 2016

---

# Plugin suddenly stopped working

 *  Resolved [Hunchback](https://wordpress.org/support/users/hunchback/)
 * (@hunchback)
 * [12 years ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/)
 * Hello,
 * I’ve been using your plugin on our site for a while, and everything was fine.
   Today, for a reason i fail to find it stopped working – when you click on the
   button to generate a PDF it opens a blank window with a url like this: [http://dobiart.fr/wp-admin/admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=2634&_wpnonce=7f3f14e008](http://dobiart.fr/wp-admin/admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=2634&_wpnonce=7f3f14e008)
 * I haven’t updated anything recently, or changed any settings. I know this sounds
   silly, but i really don’t see what could have caused that.
 * If this can help, the “WooCommerce Sequential Order Numbers” plugin apparently
   stopped working at the same time, it won’t generate a new order ID for new orders.
   Finally, a completed order won’t update the stock levels.
 * This is all quite weird since as i said, there have been no plugin updates lately,
   no modifications to the code or anything…
 * I checked through the forum here and i did the following based on other threads:
 * 1. Check the write permissions for the plugin folder
    2. Change the logo for 
   the PDF file to a small file.
 * Didn’t work…
 * Any ideas?
 * Thanks
 * [https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)

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

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [12 years ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954318)
 * If you say some other plugins stopped working, I don’t think looking into this
   plugin specifically will help you. It could be a memory/server issue. Are you
   running other sites on the same server/is this on a shared hosting?
 * If you enable WP_DEBUG, you should get an error instead of the blank page when
   you try to generate the PDF. If not, try outputting to HTML. See [this post](http://wordpress.org/support/topic/read-this-first-4?replies=1)
   for more information.
 *  Thread Starter [Hunchback](https://wordpress.org/support/users/hunchback/)
 * (@hunchback)
 * [12 years ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954338)
 * Hey,
 * The HTML generated is simply this:
 *  <html>
    <head></head> <body> </body> </html>
 * The debug gave me back this:
 * Fatal error: Cannot redeclare build_url() (previously declared in /mnt/web7/c1/
   04/54024604/htdocs/WordPress_01/wp-content/themes/zonda/lib/widgets/facebook-
   like-widget.php:304) in /mnt/web7/c1/04/54024604/htdocs/WordPress_01/wp-content/
   plugins/woocommerce-pdf-invoices-packing-slips/lib/dompdf/include/functions.inc.
   php on line 170
 * Edit:
    Here’s the code from the widget.php
 * function build_url($url_data) {
    $url=””; if (isset($url_data[‘host’])) { $url.
   = $url_data[‘scheme’] . ‘://’; if (isset($url_data[‘user’])) { $url .= $url_data[‘
   user’]; if (isset($url_data[‘pass’])) $url .= ‘:’ . $url_data[‘pass’]; $url .
   = ‘@’; } $url .= $url_data[‘host’]; if (isset($url_data[‘port’])) $url .= ‘:’.
   $url_data[‘port’]; } if (isset($url_data[‘path’])) $url .= $url_data[‘path’];
   if (isset($url_data[‘query’])) $url .= ‘?’ . $url_data[‘query’]; if (isset($url_data[‘
   fragment’])) $url .= ‘#’ . $url_data[‘fragment’];
 *  return $url;
 * ———–
 *  Thread Starter [Hunchback](https://wordpress.org/support/users/hunchback/)
 * (@hunchback)
 * [12 years ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954345)
 * Update:
 * I commented out that section of the code in the widget, since it’s not even a
   widget that we are using. The PDF generated correctly.
 * I am not sure if this is a solution tho, since the problem must have appeared
   when we last update the theme and we somehow didn’t notice it. Perhaps no PDF
   Invoices have been generated lately, can’t say since i am not running the shop
   itself, i am doing the technical part of it.
 * Could you explain what’s wrong, and if there’s another way to fix this?
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [12 years ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954360)
 * Alright, glad to hear you were able to fix that.
 * It looks like that widget is using the same function name as one in the PDF engine.
   There’s no easy way to fix this, but if you’re not using the widget, it’s probably
   best to disable it like you did.
 * You can check if PDF invoices by enabling the invoice number column in the PDF
   invoice plugin settings. If an order has an invoice number, it means an invoice
   was created for that order.
 *  Thread Starter [Hunchback](https://wordpress.org/support/users/hunchback/)
 * (@hunchback)
 * [12 years ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954381)
 * I see…
    I am a systems and networks engineer so i only know basic code really…
 * What bothers me with this solution is that the next time i update the theme it
   will probably break again, since this widget comes with the theme. I tried deleting
   the widget .php file altogether, but then there’s another error produced, cause
   the theme is looking for the widget and fails to find it.
 * Is there no way to get your plugin and that widget work with a warning instead
   of a critical error?
 * I’ll report that to the theme author too, so that he knows.
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [12 years ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954385)
 * There would be another way if it wasn’t the PDF engine that was causing the issue.
   This is a public librabry that I use (dompdf), and I cannot make any changes 
   like that for the same reason: it would break again on updates. It’s good practice
   to wrap all functions in classes (like I do in my plugin too). Another possibility
   is to do a `function_exists` before adding the function. My advice to the theme
   author would be to do the first (wrap everything in a class).
 *  [alemitta](https://wordpress.org/support/users/alemitta/)
 * (@alemitta)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954585)
 * Hi,
    I have the same fatal error.
 * Fatal error: Cannot redeclare build_url() (previously declared in /homepages/
   1/d284977028/htdocs/clickandbuilds/WordPress/MyCMS/wp-content/themes/venedor/
   inc/functions.php:398) in /homepages/1/d284977028/htdocs/clickandbuilds/WordPress/
   MyCMS/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/lib/dompdf/include/
   functions.inc.php on line 170
 * How can i wrap the plugin in a class?
    Thanks!
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954586)
 * Hellio Alemitta,
    The plugin is already wrapped in a class, the PDF engine is
   not. Unfortunately this is not something I can help you with right now. My advice
   is to contact the theme author(s) about this issue and ask if it’s possible for
   them to use a less generic function name or to wrap the theme in a class. Wrapping
   the theme in a class is not something that you can easily do yourself unless 
   you’re a coder.
 * Kind regards,
    Ewout
 *  [alemitta](https://wordpress.org/support/users/alemitta/)
 * (@alemitta)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954587)
 * Hi Ewout,
 * Thanks for you reply.
 * I tried contact with the theme author but i didnt had answer.
 * Are there other form to solve this problem?

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

The topic ‘Plugin suddenly stopped working’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [alemitta](https://wordpress.org/support/users/alemitta/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-suddenly-stopped-working-4/#post-4954587)
 * Status: resolved