Plugin Directory

Changeset 3227461


Ignore:
Timestamp:
01/23/2025 12:48:24 PM (13 months ago)
Author:
instawp
Message:

Update to version 0.1.0.79 from GitHub

Location:
instawp-connect
Files:
24 added
46 edited
1 copied

Legend:

Unmodified
Added
Removed
  • instawp-connect/tags/0.1.0.79/dest.php

    r3216309 r3227461  
    55include_once 'includes/functions-pull-push.php';
    66
    7 if ( ! file_exists( 'iwp_log.txt' ) ) {
    8     file_put_contents( 'iwp_log.txt', "Migration log started \n" );
    9 }
    10 
    117if ( ! isset( $_SERVER['HTTP_X_IWP_MIGRATE_KEY'] ) || empty( $migrate_key = $_SERVER['HTTP_X_IWP_MIGRATE_KEY'] ) ) {
    128    header( 'x-iwp-status: false' );
     
    2622}
    2723
    28 //$options_data_path = $root_dir_path . DIRECTORY_SEPARATORz . 'wp-content' . DIRECTORY_SEPARATOR . 'instawpbackups' . DIRECTORY_SEPARATOR . 'migrate-push-db-' . substr( $migrate_key, 0, 5 ) . '.txt';
     24$log_file_path     = $root_dir_path . DIRECTORY_SEPARATOR . 'iwp-push-log.txt';
     25$received_db_path  = $root_dir_path . DIRECTORY_SEPARATOR . 'iwp-db-received.sql';
    2926$options_data_path = $root_dir_path . DIRECTORY_SEPARATOR . 'migrate-push-db-' . substr( $migrate_key, 0, 5 ) . '.txt';
    3027
     
    8986$req_order          = isset( $_GET['r'] ) ? intval( $_GET['r'] ) : 1;
    9087
    91 //if ( ! file_exists( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt' ) ) {
    92 //  file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', json_encode( $user_details ) . "\n" . json_encode( $retain_user ) );
    93 //}
    94 
    9588if ( in_array( $file_relative_path, $excluded_paths ) ) {
    9689    exit( 0 );
     
    9891
    9992$file_save_path = $root_dir_path . DIRECTORY_SEPARATOR . $file_relative_path;
    100 //file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', "full path: " . $file_save_path . "\n", FILE_APPEND );
     93
    10194if ( in_array( $file_save_path, $excluded_paths ) || str_contains( $file_save_path, 'instawp-autologin' ) ) {
    10295    exit( 0 );
    10396}
    104 //file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', "full path success" . "\n", FILE_APPEND );
    10597
    10698$directory_name = dirname( $file_save_path );
     
    121113        unlink( $file_save_path );
    122114    }
    123 //  $file_save_path = $root_dir_path . DIRECTORY_SEPARATOR . time() . '.sql'; // added for debugging
    124115    $file_stream = fopen( $file_save_path, 'a+b' );
    125116} else {
     
    212203    $commands     = explode( ";\n\n", $sql_commands );
    213204
     205    file_put_contents( $received_db_path, $sql_commands, FILE_APPEND );
     206
    214207    foreach ( $commands as $command ) {
    215208        if ( ! empty( trim( $command ) ) ) {
     
    231224        if ( isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) ) {
    232225            $log_content = "x-iwp-progress: {$_SERVER['HTTP_X_IWP_PROGRESS']}\n";
    233             file_put_contents( 'iwp_log.txt', $log_content, FILE_APPEND );
     226            file_put_contents( $log_file_path, $log_content, FILE_APPEND );
    234227        }
    235228
    236229        if ( isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) && $_SERVER['HTTP_X_IWP_PROGRESS'] == 100 ) {
    237 
    238             file_put_contents( 'iwp_log.txt', "Retain User: " . var_dump( $retain_user ), FILE_APPEND );
    239             file_put_contents( 'iwp_log.txt', "User Details: " . json_encode( $user_details ), FILE_APPEND );
    240230
    241231            // Retaining user after migration
     
    262252                $query  = "INSERT INTO {$table_prefix}users ($fields) VALUES ($values)";
    263253
    264                 file_put_contents( 'iwp_log.txt', "Query: " . $query, FILE_APPEND );
    265 
    266254                $query_response = $mysqli->query( $query );
    267 
    268                 file_put_contents( 'iwp_log.txt', "Query Response: " . json_encode( $query_response ), FILE_APPEND );
    269255
    270256                if ( $query_response ) {
    271257                    $user_id = $mysqli->insert_id;
    272258
    273                     file_put_contents( 'iwp_log.txt', "User ID: " . json_encode( $user_id ), FILE_APPEND );
    274 
    275259                    if ( $user_id ) {
    276 
    277260                        // Set user capabilities
    278261                        $caps_key   = $mysqli->real_escape_string( $table_prefix . 'capabilities' );
     
    290273
    291274                if ( $mysqli->error ) {
    292                     file_put_contents( 'iwp_log.txt', "insert response: " . $mysqli->error . "\n", FILE_APPEND );
     275                    file_put_contents( $log_file_path, "insert response: " . $mysqli->error . "\n", FILE_APPEND );
    293276                }
    294277            }
     
    300283
    301284                try {
    302                     $query = "INSERT INTO `{$table_prefix}options` (`option_name`, `option_value`) VALUES('instawp_api_options', '{$instawp_api_options}')";
    303 
    304                     // log start
    305                     file_put_contents( 'iwp_log.txt', "insert query: " . $query . "\n", FILE_APPEND );
    306                     // log end
    307 
     285                    $query           = "INSERT INTO `{$table_prefix}options` (`option_name`, `option_value`) VALUES('instawp_api_options', '{$instawp_api_options}')";
    308286                    $insert_response = $mysqli->query( $query );
    309 
    310                     // log start
    311                     file_put_contents( 'iwp_log.txt', "insert response: " . var_dump( $insert_response ) . "\n", FILE_APPEND );
    312                     // log end
    313287
    314288                    if ( ! $insert_response ) {
     
    316290                    }
    317291                } catch ( Exception $e ) {
    318                     // log start
    319                     file_put_contents( 'iwp_log.txt', "insert exception: " . $e->getMessage() . "\n", FILE_APPEND );
    320                     // log end
     292                    file_put_contents( $log_file_path, "insert exception: " . $e->getMessage() . "\n", FILE_APPEND );
    321293
    322294                    $is_insert_failed = true;
     
    325297                if ( $is_insert_failed ) {
    326298                    try {
    327                         $query = "UPDATE `{$table_prefix}options` SET `option_value` = '{$instawp_api_options}' WHERE `option_name` = 'instawp_api_options'";
    328 
    329                         // log start
    330                         file_put_contents( 'iwp_log.txt', "update query: " . $query . "\n", FILE_APPEND );
    331                         // log end
    332 
     299                        $query           = "UPDATE `{$table_prefix}options` SET `option_value` = '{$instawp_api_options}' WHERE `option_name` = 'instawp_api_options'";
    333300                        $update_response = $mysqli->query( $query );
    334 
    335                         // log start
    336                         file_put_contents( 'iwp_log.txt', "update response: " . var_dump( $update_response ) . "\n", FILE_APPEND );
    337                         // log end
    338301                    } catch ( Exception $e ) {
     302                        file_put_contents( $log_file_path, "Update failed. Error message: {$e->getMessage()}\n", FILE_APPEND );
     303
    339304                        header( 'x-iwp-status: false' );
    340305                        header( "x-iwp-message: Update failed. Error message: {$e->getMessage()}\n" );
     
    355320    }
    356321
    357     if ( file_exists( $file_save_path ) ) {
    358         unlink( $file_save_path );
    359     }
     322//  if ( file_exists( $file_save_path ) ) {
     323//      unlink( $file_save_path );
     324//  }
    360325}
    361326
     
    373338                    $file_name = $zip->getNameIndex( $i );
    374339
    375                     if ( ! array_contains_str( $directory_name . DIRECTORY_SEPARATOR . $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) {
    376                         //file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', "zip path: " . $directory_name . DIRECTORY_SEPARATOR . $file_name . "\n", FILE_APPEND );
     340                    if ( false !== strpos( $directory_name, DIRECTORY_SEPARATOR . 'wp-content' ) || false !== strpos( $directory_name, DIRECTORY_SEPARATOR . 'wp-includes' ) || false !== strpos( $directory_name, DIRECTORY_SEPARATOR . 'wp-admin' ) ) {
     341                        if ( ! array_contains_str( $directory_name . DIRECTORY_SEPARATOR . $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) {
     342                            $extracted_files[] = $file_name;
     343                        }
     344                    } else if ( ! in_array( $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) {
    377345                        $extracted_files[] = $file_name;
    378346                    }
     
    448416
    449417if ( str_contains( $file_relative_path, 'wp-config.php' ) || $is_wp_config_file ) {
    450     //file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', "wp-config.php" . "\n", FILE_APPEND );
    451418    if ( ! isset( $db_host ) || ! isset( $db_username ) || ! isset( $db_password ) || ! isset( $db_name ) ) {
    452419        header( 'x-iwp-status: false' );
  • instawp-connect/tags/0.1.0.79/includes/apis/class-instawp-rest-api.php

    r3220103 r3227461  
    145145        $api_domain           = isset( $parameters['api_domain'] ) ? sanitize_text_field( $parameters['api_domain'] ) : '';
    146146        $plan_id              = isset( $parameters['advance_connect_plan_id'] ) ? intval( $parameters['advance_connect_plan_id'] ) : 0;
     147        $managed              = isset( $parameters['managed'] ) ? boolval( $parameters['managed'] ) : true;
    147148
    148149        if ( empty( $wp_username ) || empty( $application_password ) ) {
     
    250251        }
    251252
    252         if ( ! Helper::instawp_generate_api_key( $api_key, $jwt ) ) {
     253        if ( ! Helper::instawp_generate_api_key( $api_key, $jwt, $managed ) ) {
    253254            return $this->send_response( array(
    254255                'status'  => false,
  • instawp-connect/tags/0.1.0.79/includes/class-instawp-tools.php

    r3222813 r3227461  
    498498        if ( isset( $config_constants['DB_HOST'] ) ) {
    499499            unset( $config_constants['DB_HOST'] );
     500        }
     501
     502        if ( isset( $config_constants['MYSQL_CLIENT_FLAGS'] ) ) {
     503            unset( $config_constants['MYSQL_CLIENT_FLAGS'] );
    500504        }
    501505
  • instawp-connect/tags/0.1.0.79/includes/functions-pull-push.php

    r3216309 r3227461  
    156156        }
    157157
    158         foreach ( $array as $item ) {
    159             if ( str_contains( $string, $item ) ) {
    160                 return true;
    161             }
    162         }
     158//      foreach ( $array as $item ) {
     159//          if ( str_contains( $string, $item ) ) {
     160//              return true;
     161//          }
     162//      }
    163163
    164164        return false;
  • instawp-connect/tags/0.1.0.79/instawp-connect.php

    r3223388 r3227461  
    88 * Plugin Name:       InstaWP Connect
    99 * Description:       1-click WordPress plugin for Staging, Migrations, Management, Sync and Companion plugin for InstaWP.
    10  * Version:           0.1.0.78
     10 * Version:           0.1.0.79
    1111 * Author:            InstaWP Team
    1212 * Author URI:        https://instawp.com/
     
    2828global $wpdb;
    2929
    30 defined( 'INSTAWP_PLUGIN_VERSION' ) || define( 'INSTAWP_PLUGIN_VERSION', '0.1.0.78' );
     30defined( 'INSTAWP_PLUGIN_VERSION' ) || define( 'INSTAWP_PLUGIN_VERSION', '0.1.0.79' );
    3131defined( 'INSTAWP_API_DOMAIN_PROD' ) || define( 'INSTAWP_API_DOMAIN_PROD', 'https://app.instawp.io' );
    3232
     
    155155
    156156run_instawp();
     157
     158
     159/**
     160 * Custom Functions Started
     161 */
     162if ( ! function_exists( 'iwp_is_serialized' ) ) {
     163    function iwp_is_serialized( $data, $strict = true ) {
     164        // If it isn't a string, it isn't serialized.
     165        if ( ! is_string( $data ) ) {
     166            return false;
     167        }
     168        $data = trim( $data );
     169        if ( 'N;' === $data ) {
     170            return true;
     171        }
     172        if ( strlen( $data ) < 4 ) {
     173            return false;
     174        }
     175        if ( ':' !== $data[1] ) {
     176            return false;
     177        }
     178        if ( $strict ) {
     179            $lastc = substr( $data, - 1 );
     180            if ( ';' !== $lastc && '}' !== $lastc ) {
     181                return false;
     182            }
     183        } else {
     184            $semicolon = strpos( $data, ';' );
     185            $brace     = strpos( $data, '}' );
     186            // Either ; or } must exist.
     187            if ( false === $semicolon && false === $brace ) {
     188                return false;
     189            }
     190            // But neither must be in the first X characters.
     191            if ( false !== $semicolon && $semicolon < 3 ) {
     192                return false;
     193            }
     194            if ( false !== $brace && $brace < 4 ) {
     195                return false;
     196            }
     197        }
     198        $token = $data[0];
     199        switch ( $token ) {
     200            case 's':
     201                if ( $strict ) {
     202                    if ( '"' !== substr( $data, - 2, 1 ) ) {
     203                        return false;
     204                    }
     205                } elseif ( ! str_contains( $data, '"' ) ) {
     206                    return false;
     207                }
     208            // Or else fall through.
     209            case 'a':
     210            case 'O':
     211            case 'E':
     212                return (bool) preg_match( "/^{$token}:[0-9]+:/s", $data );
     213            case 'b':
     214            case 'i':
     215            case 'd':
     216                $end = $strict ? '$' : '';
     217
     218                return (bool) preg_match( "/^{$token}:[0-9.E+-]+;$end/", $data );
     219        }
     220
     221        return false;
     222    }
     223}
     224
     225if ( ! function_exists( 'iwp_maybe_serialize' ) ) {
     226    function iwp_maybe_serialize( $data ) {
     227
     228        if ( is_array( $data ) || is_object( $data ) ) {
     229            return serialize( $data );
     230        }
     231
     232        if ( iwp_is_serialized( $data, false ) ) {
     233            return serialize( $data );
     234        }
     235
     236        return $data;
     237    }
     238}
     239
     240
     241function iwp_recursive_unserialize_replace( $data, $search_replace ) {
     242
     243    if ( is_string( $data ) ) {
     244        return str_replace( array_keys( $search_replace ), array_values( $search_replace ), $data );
     245    }
     246
     247    if ( is_array( $data ) ) {
     248        $data = array_map( function ( $item ) use ( $search_replace ) {
     249            return iwp_recursive_unserialize_replace( $item, $search_replace );
     250        }, $data );
     251    } elseif ( is_object( $data ) ) {
     252        // Check if the object is __PHP_Incomplete_Class
     253        if ( $data instanceof __PHP_Incomplete_Class ) {
     254
     255            $className = get_class( $data );
     256
     257            // iwp_send_migration_log( 'Incomplete Class Warning', "Encountered incomplete class: $className. Make sure this class is loaded before unserialization.", [ 'class' => $className ] );
     258
     259            return $data;
     260        }
     261
     262        $properties = [];
     263
     264        try {
     265            $reflection = new ReflectionObject( $data );
     266            $properties = $reflection->getProperties();
     267        } catch ( Exception $e ) {
     268//          iwp_send_migration_log(
     269//              'Reflection Error',
     270//              "Failed to reflect object of class " . get_class( $data ),
     271//              [ 'error' => $e->getMessage() ]
     272//          );
     273
     274            return $data;
     275        }
     276
     277        echo "<pre>"; print_r( $properties ); echo "</pre>";
     278
     279//      foreach ( $properties as $property ) {
     280//          try {
     281//              $property->setAccessible( true );
     282//              $value     = $property->getValue( $data );
     283//              $new_value = iwp_recursive_unserialize_replace( $value, $search_replace );
     284//              $property->setValue( $data, $new_value );
     285//          } catch ( Exception $e ) {
     286//              // Skip this property if we can't access it
     287//              continue;
     288//          }
     289//      }
     290    }
     291
     292    return $data;
     293}
     294
     295if ( ! function_exists( 'iwp_maybe_unserialize' ) ) {
     296    function iwp_maybe_unserialize( $data ) {
     297        if ( iwp_is_serialized( $data ) ) {
     298            global $search_replace;
     299
     300            $data = @unserialize( trim( $data ) );
     301
     302            if ( is_array( $data ) ) {
     303                $data = iwp_recursive_unserialize_replace( $data, $search_replace );
     304            }
     305        }
     306
     307        return $data;
     308    }
     309}
     310
     311if ( ! function_exists( 'iwp_array_filter_recursive' ) ) {
     312    function iwp_array_filter_recursive( array $array, callable $callback = null ) {
     313        $array = is_callable( $callback ) ? array_filter( $array, $callback ) : array_filter( $array );
     314        foreach ( $array as &$value ) {
     315            if ( is_array( $value ) ) {
     316                $value = call_user_func( __FUNCTION__, $value, $callback );
     317            }
     318        }
     319
     320        return $array;
     321    }
     322}
     323/**
     324 * Custom Functions End
     325 */
     326
     327add_action( 'wp_head', function () {
     328    if ( isset( $_GET['debug'] ) ) {
     329
     330        global $mysqli, $search_replace;
     331
     332        $db_host     = 'localhost';
     333        $db_username = 'xifafugelu2996_fogipixuwo5351';
     334        $db_password = '6DLeQM9Aj12sf8VxGvXI';
     335        $db_name     = 'xifafugelu2996_9NCiSZ5Dcbl8LQk1Ustq';
     336        $mysqli      = new mysqli( $db_host, $db_username, $db_password, $db_name );
     337        $mysqli->set_charset( 'utf8' );
     338
     339        $offset    = isset( $_GET['offset'] ) ? (int) $_GET['offset'] : 839;
     340        $tableName = isset( $_GET['table'] ) ? sanitize_text_field( $_GET['table'] ) : 'AXF_options';
     341        $query     = "SELECT * FROM `$tableName` WHERE 1 LIMIT 3 OFFSET $offset";
     342        $result    = $mysqli->query( $query );
     343
     344        $source_domain  = 'astonished-sandpiper-aab1df.instawp.xyz';
     345        $dest_domain    = 'roomier-mallard-5683f5.instawp.xyz';
     346        $search_replace = [
     347            '//' . $source_domain   => '//' . $dest_domain,
     348            '\/\/' . $source_domain => '\/\/' . $dest_domain,
     349        ];
     350
     351        if ( $mysqli->errno ) {
     352            echo "<pre>";
     353            print_r( $mysqli->connect_error );
     354            echo "</pre>";
     355
     356            return;
     357        }
     358
     359        while ( $dataRow = $result->fetch_assoc() ) {
     360            $columns = array_map( function ( $value ) {
     361                global $mysqli;
     362
     363                if ( empty( $value ) ) {
     364                    return is_array( $value ) ? [] : '';
     365                }
     366
     367                return $mysqli->real_escape_string( $value );
     368            }, array_keys( $dataRow ) );
     369
     370            $values = array_map( function ( $value ) {
     371                global $mysqli;
     372
     373                if ( is_numeric( $value ) ) {
     374                    // If $value has leading zero it will mark as string and bypass returning as numeric
     375                    if ( substr( $value, 0, 1 ) !== '0' ) {
     376                        return $value;
     377                    }
     378                } else if ( is_null( $value ) ) {
     379                    return "NULL";
     380                } else if ( is_array( $value ) && empty( $value ) ) {
     381                    $value = [];
     382                } else if ( is_string( $value ) ) {
     383                    if ( iwp_is_serialized( $value ) ) {
     384                        $value = iwp_maybe_unserialize( $value );
     385                        $value = iwp_maybe_serialize( $value );
     386                    }
     387                    $value = $mysqli->real_escape_string( $value );
     388                }
     389
     390                return "'" . $value . "'";
     391            }, array_values( $dataRow ) );
     392
     393            $sql_query = "INSERT IGNORE INTO `$tableName` (`" . implode( "`, `", $columns ) . "`) VALUES (" . implode( ", ", $values ) . ");";
     394
     395            echo "<pre>";
     396            print_r( $sql_query );
     397            echo "</pre>";
     398        }
     399
     400        die();
     401    }
     402}, 0 );
     403
  • instawp-connect/tags/0.1.0.79/languages/instawp-connect.pot

    r3220103 r3227461  
    66"Content-Type: text/plain; charset=UTF-8\n"
    77"Content-Transfer-Encoding: 8bit\n"
    8 "POT-Creation-Date: 2025-01-09 09:06+0000\n"
     8"POT-Creation-Date: 2025-01-23 12:44+0000\n"
    99"X-Poedit-Basepath: ..\n"
    1010"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
     
    9090msgstr ""
    9191
    92 #: includes/apis/class-instawp-rest-api.php:151
     92#: includes/apis/class-instawp-rest-api.php:152
    9393msgid "This request is not authorized."
    9494msgstr ""
    9595
    96 #: includes/apis/class-instawp-rest-api.php:158
     96#: includes/apis/class-instawp-rest-api.php:159
    9797msgid "API key and JWT token is required."
    9898msgstr ""
    9999
    100 #: includes/apis/class-instawp-rest-api.php:172
     100#: includes/apis/class-instawp-rest-api.php:173
    101101msgid "No user found with the provided username."
    102102msgstr ""
    103103
    104 #: includes/apis/class-instawp-rest-api.php:180
     104#: includes/apis/class-instawp-rest-api.php:181
    105105msgid "This user does not have capability to config the website."
    106106msgstr ""
    107107
    108 #: includes/apis/class-instawp-rest-api.php:199
     108#: includes/apis/class-instawp-rest-api.php:200
    109109msgid "Application password does not match."
    110110msgstr ""
    111111
    112 #: includes/apis/class-instawp-rest-api.php:221
     112#: includes/apis/class-instawp-rest-api.php:222
    113113msgid "This website is already connected!"
    114114msgstr ""
    115115
    116 #: includes/apis/class-instawp-rest-api.php:241
     116#: includes/apis/class-instawp-rest-api.php:242
    117117msgid "Invalid API domain parameter passed."
    118118msgstr ""
    119119
    120 #: includes/apis/class-instawp-rest-api.php:255
     120#: includes/apis/class-instawp-rest-api.php:256
    121121msgid "API Key is not valid."
    122122msgstr ""
    123123
    124 #: includes/apis/class-instawp-rest-api.php:262
     124#: includes/apis/class-instawp-rest-api.php:263
    125125msgid "Something went wrong during connecting to InstaWP."
    126126msgstr ""
    127127
    128 #: includes/apis/class-instawp-rest-api.php:269
     128#: includes/apis/class-instawp-rest-api.php:270
    129129msgid "Connected."
    130130msgstr ""
    131131
    132 #: includes/apis/class-instawp-rest-api.php:289
     132#: includes/apis/class-instawp-rest-api.php:290
    133133msgid "This site is not currently marked as staging"
    134134msgstr ""
    135135
    136 #: includes/apis/class-instawp-rest-api.php:297
     136#: includes/apis/class-instawp-rest-api.php:298
    137137msgid "Invalid parent connect ID"
    138138msgstr ""
    139139
    140 #: includes/apis/class-instawp-rest-api.php:305
     140#: includes/apis/class-instawp-rest-api.php:306
    141141msgid "Parent connect ID does not match"
    142142msgstr ""
    143143
    144 #: includes/apis/class-instawp-rest-api.php:317
     144#: includes/apis/class-instawp-rest-api.php:318
    145145msgid "Site has been marked as parent"
    146146msgstr ""
    147147
    148 #: includes/apis/class-instawp-rest-api.php:338
     148#: includes/apis/class-instawp-rest-api.php:339
    149149msgid "Invalid connect ID"
    150150msgstr ""
    151151
    152 #: includes/apis/class-instawp-rest-api.php:349
     152#: includes/apis/class-instawp-rest-api.php:350
    153153msgid "Site has been marked as staging"
    154154msgstr ""
    155155
    156 #: includes/apis/class-instawp-rest-api.php:370
     156#: includes/apis/class-instawp-rest-api.php:371
    157157msgid "Staging Site List Refreshed."
    158158msgstr ""
    159159
    160 #: includes/apis/class-instawp-rest-api.php:392
     160#: includes/apis/class-instawp-rest-api.php:393
    161161msgid "Plugin reset Successful."
    162162msgstr ""
    163163
    164 #: includes/apis/class-instawp-rest-api.php:462
     164#: includes/apis/class-instawp-rest-api.php:463
    165165msgid "Activity log is enabled."
    166166msgstr ""
    167167
    168 #: includes/apis/class-instawp-rest-api.php:462
     168#: includes/apis/class-instawp-rest-api.php:463
    169169msgid "Activity log is disabled."
    170170msgstr ""
    171171
    172 #: includes/apis/class-instawp-rest-api.php:484, includes/functions.php:778
     172#: includes/apis/class-instawp-rest-api.php:485, includes/functions.php:778
    173173msgid "No login information found."
    174174msgstr ""
    175175
    176 #: includes/apis/class-instawp-rest-api.php:544
     176#: includes/apis/class-instawp-rest-api.php:545
    177177msgid "All Temporary logins are removed."
    178178msgstr ""
    179179
    180 #: includes/apis/class-instawp-rest-api.php:605
     180#: includes/apis/class-instawp-rest-api.php:606
    181181msgid "No items found"
    182182msgstr ""
    183183
    184 #: includes/apis/class-instawp-rest-api.php:614
     184#: includes/apis/class-instawp-rest-api.php:615
    185185msgid "Update task create successfully"
    186186msgstr ""
    187187
    188 #: includes/apis/class-instawp-rest-api.php:675
     188#: includes/apis/class-instawp-rest-api.php:676
    189189msgid "Empty bearer token."
    190190msgstr ""
    191191
    192 #: includes/apis/class-instawp-rest-api.php:688
     192#: includes/apis/class-instawp-rest-api.php:689
    193193msgid "Empty api key."
    194194msgstr ""
    195195
    196 #: includes/apis/class-instawp-rest-api.php:703
     196#: includes/apis/class-instawp-rest-api.php:704
    197197msgid "Invalid bearer token."
    198198msgstr ""
    199199
    200 #: includes/apis/class-instawp-rest-api.php:840
     200#: includes/apis/class-instawp-rest-api.php:841
    201201msgid "Route not allowed"
    202202msgstr ""
    203203
    204 #: includes/apis/class-instawp-rest-api.php:943, includes/class-instawp-setting.php:583, includes/class-instawp-setting.php:589
     204#: includes/apis/class-instawp-rest-api.php:944, includes/class-instawp-setting.php:583, includes/class-instawp-setting.php:589
    205205msgid "Heartbeat"
    206206msgstr ""
    207207
    208 #: includes/apis/class-instawp-rest-api.php:944, includes/class-instawp-hooks.php:285, includes/class-instawp-setting.php:249, includes/class-instawp-setting.php:621
     208#: includes/apis/class-instawp-rest-api.php:945, includes/class-instawp-hooks.php:285, includes/class-instawp-setting.php:249, includes/class-instawp-setting.php:621
    209209msgid "Database Manager"
    210210msgstr ""
    211211
    212 #: includes/apis/class-instawp-rest-api.php:945, includes/class-instawp-setting.php:629
     212#: includes/apis/class-instawp-rest-api.php:946, includes/class-instawp-setting.php:629
    213213msgid "Install Plugin / Themes"
    214214msgstr ""
    215215
    216 #: includes/apis/class-instawp-rest-api.php:946, includes/class-instawp-setting.php:637
     216#: includes/apis/class-instawp-rest-api.php:947, includes/class-instawp-setting.php:637
    217217msgid "Update Core / Plugin / Themes"
    218218msgstr ""
    219219
    220 #: includes/apis/class-instawp-rest-api.php:947, includes/class-instawp-setting.php:645
     220#: includes/apis/class-instawp-rest-api.php:948, includes/class-instawp-setting.php:645
    221221msgid "Activate / Deactivate"
    222222msgstr ""
    223223
    224 #: includes/apis/class-instawp-rest-api.php:948, includes/class-instawp-setting.php:653
     224#: includes/apis/class-instawp-rest-api.php:949, includes/class-instawp-setting.php:653
    225225msgid "Config Management"
    226226msgstr ""
    227227
    228 #: includes/apis/class-instawp-rest-api.php:949, includes/class-instawp-setting.php:661
     228#: includes/apis/class-instawp-rest-api.php:950, includes/class-instawp-setting.php:661
    229229msgid "Site Inventory"
    230230msgstr ""
    231231
    232 #: includes/apis/class-instawp-rest-api.php:950, includes/class-instawp-setting.php:250, includes/class-instawp-setting.php:669
     232#: includes/apis/class-instawp-rest-api.php:951, includes/class-instawp-setting.php:250, includes/class-instawp-setting.php:669
    233233msgid "Debug Log"
    234234msgstr ""
     
    730730msgstr ""
    731731
    732 #: includes/class-instawp-tools.php:701
     732#: includes/class-instawp-tools.php:709
    733733msgid "API key not found"
    734734msgstr ""
    735735
    736 #: includes/class-instawp-tools.php:926
     736#: includes/class-instawp-tools.php:934
    737737msgid "Root directory for this WordPress installation could not find."
    738738msgstr ""
    739739
    740 #: includes/class-instawp-tools.php:947
     740#: includes/class-instawp-tools.php:955
    741741msgid "Tracking database could not found."
    742742msgstr ""
    743743
    744 #: includes/class-instawp-tools.php:957
     744#: includes/class-instawp-tools.php:965
    745745msgid "API Signature and others data could not set properly"
    746746msgstr ""
    747747
    748 #: includes/class-instawp-tools.php:983
     748#: includes/class-instawp-tools.php:991
    749749msgid "InstaWP could not access or read required files from your WordPress directory due to file permission issue."
    750750msgstr ""
    751751
    752 #: includes/class-instawp-tools.php:985
     752#: includes/class-instawp-tools.php:993
    753753msgid "Learn more."
    754754msgstr ""
    755755
    756 #: includes/class-instawp-tools.php:1193
     756#: includes/class-instawp-tools.php:1201
    757757msgid "Launch %s"
    758758msgstr ""
    759759
    760 #: includes/class-instawp-tools.php:1281
     760#: includes/class-instawp-tools.php:1289
    761761msgid "Please create staging sites first."
    762762msgstr ""
    763763
    764 #: includes/class-instawp-tools.php:1282
     764#: includes/class-instawp-tools.php:1290
    765765msgid "Skip"
    766766msgstr ""
    767767
    768 #: includes/class-instawp-tools.php:1283
     768#: includes/class-instawp-tools.php:1291
    769769msgid "Do you really want to disconnect the plugin? It will completely remove the existing staging sites from the plugin."
    770770msgstr ""
    771771
    772 #: includes/class-instawp-tools.php:1284
     772#: includes/class-instawp-tools.php:1292
    773773msgid "Do you still want to disconnect the plugin?"
    774774msgstr ""
    775775
    776 #: includes/class-instawp-tools.php:1332
     776#: includes/class-instawp-tools.php:1340
    777777msgid "Zip archive is not opening."
    778778msgstr ""
    779779
    780 #: includes/class-instawp-tools.php:1385
     780#: includes/class-instawp-tools.php:1393
    781781msgid "No compression method find."
    782782msgstr ""
    783783
    784 #: includes/class-instawp-tools.php:1429
     784#: includes/class-instawp-tools.php:1437
    785785msgid "Site ID not found in site create response."
    786786msgstr ""
    787787
    788 #: includes/class-instawp-tools.php:1468
     788#: includes/class-instawp-tools.php:1476
    789789msgid "SFTP login failed."
    790790msgstr ""
    791791
    792 #: includes/class-instawp-tools.php:1479
     792#: includes/class-instawp-tools.php:1487
    793793msgid "SFTP upload failed for files."
    794794msgstr ""
    795795
    796 #: includes/class-instawp-tools.php:1487
     796#: includes/class-instawp-tools.php:1495
    797797msgid "SFTP upload failed for database."
    798798msgstr ""
  • instawp-connect/tags/0.1.0.79/readme.txt

    r3223388 r3227461  
    55Tested up to: 6.7
    66Requires PHP: 7.0
    7 Stable tag: 0.1.0.78
     7Stable tag: 0.1.0.79
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    9999== Changelog ==
    100100
     101= 0.1.0.79 - 23 January 2025 =
     102- FIX: Fixed default username for magic login.
     103- FIX: Added managed parameter to config API.
     104- FIX: Fixed cache clearing issue with WP Rocket.
     105- FIX: Push migration exclude files check.
     106
    101107= 0.1.0.78 - 16 January 2025 =
    102108- NEW: Added extra log message for handling pull migration failure.
  • instawp-connect/tags/0.1.0.79/vendor/composer/InstalledVersions.php

    r3216309 r3227461  
    3232     */
    3333    private static $installed;
     34
     35    /**
     36     * @var bool
     37     */
     38    private static $installedIsLocalDir;
    3439
    3540    /**
     
    310315        self::$installed = $data;
    311316        self::$installedByVendor = array();
     317
     318        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     319        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     320        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     321        // all installed packages for example
     322        self::$installedIsLocalDir = false;
    312323    }
    313324
     
    326337
    327338        if (self::$canGetVendors) {
     339            $selfDir = strtr(__DIR__, '\\', '/');
    328340            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     341                $vendorDir = strtr($vendorDir, '\\', '/');
    329342                if (isset(self::$installedByVendor[$vendorDir])) {
    330343                    $installed[] = self::$installedByVendor[$vendorDir];
     
    334347                    self::$installedByVendor[$vendorDir] = $required;
    335348                    $installed[] = $required;
    336                     if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
     349                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
    337350                        self::$installed = $required;
    338                         $copiedLocalDir = true;
     351                        self::$installedIsLocalDir = true;
    339352                    }
     353                }
     354                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     355                    $copiedLocalDir = true;
    340356                }
    341357            }
  • instawp-connect/tags/0.1.0.79/vendor/composer/installed.json

    r3218292 r3227461  
    88                "type": "git",
    99                "url": "https://github.com/InstaWP/connect-helpers.git",
    10                 "reference": "4e5a060b35cdcc903ee2165e1cb5b2794437cf74"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/InstaWP/connect-helpers/zipball/4e5a060b35cdcc903ee2165e1cb5b2794437cf74",
    15                 "reference": "4e5a060b35cdcc903ee2165e1cb5b2794437cf74",
     10                "reference": "2e60645a8e670973fba99dcbb9cecd8c9e3eefd1"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/InstaWP/connect-helpers/zipball/2e60645a8e670973fba99dcbb9cecd8c9e3eefd1",
     15                "reference": "2e60645a8e670973fba99dcbb9cecd8c9e3eefd1",
    1616                "shasum": ""
    1717            },
     
    2020                "wp-cli/wp-config-transformer": "^1.3"
    2121            },
    22             "time": "2025-01-02T11:30:59+00:00",
     22            "time": "2025-01-23T09:43:33+00:00",
    2323            "default-branch": true,
    2424            "type": "library",
     
    4848            "description": "CLI Package for InstaWP Remote Features",
    4949            "support": {
    50                 "source": "https://github.com/InstaWP/connect-helpers/tree/main",
     50                "source": "https://github.com/InstaWP/connect-helpers/tree/1.0.1",
    5151                "issues": "https://github.com/InstaWP/connect-helpers/issues"
    5252            },
     
    291291        {
    292292            "name": "woocommerce/action-scheduler",
    293             "version": "3.9.0",
    294             "version_normalized": "3.9.0.0",
     293            "version": "3.9.1",
     294            "version_normalized": "3.9.1.0",
    295295            "source": {
    296296                "type": "git",
    297297                "url": "https://github.com/woocommerce/action-scheduler.git",
    298                 "reference": "90b98e6fe97d455679b1d288f050cad8f6f79771"
    299             },
    300             "dist": {
    301                 "type": "zip",
    302                 "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/90b98e6fe97d455679b1d288f050cad8f6f79771",
    303                 "reference": "90b98e6fe97d455679b1d288f050cad8f6f79771",
     298                "reference": "d73b5f83cd42832fa137e03687bad3e312298d29"
     299            },
     300            "dist": {
     301                "type": "zip",
     302                "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/d73b5f83cd42832fa137e03687bad3e312298d29",
     303                "reference": "d73b5f83cd42832fa137e03687bad3e312298d29",
    304304                "shasum": ""
    305305            },
     
    313313                "yoast/phpunit-polyfills": "^2.0"
    314314            },
    315             "time": "2024-11-15T00:11:39+00:00",
     315            "time": "2025-01-21T11:39:08+00:00",
    316316            "type": "wordpress-plugin",
    317317            "extra": {
     
    331331            "support": {
    332332                "issues": "https://github.com/woocommerce/action-scheduler/issues",
    333                 "source": "https://github.com/woocommerce/action-scheduler/tree/3.9.0"
     333                "source": "https://github.com/woocommerce/action-scheduler/tree/3.9.1"
    334334            },
    335335            "install-path": "../woocommerce/action-scheduler"
  • instawp-connect/tags/0.1.0.79/vendor/composer/installed.php

    r3218292 r3227461  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '5e2939ad37db1d19f4609420ae51403a96362415',
     6        'reference' => '5419ef006247c7db8093cc35d038fc2b0e25fb7a',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '5e2939ad37db1d19f4609420ae51403a96362415',
     16            'reference' => '5419ef006247c7db8093cc35d038fc2b0e25fb7a',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
     
    2323            'pretty_version' => 'dev-main',
    2424            'version' => 'dev-main',
    25             'reference' => '4e5a060b35cdcc903ee2165e1cb5b2794437cf74',
     25            'reference' => '2e60645a8e670973fba99dcbb9cecd8c9e3eefd1',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../instawp/connect-helpers',
     
    5959        ),
    6060        'woocommerce/action-scheduler' => array(
    61             'pretty_version' => '3.9.0',
    62             'version' => '3.9.0.0',
    63             'reference' => '90b98e6fe97d455679b1d288f050cad8f6f79771',
     61            'pretty_version' => '3.9.1',
     62            'version' => '3.9.1.0',
     63            'reference' => 'd73b5f83cd42832fa137e03687bad3e312298d29',
    6464            'type' => 'wordpress-plugin',
    6565            'install_path' => __DIR__ . '/../woocommerce/action-scheduler',
  • instawp-connect/tags/0.1.0.79/vendor/instawp/connect-helpers/connect-helpers.php

    r2957903 r3227461  
    44 *
    55 * @package      InstaWP\Connect\Helpers
    6  * @copyright    Copyright (C) 2023, InstaWP
    7  * @link         http://instawp.com
     6 * @copyright    Copyright (C) 2025, InstaWP
     7 * @link         https://instawp.com
    88 * @since        1.0.0
    99 *
    1010 * @wordpress-plugin
    1111 * Plugin Name:       InstaWP Connect Helpers
    12  * Version:           1.0.0
     12 * Version:           1.0.1
    1313 * Plugin URI:        https://instawp.com
    1414 * Description:       Helpers Package for InstaWP Remote Features.
     
    1818 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
    1919 * Requires at least: 5.6
    20  * Tested up to:      6.3
     20 * Tested up to:      6.7
    2121 */
    2222
  • instawp-connect/tags/0.1.0.79/vendor/instawp/connect-helpers/src/Cache.php

    r3147089 r3227461  
    4343        // WP Rocket.
    4444        if ( is_plugin_active( 'wp-rocket/wp-rocket.php' ) ) {
    45             $message = '';
    46            
    47             if ( function_exists( 'rocket_clean_minify' ) && function_exists( 'rocket_clean_domain' ) ) {
    48                 rocket_clean_minify();
    49                 rocket_clean_domain();
    50             } else {
    51                 $message = 'Function not exists.';
    52             }
     45            $functions = [
     46                'rocket_clean_minify',
     47                'rocket_clean_domain',
     48                'rocket_clean_cache_busting',
     49                [ 'rocket_dismiss_box', 'rocket_warning_plugin_modification' ],
     50                [ 'rocket_renew_box', 'preload_notice' ]
     51            ];
     52
     53            $executed = array_reduce( $functions, function( $count, $item ) {
     54                if ( is_array( $item ) ) {
     55                    $func = $item[0];
     56                    $arg = $item[1];
     57                    if ( function_exists( $func ) ) {
     58                        $func( $arg );
     59                        return $count + 1;
     60                    }
     61                } elseif ( function_exists( $item )) {
     62                    $item();
     63                    return $count + 1;
     64                }
     65                return $count;
     66            }, 0 );
    5367
    5468            $results[] = [
    5569                'slug'    => 'wp-rocket',
    5670                'name'    => 'WP Rocket',
    57                 'message' => $message
     71                'message' => $executed === 0 ? 'Function not exists.' : ''
    5872            ];
    5973        }
  • instawp-connect/tags/0.1.0.79/vendor/instawp/connect-helpers/src/Helper.php

    r3218292 r3227461  
    181181
    182182    public static function get_admin_username() {
     183        if ( current_user_can( 'manage_options' ) ) {
     184            $current_user = wp_get_current_user();
     185           
     186            if ( ! empty( $current_user ) ) {
     187                return $current_user->user_login;
     188            }
     189        }
     190       
    183191        $username = '';
    184192
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/action-scheduler.php

    r3194914 r3227461  
    66 * Author: Automattic
    77 * Author URI: https://automattic.com/
    8  * Version: 3.9.0
     8 * Version: 3.9.1
    99 * License: GPLv3
    1010 * Requires at least: 6.5
    11  * Tested up to: 6.7
     11 * Tested up to: 6.5
    1212 * Requires PHP: 7.1
    1313 *
     
    3030 */
    3131
    32 if ( ! function_exists( 'action_scheduler_register_3_dot_9_dot_0' ) && function_exists( 'add_action' ) ) { // WRCS: DEFINED_VERSION.
     32if ( ! function_exists( 'action_scheduler_register_3_dot_9_dot_1' ) && function_exists( 'add_action' ) ) { // WRCS: DEFINED_VERSION.
    3333
    3434    if ( ! class_exists( 'ActionScheduler_Versions', false ) ) {
     
    3737    }
    3838
    39     add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_9_dot_0', 0, 0 ); // WRCS: DEFINED_VERSION.
     39    add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_9_dot_1', 0, 0 ); // WRCS: DEFINED_VERSION.
    4040
    4141    // phpcs:disable Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace
     
    4343     * Registers this version of Action Scheduler.
    4444     */
    45     function action_scheduler_register_3_dot_9_dot_0() { // WRCS: DEFINED_VERSION.
     45    function action_scheduler_register_3_dot_9_dot_1() { // WRCS: DEFINED_VERSION.
    4646        $versions = ActionScheduler_Versions::instance();
    47         $versions->register( '3.9.0', 'action_scheduler_initialize_3_dot_9_dot_0' ); // WRCS: DEFINED_VERSION.
     47        $versions->register( '3.9.1', 'action_scheduler_initialize_3_dot_9_dot_1' ); // WRCS: DEFINED_VERSION.
    4848    }
    4949
     
    5252     * Initializes this version of Action Scheduler.
    5353     */
    54     function action_scheduler_initialize_3_dot_9_dot_0() { // WRCS: DEFINED_VERSION.
     54    function action_scheduler_initialize_3_dot_9_dot_1() { // WRCS: DEFINED_VERSION.
    5555        // A final safety check is required even here, because historic versions of Action Scheduler
    5656        // followed a different pattern (in some unusual cases, we could reach this point and the
     
    6464    // Support usage in themes - load this version if no plugin has loaded a version yet.
    6565    if ( did_action( 'plugins_loaded' ) && ! doing_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler', false ) ) {
    66         action_scheduler_initialize_3_dot_9_dot_0(); // WRCS: DEFINED_VERSION.
     66        action_scheduler_initialize_3_dot_9_dot_1(); // WRCS: DEFINED_VERSION.
    6767        do_action( 'action_scheduler_pre_theme_init' );
    6868        ActionScheduler_Versions::initialize_latest_version();
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/changelog.txt

    r3194914 r3227461  
    11*** Changelog ***
     2
     3= 3.9.1 - 2025-01-21 =
     4* A number of new WP CLI commands have been added, making it easier to manage actions in the terminal and from scripts.
     5* New wp action-scheduler source command to help determine how Action Scheduler is being loaded.
     6* Additional information about the active instance of Action Scheduler is now available in the Help pull-down drawer.
     7* Make some other nullable parameters explicitly nullable.
     8* Set option value to `no` rather than deleting.
    29
    310= 3.9.0 - 2024-11-14 = 
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionFactory.php

    r3194914 r3227461  
    99     * Return stored actions for given params.
    1010     *
    11      * @param string                   $status The action's status in the data store.
    12      * @param string                   $hook The hook to trigger when this action runs.
    13      * @param array                    $args Args to pass to callbacks when the hook is triggered.
    14      * @param ActionScheduler_Schedule $schedule The action's schedule.
    15      * @param string                   $group A group to put the action in.
     11     * @param string                        $status The action's status in the data store.
     12     * @param string                        $hook The hook to trigger when this action runs.
     13     * @param array                         $args Args to pass to callbacks when the hook is triggered.
     14     * @param ActionScheduler_Schedule|null $schedule The action's schedule.
     15     * @param string                        $group A group to put the action in.
    1616     * phpcs:ignore Squiz.Commenting.FunctionComment.ExtraParamComment
    17      * @param int                      $priority The action priority.
     17     * @param int                           $priority The action priority.
    1818     *
    1919     * @return ActionScheduler_Action An instance of the stored action.
    2020     */
    21     public function get_stored_action( $status, $hook, array $args = array(), ActionScheduler_Schedule $schedule = null, $group = '' ) {
     21    public function get_stored_action( $status, $hook, array $args = array(), ?ActionScheduler_Schedule $schedule = null, $group = '' ) {
    2222        // The 6th parameter ($priority) is not formally declared in the method signature to maintain compatibility with
    2323        // third-party subclasses created before this param was added.
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/classes/ActionScheduler_AdminView.php

    r3194914 r3227461  
    251251        }
    252252
    253         $as_version = ActionScheduler_Versions::instance()->latest_version();
     253        $as_version       = ActionScheduler_Versions::instance()->latest_version();
     254        $as_source        = ActionScheduler_Versions::instance()->active_source();
     255        $as_source_path   = ActionScheduler_Versions::instance()->active_source_path();
     256        $as_source_markup = sprintf( '<code>%s</code>', esc_html( $as_source_path ) );
     257
     258        if ( ! empty( $as_source ) ) {
     259            $as_source_markup = sprintf(
     260                '%s: <abbr title="%s">%s</abbr>',
     261                ucfirst( $as_source['type'] ),
     262                esc_attr( $as_source_path ),
     263                esc_html( $as_source['name'] )
     264            );
     265        }
     266
    254267        $screen->add_help_tab(
    255268            array(
     
    261274                    '<p>' .
    262275                        __( 'Action Scheduler is a scalable, traceable job queue for background processing large sets of actions. Action Scheduler works by triggering an action hook to run at some time in the future. Scheduled actions can also be scheduled to run on a recurring schedule.', 'action-scheduler' ) .
     276                    '</p>' .
     277                    '<h3>' . esc_html__( 'Source', 'action-scheduler' ) . '</h3>' .
     278                    '<p>' .
     279                        esc_html__( 'Action Scheduler is currently being loaded from the following location. This can be useful when debugging, or if requested by the support team.', 'action-scheduler' ) .
     280                    '</p>' .
     281                    '<p>' . $as_source_markup . '</p>' .
     282                    '<h3>' . esc_html__( 'WP CLI', 'action-scheduler' ) . '</h3>' .
     283                    '<p>' .
     284                        sprintf(
     285                            /* translators: %1$s is WP CLI command (not translatable) */
     286                            esc_html__( 'WP CLI commands are available: execute %1$s for a list of available commands.', 'action-scheduler' ),
     287                            '<code>wp help action-scheduler</code>'
     288                        ) .
    263289                    '</p>',
    264290            )
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Versions.php

    r3194914 r3227461  
    2020
    2121    /**
     22     * Registered sources.
     23     *
     24     * @var array<string, string>
     25     */
     26    private $sources = array();
     27
     28    /**
    2229     * Register version's callback.
    2330     *
     
    2936            return false;
    3037        }
     38
     39        // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace
     40        $backtrace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
     41        $source    = $backtrace[0]['file'];
     42
    3143        $this->versions[ $version_string ] = $initialization_callback;
     44        $this->sources[ $source ]          = $version_string;
    3245        return true;
    3346    }
     
    3851    public function get_versions() {
    3952        return $this->versions;
     53    }
     54
     55    /**
     56     * Get registered sources.
     57     *
     58     * @return array<string, string>
     59     */
     60    public function get_sources() {
     61        return $this->sources;
    4062    }
    4163
     
    87109        call_user_func( $self->latest_version_callback() );
    88110    }
     111
     112    /**
     113     * Returns information about the plugin or theme which contains the current active version
     114     * of Action Scheduler.
     115     *
     116     * If this cannot be determined, or if Action Scheduler is being loaded via some other
     117     * method, then it will return an empty array. Otherwise, if populated, the array will
     118     * look like the following:
     119     *
     120     *     [
     121     *         'type' => 'plugin', # or 'theme'
     122     *         'name' => 'Name',
     123     *     ]
     124     *
     125     * @return array
     126     */
     127    public function active_source(): array {
     128        $file         = __FILE__;
     129        $dir          = __DIR__;
     130        $plugins      = get_plugins();
     131        $plugin_files = array_keys( $plugins );
     132
     133        foreach ( $plugin_files as $plugin_file ) {
     134            $plugin_path = trailingslashit( WP_PLUGIN_DIR ) . dirname( $plugin_file );
     135            $plugin_file = trailingslashit( WP_PLUGIN_DIR ) . $plugin_file;
     136
     137            if ( 0 !== strpos( dirname( $dir ), $plugin_path ) ) {
     138                continue;
     139            }
     140
     141            $plugin_data = get_plugin_data( $plugin_file );
     142
     143            if ( ! is_array( $plugin_data ) || empty( $plugin_data['Name'] ) ) {
     144                continue;
     145            }
     146
     147            return array(
     148                'type' => 'plugin',
     149                'name' => $plugin_data['Name'],
     150            );
     151        }
     152
     153        $themes = (array) search_theme_directories();
     154
     155        foreach ( $themes as $slug => $data ) {
     156            $needle = trailingslashit( $data['theme_root'] ) . $slug . '/';
     157
     158            if ( 0 !== strpos( $file, $needle ) ) {
     159                continue;
     160            }
     161
     162            $theme = wp_get_theme( $slug );
     163
     164            if ( ! is_object( $theme ) || ! is_a( $theme, \WP_Theme::class ) ) {
     165                continue;
     166            }
     167
     168            return array(
     169                'type' => 'theme',
     170                // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
     171                'name' => $theme->Name,
     172            );
     173        }
     174
     175        return array();
     176    }
     177
     178    /**
     179     * Returns the directory path for the currently active installation of Action Scheduler.
     180     *
     181     * @return string
     182     */
     183    public function active_source_path(): string {
     184        return trailingslashit( dirname( __DIR__ ) );
     185    }
    89186}
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/classes/ActionScheduler_WPCommentCleaner.php

    r3194914 r3227461  
    6767     */
    6868    public static function maybe_schedule_cleanup() {
     69        $has_logs = 'no';
     70
    6971        $args = array(
    7072            'type'   => ActionScheduler_wpCommentLogger::TYPE,
     
    7476
    7577        if ( (bool) get_comments( $args ) ) {
    76             update_option( self::$has_logs_option_key, 'yes' );
     78            $has_logs = 'yes';
    7779
    7880            if ( ! as_next_scheduled_action( self::$cleanup_hook ) ) {
     
    8082            }
    8183        }
     84
     85        update_option( self::$has_logs_option_key, $has_logs, true );
    8286    }
    8387
     
    96100        );
    97101
    98         delete_option( self::$has_logs_option_key );
     102        update_option( self::$has_logs_option_key, 'no', true );
    99103    }
    100104
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php

    r3194914 r3227461  
    241241            WP_CLI::add_command( 'action-scheduler', 'ActionScheduler_WPCLI_Scheduler_command' );
    242242            WP_CLI::add_command( 'action-scheduler', 'ActionScheduler_WPCLI_Clean_Command' );
     243            WP_CLI::add_command( 'action-scheduler action', '\Action_Scheduler\WP_CLI\Action_Command' );
     244            WP_CLI::add_command( 'action-scheduler', '\Action_Scheduler\WP_CLI\System_Command' );
    243245            if ( ! ActionScheduler_DataController::is_migration_complete() && Controller::instance()->allow_migration() ) {
    244246                $command = new Migration_Command();
     
    297299            'ActionScheduler_Store'                      => true,
    298300            'ActionScheduler_TimezoneHelper'             => true,
     301            'ActionScheduler_WPCLI_Command'              => true,
    299302        );
    300303
     
    341344    protected static function is_class_cli( $class ) {
    342345        static $cli_segments = array(
    343             'QueueRunner' => true,
    344             'Command'     => true,
    345             'ProgressBar' => true,
     346            'QueueRunner'                             => true,
     347            'Command'                                 => true,
     348            'ProgressBar'                             => true,
     349            '\Action_Scheduler\WP_CLI\Action_Command' => true,
     350            '\Action_Scheduler\WP_CLI\System_Command' => true,
    346351        );
    347352
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php

    r3051765 r3227461  
    1414     * @return DateTime|null
    1515     */
    16     public function next( DateTime $after = null ) {
     16    public function next( ?DateTime $after = null ) {
    1717        if ( empty( $after ) ) {
    1818            $return_value       = $this->get_date();
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression.php

    r3051765 r3227461  
    5555     * @return CronExpression
    5656     */
    57     public static function factory($expression, CronExpression_FieldFactory $fieldFactory = null)
     57    public static function factory($expression, ?CronExpression_FieldFactory $fieldFactory = null)
    5858    {
    5959        $mappings = array(
  • instawp-connect/tags/0.1.0.79/vendor/woocommerce/action-scheduler/readme.txt

    r3194914 r3227461  
    22Contributors: Automattic, wpmuguru, claudiosanches, peterfabian1000, vedjain, jamosova, obliviousharmony, konamiman, sadowski, royho, barryhughes-1
    33Tags: scheduler, cron
    4 Stable tag: 3.9.0
     4Stable tag: 3.9.1
    55License: GPLv3
    66Requires at least: 6.5
    7 Tested up to: 6.7
     7Tested up to: 6.5
    88Requires PHP: 7.1
    99
     
    4747
    4848== Changelog ==
     49
     50= 3.9.1 - 2025-01-21 =
     51* A number of new WP CLI commands have been added, making it easier to manage actions in the terminal and from scripts.
     52* New wp action-scheduler source command to help determine how Action Scheduler is being loaded.
     53* Additional information about the active instance of Action Scheduler is now available in the Help pull-down drawer.
     54* Make some other nullable parameters explicitly nullable.
     55* Set option value to `no` rather than deleting.
    4956
    5057= 3.9.0 - 2024-11-14 = 
  • instawp-connect/trunk/dest.php

    r3216309 r3227461  
    55include_once 'includes/functions-pull-push.php';
    66
    7 if ( ! file_exists( 'iwp_log.txt' ) ) {
    8     file_put_contents( 'iwp_log.txt', "Migration log started \n" );
    9 }
    10 
    117if ( ! isset( $_SERVER['HTTP_X_IWP_MIGRATE_KEY'] ) || empty( $migrate_key = $_SERVER['HTTP_X_IWP_MIGRATE_KEY'] ) ) {
    128    header( 'x-iwp-status: false' );
     
    2622}
    2723
    28 //$options_data_path = $root_dir_path . DIRECTORY_SEPARATORz . 'wp-content' . DIRECTORY_SEPARATOR . 'instawpbackups' . DIRECTORY_SEPARATOR . 'migrate-push-db-' . substr( $migrate_key, 0, 5 ) . '.txt';
     24$log_file_path     = $root_dir_path . DIRECTORY_SEPARATOR . 'iwp-push-log.txt';
     25$received_db_path  = $root_dir_path . DIRECTORY_SEPARATOR . 'iwp-db-received.sql';
    2926$options_data_path = $root_dir_path . DIRECTORY_SEPARATOR . 'migrate-push-db-' . substr( $migrate_key, 0, 5 ) . '.txt';
    3027
     
    8986$req_order          = isset( $_GET['r'] ) ? intval( $_GET['r'] ) : 1;
    9087
    91 //if ( ! file_exists( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt' ) ) {
    92 //  file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', json_encode( $user_details ) . "\n" . json_encode( $retain_user ) );
    93 //}
    94 
    9588if ( in_array( $file_relative_path, $excluded_paths ) ) {
    9689    exit( 0 );
     
    9891
    9992$file_save_path = $root_dir_path . DIRECTORY_SEPARATOR . $file_relative_path;
    100 //file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', "full path: " . $file_save_path . "\n", FILE_APPEND );
     93
    10194if ( in_array( $file_save_path, $excluded_paths ) || str_contains( $file_save_path, 'instawp-autologin' ) ) {
    10295    exit( 0 );
    10396}
    104 //file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', "full path success" . "\n", FILE_APPEND );
    10597
    10698$directory_name = dirname( $file_save_path );
     
    121113        unlink( $file_save_path );
    122114    }
    123 //  $file_save_path = $root_dir_path . DIRECTORY_SEPARATOR . time() . '.sql'; // added for debugging
    124115    $file_stream = fopen( $file_save_path, 'a+b' );
    125116} else {
     
    212203    $commands     = explode( ";\n\n", $sql_commands );
    213204
     205    file_put_contents( $received_db_path, $sql_commands, FILE_APPEND );
     206
    214207    foreach ( $commands as $command ) {
    215208        if ( ! empty( trim( $command ) ) ) {
     
    231224        if ( isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) ) {
    232225            $log_content = "x-iwp-progress: {$_SERVER['HTTP_X_IWP_PROGRESS']}\n";
    233             file_put_contents( 'iwp_log.txt', $log_content, FILE_APPEND );
     226            file_put_contents( $log_file_path, $log_content, FILE_APPEND );
    234227        }
    235228
    236229        if ( isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) && $_SERVER['HTTP_X_IWP_PROGRESS'] == 100 ) {
    237 
    238             file_put_contents( 'iwp_log.txt', "Retain User: " . var_dump( $retain_user ), FILE_APPEND );
    239             file_put_contents( 'iwp_log.txt', "User Details: " . json_encode( $user_details ), FILE_APPEND );
    240230
    241231            // Retaining user after migration
     
    262252                $query  = "INSERT INTO {$table_prefix}users ($fields) VALUES ($values)";
    263253
    264                 file_put_contents( 'iwp_log.txt', "Query: " . $query, FILE_APPEND );
    265 
    266254                $query_response = $mysqli->query( $query );
    267 
    268                 file_put_contents( 'iwp_log.txt', "Query Response: " . json_encode( $query_response ), FILE_APPEND );
    269255
    270256                if ( $query_response ) {
    271257                    $user_id = $mysqli->insert_id;
    272258
    273                     file_put_contents( 'iwp_log.txt', "User ID: " . json_encode( $user_id ), FILE_APPEND );
    274 
    275259                    if ( $user_id ) {
    276 
    277260                        // Set user capabilities
    278261                        $caps_key   = $mysqli->real_escape_string( $table_prefix . 'capabilities' );
     
    290273
    291274                if ( $mysqli->error ) {
    292                     file_put_contents( 'iwp_log.txt', "insert response: " . $mysqli->error . "\n", FILE_APPEND );
     275                    file_put_contents( $log_file_path, "insert response: " . $mysqli->error . "\n", FILE_APPEND );
    293276                }
    294277            }
     
    300283
    301284                try {
    302                     $query = "INSERT INTO `{$table_prefix}options` (`option_name`, `option_value`) VALUES('instawp_api_options', '{$instawp_api_options}')";
    303 
    304                     // log start
    305                     file_put_contents( 'iwp_log.txt', "insert query: " . $query . "\n", FILE_APPEND );
    306                     // log end
    307 
     285                    $query           = "INSERT INTO `{$table_prefix}options` (`option_name`, `option_value`) VALUES('instawp_api_options', '{$instawp_api_options}')";
    308286                    $insert_response = $mysqli->query( $query );
    309 
    310                     // log start
    311                     file_put_contents( 'iwp_log.txt', "insert response: " . var_dump( $insert_response ) . "\n", FILE_APPEND );
    312                     // log end
    313287
    314288                    if ( ! $insert_response ) {
     
    316290                    }
    317291                } catch ( Exception $e ) {
    318                     // log start
    319                     file_put_contents( 'iwp_log.txt', "insert exception: " . $e->getMessage() . "\n", FILE_APPEND );
    320                     // log end
     292                    file_put_contents( $log_file_path, "insert exception: " . $e->getMessage() . "\n", FILE_APPEND );
    321293
    322294                    $is_insert_failed = true;
     
    325297                if ( $is_insert_failed ) {
    326298                    try {
    327                         $query = "UPDATE `{$table_prefix}options` SET `option_value` = '{$instawp_api_options}' WHERE `option_name` = 'instawp_api_options'";
    328 
    329                         // log start
    330                         file_put_contents( 'iwp_log.txt', "update query: " . $query . "\n", FILE_APPEND );
    331                         // log end
    332 
     299                        $query           = "UPDATE `{$table_prefix}options` SET `option_value` = '{$instawp_api_options}' WHERE `option_name` = 'instawp_api_options'";
    333300                        $update_response = $mysqli->query( $query );
    334 
    335                         // log start
    336                         file_put_contents( 'iwp_log.txt', "update response: " . var_dump( $update_response ) . "\n", FILE_APPEND );
    337                         // log end
    338301                    } catch ( Exception $e ) {
     302                        file_put_contents( $log_file_path, "Update failed. Error message: {$e->getMessage()}\n", FILE_APPEND );
     303
    339304                        header( 'x-iwp-status: false' );
    340305                        header( "x-iwp-message: Update failed. Error message: {$e->getMessage()}\n" );
     
    355320    }
    356321
    357     if ( file_exists( $file_save_path ) ) {
    358         unlink( $file_save_path );
    359     }
     322//  if ( file_exists( $file_save_path ) ) {
     323//      unlink( $file_save_path );
     324//  }
    360325}
    361326
     
    373338                    $file_name = $zip->getNameIndex( $i );
    374339
    375                     if ( ! array_contains_str( $directory_name . DIRECTORY_SEPARATOR . $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) {
    376                         //file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', "zip path: " . $directory_name . DIRECTORY_SEPARATOR . $file_name . "\n", FILE_APPEND );
     340                    if ( false !== strpos( $directory_name, DIRECTORY_SEPARATOR . 'wp-content' ) || false !== strpos( $directory_name, DIRECTORY_SEPARATOR . 'wp-includes' ) || false !== strpos( $directory_name, DIRECTORY_SEPARATOR . 'wp-admin' ) ) {
     341                        if ( ! array_contains_str( $directory_name . DIRECTORY_SEPARATOR . $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) {
     342                            $extracted_files[] = $file_name;
     343                        }
     344                    } else if ( ! in_array( $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) {
    377345                        $extracted_files[] = $file_name;
    378346                    }
     
    448416
    449417if ( str_contains( $file_relative_path, 'wp-config.php' ) || $is_wp_config_file ) {
    450     //file_put_contents( $root_dir_path . DIRECTORY_SEPARATOR . 'iwp_log.txt', "wp-config.php" . "\n", FILE_APPEND );
    451418    if ( ! isset( $db_host ) || ! isset( $db_username ) || ! isset( $db_password ) || ! isset( $db_name ) ) {
    452419        header( 'x-iwp-status: false' );
  • instawp-connect/trunk/includes/apis/class-instawp-rest-api.php

    r3220103 r3227461  
    145145        $api_domain           = isset( $parameters['api_domain'] ) ? sanitize_text_field( $parameters['api_domain'] ) : '';
    146146        $plan_id              = isset( $parameters['advance_connect_plan_id'] ) ? intval( $parameters['advance_connect_plan_id'] ) : 0;
     147        $managed              = isset( $parameters['managed'] ) ? boolval( $parameters['managed'] ) : true;
    147148
    148149        if ( empty( $wp_username ) || empty( $application_password ) ) {
     
    250251        }
    251252
    252         if ( ! Helper::instawp_generate_api_key( $api_key, $jwt ) ) {
     253        if ( ! Helper::instawp_generate_api_key( $api_key, $jwt, $managed ) ) {
    253254            return $this->send_response( array(
    254255                'status'  => false,
  • instawp-connect/trunk/includes/class-instawp-tools.php

    r3222813 r3227461  
    498498        if ( isset( $config_constants['DB_HOST'] ) ) {
    499499            unset( $config_constants['DB_HOST'] );
     500        }
     501
     502        if ( isset( $config_constants['MYSQL_CLIENT_FLAGS'] ) ) {
     503            unset( $config_constants['MYSQL_CLIENT_FLAGS'] );
    500504        }
    501505
  • instawp-connect/trunk/includes/functions-pull-push.php

    r3216309 r3227461  
    156156        }
    157157
    158         foreach ( $array as $item ) {
    159             if ( str_contains( $string, $item ) ) {
    160                 return true;
    161             }
    162         }
     158//      foreach ( $array as $item ) {
     159//          if ( str_contains( $string, $item ) ) {
     160//              return true;
     161//          }
     162//      }
    163163
    164164        return false;
  • instawp-connect/trunk/instawp-connect.php

    r3223388 r3227461  
    88 * Plugin Name:       InstaWP Connect
    99 * Description:       1-click WordPress plugin for Staging, Migrations, Management, Sync and Companion plugin for InstaWP.
    10  * Version:           0.1.0.78
     10 * Version:           0.1.0.79
    1111 * Author:            InstaWP Team
    1212 * Author URI:        https://instawp.com/
     
    2828global $wpdb;
    2929
    30 defined( 'INSTAWP_PLUGIN_VERSION' ) || define( 'INSTAWP_PLUGIN_VERSION', '0.1.0.78' );
     30defined( 'INSTAWP_PLUGIN_VERSION' ) || define( 'INSTAWP_PLUGIN_VERSION', '0.1.0.79' );
    3131defined( 'INSTAWP_API_DOMAIN_PROD' ) || define( 'INSTAWP_API_DOMAIN_PROD', 'https://app.instawp.io' );
    3232
     
    155155
    156156run_instawp();
     157
     158
     159/**
     160 * Custom Functions Started
     161 */
     162if ( ! function_exists( 'iwp_is_serialized' ) ) {
     163    function iwp_is_serialized( $data, $strict = true ) {
     164        // If it isn't a string, it isn't serialized.
     165        if ( ! is_string( $data ) ) {
     166            return false;
     167        }
     168        $data = trim( $data );
     169        if ( 'N;' === $data ) {
     170            return true;
     171        }
     172        if ( strlen( $data ) < 4 ) {
     173            return false;
     174        }
     175        if ( ':' !== $data[1] ) {
     176            return false;
     177        }
     178        if ( $strict ) {
     179            $lastc = substr( $data, - 1 );
     180            if ( ';' !== $lastc && '}' !== $lastc ) {
     181                return false;
     182            }
     183        } else {
     184            $semicolon = strpos( $data, ';' );
     185            $brace     = strpos( $data, '}' );
     186            // Either ; or } must exist.
     187            if ( false === $semicolon && false === $brace ) {
     188                return false;
     189            }
     190            // But neither must be in the first X characters.
     191            if ( false !== $semicolon && $semicolon < 3 ) {
     192                return false;
     193            }
     194            if ( false !== $brace && $brace < 4 ) {
     195                return false;
     196            }
     197        }
     198        $token = $data[0];
     199        switch ( $token ) {
     200            case 's':
     201                if ( $strict ) {
     202                    if ( '"' !== substr( $data, - 2, 1 ) ) {
     203                        return false;
     204                    }
     205                } elseif ( ! str_contains( $data, '"' ) ) {
     206                    return false;
     207                }
     208            // Or else fall through.
     209            case 'a':
     210            case 'O':
     211            case 'E':
     212                return (bool) preg_match( "/^{$token}:[0-9]+:/s", $data );
     213            case 'b':
     214            case 'i':
     215            case 'd':
     216                $end = $strict ? '$' : '';
     217
     218                return (bool) preg_match( "/^{$token}:[0-9.E+-]+;$end/", $data );
     219        }
     220
     221        return false;
     222    }
     223}
     224
     225if ( ! function_exists( 'iwp_maybe_serialize' ) ) {
     226    function iwp_maybe_serialize( $data ) {
     227
     228        if ( is_array( $data ) || is_object( $data ) ) {
     229            return serialize( $data );
     230        }
     231
     232        if ( iwp_is_serialized( $data, false ) ) {
     233            return serialize( $data );
     234        }
     235
     236        return $data;
     237    }
     238}
     239
     240
     241function iwp_recursive_unserialize_replace( $data, $search_replace ) {
     242
     243    if ( is_string( $data ) ) {
     244        return str_replace( array_keys( $search_replace ), array_values( $search_replace ), $data );
     245    }
     246
     247    if ( is_array( $data ) ) {
     248        $data = array_map( function ( $item ) use ( $search_replace ) {
     249            return iwp_recursive_unserialize_replace( $item, $search_replace );
     250        }, $data );
     251    } elseif ( is_object( $data ) ) {
     252        // Check if the object is __PHP_Incomplete_Class
     253        if ( $data instanceof __PHP_Incomplete_Class ) {
     254
     255            $className = get_class( $data );
     256
     257            // iwp_send_migration_log( 'Incomplete Class Warning', "Encountered incomplete class: $className. Make sure this class is loaded before unserialization.", [ 'class' => $className ] );
     258
     259            return $data;
     260        }
     261
     262        $properties = [];
     263
     264        try {
     265            $reflection = new ReflectionObject( $data );
     266            $properties = $reflection->getProperties();
     267        } catch ( Exception $e ) {
     268//          iwp_send_migration_log(
     269//              'Reflection Error',
     270//              "Failed to reflect object of class " . get_class( $data ),
     271//              [ 'error' => $e->getMessage() ]
     272//          );
     273
     274            return $data;
     275        }
     276
     277        echo "<pre>"; print_r( $properties ); echo "</pre>";
     278
     279//      foreach ( $properties as $property ) {
     280//          try {
     281//              $property->setAccessible( true );
     282//              $value     = $property->getValue( $data );
     283//              $new_value = iwp_recursive_unserialize_replace( $value, $search_replace );
     284//              $property->setValue( $data, $new_value );
     285//          } catch ( Exception $e ) {
     286//              // Skip this property if we can't access it
     287//              continue;
     288//          }
     289//      }
     290    }
     291
     292    return $data;
     293}
     294
     295if ( ! function_exists( 'iwp_maybe_unserialize' ) ) {
     296    function iwp_maybe_unserialize( $data ) {
     297        if ( iwp_is_serialized( $data ) ) {
     298            global $search_replace;
     299
     300            $data = @unserialize( trim( $data ) );
     301
     302            if ( is_array( $data ) ) {
     303                $data = iwp_recursive_unserialize_replace( $data, $search_replace );
     304            }
     305        }
     306
     307        return $data;
     308    }
     309}
     310
     311if ( ! function_exists( 'iwp_array_filter_recursive' ) ) {
     312    function iwp_array_filter_recursive( array $array, callable $callback = null ) {
     313        $array = is_callable( $callback ) ? array_filter( $array, $callback ) : array_filter( $array );
     314        foreach ( $array as &$value ) {
     315            if ( is_array( $value ) ) {
     316                $value = call_user_func( __FUNCTION__, $value, $callback );
     317            }
     318        }
     319
     320        return $array;
     321    }
     322}
     323/**
     324 * Custom Functions End
     325 */
     326
     327add_action( 'wp_head', function () {
     328    if ( isset( $_GET['debug'] ) ) {
     329
     330        global $mysqli, $search_replace;
     331
     332        $db_host     = 'localhost';
     333        $db_username = 'xifafugelu2996_fogipixuwo5351';
     334        $db_password = '6DLeQM9Aj12sf8VxGvXI';
     335        $db_name     = 'xifafugelu2996_9NCiSZ5Dcbl8LQk1Ustq';
     336        $mysqli      = new mysqli( $db_host, $db_username, $db_password, $db_name );
     337        $mysqli->set_charset( 'utf8' );
     338
     339        $offset    = isset( $_GET['offset'] ) ? (int) $_GET['offset'] : 839;
     340        $tableName = isset( $_GET['table'] ) ? sanitize_text_field( $_GET['table'] ) : 'AXF_options';
     341        $query     = "SELECT * FROM `$tableName` WHERE 1 LIMIT 3 OFFSET $offset";
     342        $result    = $mysqli->query( $query );
     343
     344        $source_domain  = 'astonished-sandpiper-aab1df.instawp.xyz';
     345        $dest_domain    = 'roomier-mallard-5683f5.instawp.xyz';
     346        $search_replace = [
     347            '//' . $source_domain   => '//' . $dest_domain,
     348            '\/\/' . $source_domain => '\/\/' . $dest_domain,
     349        ];
     350
     351        if ( $mysqli->errno ) {
     352            echo "<pre>";
     353            print_r( $mysqli->connect_error );
     354            echo "</pre>";
     355
     356            return;
     357        }
     358
     359        while ( $dataRow = $result->fetch_assoc() ) {
     360            $columns = array_map( function ( $value ) {
     361                global $mysqli;
     362
     363                if ( empty( $value ) ) {
     364                    return is_array( $value ) ? [] : '';
     365                }
     366
     367                return $mysqli->real_escape_string( $value );
     368            }, array_keys( $dataRow ) );
     369
     370            $values = array_map( function ( $value ) {
     371                global $mysqli;
     372
     373                if ( is_numeric( $value ) ) {
     374                    // If $value has leading zero it will mark as string and bypass returning as numeric
     375                    if ( substr( $value, 0, 1 ) !== '0' ) {
     376                        return $value;
     377                    }
     378                } else if ( is_null( $value ) ) {
     379                    return "NULL";
     380                } else if ( is_array( $value ) && empty( $value ) ) {
     381                    $value = [];
     382                } else if ( is_string( $value ) ) {
     383                    if ( iwp_is_serialized( $value ) ) {
     384                        $value = iwp_maybe_unserialize( $value );
     385                        $value = iwp_maybe_serialize( $value );
     386                    }
     387                    $value = $mysqli->real_escape_string( $value );
     388                }
     389
     390                return "'" . $value . "'";
     391            }, array_values( $dataRow ) );
     392
     393            $sql_query = "INSERT IGNORE INTO `$tableName` (`" . implode( "`, `", $columns ) . "`) VALUES (" . implode( ", ", $values ) . ");";
     394
     395            echo "<pre>";
     396            print_r( $sql_query );
     397            echo "</pre>";
     398        }
     399
     400        die();
     401    }
     402}, 0 );
     403
  • instawp-connect/trunk/languages/instawp-connect.pot

    r3220103 r3227461  
    66"Content-Type: text/plain; charset=UTF-8\n"
    77"Content-Transfer-Encoding: 8bit\n"
    8 "POT-Creation-Date: 2025-01-09 09:06+0000\n"
     8"POT-Creation-Date: 2025-01-23 12:44+0000\n"
    99"X-Poedit-Basepath: ..\n"
    1010"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
     
    9090msgstr ""
    9191
    92 #: includes/apis/class-instawp-rest-api.php:151
     92#: includes/apis/class-instawp-rest-api.php:152
    9393msgid "This request is not authorized."
    9494msgstr ""
    9595
    96 #: includes/apis/class-instawp-rest-api.php:158
     96#: includes/apis/class-instawp-rest-api.php:159
    9797msgid "API key and JWT token is required."
    9898msgstr ""
    9999
    100 #: includes/apis/class-instawp-rest-api.php:172
     100#: includes/apis/class-instawp-rest-api.php:173
    101101msgid "No user found with the provided username."
    102102msgstr ""
    103103
    104 #: includes/apis/class-instawp-rest-api.php:180
     104#: includes/apis/class-instawp-rest-api.php:181
    105105msgid "This user does not have capability to config the website."
    106106msgstr ""
    107107
    108 #: includes/apis/class-instawp-rest-api.php:199
     108#: includes/apis/class-instawp-rest-api.php:200
    109109msgid "Application password does not match."
    110110msgstr ""
    111111
    112 #: includes/apis/class-instawp-rest-api.php:221
     112#: includes/apis/class-instawp-rest-api.php:222
    113113msgid "This website is already connected!"
    114114msgstr ""
    115115
    116 #: includes/apis/class-instawp-rest-api.php:241
     116#: includes/apis/class-instawp-rest-api.php:242
    117117msgid "Invalid API domain parameter passed."
    118118msgstr ""
    119119
    120 #: includes/apis/class-instawp-rest-api.php:255
     120#: includes/apis/class-instawp-rest-api.php:256
    121121msgid "API Key is not valid."
    122122msgstr ""
    123123
    124 #: includes/apis/class-instawp-rest-api.php:262
     124#: includes/apis/class-instawp-rest-api.php:263
    125125msgid "Something went wrong during connecting to InstaWP."
    126126msgstr ""
    127127
    128 #: includes/apis/class-instawp-rest-api.php:269
     128#: includes/apis/class-instawp-rest-api.php:270
    129129msgid "Connected."
    130130msgstr ""
    131131
    132 #: includes/apis/class-instawp-rest-api.php:289
     132#: includes/apis/class-instawp-rest-api.php:290
    133133msgid "This site is not currently marked as staging"
    134134msgstr ""
    135135
    136 #: includes/apis/class-instawp-rest-api.php:297
     136#: includes/apis/class-instawp-rest-api.php:298
    137137msgid "Invalid parent connect ID"
    138138msgstr ""
    139139
    140 #: includes/apis/class-instawp-rest-api.php:305
     140#: includes/apis/class-instawp-rest-api.php:306
    141141msgid "Parent connect ID does not match"
    142142msgstr ""
    143143
    144 #: includes/apis/class-instawp-rest-api.php:317
     144#: includes/apis/class-instawp-rest-api.php:318
    145145msgid "Site has been marked as parent"
    146146msgstr ""
    147147
    148 #: includes/apis/class-instawp-rest-api.php:338
     148#: includes/apis/class-instawp-rest-api.php:339
    149149msgid "Invalid connect ID"
    150150msgstr ""
    151151
    152 #: includes/apis/class-instawp-rest-api.php:349
     152#: includes/apis/class-instawp-rest-api.php:350
    153153msgid "Site has been marked as staging"
    154154msgstr ""
    155155
    156 #: includes/apis/class-instawp-rest-api.php:370
     156#: includes/apis/class-instawp-rest-api.php:371
    157157msgid "Staging Site List Refreshed."
    158158msgstr ""
    159159
    160 #: includes/apis/class-instawp-rest-api.php:392
     160#: includes/apis/class-instawp-rest-api.php:393
    161161msgid "Plugin reset Successful."
    162162msgstr ""
    163163
    164 #: includes/apis/class-instawp-rest-api.php:462
     164#: includes/apis/class-instawp-rest-api.php:463
    165165msgid "Activity log is enabled."
    166166msgstr ""
    167167
    168 #: includes/apis/class-instawp-rest-api.php:462
     168#: includes/apis/class-instawp-rest-api.php:463
    169169msgid "Activity log is disabled."
    170170msgstr ""
    171171
    172 #: includes/apis/class-instawp-rest-api.php:484, includes/functions.php:778
     172#: includes/apis/class-instawp-rest-api.php:485, includes/functions.php:778
    173173msgid "No login information found."
    174174msgstr ""
    175175
    176 #: includes/apis/class-instawp-rest-api.php:544
     176#: includes/apis/class-instawp-rest-api.php:545
    177177msgid "All Temporary logins are removed."
    178178msgstr ""
    179179
    180 #: includes/apis/class-instawp-rest-api.php:605
     180#: includes/apis/class-instawp-rest-api.php:606
    181181msgid "No items found"
    182182msgstr ""
    183183
    184 #: includes/apis/class-instawp-rest-api.php:614
     184#: includes/apis/class-instawp-rest-api.php:615
    185185msgid "Update task create successfully"
    186186msgstr ""
    187187
    188 #: includes/apis/class-instawp-rest-api.php:675
     188#: includes/apis/class-instawp-rest-api.php:676
    189189msgid "Empty bearer token."
    190190msgstr ""
    191191
    192 #: includes/apis/class-instawp-rest-api.php:688
     192#: includes/apis/class-instawp-rest-api.php:689
    193193msgid "Empty api key."
    194194msgstr ""
    195195
    196 #: includes/apis/class-instawp-rest-api.php:703
     196#: includes/apis/class-instawp-rest-api.php:704
    197197msgid "Invalid bearer token."
    198198msgstr ""
    199199
    200 #: includes/apis/class-instawp-rest-api.php:840
     200#: includes/apis/class-instawp-rest-api.php:841
    201201msgid "Route not allowed"
    202202msgstr ""
    203203
    204 #: includes/apis/class-instawp-rest-api.php:943, includes/class-instawp-setting.php:583, includes/class-instawp-setting.php:589
     204#: includes/apis/class-instawp-rest-api.php:944, includes/class-instawp-setting.php:583, includes/class-instawp-setting.php:589
    205205msgid "Heartbeat"
    206206msgstr ""
    207207
    208 #: includes/apis/class-instawp-rest-api.php:944, includes/class-instawp-hooks.php:285, includes/class-instawp-setting.php:249, includes/class-instawp-setting.php:621
     208#: includes/apis/class-instawp-rest-api.php:945, includes/class-instawp-hooks.php:285, includes/class-instawp-setting.php:249, includes/class-instawp-setting.php:621
    209209msgid "Database Manager"
    210210msgstr ""
    211211
    212 #: includes/apis/class-instawp-rest-api.php:945, includes/class-instawp-setting.php:629
     212#: includes/apis/class-instawp-rest-api.php:946, includes/class-instawp-setting.php:629
    213213msgid "Install Plugin / Themes"
    214214msgstr ""
    215215
    216 #: includes/apis/class-instawp-rest-api.php:946, includes/class-instawp-setting.php:637
     216#: includes/apis/class-instawp-rest-api.php:947, includes/class-instawp-setting.php:637
    217217msgid "Update Core / Plugin / Themes"
    218218msgstr ""
    219219
    220 #: includes/apis/class-instawp-rest-api.php:947, includes/class-instawp-setting.php:645
     220#: includes/apis/class-instawp-rest-api.php:948, includes/class-instawp-setting.php:645
    221221msgid "Activate / Deactivate"
    222222msgstr ""
    223223
    224 #: includes/apis/class-instawp-rest-api.php:948, includes/class-instawp-setting.php:653
     224#: includes/apis/class-instawp-rest-api.php:949, includes/class-instawp-setting.php:653
    225225msgid "Config Management"
    226226msgstr ""
    227227
    228 #: includes/apis/class-instawp-rest-api.php:949, includes/class-instawp-setting.php:661
     228#: includes/apis/class-instawp-rest-api.php:950, includes/class-instawp-setting.php:661
    229229msgid "Site Inventory"
    230230msgstr ""
    231231
    232 #: includes/apis/class-instawp-rest-api.php:950, includes/class-instawp-setting.php:250, includes/class-instawp-setting.php:669
     232#: includes/apis/class-instawp-rest-api.php:951, includes/class-instawp-setting.php:250, includes/class-instawp-setting.php:669
    233233msgid "Debug Log"
    234234msgstr ""
     
    730730msgstr ""
    731731
    732 #: includes/class-instawp-tools.php:701
     732#: includes/class-instawp-tools.php:709
    733733msgid "API key not found"
    734734msgstr ""
    735735
    736 #: includes/class-instawp-tools.php:926
     736#: includes/class-instawp-tools.php:934
    737737msgid "Root directory for this WordPress installation could not find."
    738738msgstr ""
    739739
    740 #: includes/class-instawp-tools.php:947
     740#: includes/class-instawp-tools.php:955
    741741msgid "Tracking database could not found."
    742742msgstr ""
    743743
    744 #: includes/class-instawp-tools.php:957
     744#: includes/class-instawp-tools.php:965
    745745msgid "API Signature and others data could not set properly"
    746746msgstr ""
    747747
    748 #: includes/class-instawp-tools.php:983
     748#: includes/class-instawp-tools.php:991
    749749msgid "InstaWP could not access or read required files from your WordPress directory due to file permission issue."
    750750msgstr ""
    751751
    752 #: includes/class-instawp-tools.php:985
     752#: includes/class-instawp-tools.php:993
    753753msgid "Learn more."
    754754msgstr ""
    755755
    756 #: includes/class-instawp-tools.php:1193
     756#: includes/class-instawp-tools.php:1201
    757757msgid "Launch %s"
    758758msgstr ""
    759759
    760 #: includes/class-instawp-tools.php:1281
     760#: includes/class-instawp-tools.php:1289
    761761msgid "Please create staging sites first."
    762762msgstr ""
    763763
    764 #: includes/class-instawp-tools.php:1282
     764#: includes/class-instawp-tools.php:1290
    765765msgid "Skip"
    766766msgstr ""
    767767
    768 #: includes/class-instawp-tools.php:1283
     768#: includes/class-instawp-tools.php:1291
    769769msgid "Do you really want to disconnect the plugin? It will completely remove the existing staging sites from the plugin."
    770770msgstr ""
    771771
    772 #: includes/class-instawp-tools.php:1284
     772#: includes/class-instawp-tools.php:1292
    773773msgid "Do you still want to disconnect the plugin?"
    774774msgstr ""
    775775
    776 #: includes/class-instawp-tools.php:1332
     776#: includes/class-instawp-tools.php:1340
    777777msgid "Zip archive is not opening."
    778778msgstr ""
    779779
    780 #: includes/class-instawp-tools.php:1385
     780#: includes/class-instawp-tools.php:1393
    781781msgid "No compression method find."
    782782msgstr ""
    783783
    784 #: includes/class-instawp-tools.php:1429
     784#: includes/class-instawp-tools.php:1437
    785785msgid "Site ID not found in site create response."
    786786msgstr ""
    787787
    788 #: includes/class-instawp-tools.php:1468
     788#: includes/class-instawp-tools.php:1476
    789789msgid "SFTP login failed."
    790790msgstr ""
    791791
    792 #: includes/class-instawp-tools.php:1479
     792#: includes/class-instawp-tools.php:1487
    793793msgid "SFTP upload failed for files."
    794794msgstr ""
    795795
    796 #: includes/class-instawp-tools.php:1487
     796#: includes/class-instawp-tools.php:1495
    797797msgid "SFTP upload failed for database."
    798798msgstr ""
  • instawp-connect/trunk/readme.txt

    r3223388 r3227461  
    55Tested up to: 6.7
    66Requires PHP: 7.0
    7 Stable tag: 0.1.0.78
     7Stable tag: 0.1.0.79
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    9999== Changelog ==
    100100
     101= 0.1.0.79 - 23 January 2025 =
     102- FIX: Fixed default username for magic login.
     103- FIX: Added managed parameter to config API.
     104- FIX: Fixed cache clearing issue with WP Rocket.
     105- FIX: Push migration exclude files check.
     106
    101107= 0.1.0.78 - 16 January 2025 =
    102108- NEW: Added extra log message for handling pull migration failure.
  • instawp-connect/trunk/vendor/composer/InstalledVersions.php

    r3216309 r3227461  
    3232     */
    3333    private static $installed;
     34
     35    /**
     36     * @var bool
     37     */
     38    private static $installedIsLocalDir;
    3439
    3540    /**
     
    310315        self::$installed = $data;
    311316        self::$installedByVendor = array();
     317
     318        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     319        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     320        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     321        // all installed packages for example
     322        self::$installedIsLocalDir = false;
    312323    }
    313324
     
    326337
    327338        if (self::$canGetVendors) {
     339            $selfDir = strtr(__DIR__, '\\', '/');
    328340            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     341                $vendorDir = strtr($vendorDir, '\\', '/');
    329342                if (isset(self::$installedByVendor[$vendorDir])) {
    330343                    $installed[] = self::$installedByVendor[$vendorDir];
     
    334347                    self::$installedByVendor[$vendorDir] = $required;
    335348                    $installed[] = $required;
    336                     if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
     349                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
    337350                        self::$installed = $required;
    338                         $copiedLocalDir = true;
     351                        self::$installedIsLocalDir = true;
    339352                    }
     353                }
     354                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     355                    $copiedLocalDir = true;
    340356                }
    341357            }
  • instawp-connect/trunk/vendor/composer/installed.json

    r3218292 r3227461  
    88                "type": "git",
    99                "url": "https://github.com/InstaWP/connect-helpers.git",
    10                 "reference": "4e5a060b35cdcc903ee2165e1cb5b2794437cf74"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/InstaWP/connect-helpers/zipball/4e5a060b35cdcc903ee2165e1cb5b2794437cf74",
    15                 "reference": "4e5a060b35cdcc903ee2165e1cb5b2794437cf74",
     10                "reference": "2e60645a8e670973fba99dcbb9cecd8c9e3eefd1"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/InstaWP/connect-helpers/zipball/2e60645a8e670973fba99dcbb9cecd8c9e3eefd1",
     15                "reference": "2e60645a8e670973fba99dcbb9cecd8c9e3eefd1",
    1616                "shasum": ""
    1717            },
     
    2020                "wp-cli/wp-config-transformer": "^1.3"
    2121            },
    22             "time": "2025-01-02T11:30:59+00:00",
     22            "time": "2025-01-23T09:43:33+00:00",
    2323            "default-branch": true,
    2424            "type": "library",
     
    4848            "description": "CLI Package for InstaWP Remote Features",
    4949            "support": {
    50                 "source": "https://github.com/InstaWP/connect-helpers/tree/main",
     50                "source": "https://github.com/InstaWP/connect-helpers/tree/1.0.1",
    5151                "issues": "https://github.com/InstaWP/connect-helpers/issues"
    5252            },
     
    291291        {
    292292            "name": "woocommerce/action-scheduler",
    293             "version": "3.9.0",
    294             "version_normalized": "3.9.0.0",
     293            "version": "3.9.1",
     294            "version_normalized": "3.9.1.0",
    295295            "source": {
    296296                "type": "git",
    297297                "url": "https://github.com/woocommerce/action-scheduler.git",
    298                 "reference": "90b98e6fe97d455679b1d288f050cad8f6f79771"
    299             },
    300             "dist": {
    301                 "type": "zip",
    302                 "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/90b98e6fe97d455679b1d288f050cad8f6f79771",
    303                 "reference": "90b98e6fe97d455679b1d288f050cad8f6f79771",
     298                "reference": "d73b5f83cd42832fa137e03687bad3e312298d29"
     299            },
     300            "dist": {
     301                "type": "zip",
     302                "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/d73b5f83cd42832fa137e03687bad3e312298d29",
     303                "reference": "d73b5f83cd42832fa137e03687bad3e312298d29",
    304304                "shasum": ""
    305305            },
     
    313313                "yoast/phpunit-polyfills": "^2.0"
    314314            },
    315             "time": "2024-11-15T00:11:39+00:00",
     315            "time": "2025-01-21T11:39:08+00:00",
    316316            "type": "wordpress-plugin",
    317317            "extra": {
     
    331331            "support": {
    332332                "issues": "https://github.com/woocommerce/action-scheduler/issues",
    333                 "source": "https://github.com/woocommerce/action-scheduler/tree/3.9.0"
     333                "source": "https://github.com/woocommerce/action-scheduler/tree/3.9.1"
    334334            },
    335335            "install-path": "../woocommerce/action-scheduler"
  • instawp-connect/trunk/vendor/composer/installed.php

    r3218292 r3227461  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '5e2939ad37db1d19f4609420ae51403a96362415',
     6        'reference' => '5419ef006247c7db8093cc35d038fc2b0e25fb7a',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '5e2939ad37db1d19f4609420ae51403a96362415',
     16            'reference' => '5419ef006247c7db8093cc35d038fc2b0e25fb7a',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
     
    2323            'pretty_version' => 'dev-main',
    2424            'version' => 'dev-main',
    25             'reference' => '4e5a060b35cdcc903ee2165e1cb5b2794437cf74',
     25            'reference' => '2e60645a8e670973fba99dcbb9cecd8c9e3eefd1',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../instawp/connect-helpers',
     
    5959        ),
    6060        'woocommerce/action-scheduler' => array(
    61             'pretty_version' => '3.9.0',
    62             'version' => '3.9.0.0',
    63             'reference' => '90b98e6fe97d455679b1d288f050cad8f6f79771',
     61            'pretty_version' => '3.9.1',
     62            'version' => '3.9.1.0',
     63            'reference' => 'd73b5f83cd42832fa137e03687bad3e312298d29',
    6464            'type' => 'wordpress-plugin',
    6565            'install_path' => __DIR__ . '/../woocommerce/action-scheduler',
  • instawp-connect/trunk/vendor/instawp/connect-helpers/connect-helpers.php

    r2957903 r3227461  
    44 *
    55 * @package      InstaWP\Connect\Helpers
    6  * @copyright    Copyright (C) 2023, InstaWP
    7  * @link         http://instawp.com
     6 * @copyright    Copyright (C) 2025, InstaWP
     7 * @link         https://instawp.com
    88 * @since        1.0.0
    99 *
    1010 * @wordpress-plugin
    1111 * Plugin Name:       InstaWP Connect Helpers
    12  * Version:           1.0.0
     12 * Version:           1.0.1
    1313 * Plugin URI:        https://instawp.com
    1414 * Description:       Helpers Package for InstaWP Remote Features.
     
    1818 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
    1919 * Requires at least: 5.6
    20  * Tested up to:      6.3
     20 * Tested up to:      6.7
    2121 */
    2222
  • instawp-connect/trunk/vendor/instawp/connect-helpers/src/Cache.php

    r3147089 r3227461  
    4343        // WP Rocket.
    4444        if ( is_plugin_active( 'wp-rocket/wp-rocket.php' ) ) {
    45             $message = '';
    46            
    47             if ( function_exists( 'rocket_clean_minify' ) && function_exists( 'rocket_clean_domain' ) ) {
    48                 rocket_clean_minify();
    49                 rocket_clean_domain();
    50             } else {
    51                 $message = 'Function not exists.';
    52             }
     45            $functions = [
     46                'rocket_clean_minify',
     47                'rocket_clean_domain',
     48                'rocket_clean_cache_busting',
     49                [ 'rocket_dismiss_box', 'rocket_warning_plugin_modification' ],
     50                [ 'rocket_renew_box', 'preload_notice' ]
     51            ];
     52
     53            $executed = array_reduce( $functions, function( $count, $item ) {
     54                if ( is_array( $item ) ) {
     55                    $func = $item[0];
     56                    $arg = $item[1];
     57                    if ( function_exists( $func ) ) {
     58                        $func( $arg );
     59                        return $count + 1;
     60                    }
     61                } elseif ( function_exists( $item )) {
     62                    $item();
     63                    return $count + 1;
     64                }
     65                return $count;
     66            }, 0 );
    5367
    5468            $results[] = [
    5569                'slug'    => 'wp-rocket',
    5670                'name'    => 'WP Rocket',
    57                 'message' => $message
     71                'message' => $executed === 0 ? 'Function not exists.' : ''
    5872            ];
    5973        }
  • instawp-connect/trunk/vendor/instawp/connect-helpers/src/Helper.php

    r3218292 r3227461  
    181181
    182182    public static function get_admin_username() {
     183        if ( current_user_can( 'manage_options' ) ) {
     184            $current_user = wp_get_current_user();
     185           
     186            if ( ! empty( $current_user ) ) {
     187                return $current_user->user_login;
     188            }
     189        }
     190       
    183191        $username = '';
    184192
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/action-scheduler.php

    r3194914 r3227461  
    66 * Author: Automattic
    77 * Author URI: https://automattic.com/
    8  * Version: 3.9.0
     8 * Version: 3.9.1
    99 * License: GPLv3
    1010 * Requires at least: 6.5
    11  * Tested up to: 6.7
     11 * Tested up to: 6.5
    1212 * Requires PHP: 7.1
    1313 *
     
    3030 */
    3131
    32 if ( ! function_exists( 'action_scheduler_register_3_dot_9_dot_0' ) && function_exists( 'add_action' ) ) { // WRCS: DEFINED_VERSION.
     32if ( ! function_exists( 'action_scheduler_register_3_dot_9_dot_1' ) && function_exists( 'add_action' ) ) { // WRCS: DEFINED_VERSION.
    3333
    3434    if ( ! class_exists( 'ActionScheduler_Versions', false ) ) {
     
    3737    }
    3838
    39     add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_9_dot_0', 0, 0 ); // WRCS: DEFINED_VERSION.
     39    add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_9_dot_1', 0, 0 ); // WRCS: DEFINED_VERSION.
    4040
    4141    // phpcs:disable Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace
     
    4343     * Registers this version of Action Scheduler.
    4444     */
    45     function action_scheduler_register_3_dot_9_dot_0() { // WRCS: DEFINED_VERSION.
     45    function action_scheduler_register_3_dot_9_dot_1() { // WRCS: DEFINED_VERSION.
    4646        $versions = ActionScheduler_Versions::instance();
    47         $versions->register( '3.9.0', 'action_scheduler_initialize_3_dot_9_dot_0' ); // WRCS: DEFINED_VERSION.
     47        $versions->register( '3.9.1', 'action_scheduler_initialize_3_dot_9_dot_1' ); // WRCS: DEFINED_VERSION.
    4848    }
    4949
     
    5252     * Initializes this version of Action Scheduler.
    5353     */
    54     function action_scheduler_initialize_3_dot_9_dot_0() { // WRCS: DEFINED_VERSION.
     54    function action_scheduler_initialize_3_dot_9_dot_1() { // WRCS: DEFINED_VERSION.
    5555        // A final safety check is required even here, because historic versions of Action Scheduler
    5656        // followed a different pattern (in some unusual cases, we could reach this point and the
     
    6464    // Support usage in themes - load this version if no plugin has loaded a version yet.
    6565    if ( did_action( 'plugins_loaded' ) && ! doing_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler', false ) ) {
    66         action_scheduler_initialize_3_dot_9_dot_0(); // WRCS: DEFINED_VERSION.
     66        action_scheduler_initialize_3_dot_9_dot_1(); // WRCS: DEFINED_VERSION.
    6767        do_action( 'action_scheduler_pre_theme_init' );
    6868        ActionScheduler_Versions::initialize_latest_version();
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/changelog.txt

    r3194914 r3227461  
    11*** Changelog ***
     2
     3= 3.9.1 - 2025-01-21 =
     4* A number of new WP CLI commands have been added, making it easier to manage actions in the terminal and from scripts.
     5* New wp action-scheduler source command to help determine how Action Scheduler is being loaded.
     6* Additional information about the active instance of Action Scheduler is now available in the Help pull-down drawer.
     7* Make some other nullable parameters explicitly nullable.
     8* Set option value to `no` rather than deleting.
    29
    310= 3.9.0 - 2024-11-14 = 
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionFactory.php

    r3194914 r3227461  
    99     * Return stored actions for given params.
    1010     *
    11      * @param string                   $status The action's status in the data store.
    12      * @param string                   $hook The hook to trigger when this action runs.
    13      * @param array                    $args Args to pass to callbacks when the hook is triggered.
    14      * @param ActionScheduler_Schedule $schedule The action's schedule.
    15      * @param string                   $group A group to put the action in.
     11     * @param string                        $status The action's status in the data store.
     12     * @param string                        $hook The hook to trigger when this action runs.
     13     * @param array                         $args Args to pass to callbacks when the hook is triggered.
     14     * @param ActionScheduler_Schedule|null $schedule The action's schedule.
     15     * @param string                        $group A group to put the action in.
    1616     * phpcs:ignore Squiz.Commenting.FunctionComment.ExtraParamComment
    17      * @param int                      $priority The action priority.
     17     * @param int                           $priority The action priority.
    1818     *
    1919     * @return ActionScheduler_Action An instance of the stored action.
    2020     */
    21     public function get_stored_action( $status, $hook, array $args = array(), ActionScheduler_Schedule $schedule = null, $group = '' ) {
     21    public function get_stored_action( $status, $hook, array $args = array(), ?ActionScheduler_Schedule $schedule = null, $group = '' ) {
    2222        // The 6th parameter ($priority) is not formally declared in the method signature to maintain compatibility with
    2323        // third-party subclasses created before this param was added.
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_AdminView.php

    r3194914 r3227461  
    251251        }
    252252
    253         $as_version = ActionScheduler_Versions::instance()->latest_version();
     253        $as_version       = ActionScheduler_Versions::instance()->latest_version();
     254        $as_source        = ActionScheduler_Versions::instance()->active_source();
     255        $as_source_path   = ActionScheduler_Versions::instance()->active_source_path();
     256        $as_source_markup = sprintf( '<code>%s</code>', esc_html( $as_source_path ) );
     257
     258        if ( ! empty( $as_source ) ) {
     259            $as_source_markup = sprintf(
     260                '%s: <abbr title="%s">%s</abbr>',
     261                ucfirst( $as_source['type'] ),
     262                esc_attr( $as_source_path ),
     263                esc_html( $as_source['name'] )
     264            );
     265        }
     266
    254267        $screen->add_help_tab(
    255268            array(
     
    261274                    '<p>' .
    262275                        __( 'Action Scheduler is a scalable, traceable job queue for background processing large sets of actions. Action Scheduler works by triggering an action hook to run at some time in the future. Scheduled actions can also be scheduled to run on a recurring schedule.', 'action-scheduler' ) .
     276                    '</p>' .
     277                    '<h3>' . esc_html__( 'Source', 'action-scheduler' ) . '</h3>' .
     278                    '<p>' .
     279                        esc_html__( 'Action Scheduler is currently being loaded from the following location. This can be useful when debugging, or if requested by the support team.', 'action-scheduler' ) .
     280                    '</p>' .
     281                    '<p>' . $as_source_markup . '</p>' .
     282                    '<h3>' . esc_html__( 'WP CLI', 'action-scheduler' ) . '</h3>' .
     283                    '<p>' .
     284                        sprintf(
     285                            /* translators: %1$s is WP CLI command (not translatable) */
     286                            esc_html__( 'WP CLI commands are available: execute %1$s for a list of available commands.', 'action-scheduler' ),
     287                            '<code>wp help action-scheduler</code>'
     288                        ) .
    263289                    '</p>',
    264290            )
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Versions.php

    r3194914 r3227461  
    2020
    2121    /**
     22     * Registered sources.
     23     *
     24     * @var array<string, string>
     25     */
     26    private $sources = array();
     27
     28    /**
    2229     * Register version's callback.
    2330     *
     
    2936            return false;
    3037        }
     38
     39        // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace
     40        $backtrace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
     41        $source    = $backtrace[0]['file'];
     42
    3143        $this->versions[ $version_string ] = $initialization_callback;
     44        $this->sources[ $source ]          = $version_string;
    3245        return true;
    3346    }
     
    3851    public function get_versions() {
    3952        return $this->versions;
     53    }
     54
     55    /**
     56     * Get registered sources.
     57     *
     58     * @return array<string, string>
     59     */
     60    public function get_sources() {
     61        return $this->sources;
    4062    }
    4163
     
    87109        call_user_func( $self->latest_version_callback() );
    88110    }
     111
     112    /**
     113     * Returns information about the plugin or theme which contains the current active version
     114     * of Action Scheduler.
     115     *
     116     * If this cannot be determined, or if Action Scheduler is being loaded via some other
     117     * method, then it will return an empty array. Otherwise, if populated, the array will
     118     * look like the following:
     119     *
     120     *     [
     121     *         'type' => 'plugin', # or 'theme'
     122     *         'name' => 'Name',
     123     *     ]
     124     *
     125     * @return array
     126     */
     127    public function active_source(): array {
     128        $file         = __FILE__;
     129        $dir          = __DIR__;
     130        $plugins      = get_plugins();
     131        $plugin_files = array_keys( $plugins );
     132
     133        foreach ( $plugin_files as $plugin_file ) {
     134            $plugin_path = trailingslashit( WP_PLUGIN_DIR ) . dirname( $plugin_file );
     135            $plugin_file = trailingslashit( WP_PLUGIN_DIR ) . $plugin_file;
     136
     137            if ( 0 !== strpos( dirname( $dir ), $plugin_path ) ) {
     138                continue;
     139            }
     140
     141            $plugin_data = get_plugin_data( $plugin_file );
     142
     143            if ( ! is_array( $plugin_data ) || empty( $plugin_data['Name'] ) ) {
     144                continue;
     145            }
     146
     147            return array(
     148                'type' => 'plugin',
     149                'name' => $plugin_data['Name'],
     150            );
     151        }
     152
     153        $themes = (array) search_theme_directories();
     154
     155        foreach ( $themes as $slug => $data ) {
     156            $needle = trailingslashit( $data['theme_root'] ) . $slug . '/';
     157
     158            if ( 0 !== strpos( $file, $needle ) ) {
     159                continue;
     160            }
     161
     162            $theme = wp_get_theme( $slug );
     163
     164            if ( ! is_object( $theme ) || ! is_a( $theme, \WP_Theme::class ) ) {
     165                continue;
     166            }
     167
     168            return array(
     169                'type' => 'theme',
     170                // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
     171                'name' => $theme->Name,
     172            );
     173        }
     174
     175        return array();
     176    }
     177
     178    /**
     179     * Returns the directory path for the currently active installation of Action Scheduler.
     180     *
     181     * @return string
     182     */
     183    public function active_source_path(): string {
     184        return trailingslashit( dirname( __DIR__ ) );
     185    }
    89186}
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_WPCommentCleaner.php

    r3194914 r3227461  
    6767     */
    6868    public static function maybe_schedule_cleanup() {
     69        $has_logs = 'no';
     70
    6971        $args = array(
    7072            'type'   => ActionScheduler_wpCommentLogger::TYPE,
     
    7476
    7577        if ( (bool) get_comments( $args ) ) {
    76             update_option( self::$has_logs_option_key, 'yes' );
     78            $has_logs = 'yes';
    7779
    7880            if ( ! as_next_scheduled_action( self::$cleanup_hook ) ) {
     
    8082            }
    8183        }
     84
     85        update_option( self::$has_logs_option_key, $has_logs, true );
    8286    }
    8387
     
    96100        );
    97101
    98         delete_option( self::$has_logs_option_key );
     102        update_option( self::$has_logs_option_key, 'no', true );
    99103    }
    100104
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php

    r3194914 r3227461  
    241241            WP_CLI::add_command( 'action-scheduler', 'ActionScheduler_WPCLI_Scheduler_command' );
    242242            WP_CLI::add_command( 'action-scheduler', 'ActionScheduler_WPCLI_Clean_Command' );
     243            WP_CLI::add_command( 'action-scheduler action', '\Action_Scheduler\WP_CLI\Action_Command' );
     244            WP_CLI::add_command( 'action-scheduler', '\Action_Scheduler\WP_CLI\System_Command' );
    243245            if ( ! ActionScheduler_DataController::is_migration_complete() && Controller::instance()->allow_migration() ) {
    244246                $command = new Migration_Command();
     
    297299            'ActionScheduler_Store'                      => true,
    298300            'ActionScheduler_TimezoneHelper'             => true,
     301            'ActionScheduler_WPCLI_Command'              => true,
    299302        );
    300303
     
    341344    protected static function is_class_cli( $class ) {
    342345        static $cli_segments = array(
    343             'QueueRunner' => true,
    344             'Command'     => true,
    345             'ProgressBar' => true,
     346            'QueueRunner'                             => true,
     347            'Command'                                 => true,
     348            'ProgressBar'                             => true,
     349            '\Action_Scheduler\WP_CLI\Action_Command' => true,
     350            '\Action_Scheduler\WP_CLI\System_Command' => true,
    346351        );
    347352
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php

    r3051765 r3227461  
    1414     * @return DateTime|null
    1515     */
    16     public function next( DateTime $after = null ) {
     16    public function next( ?DateTime $after = null ) {
    1717        if ( empty( $after ) ) {
    1818            $return_value       = $this->get_date();
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression.php

    r3051765 r3227461  
    5555     * @return CronExpression
    5656     */
    57     public static function factory($expression, CronExpression_FieldFactory $fieldFactory = null)
     57    public static function factory($expression, ?CronExpression_FieldFactory $fieldFactory = null)
    5858    {
    5959        $mappings = array(
  • instawp-connect/trunk/vendor/woocommerce/action-scheduler/readme.txt

    r3194914 r3227461  
    22Contributors: Automattic, wpmuguru, claudiosanches, peterfabian1000, vedjain, jamosova, obliviousharmony, konamiman, sadowski, royho, barryhughes-1
    33Tags: scheduler, cron
    4 Stable tag: 3.9.0
     4Stable tag: 3.9.1
    55License: GPLv3
    66Requires at least: 6.5
    7 Tested up to: 6.7
     7Tested up to: 6.5
    88Requires PHP: 7.1
    99
     
    4747
    4848== Changelog ==
     49
     50= 3.9.1 - 2025-01-21 =
     51* A number of new WP CLI commands have been added, making it easier to manage actions in the terminal and from scripts.
     52* New wp action-scheduler source command to help determine how Action Scheduler is being loaded.
     53* Additional information about the active instance of Action Scheduler is now available in the Help pull-down drawer.
     54* Make some other nullable parameters explicitly nullable.
     55* Set option value to `no` rather than deleting.
    4956
    5057= 3.9.0 - 2024-11-14 = 
Note: See TracChangeset for help on using the changeset viewer.