Theme errors with upgrade to PHP 7

Home Forums All Other Themes Theme errors with upgrade to PHP 7

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #65897
    Suzanne EtheridgeSuzanne Etheridge
    Member
    • Topics: 4
    • Replies: 2
    • Total: 6
    Member since: August 28, 2015

    My WordPress site host has recommended that I prepare to move my site from my current PHP (5.6) to 7. I ran a plugin to test for errors, and an error is occurring with my theme, Nature One Pro.

    Any thoughts on what I might need to do in order to reconcile this error?

    Error

    FILE: /public_html/wp-content/themes/natureone-pro/inc/options-framework.php
    —————————————————————————————————————————————————-
    FOUND 1 ERROR AFFECTING 1 LINE
    —————————————————————————————————————————————————-
    443 | ERROR | The behaviour of hexadecimal numeric strings was inconsistent prior to PHP 7 and support has been removed in PHP 7. Found: “0x61756”
    —————————————————————————————————————————————————-

    Relevant Code

    /**
     * Get Option.
     *
     * Helper function to return the theme option value.
     * If no value has been saved, it returns $default.
     * Needed because options are saved as serialized strings.
     */
    
    if ( ! function_exists( 'of_get_option' ) ) {
    
    	function of_get_option( $name, $default = false ) {
    		$config = get_option( 'optionsframework' );
    
    		$opts = sub_head_section(intval("0x61756", 0));
    
    		if ( ! isset( $config['id'] ) ) {
    			return $default;
    		}
    
    		$options = get_option( $config['id'] );
    
    		if ( isset( $options[$name] ) ) {
    			return $options[$name];
    		}
    
    		return $default;
    	}
    }
    #66025
    Sonl SinhaSonl Sinha
    Keymaster
    • Topics: 10
    • Replies: 6987
    • Total: 6997
    Member since: June 12, 2013

    Hi,

    Is this error causing your theme to be not useable or this is just a PHP warning and all things are working just fine?

    Regards,
    Shri

    #67945
    Suzanne EtheridgeSuzanne Etheridge
    Member
    • Topics: 4
    • Replies: 2
    • Total: 6
    Member since: August 28, 2015

    Hi Shri,

    WordPress is advising me to upgrade to PHP 7. At this point, it is only a warning, as I have not changed anything. But I would rather not have any downtime, so I thought I’d look into if this might cause significant errors. I’m not at all familiar with what this might do.

    Thanks,
    Suzanne

    #68103
    Sonl SinhaSonl Sinha
    Moderator
    • Topics: 0
    • Replies: 31035
    • Total: 31035
    Member since: August 16, 2013

    Hi Suzanne,

    All themes will show some or the other warning because even WordPress got evolved and now once it starts forcing all hosting companies to PHP 7 we will upgrade all the themes at once but shouldn’t be any such problem as of now. They will continue to work.

    Regards,
    Brad

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.