| @@ -991,12 +991,12 @@ | ||
| 991 | 991 | $name = sanitize_text_field( $request->get_param( 'name' ) ); |
| 992 | 992 | $app_id = sanitize_text_field( $request->get_param( 'app_id' ) ); |
| 993 | 993 | $data = $request->get_param( 'data' ); |
| 994 | 994 | |
| 995 | - error_log('save_credential params: name=' . $name . ', app_id=' . $app_id . ', data=' . print_r($data, true)); | |
| 995 | + //error_log('save_credential params: name=' . $name . ', app_id=' . $app_id . ', data=' . print_r($data, true)); | |
| 996 | 996 | |
| 997 | 997 | if ( empty( $name ) || empty( $app_id ) || empty( $data ) ) { |
| 998 | - error_log('save_credential missing data error'); | |
| 998 | + //error_log('save_credential missing data error'); | |
| 999 | 999 | return new \WP_Error( 'missing_data', __( 'Name, app_id, and data are required.', 'wpbot-automator' ), array( 'status' => 400 ) ); |
| 1000 | 1000 | } |
| 1001 | 1001 | |
| 1002 | 1002 | $credentials = get_option( 'wpbot_automator_credentials', array() ); |
| @@ -1013,9 +1013,9 @@ | ||
| 1013 | 1013 | 'created_at' => current_time( 'mysql' ), |
| 1014 | 1014 | ); |
| 1015 | 1015 | |
| 1016 | 1016 | update_option( 'wpbot_automator_credentials', $credentials ); |
| 1017 | - error_log('save_credential saved: ' . $new_id); | |
| 1017 | + //error_log('save_credential saved: ' . $new_id); | |
| 1018 | 1018 | |
| 1019 | 1019 | return rest_ensure_response( array( |
| 1020 | 1020 | 'success' => true, |
| 1021 | 1021 | 'credential' => array( |
| @@ -1060,11 +1060,11 @@ | ||
| 1060 | 1060 | "SELECT id, name FROM {$table} ORDER BY name ASC", |
| 1061 | 1061 | ARRAY_A |
| 1062 | 1062 | ); |
| 1063 | 1063 | |
| 1064 | - error_log( 'WPbot Automator - GET Templates - Table: ' . $table ); | |
| 1065 | - error_log( 'WPbot Automator - GET Templates - Count: ' . count( $templates ) ); | |
| 1066 | - error_log( 'WPbot Automator - GET Templates - JSON: ' . wp_json_encode( $templates ) ); | |
| 1064 | + //error_log( 'WPbot Automator - GET Templates - Table: ' . $table ); | |
| 1065 | + //error_log( 'WPbot Automator - GET Templates - Count: ' . count( $templates ) ); | |
| 1066 | + //error_log( 'WPbot Automator - GET Templates - JSON: ' . wp_json_encode( $templates ) ); | |
| 1067 | 1067 | |
| 1068 | 1068 | return rest_ensure_response( is_array( $templates ) ? $templates : array() ); |
| 1069 | 1069 | } |
| 1070 | 1070 | |
| @@ -1122,10 +1122,10 @@ | ||
| 1122 | 1122 | 'body_html' => $body_html, |
| 1123 | 1123 | 'body_json' => is_scalar( $body_json ) ? $body_json : wp_json_encode( $body_json ), |
| 1124 | 1124 | ); |
| 1125 | 1125 | |
| 1126 | - error_log( 'WPbot Automator - Saving Template - ID: ' . $id ); | |
| 1127 | - error_log( 'WPbot Automator - Saving Template - Data: ' . wp_json_encode( array_keys( $data ) ) ); | |
| 1126 | + //error_log( 'WPbot Automator - Saving Template - ID: ' . $id ); | |
| 1127 | + //error_log( 'WPbot Automator - Saving Template - Data: ' . wp_json_encode( array_keys( $data ) ) ); | |
| 1128 | 1128 | |
| 1129 | 1129 | if ( $id ) { |
| 1130 | 1130 | $result = $wpdb->update( $table, $data, array( 'id' => $id ) ); |
| 1131 | 1131 | } else { |
| @@ -1133,13 +1133,13 @@ | ||
| 1133 | 1133 | $id = $wpdb->insert_id; |
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | 1136 | if ( false === $result ) { |
| 1137 | - error_log( 'WPbot Automator - Save Template FAILED. Error: ' . $wpdb->last_error ); | |
| 1137 | + //error_log( 'WPbot Automator - Save Template FAILED. Error: ' . $wpdb->last_error ); | |
| 1138 | 1138 | return new \WP_Error( 'save_failed', __( 'Failed to save template', 'wpbot-automator' ) . ': ' . $wpdb->last_error, array( 'status' => 500 ) ); |
| 1139 | 1139 | } |
| 1140 | 1140 | |
| 1141 | - error_log( 'WPbot Automator - Save Template SUCCESS. ID: ' . $id ); | |
| 1141 | + //error_log( 'WPbot Automator - Save Template SUCCESS. ID: ' . $id ); | |
| 1142 | 1142 | |
| 1143 | 1143 | return rest_ensure_response( array( 'success' => true, 'id' => $id ) ); |
| 1144 | 1144 | } |
| 1145 | 1145 | |