WordPress VIP realpath Alternative?

I don’t know what “wp vip” wants or needs, but you should be loading files by means of get_template_part, locate_template, site_url, or home_url and I am guessing that using one or more of those is what the “scan” wants. It is hard to say exactly which since you posted only the error and not the … Read more

Calling mysql_query() on another database, assumes WordPress using that database

Use a new instance of wpdb to connect and read from the other database: $mydb = new wpdb(‘blah’,’blah’,’dkpldump’,’localhost’); $event_categories = $mydb->get_results(“SELECT * FROM calendar_cats”); foreach( $event_categories as $event_category ){ //create term! $term = wp_insert_term( $event_category->categoryId, ‘event_category’, array( ‘slug’ => $event_category->categoryName ) ); }

List users with the most posts in the last 30 days

Here is what you need. <?php $date = new DateTime(‘NOW’); $date->sub(new DateInterval(‘P30D’)); //30 Days Interval echo $back30days= $date->format(‘Y-m-d H:i:s’) . “\n”; global $wpdp; $top_users = $wpdb->get_results(“select count(users.user_nicename) as posts, users.user_nicename as user_name from $wpdb->users as users join $wpdb->posts as posts where users.ID = posts.post_author AND posts.post_status=”publish” AND posts.post_date_gmt > ‘$back30days’ GROUP BY users.user_nicename ORDER BY … Read more

Exporting completed webiste for another server

It’s not difficult. You need to transfer files to the new server. Create a blank database and keep it’s name, user_name (this user must have all privileges of this newly created database) and password. Edit config.php file on new server with the these new details. Read: WordPress Codex for transferring site

Changing host permissions for MySQL users

If you’ve got access to the mysql database, you can change the grant tables directly: UPDATE mysql.user SET Host=”%” WHERE Host=”localhost” AND User=”username”; …and an analogous UPDATE-statement to change it back. Also you might need to make changes to the mysql.db table as well: UPDATE mysql.db SET Host=”%” WHERE Host=”localhost” AND User=”username”; and then flush … Read more

Will reducing mysql permissions hinder WP function? [duplicate]

WordPress absolutely does need “DELETE“, otherwise it has no way to delete posts or tags or options rows or anything else. The “DROP” command is sometimes used during upgrades, although it’s been a long time. The last time I think it was used was during the WordPress 2.3 update, which removed the assorted categories tables … Read more

Getting data from Mysql Table..confusing

Bulk of WP’s native data structures aren’t meant for direct MySQL access. They are typically accessed via PHP APIs which take care of MySQL generation/execution and many more things, such as allowing to filter data, caching it for performance, and so on. Your issue here is that from MySQL point of view meta values aren’t … Read more