New answers tagged

0

Although this got asked some time ago, it came time to actually implement this and ran into issues (see: Connecting to external oracle database) The answer is no. Oracle is not a mysql based database, thus wordpress will not be able to connect to it via wpdb. For more information see the linked post.


3

You can't use WPDB to connect to databases that aren't MySQL/MariaDB based. There are no WordPress APIs or WP based solutions that will do this. Instead you will need to use a general PHP solution inside your plugin, and should look at general PHP resources and communities, not WP ones. I can also guarantee, that this will require additional PHP extensions ...


1

Have you tried the PDO Class yet? $db = new PDO("sqlsrv:Server=YouAddress;Database=YourDatabase", "Username", "Password"); If that fails, I think you might need specific drivers setup on your WordPress hosting environment to talk to that Oracle DB. (At least to get the PDO class working) https://www.php.net/manual/en/ref.pdo-oci.php


0

I have encountered the same issue but with product attributes, since I had more than 20000 products and much more product attributes, the queries were very slow. What I did was, in order to make it faster, wrote an small plugin converting tags to custom fields and then displayed those on the page, but in your case if you need the tag archive pages and its ...


0

A couple of things: there are robust CDN plugins that you should use instead of trying to do this manually. That'll handle performance if that's the motivation for separating php from other files. If your concern is just that you like to separate them in your source because of personal aesthetic code organization reasons, you should try this only in your ...


0

you can try this $all_posts = get_posts(array( 'numberposts' => - 1, 'post_status' => 'any', 'post_type' => get_post_types('', 'names') , )); foreach($all_posts as $all_post) { delete_post_media($all_post->ID); } function delete_post_media($post_id) { if (!isset($post_id)) return; elseif ($post_id == 0) return; ...


0

https://wordpress.org/plugins/advanced-database-cleaner/ This plugin comes in really handy. It actually gives you a method to schedule tasks (for instance, optimizing your database!). Hope this works for you


0

Use this: https://br.wordpress.org/plugins/all-in-one-wp-migration/ Install the plugin in the source and in destination (normal wordpress installation recently installed preferentially). Export the site in the plugin in source, then import in the destination. See the magic happens and be happy! :)


1

This is random, but a friend of mine got himself into the same situation a two weeks back and found this plugin to be helpful. https://wordpress.org/plugins/media-sync/ But as Tom mentioned above in his comment, you'll run into attachment post type issues. Hope this helps you get half way there!!


0

This should be possible. You can try function seconddb() { global $seconddb; $seconddb = new wpdb('Username','password','database name','localhost') } add_action('init','seconddb'); in your functions.php. Then you can fire a query to the new db like $seconddb->get_row( "SELECT * FROM yourtable..." ); instead of $wpdb->...


0

I have done this myself just recently. This may be late to the party, but in the event other want to know how, these were my steps in a wordpress environment Create a function that read the URL parameter, such as: function details_Page($atts) { global $wpdb; // Get the database record for this details $DatabaseId = $_GET['pid']; if(!is_numeric ($...


0

Actually I also wanted to use it now. Basically this is the only place in the internet to actually work for Tags. I have found some troubles with it, managed to edit it and it works for me now: Here you are saving also SPACE character to the value <input type="color" name="_tag_color" value=" <?php echo $color; ?>" -> deleted space <...


0

Hello Please check this article to solve above error - https://www.thetechtrackers.com/2019/06/table-prefix-must-not-be-empty.html and let me know your thoughts.


0

If you just want to get the 'customization' stuff of a theme from one site to another (running the same theme), then there are Customization Export/Import plugins that will add that feature to your Theme Customization theme. I've used "Customizer Import/Export" plugin with great success.


2

There are a number of options that depend on your level of comfort with code and the number of changes you need to make. There are also a number of ways to achieve the same result. You mention partial migrations. If you can do that, go with it. That's the fastest. I'm going to cover how I would handle this. It's not the right or wrong answer, but just my ...


0

One simple way to do this would be to use actual merge tags in your content. This can be done with the Gravity Forms Post Content Merge Tags plugin and also supports a global merge tags feature so you can fetch the entry data by the field label (without the field ID). https://gravitywiz.com/documentation/gravity-forms-post-content-merge-tags/#global-merge-...


0

The number in the above example are not indicative of a need for a custom database table solution, the database will be fine with just using the users table for the users, posts table for the posts and usermeta table for the link between users and posts. Its hard to offer a more definitive answer without knowing a little more about what the needs of the ...


0

Yes, your plugin is awesome. Just what you need to improve and finalize your plugin is that in newer WordPress versions, there are two different tables that contain user data. They are wp_user and wp_usermeta. And in the plugin, it is provided only one table to authenticate. So if this feature goes right, definitely your plugin is 100% successful. What ...


0

Found it. It was a field in phpMyAdmin which is set to a semicolon(;) by default. I have changed it to an unused char and the query ran normally.


2

The short answer is yes. Having a secure username and password is paramount to keeping your site secure.


1

Okay, here's what I did. If this happens, hopefully this will work favourably for you. If this is disabled by default, enable wp-debug by changing the value from false to true. Check that you have enabled WP_DEBUG_LOG and WP_LOG_DISPLAY. Try refreshing the page and see what happens. Either using WinSCP or the terminal, go to /var/log/apache2/error....


0

Putting together a working example of @Parthavi Patel answer. This is a page template. When the page loads the code is executed. If there's too many posts it would be good to use a conservative value on posts_per_page and adjust the offset parameter after each batch is executed. <?php /* * Template Name: experiments * Template Post Type: page *...


Top 50 recent answers are included