The plugin Exports and Reports has been temporary taken down due to a CSV issue that we’ve already fixed. The plugin is going to stay down until I refactor the whole codebase so it passes the required review steps to get it back up.
Unfortunately, the person who reported the CSV problem didn’t contact me first and went through the plugin team itself. That just means there’s a more arduous process for me to get this plugin back up and I didn’t expect to suddenly have to spend this amount of time rewriting things.
As soon as the code changes are made and it passes the automated code style checks, another release will be made available with those changes and it will be reviewed by the plugins team. Hopefully at that point, it will be approved and become available again.
]]>Hi,
Every time I try to add the sql query it triggers a Wordfence error:
A potentially unsafe operation has been detected in your request to this site
Your access to this service has been limited. (HTTP response code 403)
If you think you have been blocked in error, contact the owner of this site for assistance.
Block Technical Data
Block Reason: A potentially unsafe operation has been detected in your request to this site
I can’t find a way around this either here or on Wordfence’s support. Can you please help?
]]>I’m trying to use the option SQL Query for Count due to a large query timing out. I added to that input box a simple query like the following, which removed all the related fields I am pulling in my main SQL Query:
SELECT id
FROM wp_posts AS locations
WHERE %%WHERE%% locations.post_type = 'location'
However, when I run the report, it only shows 25 total results. Should I be querying count(*) or something else in order for it to return a total count to be used? Could you give me an example query to use for SQL Query for Count?
Thanks!
Carl
Hi,
I have a custom plugin. I would like to call the Exports and Reports plugin to export the pdf or excel through my custom plugin. Is there any way to do?
]]>Hi Scott, thanks for your work with this plugin.
I try to show a comma as decimal point using “Display Function ” field
I write “number_format (field_from_query, 2, ‘.’, ‘,’)” and it doesn’t work. What is the way to insert a function here?
Thanks in advance
I started to receive a message this critical error (about a week ago
) if I try to download the reports as an XLSX excel file:
An error of type E_ERROR was caused in line 100 of the file wp-content/plugins/exports-and-reports/wp-admin-ui/includes/PHP_XLSXWriter/xlsxwriter.class.php. Error message: Uncaught Error: Class ‘ZipArchive’ not found in wp-content/plugins/exports-and-reports/wp-admin-ui/includes/PHP_XLSXWriter/xlsxwriter.class.php:100
Stack trace:
#0 wp-content/plugins/exports-and-reports/wp-admin-ui/Admin.class.php(1468): XLSXWriter->writeToFile(‘/home/samyfishe…’)
#1 wp-content/plugins/exports-and-reports/wp-admin-ui/Admin.class.php(2183): WP_Admin_UI->export()
#2 wp-content/plugins/exports-and-reports/wp-admin-ui/Admin.class.php(742): WP_Admin_UI->manage()
#3 wp-content/plugins/exports-and-reports/exports-and-reports.php(1385): WP_Admin_UI->go()
#4 wp-includes/class-wp-hook.php(292): exports_reports_view(1)
#5 wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(”, Array)
#6 wp-includes/plugin.php(484): WP_Hook->do_action(Array)
Any idea how to address it?
Regards,
Nelson
]]>When viewing all reports (not admin), the dropdown also shows all disabled reports.
The simple fix, in exports-and-reports.php, line 1170 and following change the sql from (removed the backticks in the code):
$sql = '
SELECT *
FROM ' . EXPORTS_REPORTS_TBL . 'reports
WHERE group = %d
ORDER BY weight, name
';
to
$sql = '
SELECT *
FROM ' . EXPORTS_REPORTS_TBL . 'reports
WHERE group = %d AND disabled=0
ORDER BY weight, name
';
]]>
When trying the url:
wp-content/plugins/exports-and-reports/api.php?report=6&exports_and_reports_download=1&export_type=CSV&token=xxxxx
I’m getting a json file as a result that says:
{"success":false,"data":"Report failed to export"}
However, in the wp-content/exports directory, I can clearly see the exported file. Some issue with presenting the downloaded file? How to proceed with this? Via the web interface, everything works just fine, it is just the api call to immediately download the created report that seems to be failing.
]]>My sql query:
SELECT
IFNULL((Select WPP.post_id FROM wp_postmeta WPP WHERE WPP.post_id = WP_WC.order_id GROUP BY WPP.post_id),"") AS OrderNumber,
IFNULL((Select date_format(post_date,'%Y-%m-%d') FROM wp_posts WP_PS WHERE WP_PS.Id = WP_WC.order_id GROUP BY WP_PS.id),"") AS OrderDate,
IFNULL((Select date_format(post_date,'%Y-%m-%d') FROM wp_posts WP_PS WHERE WP_PS.Id = WP_WC.order_id GROUP BY WP_PS.id),"") AS OrderDate2,
FROM wp_wc_order_product_lookup WP_WC,
wp_woocommerce_order_items WP_I
WHERE WP_WC.order_item_id = WP_I.order_item_id
AND WP_WC.order_id = WP_I.order_id
AND (Select post_date FROM wp_posts WP_PS WHERE WP_PS.Id = WP_WC.order_id GROUP BY WP_PS.id) >= '2021-04-01' %%WHERE%%
`
In fields settings:
1. Add field. Field name: OrderDate (Date type)
2. Select Searchable and Filterable (optional) YES
3. Ongoing Date Field (optional) put OrderDate2 (I also try with Ongoing Default Filter Value (optional) field)
4. Result not found.
Other case:
1. Add field. Field name: OrderNumber (Text type)
2. I put value in Default Filter Value (optional)
3. Also result not found.
Hi,
Part of mysql qeury:
WHERE (Select meta_value From wp_postmeta wppo Where meta_key = '_billing_email' And wppo.post_id = wpp.post_id) LIKE '%@%'
AND (Select post_date From wp_posts Where wp_posts.Id = wpp.post_id) >= '2021-02-01'
AND (Select post_date From wp_posts Where wp_posts.Id = wpp.post_id) <= '2021-04-15'
How to put %%where%% variable and use it to filter by date beetween?
]]>Is it possible to run a report from a saved Procedure? I have a few procedures that create temporary tables, and then run a query based on those. I would like to call one of these procedures to create a report. I’ve tried the following, which works in the database, but not with the plugin:
CALL get_courses();
The field names I used match the column names of the final SELECT query in the procedure.
If I can’t use saved Procedures, can I run something similar with multi-step queries?
Hi there,
Your example of exporting says to append the parameters as follows:
&action=export&export_type=custom&export_delimiter=#
Is there a parameter to supply a field?
So for example can I
1. Setup the query as :
SELECT * FROM wp_postmeta WHERE %%WHERE%%
2. Setup a number field as post_id
and then report out with json using this post_id field like so?
report=#&full=1&action=json&token=#&export_type=json&post_id=100000
This didn’t work but this be done?
David,
Thanks,
Hi, when I try to export my report to this format, it shows 503 service unavailable, I contacted my server provider and they explained.
“continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /var/www/vhosts/synkiria.com/subdomains/tandasprivadas/wp-content/plugins/exports-and-reports/wp-admin-ui/includes/tcpdf/tcpdf.php on line 17786PHP message: PHP Warning: array_push() expects parameter 1 to be array,
can you please help me?
thank you!
General question. My issue is in an admin-only page.
I have a membership site with custom fields for a custom post type. A report of these records works for all (~200 members) except about 10. Those 10 records have one or two empty fields for phone numbers (e.g., fax, other.) If I enter ‘ ‘ in those fields, they show correctly in the report. How can I fix this (or what am I doing wrong)? I am familiar with NULL and NOT NULL in MySQL, but I could not make any of that work.
]]>Hi ..I added input field here but where i will get my input field database in this plugin?
]]>Hi,
This is probably more a how-to-use question as I only installed your plugin this morning.
I have written my sql query and it works against the live database when I run it directly from MySQL Workbench but I can’t get any output when used through the plugin on a test installation.
Example Posts report – they don’t have any posts!
Example Pages report –
New Daily Participants report –
There is any tutorial to learn about the plugin? I see there is a lot of possible configuration but no documentation. Looks great!
1) I did a query and I could “filter” by date+time… but the “time” part is not filtering
2) Can I add also a filter with a “range” (between) that is not a date? or create a filter for “greater than”
3) I don’t understand how to implement %variables%. If I need in the query:
WHERE Order_ID > VARIABLE… how can I define the variable?
Thanks in advance!
]]>I’m sure that this is simple, but I can’t figure out how to get search or filter to work! I made a small test query:
select ID, post_date, post_status from wp_posts
where post_type = ‘shop_order’
I have added all these to FIELDS section as TEXT fields: ID, post_date, post_status. I have also put these same names in the REAL FIELD section of each Advanced Field Options, with each one saying Hide from Report=NO, Searchable=YES.
No matter what I put in the search bar, my list of 25 orders stays the same, I would expect if I searched for wc_cancelled that the screen would change to only show those rows with that status. What am I missing here? Thanks for any help. Below is my test data.
ID Post Date Post Status
2299 1/3/2020 17:21 wc-cancelled
3032 7/1/2020 15:16 wc-cancelled
1751 11/21/2019 13:01wc-completed
1805 11/22/2019 15:02wc-completed
1808 11/22/2019 15:19wc-completed
1956 12/4/2019 18:30 wc-completed
1959 12/4/2019 18:45 wc-completed
2301 1/3/2020 18:21 wc-completed
2312 1/4/2020 11:22 wc-completed
2342 1/12/2020 14:51 wc-completed
2345 1/12/2020 14:57 wc-completed
2364 1/17/2020 14:47 wc-completed
2367 1/17/2020 14:50 wc-completed
2628 2/7/2020 16:08 wc-completed
2631 2/7/2020 16:14 wc-completed
2634 2/7/2020 16:22 wc-completed
2639 2/7/2020 18:44 wc-completed
2990 3/2/2020 17:53 wc-completed
3019 6/6/2020 12:45 wc-completed
3037 7/5/2020 12:54 wc-completed
3041 7/6/2020 10:40 wc-completed
3051 7/9/2020 12:57 wc-completed
3052 7/9/2020 13:12 wc-completed
3061 7/14/2020 11:22 wc-completed
3070 7/15/2020 17:42 wc-processing
Hello I realize that when I declare not to have SLQ – SELECT something in this model:
SELECT CASE wc.comment_approved
WHEN 'in-progress' THEN 'In progress'
WHEN 'complete' THEN 'Concluded'
ELSE 'Unknow'
END as 'Status',
Even putting the alias information in the Fields (optional) to release the search option it does not return any information, I tried to search for ‘complete’ or for the given name of the field ‘Concluded’. Does the search not occur by the type of select?
]]>how can i change small things in the pdf in the css question is it possible?
]]>The Exports and Reports verson 0.8.5 constantly generates this error:
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘()’ at line 1 for query ALTER TABLE 4rw5p2_exportsreports_log ADD
(
) made by do_action(‘admin_init’), WP_Hook->do_action, WP_Hook->apply_filters, exports_reports_init, exports_reports_upgrade, exports_reports_sql_install, dbDelta
It generates this all the time if the plugin has been activated. When deactivated, the errors stop.
It also generates the errors for the other tables. exportsreports_groups and exportsreports_reports.
]]>Is there a shortcode or way to display a report on a page in the website?
]]>How can I apply a filter to the custom SQL query. The filter has to appear on the reports page. I tried using add field, but then it shows only that field and does not consider the query. The query I am trying to use is the below:
I would like to apply filter on the post_date.
SELECT
posts.id,
posts.post_date,
posts.post_status,
MAX(CASE
WHEN meta.meta_key = ‘_shipping_first_name’ THEN meta.meta_value
END) AS shipping_first_name,
MAX(CASE
WHEN meta.meta_key = ‘_shipping_last_name’ THEN meta.meta_value
END) AS shipping_last_name,
MAX(CASE
WHEN meta.meta_key = ‘_shipping_address_1’ THEN meta.meta_value
END) AS shipping_address_1,
MAX(CASE
WHEN meta.meta_key = ‘_shipping_address_2’ THEN meta.meta_value
END) AS shipping_address_2,
MAX(CASE
WHEN meta.meta_key = ‘_shipping_city’ THEN meta.meta_value
END) AS shipping_city,
MAX(CASE
WHEN meta.meta_key = ‘_shipping_state’ THEN meta.meta_value
END) AS shipping_state,
MAX(CASE
WHEN meta.meta_key = ‘_order_shipping’ THEN meta.meta_value
END) AS order_shipping,
MAX(CASE
WHEN meta.meta_key = ‘_order_shipping_tax’ THEN meta.meta_value
END) AS order_shipping_tax,
MAX(CASE
WHEN meta.meta_key = ‘_order_tax’ THEN meta.meta_value
END) AS order_tax,
MAX(CASE
WHEN meta.meta_key = ‘_order_total’ THEN meta.meta_value
END) AS order_total,
MAX(CASE
WHEN meta.meta_key = ‘_payment_method_title’ THEN meta.meta_value
END) AS payment_method_title
FROM
wp_posts as posts LEFT OUTER JOIN wp_postmeta as meta ON posts.id = meta.post_id
WHERE
posts.post_type = ‘shop_order’
AND posts.post_date >= ‘2020-04-20’
group by posts.id,
posts.post_date,
posts.post_status
Hi,
When I put the variables (HAVING %%HAVING%% my_field=1) as given in example I get the below error when I check the report with ‘&debug=1’ to the end of the report URL.
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘HAVING my_field=1 LIMIT 0,25’ at line 1]
HAVING my_field=1 LIMIT 0,25
How to fix this ?
Kindly provide a guide/tutorial link to use the plugin.
Thanks,
Lily M.
Dear Team,
I am using the exports and reports plugin and search is not working. Please can some one tell me how to add filter.
Regards,
Boopathi
When Exports and Reports was updated from version 0.8.2 to 0.8.3, all reports became inaccessible. When I rolled it back to 0.8.2, everything worked fine again. For example,
https://sjpc.org/casptest/wp-admin/admin.php?page=exports-reports&report=6
works correctly under 0.8.2 using an admin account, but under 0.8.3, returns message “Sorry, you are not allowed to access this page.” Am I missing something?
Alan Baker
]]>It is possible to get the structure and the name of the table where the reports are stored to create in my database?
I deleted because after an unexpected shutdown the table seems to be corrupted and I can’t access to the data
Thanks in advance.
Before anything, I have tried to uninstall and delete all the files that have been created, and then reinstall the plugin, it created the tables exportsreports_gruops and exportsreports_logs but not the exportsreports_reports on the DB
]]>Thanks for the great plugin! Had some trouble getting it to work in Pantheon. Posting this in the hopes that it helps someone else, and possibly improves the plugin.
To use this plugin in Pantheon I had to do the following 3 things:
– Add the following to the wp-config.php so the plugin has filesystem access
define(‘FS_METHOD’, ‘direct’);
– Following the directions Pantheon provides, create a directory in /uploads and symbolically link it to where this plugin wants to write (/plugins/exports-and-reports/exports)
– Modify one line of the plugin. Wrapping a constant in PHP’s realpath
function so as to expand out our symbolic link to get a correct download link.
You’ll need to change this line:
wp_redirect( str_replace( WP_ADMIN_UI_EXPORT_DIR, WP_ADMIN_UI_EXPORT_URL, $file ) );
to:
wp_redirect( str_replace( realpath(WP_ADMIN_UI_EXPORT_DIR), WP_ADMIN_UI_EXPORT_URL, $file ) );
There is likely a better solution, but this worked for me.
Tackling it as the plugin author could be done in several ways. Defining the constant differently, not wrapping $file in realpath (this may not work), or at this point in the code wrapping the constant in realpath to expand out the sym-link before str_replace and redirect. /shrug Just 2 cents.
]]>How do you set up these?
Add the exports_reports_full_access capability to a role for full access to reports, exports_reports_settings for only access to settings, exports_reports_view for access to view all reports, exports_reports_view_group_{ID} for access to view a group and all of the reports within, or exports_reports_view_report_{ID} for access to view a single report
]]>What do these instructions mean?
Add the exports_reports_full_access capability to a role for full access to reports, exports_reports_settings for only access to settings, exports_reports_view for access to view all reports, exports_reports_view_group_{ID} for access to view a group and all of the reports within, or exports_reports_view_report_{ID} for access to view a single report
]]>