Skip to content

v1.5.2 — Fatal error fix on duplicate plugin folder

Latest

Choose a tag to compare

@schlebek schlebek released this 27 May 09:16

What's fixed

All global PHP functions (cqa_autoload, cqa_activate, cqa_uninstall, cqa_init, cqa_load_textdomain, cqa_invalidate_cache) are now guarded with function_exists().

Problem

Uploading a new plugin ZIP through WordPress admin extracts to a folder with a suffix such as content-quality-analyzer-master. If the previous version (content-quality-analyzer/) is still active, both plugin files load simultaneously, causing:

Fatal error: Cannot redeclare cqa_autoload() (previously declared in
.../content-quality-analyzer/content-quality-analyzer.php:28)
in .../content-quality-analyzer-master/content-quality-analyzer.php on line 37

Fix

Every global function is now wrapped in if ( ! function_exists( '...' ) ) { ... }, so the second instance silently skips redeclaration.

Upgrade path

Delete the old content-quality-analyzer-master/ directory from wp-content/plugins/ after uploading the new version, or rename the extracted folder to content-quality-analyzer before activating.