{"id":18999952,"date":"2026-08-22T01:03:36","date_gmt":"2026-08-22T01:03:36","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=18999952"},"modified":"2026-08-22T03:10:52","modified_gmt":"2026-08-22T03:10:52","slug":"php-8-warning-undefined-variable-atomchat_asset_version-v1-1-8","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-8-warning-undefined-variable-atomchat_asset_version-v1-1-8\/","title":{"rendered":"PHP 8 warning \u2014 undefined variable $atomchat_asset_version (v1.1.8)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Plugin: AtomChat 1.1.8<br \/>PHP: 8.4<br \/>File: includes\/atomchat_cloud.php, lines 22, 40, 41<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Error:<br \/>PHP Warning: Undefined variable $atomchat_asset_version in<br \/>\u2026\/wp-content\/plugins\/atomchat\/includes\/atomchat_cloud.php on line 22<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Cause:<br \/>The function declares <code>global $atomchat_base;<\/code> but also uses<br \/>$atomchat_asset_version, which is defined at file scope in installer.php<br \/>and never declared global. Under PHP 8+ this throws a warning on every<br \/>request, and wp_enqueue_script() receives null as the version argument,<br \/>which breaks asset cache-busting after plugin updates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Suggested fix:<br \/>global $atomchat_base, $atomchat_asset_version;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve applied this patch locally and it resolves the warnings.<\/p>\n","protected":false},"template":"","class_list":["post-18999952","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18999952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18999952\/revisions"}],"predecessor-version":[{"id":18999973,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18999952\/revisions\/18999973"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18999952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}