Ez a bővítmény nem lett tesztelve a WordPress legutóbbi 3 fő kiadásával. Lehetséges, hogy már nincs karbantartva, frissítve és a használata gondot jelenthet a frissebb WordPress verziókkal.

EZ SQL Reports Shortcode Widget and DB Backup


Just place some SQL on in the box and save it as a report. You can save multiple reports and they will be listed on the Admin Menu so you can quickly run them again anytime with just one click. You can place your reports on the User’s Dashboard based on Roles. You can also put a report on a Page or Post using a shortcode like [SQLREPORT name=”My Report” style=”padding: 6px;” /]

There is also an shortcode for the wpdb::get_var function that you can use to display a single value from your database. For example, this will display the number of users on your site:
[sqlgetvar]SELECT COUNT(*) FROM wp_users[/sqlgetvar]
Note: because of a known exploit in the WordPress shortcode functionality it is required that an admin user create an SQL Report with the exact query that will be used in the sqlgetvar shotcode, otherwise any subscriber could white their own shortcode query.

If you want to include an „Export to CSV” button on your page or post then use the additional shortcode [SQLEXPORTCSV] once on any page or post that contains a report you want visitors to be able to download. Thanks to @loristictok and @rob66bnu for posting the suggestion with the JavaScript that I used to make this new Shortcode.
Note: Adding this shortcode to the just one time will insert the „Export to CSV” button at the top of every HTML Table on the page.

Automatic Database Backups

Your database can be automatically saved and archived every hour and/or every day, and backups can be emailed to the address you specify. You can also restore the data to your WP DB or an external DB, which makes copying your database to another server and easy task.


  • This is a screenshot of the Plugin Settings and the Admin Menu with some example reports.


  1. Download and unzip the plugin into your WordPress plugins directory (usually /wp-content/plugins/).
  2. Activate the plugin through the ‘Plugins’ menu in your WordPress Admin.


What do I do after I activate the Plugin?

Start Creating and Saving Reports.

How do I get one of my reports onto a Page or Post?

Just use the shortcode SQLREPORT like this [SQLREPORT name=”My Report” style=”border: 2px solid #CCCCCC; padding: 6px;” /] but be sure the name attribute matches the exact name of a report you have already created.

How do I use a global PHP variable in one of my SQL queries?

Note: This < does not display properly on web pages so I used the HTML code < in this example, > works…

SELECT display_name FROM wp_users WHERE ID = ‘<?php $current_user->ID ?>’
(There are other ways to get the display name in WordPress, this is just a simple example to illustrate the proper syntax.)

SELECT * FROM wp_users WHERE user_registered > ‘<?php $_GET[thedate] ?>’
(note: this example assumes you are going to pass ‘thedate’ as a GET variable in the query string and, as this example shows, don’t use quotes inside the PHP brackets.)


There are a bunch of expensive and bloated options that try to do what this plugin does for free and don’t quite get there. Had reports being produced within half an hour of finding it, very happy.
I find this plug-in invaluable for producing reports that combine information from multiple plug-ins, such as membership and event ticket sales. Very stable and very flexible. Thanks for the September 2021 update. The new shortcode for adding a “Export to CSV” button is a great addition!
I’ve found this plugin useful to produce custom reports for website owners who don’t have the skills to run SQL queries in phpMyAdmin. I’d gladly pay for a premium version if it had at least an export to CSV button. Some extra styling options would be good too.
2018.10.08. 1 reply
Plugin gives error in WordPress 4.9.8 Deprecated: Function create_function() is deprecated in C:\xampp\htdocs\wp\wp-content\plugins\elisqlreports\index.php on line 881
15 (az összes) vélemény olvasása

Közreműködők és fejlesztők

“EZ SQL Reports Shortcode Widget and DB Backup” egy nyílt forráskódú szoftver. A bővítményhez a következő személyek járultak hozzá:


Változási napló


  • Added a Shortcode to put an „Export to CSV” button above the output Table so that a Report can be downloaded.
  • Fixed the „create_function() is deprecated” error to make the plugin compatible with the newest versions of PHP and WordPress.
  • Fixed an Undefined Index notice and cleaned up some older code that wasn’t needed any more.


  • Fixed the deletion of old backup files when the commandline backup method is used.


  • Changed all mysql_ functions to mysqli_ to fix deprecation errors in newer versions of PHP.
  • Fixed the usage of %s in queries containing PHP variables.
  • Fixed a vulnerability in the shortcodes that could be exploited by subscriber level users, thanks to J.D. Grimes for discovering this WordPress exploit.


  • Removed menu_group option to fix add_object_page deprecated bug.
  • Moved mysql_connect to fix deprecation error in some newer versions of PHP.
  • Fixed the saving of the custom backup directory setting.


  • Fixed two vulnerabilities that could be exploited by site admins, thanks to Felipe Molina for discovering these bugs.


  • Upgraded Widget Class for compatibility with WordPress 4.3 changes.


  • Fixed some minor styles in the admin pages.
  • Added a feature to hide all the reports from the main admin menu.


  • Fixed some minor bugs and improved the handling of multiple queries.
  • Added a call to do_shortcode to the query results so that shortcodes rendered in a report can be evaluated.


  • Made minor layout changes and enhancements to the Edit Reports page.
  • Fixed the Delete Report button to work even when the queries fails.
  • moved to the global wpdb object for full compatibility with WP 3.9 on MySQL 5.5.


  • Fixed table header row that contains column names.
  • Added an SQL Reports widget for the sidebar and footer area.
  • Added support for multiple queries on one report.


  • Improved the compatibility and reliability of the restore process.


  • Add ability to place reports on the dashboard for a given Role.


  • Created a second method for backups that uses the command line mysql.
  • Made compression optional and backup location changable.
  • Made restore function able to connect to external an DB.
  • Fixed shortcode to work with sanitize_title.


  • Added a WP cron scheduler for hourly and daily backups.
  • Upgraded the Backup process to ZIP and email all backups.
  • Added a shortcode for wpdb::get_var

  • Fixed the Backup process to capture VIEW definitions properly.

  • Added database backup feature.
  • Fixed Report name issue when using apostrophes.

  • Added Menu Placement and sorting options.
  • Expanded eval function to take multiple global variables.

  • Added eval function to take PHP code in the SQL Statement.

  • Added css classes to the Table and TRs for better style control.

  • Added error message to the Edit Report Page if SQL statement fails.

  • Added shortcode support so you can put your reports onto Pages and Posts.

  • Added styled DIV around Reports with ID tag so that you can customize the style.