Home Forums Plugin Support AffiliateWP MLM Error unexpected T_FUNCTION

5 replies, 2 voices Last updated by  Christian Freeman 5 months, 1 week ago
  • larrydroz
    Participant
    @larrydroz
    #7700

    I am attempting to migrate a WordPress site from one URL to another using the “Duplicator” plugin.
    The old site was archived in March with WordPress 4.7.3.
    All files have now been extracted from the archive on the new URL.
    When attempting to login to the new wordpress site, the following error shows:

    Parse error: syntax error, unexpected T_FUNCTION in /home1/theultim/public_html/thehousechurchnetwork/wp-content/plugins/affiliatewp-multi-level-marketing/affiliatewp-multi-level-marketing.php on line 266

    The version# in the php file is 1.0.6.1. The lines near line 266 are shown below.
    I need your help on how to patch this so the syntax error goes away and I can proceed with the migration and update the software to the current level.

    Thanks.

    =========================================================================================
    private function hooks() {

    // Plugin meta
    add_filter( ‘plugin_row_meta’, array( $this, ‘plugin_meta’ ), null, 2 );

    // Add sub affiliates tab
    add_action( ‘affwp_affiliate_dashboard_tabs’, array( $this, ‘add_sub_affiliates_tab’ ), 10, 2 );

    // Add template folder to hold the sub affiliates tab content
    add_filter( ‘affwp_template_paths’, array( $this, ‘get_theme_template_paths’ ) );

    // Add to the tabs list for 1.8.1 (fails silently if the hook doesn’t exist).
    (line 266) add_filter( ‘affwp_affiliate_area_tabs’, function( $tabs ) {
    return array_merge( $tabs, array( ‘sub-affiliates’ ) );
    } );

    }
    ========================================================================

  • larrydroz
    Participant
    @larrydroz
    #7701

    not sure why the text above is getting cut off.
    Is there something wrong with this site?

  • larrydroz
    Participant
    @larrydroz
    #7702

    Hold on this!
    Found a bunch of errors in the Duplicator log.
    Will fix and update this post.

  • larrydroz
    Participant
    @larrydroz
    #7703

    All errors corrected from Duplicator.
    Still getting Syntax error on line 266.

    Please help!

  • larrydroz
    Participant
    @larrydroz
    #7704

    Found the problem.
    Although cPanel says it is running PHP 5.6, the phpinfo() function returns 5.2 !!

    Will be having a chat with the hosting service

    BTW it is HostMonster.com for those who might want to avoid these problems.

  • Christian Freeman
    Participant
    @christianf
    #7712

    I’m glad you found a solution to this Larry, and thanks for sharing it.

    Yes, PHP 5.6 is a minimum requirement for the MLM plugin.

You must be logged in to reply to this topic.