GithubHelp home page GithubHelp logo

wp-migrate-db-pro-tweaks's Introduction

WP Migrate DB Pro Tweaks

This is a WordPress plugin, meant as a starting point for developers to tweak WP Migrate DB Pro using WordPress filters.

Installation

Create a /wp-migrate-db-pro-tweaks/ folder in /wp-content/plugins/ and simply drop the wp-migrate-db-pro-tweaks.php file into it. Then go to the Plugins page in your WordPress dashboard and activate it.

Setup

Open the wp-migrate-db-pro-tweaks.php file and take a look at the init() function. You will notice that all the calls to add_filter() are commented out. So, at the moment the plugin does nothing even though it's activated. To enable a filter, simply uncomment the appropriate add_filter() line.

wp-migrate-db-pro-tweaks's People

Contributors

a5hleyrich avatar aprea avatar bradt avatar ianmjones avatar jrgould avatar sudar avatar webaware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-migrate-db-pro-tweaks's Issues

Is there a filter for completely ignoring a table in all migrations.

I have a custom table in the database with the same prefix as all the other tables. All the data in that table is environment specific so I never want it to be included in migrations. I was hoping there would be a simple filter that would allow me to exclude specific tables regardless of profile settings but I haven't been able to track one down.

I know that migration profiles could be set up to exclude this table, but there's too much room for human error there.

I did find a wpmd_tables filter. It has a second parameter of $scope. During the finalization step this filter is used to figure out which tables to finalize using the temp scope.

$temp_tables = $this->table->get_tables('temp');

However, if I exclude the table using that filter, it leaves behind the temporary table.

The best I've been able to come up with is waiting for WPMDB to create the temp table and then delete it:

        add_action('wpmdb_post_process_table_data', function($table) {
            $prefix = \DeliciousBrains\WPMDB\Common\Properties\Properties::getInstance()->temp_prefix;
            $tableToIgnore = ActivityLog::getTableName();
            if ($table === $prefix . $tableToIgnore) {
                global $wpdb;
                $wpdb->query("DROP TABLE IF EXISTS $table");
            }
        });

It works but it definitely feels ridiculous.

Demonstrate new before and after filters for custom data

Two new filters will be available in WPMDB 1.5 to allow data to be 'massaged' before and after the recursive find and replace occurs. This is specifically geared towards base64 encoded data. deliciousbrains/wp-migrate-db-pro#1078

An example should be provided.

Tweaks init() method being hooked in too late

Was having an issue where I was unable to use a filter to change the temporary prefix used during a migration. Tracked it down to how we're hooking in the init() method for the tweaks plugin.

It being fired on the WordPress init action at a priority of 9. While the WPMDB class was being initialized on the same hook at priority of 5.

Changed it to instead be hooked in at a priority of 4 instead.

Is this okay?

Is there a list of attributes which we can use in our hook methods?

Hi,

I was wondering if there's a list with all object attributes we can call inside the action hooks?

In my case, I want to log some deployment with the migration_complete hook, like if the migration was a network to network migration or it was subsite to subsite and which of the subsite was migrated.
So I need some more information besides $migration_type and $connection_url.

Is there something I've missed?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.