Forum Replies Created

Viewing 1 replies (of 1 total)
  • I have the same problem.
    [23-Jun-2021 14:20:25 UTC] PHP Fatal error: Cannot declare class Lara\Widgets\GoogleAnalytics\TrackingCode, because the name is already in use in /var/www/vhosts/httpdocs/wp-content/plugins/lara-google-analytics/core/system/wordpress/tracking.code.class.php on line 14

    And this is because I call wp_head twice.
    @laragoogleanalytics The problem is in your code, you need to replace all require to require_once or use class_exists before require.

    The problem in this code.
    the file with bug: lara-google-analytics/lara-google-analytics.php:44

    add_action( 'wp_head', 'lrgawidget_ga_code');
    
    function lrgawidget_ga_code(){
    	if (!current_user_can('edit_posts')){
    		require(lrgawidget_plugin_dir . 'core/system/wordpress/tracking.code.class.php');
    		Lara\Widgets\GoogleAnalytics\TrackingCode::get_ga_code();
    	}
    } 

    @rlopes528 you can use Search & Replace to replace all require declarations to require_once, this wiil solve this problem before next update.

Viewing 1 replies (of 1 total)