Late response, but this might help others to understand why $wpdb->prepare should not be used with SQL CREATE statements.
The answer is that $wpdb->prepare surrounds strings (%s) with single quote marks. The CREATE statement produced from the above $wpdb->prepare is invalid SQL:
CREATE TABLE 'wp_classes' ( id mediumint(9) NOT NULL AUTO_INCREMENT,
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
name tinytext NOT NULL, text text NOT NULL,
url VARCHAR(55) DEFAULT '' NOT NULL, UNIQUE KEY id (id) );
instead of
CREATE TABLE wp_classes ( id mediumint...
Related Posts:
- dbDelta only creates the last table
- How can I make it so the Add New Post page has Visibility set to Private by default?
- How does WordPress handle MySQL row lock errors?
- Page Templates from plugin not working after upgrading WP to 4.7 or upper version
- Sync my svn repositories
- Override plugin localization
- When do I need to use esc_attr when using WordPress internal functions
- Using standard backend elements in Plugin
- Where should my plugin POST to?
- WordPress widget / plugin….fields not appearing in my widget
- How to list the Hooks and order of execution in current loading page? [duplicate]
- How to make my plugin theme-independent?
- Updating post meta for custom post types
- What is $tab in `install_plugins_{$tab}` hook?
- How do I use WordPress PHP functions in my Javascript code?
- Get all options saved by another plugin
- How to bulk send emails
- How to handle the Plugin Version on Update using Tortoise SVN and the worpdress.org Plugin Repository?
- Custom Shipping method not showing in checkout
- REST-API: extend media-endpoint
- Language Translation is not working?
- How to get the permalink of a page when loading my plugin
- Passing $this->get_field_name() to javascript
- add_action in functions.php, do_action in plugin?
- Ajax gives 400 error
- The Point of Using apply_filters()
- Is it possible to enqueue CSS files from plugin before theme’s CSS files?
- Read text defined under __()
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Serialize data for wp options
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- React JSX in WordPress Plugin Development
- My plugin wants to update another plugin
- Plugin Options Not Saving to Database in WP 4.5
- how to disable blockrenderAppender inside all Innerblocks?
- Redirection of users away from wp-admin (but not administrators)
- Using SVN to upload plugin created with gutenberg blocks
- Force quit running background job
- WordPress Plugin [closed]
- Custom plugin init action causing general slowness
- Proper way to replace the_content only for pages created by custom plugin
- Check if plugin exists/active “class_exists()” does not work on plugin territory
- How to get the permanent link in a plugin?
- Certain functions are undefined when called form mu-plugins
- Render content of multiple pages and their descendants
- Why am I unable to load scripts in head in plugin?
- adding a button to the media uploader
- How do I add $_SESSION[”] to my wordpress page?
- Plugin Activation Error – The plugin generated 22 characters of unexpected output during activation
- How to use the CSS of the WordPress core in the development of my administration page?
- output html on post or page from custom plugin [closed]
- Search users with custom meta data
- WordPress Object Oriented plugin development [closed]
- How can i list random author?
- How can I create a page as a draft from my plugin?
- How to get values from network settings panel?
- Woocommerce plugin – How to create two versions of the same plugin with slightly different implementation for different users
- How to Join wp_posts & wp_postmeta table using custom query
- Use localized plugin name and description even when the plugin is disabled
- Cron: Update four post at Hour
- submit two file input fields in the same form
- Unexpected character and syntax error on wp-includes/formatting.php [closed]
- Error datatable whit ajax
- Potential issue that plugin could have when it will be installed on several sites
- working code, not working – Plugin Dev
- category page multiple products add to cart any plugin available for woocommerce
- Cannot view Custom Post Type no matter what I try
- One time call to external API in widget
- Nested Actions and Filters
- How to use information from the database in the front-end?
- echo plugin results on pages
- register_activation_hook doesn’t fire at all
- WordPress scheduled event not working
- plugin_dir_url(__FILE__) searches parent theme in ACF extension
- My ajax request don´t work and return 0
- Method for creating many-to-one Relationships between custom posts and a single user?
- Confusing problem with displaying message recipient metadata
- Choose default template for a page with code
- Resetting AUTO_INCREMENT primary key
- Custom Page Templates for a complex application – code must sit in a plugin and not the Theme
- The plugin generated XXX characters of unexpected output…help?
- Template redirect inside of plugin not redirecting
- Validating values using Settings API?
- Display WP Start bar on front page only
- How to call uninstall.php?
- How to use a Must-Use plugin to hide a regular one and to hide itself?
- WordPress plugin not eching popular posts
- My first plugin doesn’t save the data in options
- Check if MemberPress exists before add_action call
- What is the source outline for a basic word press plugin?
- Submit posts in two different post types with the same form
- Load css classes after using ajax calls
- Integrating WordPress Content into a jQuery Slider
- How to create a “plugin” or “block” that can manipulate WordPress DOM in frontend?
- Create WordPress category dynamically
- Take Elementor For Email FIeld Check if user is registered. IF not registered then register on woocommerece
- Template selector for woocommerce product
- How to access values from your own settings page in javascript?
- How can I view forums from different sites in a single panel? [duplicate]
- The Best Multilanguage Plugin supporting the FSE [closed]