Plugin Directory

Changeset 3263304


Ignore:
Timestamp:
03/28/2025 08:56:21 AM (10 months ago)
Author:
flywp
Message:

Update to version 1.2.0 from GitHub

Location:
flywp-migrator
Files:
4 deleted
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • flywp-migrator/tags/1.2.0/flywp-migrator.php

    r3259238 r3263304  
    44 * Plugin URI: https://flywp.com
    55 * Description: Helps migrate WordPress sites to FlyWP platform
    6  * Version: 1.1.0
     6 * Version: 1.2.0
    77 * Author: FlyWP
    88 * Text Domain: flywp-migrator
  • flywp-migrator/tags/1.2.0/includes/Api/Database.php

    r3256652 r3263304  
    6565            ]
    6666        );
     67
     68        register_rest_route(
     69            $namespace,
     70            '/tables/structure',
     71            [
     72                'methods'             => WP_REST_Server::READABLE,
     73                'callback'            => [$this, 'get_all_tables_structure'],
     74                'permission_callback' => [Api::class, 'check_permission'],
     75            ]
     76        );
    6777    }
    6878
     
    303313        return $this->recursively_fix_serialized_string( $fixed_string, $key + 1 );
    304314    }
     315
     316    /**
     317     * Get structure of all tables
     318     *
     319     * @return WP_REST_Response
     320     */
     321    public function get_all_tables_structure() {
     322        global $wpdb;
     323
     324        $tables     = $wpdb->get_col( 'SHOW TABLES' );
     325        $structures = [];
     326
     327        foreach ( $tables as $table ) {
     328            $structure = $wpdb->get_results( 'SHOW CREATE TABLE `' . esc_sql( $table ) . '`', ARRAY_A );
     329
     330            if ( !empty( $structure ) ) {
     331                $create_table       = $structure[0]['Create Table'];
     332                $create_table       = str_replace( "CREATE TABLE `$table`", "DROP TABLE IF EXISTS `$table`; CREATE TABLE `$table`", $create_table );
     333                $structures[$table] = $create_table;
     334            }
     335        }
     336
     337        return rest_ensure_response( [
     338            'success'    => true,
     339            'structures' => $structures,
     340        ] );
     341    }
    305342}
  • flywp-migrator/tags/1.2.0/readme.txt

    r3259238 r3263304  
    44Requires at least: 6.0
    55Tested up to: 6.7
    6 Stable tag: 1.1.0
     6Stable tag: 1.2.0
    77Requires PHP: 7.4
    88License: GPL-2.0+
     
    8383== Changelog ==
    8484
     85= v1.2.0 (28 March, 2025) =
     86
     87 * **New:** Added REST API endpoint to retrieve the structure of all database tables.
     88
    8589= v1.1.0 (20 March, 2025) =
    8690
  • flywp-migrator/tags/1.2.0/vendor/composer/installed.php

    r3259238 r3263304  
    22    'root' => array(
    33        'name' => 'flywp/flywp-migrator',
    4         'pretty_version' => '1.1.0',
    5         'version' => '1.1.0.0',
    6         'reference' => '3ed9ff492a7200fe3461a69ebe649695b7263943',
     4        'pretty_version' => '1.2.0',
     5        'version' => '1.2.0.0',
     6        'reference' => '81a78ff3bac67cf38892fcdcdcc9d45baf445cdc',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'flywp/flywp-migrator' => array(
    14             'pretty_version' => '1.1.0',
    15             'version' => '1.1.0.0',
    16             'reference' => '3ed9ff492a7200fe3461a69ebe649695b7263943',
     14            'pretty_version' => '1.2.0',
     15            'version' => '1.2.0.0',
     16            'reference' => '81a78ff3bac67cf38892fcdcdcc9d45baf445cdc',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • flywp-migrator/trunk/flywp-migrator.php

    r3259238 r3263304  
    44 * Plugin URI: https://flywp.com
    55 * Description: Helps migrate WordPress sites to FlyWP platform
    6  * Version: 1.1.0
     6 * Version: 1.2.0
    77 * Author: FlyWP
    88 * Text Domain: flywp-migrator
  • flywp-migrator/trunk/includes/Api/Database.php

    r3256652 r3263304  
    6565            ]
    6666        );
     67
     68        register_rest_route(
     69            $namespace,
     70            '/tables/structure',
     71            [
     72                'methods'             => WP_REST_Server::READABLE,
     73                'callback'            => [$this, 'get_all_tables_structure'],
     74                'permission_callback' => [Api::class, 'check_permission'],
     75            ]
     76        );
    6777    }
    6878
     
    303313        return $this->recursively_fix_serialized_string( $fixed_string, $key + 1 );
    304314    }
     315
     316    /**
     317     * Get structure of all tables
     318     *
     319     * @return WP_REST_Response
     320     */
     321    public function get_all_tables_structure() {
     322        global $wpdb;
     323
     324        $tables     = $wpdb->get_col( 'SHOW TABLES' );
     325        $structures = [];
     326
     327        foreach ( $tables as $table ) {
     328            $structure = $wpdb->get_results( 'SHOW CREATE TABLE `' . esc_sql( $table ) . '`', ARRAY_A );
     329
     330            if ( !empty( $structure ) ) {
     331                $create_table       = $structure[0]['Create Table'];
     332                $create_table       = str_replace( "CREATE TABLE `$table`", "DROP TABLE IF EXISTS `$table`; CREATE TABLE `$table`", $create_table );
     333                $structures[$table] = $create_table;
     334            }
     335        }
     336
     337        return rest_ensure_response( [
     338            'success'    => true,
     339            'structures' => $structures,
     340        ] );
     341    }
    305342}
  • flywp-migrator/trunk/readme.txt

    r3259238 r3263304  
    44Requires at least: 6.0
    55Tested up to: 6.7
    6 Stable tag: 1.1.0
     6Stable tag: 1.2.0
    77Requires PHP: 7.4
    88License: GPL-2.0+
     
    8383== Changelog ==
    8484
     85= v1.2.0 (28 March, 2025) =
     86
     87 * **New:** Added REST API endpoint to retrieve the structure of all database tables.
     88
    8589= v1.1.0 (20 March, 2025) =
    8690
  • flywp-migrator/trunk/vendor/composer/installed.php

    r3259238 r3263304  
    22    'root' => array(
    33        'name' => 'flywp/flywp-migrator',
    4         'pretty_version' => '1.1.0',
    5         'version' => '1.1.0.0',
    6         'reference' => '3ed9ff492a7200fe3461a69ebe649695b7263943',
     4        'pretty_version' => '1.2.0',
     5        'version' => '1.2.0.0',
     6        'reference' => '81a78ff3bac67cf38892fcdcdcc9d45baf445cdc',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'flywp/flywp-migrator' => array(
    14             'pretty_version' => '1.1.0',
    15             'version' => '1.1.0.0',
    16             'reference' => '3ed9ff492a7200fe3461a69ebe649695b7263943',
     14            'pretty_version' => '1.2.0',
     15            'version' => '1.2.0.0',
     16            'reference' => '81a78ff3bac67cf38892fcdcdcc9d45baf445cdc',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.