The way you’re using $wpdb->prepare
doesn’t help anything. You have to properly prepare the values and then add them like with sprintf
as %s
or %d
.
Oh, and I don’t believe “working with WP ajax for over a year.”. In this case you would also know about the nopriv
hooks for public usage 🙂
add_action( 'wp_ajax_nopriv_action_stats', ...
Related Posts:
- Ajax with jQuery UI dialog not working
- When to use action hooks and plugins
- WordPress Integration with Google Groups
- What’s the preferred method of writing AJAX-enabled plugins?
- How do I show data from gravity forms in my template? [closed]
- How to load wp_editor via AJAX
- Delete tables from database when deleting plugin
- Is it bad practice to create own table for a plugin?
- How to Add an Index to Plugin Database table
- How can I delete orphan keys in WordPress database tables?
- Is there a plugin that will override the “Error establishing a database connection” message? [closed]
- How to delete all records from or empty a custom database table?
- What are these entries in the database? Looks similar to JSON
- WordPress sharding: which multi-DB plugin to use?
- Help with 4.6. Attachment response object in JSON API plugin
- Creating two database tables via plugin
- How to properly insert data into custom table via plugin
- How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
- How does WordPress handle MySQL row lock errors?
- How to make sense of the active_plugins option_value to enable and disable certain plugins from the database?
- Help making my pagination plugin better
- admin-ajax returning 400 error when request is made with Fetch API
- How to empty wordpress custom post Database table
- insert data in database table from plugin with WP3.1
- Simple form that saves to database
- How to run Two WordPress blogs with different themes and with single database and same content
- $wpdb->get_results leaking memory
- Plugins or Tutorials for displaying data from SQL-db on WP-page? [closed]
- Insert query inserts 2 entries, should insert 1
- Using Vagrant for customizable WordPress Multi-sites [closed]
- Is it a bad practice to go directly to the mysql database while developing a plugin?
- Updating WordPress – the best approach (updating wp core, plugins and db)
- How can I pass a variable to wp_ajax action?
- How do I check what plugins are enabled via the database?
- Loading shortcode with ajax
- How to store ACF custom fields data in a custom table
- How to pass JavaScript variable to PHP in wordpress widget?
- Add image to post from external URL
- Can I explicitly specify ENGINE=InnoDB in WordPress?
- How can a Firebase user registration and login be integrated into a WordPress site?
- Bad Request (Invalid Hostname) on working server, database problem
- Plugin Not Working, But Only On GoDaddy Hosted site
- Create custom column in post table in wordpress
- Custom database or Custom Post Types?
- How to add a sub menu with AJAX?
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- jQuery AJAX call not executing in Plugin
- Create Proper WordPress Ajax Request in JavaScript, NOT jQuery
- Execute a function using ajax
- Problem running Ajax in WordPress
- Ajax Load More and Masonry: is it possible to load admin-ajax.php in the front end?
- Custom database table for plugin not creating on activation
- WordPress plugin DB upgrade
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- ‘Lazy loading’ list of posts with pagination
- How to update widget_text in the wp_options table
- Errors while using ajax from external wordpress page
- I can’t access wordpress functions from an ajax php call
- Built in admin ajax hooks?
- How to include admin-ajax when loading external javascript
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- Get the last post ID
- delete_user_meta Delete one value out of array
- Add agenda items and notifications
- How to use wp-ajax in wp-cron
- Calling shortcode in wp_localize_script strips result
- Why is my ajax call refreshing the page?
- How to count number of records found in a database table?
- Should I global $wpdb outside of any of my plugin’s functions scope?
- prefix table and plugins
- Taking WordPress table prefixes into account
- Changing BIGINT to INT
- What’s the point of using WordPress’s built in admin-ajax.php?
- Admin-ajax.php is dying “0” without processing function
- WordPress register_activation_hook table creation not working
- How to add Edit | Delete button on rows?
- how to use ajax to display from database and load more in wordpress plugin
- The plugin generated x characters of unexpected output, $wpdb not defined
- How to remove an Ajax action
- how to show database content in wordpress post
- What is the easiest way to implement cascading database upgrade for my plugin?
- clean wp_options table unused rows
- How to create popup same as wordpress popup feature
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- Get Plugin Information from Multiple Sites Externally
- Shortcode in AJAX popup
- How to edit/delete single row items in a table on my own menu page
- Storing Email Account Passwords for SMTP Mailing for a WordPress Plugin
- How to add pagination to wpbakery grid?
- How can I process xml file on upload?
- Remove obsolete plugins artifacts from database tables
- How can I reuse the WordPress search form for a custom plugin / widget?
- AJAX image upload with a upload progress bar using media_handle_upload
- jQuery Plugin to use WordPress functions in AJAX request
- ajax front-end increment views on click
- If I delete plugins via FTP are settings kept in DB?
- greatest() function returns undefined property
- $wpdb working with ajax but showing ajax error instead of success
- Get total number of comment of the posts written by an author