looking for a way to allow users to backup the plugin db data(save as)

WP has Filesystem API to write files. However it can be relatively convoluted to implement (since it handles fallback for many cases and environments and workflow for requesting FTP crednetials from users) so often simply PHP functions are used to write file. Works reliably when constrained to uploads folder, otherwise need to be sure about … Read more

wpdb->update error

I’m not sure why you are using the the_date() function, but if you must, make sure it returns the value instead of echo-ing it. So instead of this part: array( ‘value’ => the_date(‘Y-m-d’) ), try this one: array( ‘value’ => the_date( ‘Y-m-d’, $before=””, $after=””, $echo = 0 ); ), To catch the update error, check … Read more

Search Query that Includes Custom Table

I managed to solve this by taking s_ha_dum’s suggestion to use a UNION. It is as follows: (SELECT ID, post_status, post_title, post_excerpt, post_content FROM wp_posts WHERE ((`post_title` LIKE ‘%diamond%’) OR (`post_excerpt` LIKE ‘%diamond%’) OR (`post_content` LIKE ‘%diamond%’)) AND (`post_status` = ‘publish’ )) UNION (SELECT ref, StoreID, Article, subarticle, description FROM wp_hwproducts WHERE (`article` LIKE ‘%diamond%’) … Read more