PHP 7.0 compatibility error Siteground

Hi,
When running the PHP 7.0 compatibility tool on a site hosted at Siteground, it is returning some errors. It all relates to woocommerce and the X theme (I am not running woocommerce on that site) So I guess I am ok to upgrade to PHP 7.0 but thought
a) you’d like to know and
b) wanted to check X theme is definitely compatible with PHP 7.0 ?

I use a bunch of other themes such Enfold, Beaver Builder, Genesis and GeneratePress none of which return any error messages for PHP 7.0 compatibility at Siteground.

Thanks in advance, here are the error messages:


FILE: /home/oldbankh/public_html/wp-content/themes/x/woocommerce/cart/cross-sells.php

FOUND 1 ERROR AFFECTING 1 LINE

26 | ERROR | Using a call-time pass-by-reference is deprecated since PHP 5.3 and prohibited since PHP 5.4

FILE: /home/oldbankh/public_html/wp-content/themes/x/woocommerce/single-product/related.php

FOUND 1 ERROR AFFECTING 1 LINE

26 | ERROR | Using a call-time pass-by-reference is deprecated since PHP 5.3 and prohibited since PHP 5.4

FILE: /home/oldbankh/public_html/wp-content/themes/x/woocommerce/single-product/up-sells.php

FOUND 1 ERROR AFFECTING 1 LINE

26 | ERROR | Using a call-time pass-by-reference is deprecated since PHP 5.3 and prohibited since PHP 5.4

Hello @hugaud,

Thanks for asking. :slight_smile:

X and Cornerstone are compatible with PHP 7. The issue you’re facing looks like it’s because of caching or other factors other than PHP 7. Please check for the following first:

  1. Ensure everything is up to date according to our version compatibility list at https://theme.co/apex/forum/t/troubleshooting-version-compatibility/1951. Please follow the best practices when updating your theme and plugins. See https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/621 for more details.
  2. Clear all caches including browser cache then deactivate your caching plugins and other optimization plugins.
  3. If you’re using a CDN, please clear the CDN’s cache and disable optimization services.
  4. Test for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
  5. Remove custom CSS, Javascript and templates.

Thanks.

Thank you Prasant,

Im have tried the standard approach you describe, cleared all caches etc…

The error appears to be related to a single line of code common to all affected files on line 26 of each of the files highlighted in my earlier message.
This is the line of code in question, could you kindly check with the developers and advise:

setup_postdata( $GLOBALS[‘post’] =& $post_object );

Also, since clearing all caches I now see additional PHP 7.0 compatibility warnings for the bundled version of Visual Composer:

FILE: /home/oldbankh/public_html/wp-content/plugins/js_composer/include/templates/editors/popups/shared-templates/category.tpl.php

FOUND 0 ERRORS AND 12 WARNINGS AFFECTING 12 LINES

134 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%- post_id %>"
135 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%- title %>"
141 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%- title %>
155 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%- post_id %>"]" titl…
166 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%- id %>">
168 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%- thumbnailUrl %>" alt=""…
171 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%- previewUrl %>" data-tit…
173 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <% if (!downloaded) { %>
177 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <% } else if (downloaded &&…
181 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <% } %>
186 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%- title %>
188 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%= status %>

FILE: /home/oldbankh/public_html/wp-content/plugins/js_composer/include/templates/editors/partials/backend-shortcodes-templates.tpl.php

FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES

44 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%= type %>">
45 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%= heading %>
47 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%= form_element %>

FILE: /home/oldbankh/public_html/wp-content/plugins/js_composer/include/templates/teaser.html.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

84 | WARNING | Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: <%= id %>" src="<%= url %>"…

Update Available: 5.4.4; Current Version: 5.4.3;

Hello There,

Thanks for updating in!

setup_postdata( $GLOBALS[‘post’] =& $post_object );
This is being used by WooCommerce template files. We just have copied it over in theme for WooCommerce template override. This should not be a problem as WooCommerce is using it.

The file: FILE: /home/oldbankh/public_html/wp-content/plugins/js_composer/include/templates/teaser.html.php is coming from WPBakery Visual Composer. This is the way how they load templates which also should not be a problem.

Hope this helps.

Great, thanks for letting me know.

I’ll bypass the PHP checker tool on SG and set PHP to 7.0 directly in Cpanel.

Cheers
Hugues

You’re welcome! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.