Home Forums Plugin Support AffiliateWP MLM Error unexpected T_FUNCTION

5 replies, 2 voices Last updated by  Christian Freeman 11 months, 1 week ago
  • larrydroz

    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 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.


    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

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

  • larrydroz

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

  • larrydroz

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

    Please help!

  • larrydroz

    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

    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.