Tag Info

Hot answers tagged

2

You can use plugins such as BackupBuddy, but I prefer to script this and use wp-cli, which reads wp-config.php and means you don't have to worry about mysql credentials. wp-cli allows you to: export the db: wp db export <filename> import the db: wp db import <filename> safe search and replace (including serialised data): wp search-replace ...


2

It is because of different encrypted algorithm. Sometimes users will override the MD5, which is the default algorithm, and add their own, which might need a little longer length to store the password. Take a look at the Q&A's »What data type to use for hashed password field and what length?«, having detailed information about hashes and their length, ...


2

If you're going to keep using that database for other things as well, keep it separate. But from what you're saying, you are rather trying to expand functionality for it within the site, so better integrated. There are a lot of things you can do with a database even from within WP anyway.


2

With everything moving towards OOP programming with classes and the use of objects increasing and favored above the use of arrays as such, I would definitely go with returning results as an object. This just makes everything easier for future use But at the end of the day, you should always use what you are comfortable with within a set scope while keeping ...


2

This error: Fatal error: Call to a member function insert() on a non-object Means that $wpdb isn't instantiated so you are running your code too early or out of WordPress context-- for example, in an exterior PHP file accessed directly, which is what I suspect (Poorly conceived AJAX request perhaps?). As mentioned, the code has more formats that data ...


1

Brandoo isn't (sadly) hosted by Azure at the moment. This plugin is written to be used by version 3.6. Newer versions make use of queries which will not work on SQL Server. That's why you get those errors. So, you need to keep your version of wordpress at all costs till a newer version of brandoo is released: ...


1

Your problem is that serialized strings contains escape slashes that are not evaluated as such, because the wrapping quote is a single quote. You are using: $v = 'a:2:{i:0;b:0;s:8:\"auto_add\";a:0:{}}'; // wrong You have to use either $v = "a:2:{i:0;b:0;s:8:\"auto_add\";a:0:{}}"; // ok or $v = 'a:2:{i:0;b:0;s:8:"auto_add";a:0:{}}'; // ok By the ...


1

WordPress uses a prefix by default just in case the database is being used by more than WordPress. Since creating a new DB is pretty simple I would go that route. You would get the potential benefit of it being something separate that you can easily export, import or blow away if needed and also the potential security benefit if your WP site gets hacked this ...


1

Woocommerce stores 'order' metakeys in the table wp_woocommerce_termmeta. The mechanism it uses is the same as menu_order for posts. Check this thread for reference. Thanks


1

I am not sure where you got that export code but I don't see the PRIMARY KEY defined as it should be. Take a look at the code from Core that creates the table: 87 CREATE TABLE $wpdb->commentmeta ( 88 meta_id bigint(20) unsigned NOT NULL auto_increment, 89 comment_id bigint(20) unsigned NOT NULL default '0', 90 meta_key varchar(255) default ...


1

I notice that to link to each post, I am calling get_permalink() and this is creating an extra DB query for each post. Not true. If you check the link to the very old trac ticket #18822 in the post that you have linked to, this issue was raised by @kaiser in 2011. The question was answered by @scribu For example: $posts = get_posts(); foreach ( ...



Only top voted, non community-wiki answers of a minimum length are eligible