$srr_tables_checked ) { //ray('Forcing update'); $tables = [ 'restaurants', 'restaurant_meta', 'restaurant_setting', 'users', 'user_meta', 'customers', 'customer_meta', 'ctaggroups', 'ctags', 'customer_ctag', 'bookings', 'booking_meta', 'booking_notifications', 'booking_reviews', 'btaggroups', 'btags', 'booking_btag', 'restaurant_user', 'settings', 'notifications', 'payments', 'floors', 'areas', 'tables', 'combinations', 'combination_table', 'booking_table', 'roles', 'actions', 'daily_notifications', 'tokens', 'bookings_recurring', 'ttaggroups', 'ttags', 'table_ttag', 'layouts', 'automation_logs', 'booking_tracking', 'whatsapp_flows', 'whatsapp_conversations', 'whatsapp_messages', 'whatsapp_webhooks', 'api_keys', 'api_logs', 'api_keys_bot', 'api_logs_bot', 'url_shorteners', 'missed_call_logs', 'spaces' //'workflows','workflow_steps', 'workflow_instances', 'workflow_step_executions' ]; foreach($tables as $table) { // Install the table if does not exists if (!WP_ALEXR()->{$table}->installed()) { //ray('Creating table:'.$table); WP_ALEXR()->{$table}->create_table(); } } // Update columns foreach($tables as $table) { // Update for new columns, check if method exists // means that need to add columns if (method_exists(WP_ALEXR()->{$table}, 'sql_update_columns_releases')) { //ray('Checking columns: ' . $table); WP_ALEXR()->{$table}->sql_update_columns_releases(); } } // Do not check until 1 day again update_option( $key, ( current_time( 'timestamp' ) + 24 * 60 * 60 ) ); //update_option( $key, ( current_time( 'timestamp' ) + WEEK_IN_SECONDS ) ); // Test 20 seconds //update_option( '_srr_tables_checked', ( current_time( 'timestamp' ) + 20 ) ); } } function ALEXR_after_install_update_translations() { $key = '_srr_translations_checked_release_'.ALEXR_RELEASE; $srr_translations_checked = get_option($key, false); if (false === $srr_translations_checked) { \Alexr\Http\Controllers\TranslateController::syncAllFiles(); update_option( $key, current_time( 'timestamp' )); } } add_action( 'admin_init', 'ALEXR_after_install_check_DB' ); add_action( 'admin_init', 'ALEXR_after_install_update_translations' );