PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
← All changes | src/MigrationLog/MigrationLogRepository.php +6 -8 2.30.04.16.9 View file →
@@ -142,19 +142,17 @@
142 142 }
143 143
144 144 /**
145 145 * Get completed migrations IDs
146 - *
147 - * @return array
148 146 */
149 - public function getCompletedMigrationsIDs()
147 + public function getCompletedMigrationsIDs(): array
150 148 {
151 149 $migrations = [];
152 150
153 151 try {
154 - $result = DB::get_results(
155 - DB::prepare("SELECT * FROM {$this->migration_table} WHERE status = %s", MigrationLogStatus::SUCCESS)
156 - );
152 + $result = DB::table('give_migrations')
153 + ->where('status', MigrationLogStatus::SUCCESS)
154 + ->getAll();
157 155 } catch (\Exception $exception) {
158 156 // This exception should happen only once, during the migration system storage update.
159 157 // But, we will log this error just in case to see if this is a repeating problem.
160 158 error_log($exception->getMessage());
@@ -196,12 +194,12 @@
196 194 public function getFailedMigrationsCountByIds($migrationIds)
197 195 {
198 196 try {
199 197 $query = sprintf(
200 - "SELECT count(id) FROM %s WHERE id IN ('%s') AND status != '%s'",
198 + "SELECT count(id) FROM %s WHERE id IN ('%s') AND status = '%s'",
201 199 $this->migration_table,
202 200 implode("','", array_map('esc_sql', $migrationIds)),
203 - MigrationLogStatus::SUCCESS
201 + MigrationLogStatus::FAILED
204 202 );
205 203
206 204 return DB::get_var($query);
207 205 } catch (\Exception $exception) {