• Resolved LZL0

    (@lchief)


    Hello,

    As a PRO customer I did not really know where to post these warnings messages which were generated by HHVM (3.7.3 – latest). It is mainly connected to the base plugin and it affects the shortcode generation of the PRO version. I have just switched over to HHVM from PHP5.6 and I got these messages.
    On the shrotcode page I only see this:

    2012-01-08 - 2015-07-05
    Title	Total Pay	Due Pay
    Title	Total Pay	Due Pay
    [Sun Jul  5 07:50:25 2015] [hphp] [1438:7f262abff700:1005:000001] [] \nWarning: Invalid operand type was used: expecting an array in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_generate_stats_class.php on line 304
    [Sun Jul  5 07:50:25 2015] [hphp] [1438:7f262abff700:1005:000002] [] \nWarning: Invalid argument supplied for foreach() in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_generate_stats_class.php on line 327
    [Sun Jul  5 07:50:25 2015] [hphp] [1438:7f262abff700:1005:000003] [] \nWarning: Invalid argument supplied for foreach() in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_generate_stats_class.php on line 369
    [Sun Jul  5 07:50:25 2015] [hphp] [1438:7f262abff700:1005:000004] [] \nWarning: Invalid argument supplied for foreach() in /htdocs/wp-content/plugins/post-pay-counter-pro/classes/ppcp_shortcode_class.php on line 183

    I only displayed one author.

    HTML resonse:

    <h2>2012-01-08 - 2015-07-05</h2>
    <table id="ppc_stats_table">
    <thead>
    <tr>
    <th scope="col">Title</th>
    <th scope="col">Total Pay</th>
    <th scope="col">Due Pay</th>
    </tr>
    </thead>
    <tfoot>
    <tr>
    <th scope="col">Title</th>
    <th scope="col">Total Pay</th>
    <th scope="col">Due Pay</th>
    </tr>
    </tfoot>
    <tbody>
    </tbody>
    </table>
    <p>Total due payment: $131.90<br>Total visits count:	131901</p>

    As you can see the shortcode generator (more precisely the table which displays the stats and the posts) is totally rendered unusable.

    I use this shortcode:
    [ppc author='700' tstart=1325980800 tend='.$nowtime.' exclude="author_id, post_id, post_publication_date, post_type, post_status, post_words_count, post_images_count, post_comments_count"]

    p.s. the plugins are updated to the latest version

    https://www.ads-software.com/plugins/post-pay-counter/

    EDIT: The page under the dashboard, if you click on the author is also broken in the same way.

    The following warnings is being displayed on the dashboard page:

    [Sun Jul  5 08:24:40 2015] [hphp] [1438:7f2632fff700:1071:000001] [] \nWarning: Invalid operand type was used: expecting an array in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_generate_stats_class.php on line 304
    [Sun Jul  5 08:24:40 2015] [hphp] [1438:7f2632fff700:1071:000002] [] \nWarning: Invalid argument supplied for foreach() in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_generate_stats_class.php on line 327
    [Sun Jul  5 08:24:40 2015] [hphp] [1438:7f2632fff700:1071:000003] [] \nWarning: Invalid argument supplied for foreach() in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_generate_stats_class.php on line 369
    [Sun Jul  5 08:24:40 2015] [hphp] [1438:7f2632fff700:1071:000004] [] \nWarning: Invalid argument supplied for foreach() in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_html_functions_class.php on line 253

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter LZL0

    (@lchief)

    I believe the problem lies in somewhere in this: PPC_generate_stats::group_stats_by_author function

    Plugin Author Stefano

    (@ste_95)

    The problem is actually with HHVM, which doesn’t support some PHP functions.

    I’ve tried to circumvent the problem, try to do the following and see if the error is solved or at least changed:
    Go to post-pay-counter/classes/ppc_generate_stats_class.php, around line 305, which should be
    $post_stats = current( $author_stats );
    change it to
    $post_stats = $author_stats[key( $author_stats )];
    save and reload your stats page.

    Let me know!

    Thread Starter LZL0

    (@lchief)

    [Sun Jul  5 10:55:27 2015] [hphp] [1438:7f263ebff700:1256:000002] [] \nWarning: Invalid operand type was used: expecting an array in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_generate_stats_class.php on line 304
    [Sun Jul  5 10:55:27 2015] [hphp] [1438:7f263ebff700:1256:000003] [] \nWarning: Invalid argument supplied for foreach() in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_generate_stats_class.php on line 327
    [Sun Jul  5 10:55:27 2015] [hphp] [1438:7f263ebff700:1256:000004] [] \nWarning: Invalid argument supplied for foreach() in /htdocs/wp-content/plugins/post-pay-counter/classes/ppc_generate_stats_class.php on line 369
    [Sun Jul  5 10:55:27 2015] [hphp] [1438:7f263ebff700:1256:000005] [] \nWarning: Invalid argument supplied for foreach() in /htdocs/wp-content/plugins/post-pay-counter-pro/classes/ppcp_shortcode_class.php on line 183

    still the very same problem remains (not just the warnings, but the table which displays the titles, views, etc. is not showing)

    Plugin Author Stefano

    (@ste_95)

    Could you contact me by email at support [ at] thecrowned.org please?

    Thread Starter LZL0

    (@lchief)

    sure

    Plugin Author Stefano

    (@ste_95)

    We got this fixed through Skype, the fix will be in version 2.505 ??

    Thread Starter LZL0

    (@lchief)

    solved. The fix will come out with the next plugin update.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘HHVM breaks the shortcodes’ is closed to new replies.