• Resolved tianpp

    (@tianpp)


    Hello,

    I’m getting php error messages when installing WPeMatico in WP 5.3.2. I’ve tried with the last version of the plugin and with older ones with the same results. Maybe is about php version?

    Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /opt/lampp/apps/wordpress/htdocs/wp-content/plugins/wpematico/app/plugin_functions.php on line 209

    Warning: Cannot modify header information – headers already sent by (output started at /opt/lampp/apps/wordpress/htdocs/wp-content/plugins/wpematico/app/wpematico_functions.php:755) in /opt/lampp/apps/wordpress/htdocs/wp-includes/functions.php on line 6029

    Warning: Cannot modify header information – headers already sent by (output started at /opt/lampp/apps/wordpress/htdocs/wp-content/plugins/wpematico/app/wpematico_functions.php:755) in /opt/lampp/apps/wordpress/htdocs/wp-admin/includes/misc.php on line 1252

    Warning: Cannot modify header information – headers already sent by (output started at /opt/lampp/apps/wordpress/htdocs/wp-content/plugins/wpematico/app/wpematico_functions.php:755) in /opt/lampp/apps/wordpress/htdocs/wp-admin/admin-header.php on line 9

    Warning: Cannot modify header information – headers already sent by (output started at /opt/lampp/apps/wordpress/htdocs/wp-content/plugins/wpematico/app/wpematico_functions.php:755) in /opt/lampp/apps/wordpress/htdocs/wp-includes/option.php on line 961

    Warning: Cannot modify header information – headers already sent by (output started at /opt/lampp/apps/wordpress/htdocs/wp-content/plugins/wpematico/app/wpematico_functions.php:755) in /opt/lampp/apps/wordpress/htdocs/wp-includes/option.php on line 962

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author etruel

    (@etruel)

    Hi @tianpp,
    These are warnings, could be php version but anyway should work well.
    Could you send the system status to see the versions of the php and its installed extensions, apache, DB etc? You can find it in WPeMatico Settings, System Status tab.

    regards

    Hi @etruel ,

    This warning are connected with PHP 7.4 depreciated things. So if one have php 7.4 with enabled debug this will happen always. It would be great that you update the plugin.

    Thread Starter tianpp

    (@tianpp)

    Hi @etruel,

    here is the system status log:

    Warning: count(): Parameter must be an array or an object that implements Countable in /opt/lampp/apps/wordpress/htdocs/wp-content/plugins/wpematico/app/debug_page.php on line 1501
    ### Begin Debug Info ###

    — Server Environment

    Hosting Provider: DBH: localhost:3306, SRV: localhost
    WebServer Info: Apache/2.4.41 (Unix) OpenSSL/1.1.1d PHP/7.4.2 mod_perl/2.0.8-dev Perl/v5.16.3
    MySQL Version: 5.5.5
    PHP Version: 7.4.2

    — Required Apache Mods
    Mod Rewrite: Enabled
    Mod Mime: Enabled
    Mod Deflate: Enabled

    — PHP Extensions

    cURL (php.net/curl): 7.53.1
    ZipArchive: Enabled
    DOMDocument: Enabled
    GD Library: Enabled
    XML (php.net/xml): Enabled, and sane
    PCRE (php.net/pcre): Enabled
    Zlib (php.net/zlib): Enabled
    php.net/mbstring: Enabled
    iconv (php.net/iconv): Enabled
    OpenSSL(php.net/openssl):Enabled
    MCrypt (php.net/mcrypt): Disabled

    It’s a local new install, without any other extensions in WP when I’ve received this errors and warnings for the first time… In fact, it’s a php 7.4 system with debug enabled.

    I’ll try to run a campaign,

    thank you.

    @etruel can you please fix deprecated functions for php 7.4? I did some of the work for you. The main warnings I get are:
    Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in
    followed by many line numbers and gave you examples of how to fix them. I traced it to these lines but there may be more:

    **** campaigns_list.php ****
    lines 2125-2133:

    $campaign[‘campaign_feed_order_date’] = (!isset($posdata[‘campaign_feed_order_date’]) || empty($posdata[‘campaign_feed_order_date’])) ? false : ($posdata[‘campaign_feed_order_date’] == 1) ? true : false;

    $campaign[‘campaign_feeddate’] = (!isset($posdata[‘campaign_feeddate’]) || empty($posdata[‘campaign_feeddate’])) ? false : ($posdata[‘campaign_feeddate’] == 1) ? true : false;

    $campaign[‘campaign_allowpings’] = (!isset($posdata[‘campaign_allowpings’]) || empty($posdata[‘campaign_allowpings’])) ? false : ($posdata[‘campaign_allowpings’] == 1) ? true : false;

    $campaign[‘campaign_linktosource’] = (!isset($posdata[‘campaign_linktosource’]) || empty($posdata[‘campaign_linktosource’])) ? false : ($posdata[‘campaign_linktosource’] == 1) ? true : false;

    $campaign[‘campaign_strip_links’] = (!isset($posdata[‘campaign_strip_links’]) || empty($posdata[‘campaign_strip_links’])) ? false : ($posdata[‘campaign_strip_links’] == 1) ? true : false;

    ** change to: **

    $campaign[‘campaign_feed_order_date’] = (!isset($posdata[‘campaign_feed_order_date’]) || empty($posdata[‘campaign_feed_order_date’])) ? false : (($posdata[‘campaign_feed_order_date’] == 1) ? true : false);

    $campaign[‘campaign_feeddate’] = (!isset($posdata[‘campaign_feeddate’]) || empty($posdata[‘campaign_feeddate’])) ? false : (($posdata[‘campaign_feeddate’] == 1) ? true : false);

    $campaign[‘campaign_allowpings’] = (!isset($posdata[‘campaign_allowpings’]) || empty($posdata[‘campaign_allowpings’])) ? false : (($posdata[‘campaign_allowpings’] == 1) ? true : false);

    $campaign[‘campaign_linktosource’] = (!isset($posdata[‘campaign_linktosource’]) || empty($posdata[‘campaign_linktosource’])) ? false : (($posdata[‘campaign_linktosource’] == 1) ? true : false);

    $campaign[‘campaign_strip_links’] = (!isset($posdata[‘campaign_strip_links’]) || empty($posdata[‘campaign_strip_links’])) ? false : (($posdata[‘campaign_strip_links’] == 1) ? true : false);

    ** lines 2217-2225 **

    $arrayData[‘campaign_feeddate’] = (!isset($_POST[‘campaign_feeddate’]) || empty($_POST[‘campaign_feeddate’])) ? false : ($_POST[‘campaign_feeddate’] == 1) ? true : false;

    $arrayData[‘campaign_commentstatus’] = (!isset($_POST[‘campaign_commentstatus’]) ) ? ‘closed’ : sanitize_text_field($_POST[‘campaign_commentstatus’]);

    $arrayData[‘campaign_allowpings’] = (!isset($_POST[‘campaign_allowpings’]) || empty($_POST[‘campaign_allowpings’])) ? false : ($_POST[‘campaign_allowpings’] == 1) ? true : false;

    $arrayData[‘campaign_linktosource’] = (!isset($_POST[‘campaign_linktosource’]) || empty($_POST[‘campaign_linktosource’])) ? false : ($_POST[‘campaign_linktosource’] == 1) ? true : false;

    $arrayData[‘campaign_strip_links’] = (!isset($_POST[‘campaign_strip_links’]) || empty($_POST[‘campaign_strip_links’])) ? false : ($_POST[‘campaign_strip_links’] == 1) ? true : false;

    ** change to: **

    $arrayData[‘campaign_feeddate’] = (!isset($_POST[‘campaign_feeddate’]) || empty($_POST[‘campaign_feeddate’])) ? false : (($_POST[‘campaign_feeddate’] == 1) ? true : false);

    $arrayData[‘campaign_commentstatus’] = (!isset($_POST[‘campaign_commentstatus’]) ) ? ‘closed’ : sanitize_text_field($_POST[‘campaign_commentstatus’]);

    $arrayData[‘campaign_allowpings’] = (!isset($_POST[‘campaign_allowpings’]) || empty($_POST[‘campaign_allowpings’])) ? false : (($_POST[‘campaign_allowpings’] == 1) ? true : false);

    $arrayData[‘campaign_linktosource’] = (!isset($_POST[‘campaign_linktosource’]) || empty($_POST[‘campaign_linktosource’])) ? false : (($_POST[‘campaign_linktosource’] == 1) ? true : false);

    $arrayData[‘campaign_strip_links’] = (!isset($_POST[‘campaign_strip_links’]) || empty($_POST[‘campaign_strip_links’])) ? false : (($_POST[‘campaign_strip_links’] == 1) ? true : false);

    **** debug_page.php ****

    ** line 1519 **
    <td><?php echo ($m_rewrite_ok) ? ‘<mark class=”yes”>✔</mark>’ : ‘<mark class=”‘ . (defined(‘WPEMATICO_CACHE_VERSION’) ? ‘error’ : ‘error-no-install’ ) . ‘”>’ . sprintf(__(‘%s is not installed on your server, but is recommended by %s.’, ‘wpematico’), ‘Mod Rewrite’, ‘some addons’) . ‘</mark>’; ?></td>

    ** change to: **

    <td><?php echo ($m_rewrite_ok) ? ‘<mark class=”yes”>✔</mark>’ : (‘<mark class=”‘ . (defined(‘WPEMATICO_CACHE_VERSION’) ? ‘error’ : ‘error-no-install’ ) . ‘”>’ . sprintf(__(‘%s is not installed on your server, but is recommended by %s.’, ‘wpematico’), ‘Mod Rewrite’, ‘some addons’) . ‘</mark>’); ?></td>

    ** line 1539 change: **

    <td><?php echo ($m_deflate_ok) ? ‘<mark class=”yes”>✔</mark>’ : ‘<mark class=”‘ . (defined(‘WPEMATICO_CACHE_VERSION’) ? ‘error’ : ‘error-no-install’ ) . ‘”>’ . sprintf(__(‘%s is not installed on your server, but is recommended by %s.’, ‘wpematico’), ‘Mod Deflate’, ‘some addons’) . ‘</mark>’; ?></td>

    ** change to: **

    <td><?php echo ($m_deflate_ok) ? ‘<mark class=”yes”>✔</mark>’ : (‘<mark class=”‘ . (defined(‘WPEMATICO_CACHE_VERSION’) ? ‘error’ : ‘error-no-install’ ) . ‘”>’ . sprintf(__(‘%s is not installed on your server, but is recommended by %s.’, ‘wpematico’), ‘Mod Deflate’, ‘some addons’) . ‘</mark>’); ?></td>

    wpematico_functions.php

    line 1505 – 1649, 1743, 1801-1803, 1849-1877, 2183 same ? ? issue with missing parentheses

    xml-importer.php

    line 187-193

    \lang\wpematico-sk_SK.mo
    line 43

    \lang\wpematico-sk_SK.po
    line 13

    wpematico_class.php
    line 416-480

    Plugin Author etruel

    (@etruel)

    Hi @dconsorte,
    Thankyou for your work.
    This was already fixed in our development version. It isn’t ready to publish it here yet, but you can take a look and test it in the development repo at github.

    cheers
    etruel

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP errors when installing plugin’ is closed to new replies.