Execute multiple PHP Snippets causes error?

Maybe I’m misunderstanding something, and it’s still not clear to me how you’re using this code, but it seems like a straightforward PHP error. You can’t declare an independent function with the same name twice. You declare (or define) the function with the function function_name() only once, and then you can call it by name. … Read more

How to update multiple row by one query

global $wpdb; $table_name = $wpdb->prefix . ‘table_name’; $data_to_insert = array ( array ( ‘name’ => ‘sample name’, ‘data’ => ‘something’ ), array ( ‘name’ => ‘sample name two’, ‘data’ => ‘something else’ ) ); foreach( $data_to_insert as $data ) { $wpdb->update( $table_name, $data ); }

How do I find users by password?

The user password (stored as an MD5 hash) can be retrieved like so: $users = get_users(); foreach ( $users as $user ) { $password = $user->user_pass; } Assuming you have some known value for passkey, you can hash it and compare it to each user’s password: $passkey = ‘somestring’; $hashed_passkey = md5( $passkey ); $users … Read more

cannot access wp-admin after options table crash and repair

I think you have lost your Admin Privileges. Please run following SQL query and login to WP Admin using newly created WP ADMIN. INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (‘4’, ‘demo’, MD5(‘demo’), ‘Your Name’, ‘[email protected]’, ‘http://www.test.com/’, ‘2011-06-07 00:00:00’, ”, ‘0’, ‘Your Name’); INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, … Read more

Very slow page loads

The problem as it turned out was the fusion-builder-mobile-layout-creator plugin. By going into settings for the theme and unchecking mobile layout (which checked itself again immediately), it cleared the buildup of entries. It may recur but that’s the fix. We might have to uninstall the plugin entirely longer term.