Skip to content

Commit

Permalink
Added new function to check wpr related error in debug.log
Browse files Browse the repository at this point in the history
  • Loading branch information
jeawhanlee committed Jan 7, 2025
1 parent 37204c7 commit b499161
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,26 @@ export const getScenarioTag = async(tags: Array<string>): Promise<string> => {

return tag;
}

/**
* Check for WP Rocket related error in debug.log.
*
* @param {string} contents File content to be checked.
*
* @return {Promise<boolean>} Promise that resolves after check is completed.
*/
export const isWprRelatedError = async(contents: string): Promise<boolean> => {
const patterns: Array<string> = [
'/plugins/wp-rocket/',
'wpr_rucss_used_css',
'wpr_rocket_cache'
];

for (const pattern of patterns) {
if (contents.includes(pattern)) {
return true;
}
}

return false;
}

0 comments on commit b499161

Please sign in to comment.