WordPress cannot detect (present, loaded) mysqli
WordPress cannot detect (present, loaded) mysqli
WordPress cannot detect (present, loaded) mysqli
So the issue was actually a DDOS attack on our site. I used urlsnarf to see what requests were being placed and there were basically hundreds of POST request from about 20-30 or so IP addresses. Seems quite small scale for what I understood is a typical DDOS attack. It also explains why it took … Read more
$wpdb->get_results() query empty, but same query in phpmyadmin has results
Is it normal to have multiple postmeta tables in a WordPress database? No, each site has a single post/user/term and comment meta table. A multisite will have a set of those tables for each site in the multisite, plus network/site meta tables. What could be the reason behind this duplication? WP wouldn’t duplicate the tables … Read more
It appears, at least in cPanel, the lines in question were not required in the export, with the unsurprising consequence of the other encapsulated sql statements defaulting to reference the current database only. Turns out to be convenient when more than one database is configured, so long as there are no statements that select objects … Read more
Using the FPDF library (found at http://www.fpdf.org) you generate PDFs on the fly using any data from your WP site. function wpse60844_generate_pdf( $post ) { /* Define paths for where the PDF will be permanently or temporarily saved */ define( ‘FPDF_PATH’, plugin_dir_path( __DIR__ ) . ‘/fpdf/’ ); define( ‘SAVE_PATH’, plugin_dir_path( __DIR__ ) . ‘fpdf/pdfs/’ ); … Read more
Looking at the source of class-wp-query.php (ie, the WP_Query code), I find this: /* * Ensure the ID database query is able to be cached. * * Random queries are expected to have unpredictable results and * cannot be cached. Note the space before `RAND` in the string * search, that to ensure against a … Read more
When you use $wpdb->update in WordPress, it updates the database immediately, but WordPress might still show cached data. To ensure the updated data is displayed right away, you should manually clear the post cache using clean_post_cache($pid); after the update. Here’s the adjusted code: $pid = 55276; $post = get_post($pid); echo ‘original post:<BR>’.$post->post_excerpt.'<HR>’; $newtext=”some textt2″; global … Read more
This definitely is possible. You won’t be able to get your media back with just the sql file but you can get your content. Assuming this is your content and you have a proper admin account this is fairly easy. Install a fresh version of WordPress (on a web-server or locally). In phpMyAdmin. Delete the … Read more
The errors were generated because there was a plugin that forced sql modes to be used on the database that are actually “incompatible” with wordpress. The following code was sadly executed for every request… private function set_sql_mode() : void { // Make sure no sql modes can be blocked (By wordpress built-in incompatible modes) add_filter(‘incompatible_sql_modes’, … Read more