Forum Replies Created
-
AuthorPosts
-
ishmaelangeloMember
One of our programmers was using the wrong character encoding in his editor. We need to treat PHP files with the UTF-8(BOM off) or blank spaces or newlines can interefere somehow in the file integrity:
[http://stackoverflow.com/questions/2558172/utf-8-bom-signature-in-php-files]
Offending line of code in WordPress’ functions.php: if ($bom != b”xEFxBBxBF”)
Our culprits, remember: EF BB BF
They appeared in the beggining of the corrupted .epub files.
So glad we finally got to the root of the problem, was driving us mad! Ha haa!!!
Thank you very much for your support, eliminating possibilities helped us get to the source of the problem.
Peace & Happy Coding to You
ishmaelangeloMemberWe reverted our VPS to 10 days prior yet the problem is still occurring. Setting up on a different host now to test there.
Since others have had this problem as well, do you think it is possible that something in the database related to this plug-in is causing the problem? Maybe something got corrupted in the database.
If we uninstalled and then reinstalled the eStore plug-in, would all the eStore related database entries be cleared out?
ALSO, HOW CAN WE TURN OFF THE ENCRYPTED LINKS? We would be fine just giving our customers direct access to the downloads for now, and then change the URLs once this problem is fixed.
Thanks
ishmaelangeloMemberrepeated send to server, see post below
ishmaelangeloMemberWow. This post is showing a similar problem. The guy was using eStore successfully, and then suddenly it stopped working and the files were getting corrupted:
https://support.tipsandtricks-hq.com/forums/topic/digital-download-file-corrupted/page/2
ishmaelangeloMemberWe converted the binary to ascii and found that the junk data at the beginning of the file is: ï°¿
Which are HTML Codes for:
¿ = inverted question mark
° = degree sign
ï = latin small letter i with diaeresis
Now we are trying to figure out where the heck this is coming from!
From the eStore plug-in? From the server? From Windows (because it only happens on Windows)?
ishmaelangeloMemberWe just tried looking at the corrupt file vs the working file with a Binary Editor and found that there is junk data at the beginning of the corrupt file. (Per this tip here: http://stackoverflow.com/questions/4465135/php-file-download-is-always-corrupt-50-of-the-time)
What could be the source of the junk data at the beginning of the file?
ishmaelangeloMemberwzp, thanks
We went through all of the items in the checklist, but to no avail. Still having corrupted files.
We tried a different download method.
The debug logs looks normal, the same now as they were before the error started occurring
We sent a ticket to our web host asking if anything has changed and they said no
In the post it says: “If the above steps do not fix the issue you are having please contact us and we will take a close look at your site.”
What do you need to take a closer look at our site?
Thank you
ishmaelangeloMemberWell, that wasn’t too hard, only took a little while using the functions in shortcode_include.php as templates.
Here’s a couple of functions that you can place in your WordPress theme’s functions.php file:
//returns a product object, you can then place values in your own HTML markup
function eStore_get_product_by_ID($id)
{
if(empty($id))
{
return “You did not specify a product ID.”;
}
global $wpdb;
$products_table_name = WP_ESTORE_PRODUCTS_TABLE_NAME;
$wp_eStore_db = $wpdb->get_results(“SELECT * FROM $products_table_name where id=$id LIMIT 1”, OBJECT);
if(!empty($wp_eStore_db))return $wp_eStore_db[0];
else return false;
}
//returns an array of product objects, you can then output the product list in your own HTML markup using PHP loop
function eStore_get_products_by_cat_ID($id,$limit=null)
{
if(empty($id))
{
return “You did not specify a category ID.”;
}
$limit = $limit == null?””:”LIMIT {$limit}”;
global $wpdb;
$cat_prod_rel_table_name = WP_ESTORE_CATEGORY_RELATIONS_TABLE_NAME;
$products_table_name = WP_ESTORE_PRODUCTS_TABLE_NAME;
$wp_eStore_db = $wpdb->get_results(“SELECT * FROM $cat_prod_rel_table_name INNER JOIN $products_table_name ON
$cat_prod_rel_table_name.prod_id=$products_table_name.id where cat_id=$id ORDER BY name {$limit}”, OBJECT);
if(!empty($wp_eStore_db))return $wp_eStore_db;
else return false;
}
ishmaelangeloMemberI found the extra short codes pdf: http://www.tipsandtricks-hq.com/ecommerce/wp-content/uploads/extra-eStore-shortcodes.pdf
And I installed this addon. It provides more functionality however still not exactly what I am looking for.
I may just end up writing some custom functions, if so I’ll post them here for others who want to query the products database and get PHP objects to work with.
ishmaelangeloMemberAnd now, 10 months later. Are there still no custom field options for products?
Thanks
-
AuthorPosts