WordPress ThemePunch Revolution Slider PHP Line fix

and published
revolution slider php version fix

In this short tutorial, I will show you how you can fix the problem with upgrading the PHP error while using the WordPress plugin ThemePunch Revolution Slider. This fix covers PHP versions 5.6, 7.0, 7.1 and 7.2 upwards.

The reason that this problem occurs is that the PHP code within the Revolution Slider contains snippets of code that is now deprecated in later versions of PHP, particularly PHP5.5, often these errors are reported by WordPress in files db.class.php:29 and base_admin.class.php:70. Line 29 and 70 may vary depending on the version of the plugin installed on your website.

The easiest method to fix this problem is to purchase a newer version of this plugin, by doing so you will receive the newer code and more likely fewer security vulnerabilities. However, you may be on a tight budget and may just be looking for a quick band-aid fix! well, you came to the right place.

ThemePunch Revolution Slider PHP Fix

Enough of the introductions lets get on with fixing your website!

Step 1: edit file db.class.php

Using SFTP, WordPress Plugin Editor or a file manager (cPanel/Plesk) edit /wp-content/plugins/revslider/inc_php/framework/db.class.php

Find this code:

private function checkForErrors($prefix = ""){
  if(mysql_error()){
    $query = $this->wpdb->last_query;
    $message = $this->wpdb->last_error;

    if($prefix) $message = $prefix.' - '.$message.'';
    if($query) $message .=  '
---
Query: ' . $query; $this->throwError($message); } }

Replace it with this code:

private function checkForErrors($prefix = ""){
  if(function_exists('mysql_error')){
    if(mysql_error()){
      $query = $this->wpdb->last_query;
      $message = $this->wpdb->last_error;
      if($prefix) $message = $prefix.' - '.$message.'';
      if($query) $message .=  '
---
Query: ' . $query; $this->throwError($message); } } }
Step 2: edit file base_admin.class.php

Using your opted file editor, edit file /wp-content/plugins/revslider/inc_php/framework/base_admin.class.php

Find this code:

private static $arrMetaBoxes = "";		//option boxes that will be added to post

Replace it with this code:

private static $arrMetaBoxes = array();

Confused? watch WordPress ThemePunch Revolution Slider db.class.php Line Fix PHP 5.6 – 7.2+

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>