• Hi there,
    I’m new to WordPress and am just building my first WordPress site, I am working on localhost so I can’t include a link – sorry. I have some HTML & CSS knowledge but have not used PHP. Hopefully someone out there can help me with the problem below.

    I apologise in advance if this is a ‘bit messy’ as I said I’m new to WP ??

    I purchased and installed storeone-pro in wordpress, but it caused a critical error on my site. There are FOUR errors:

    FIRST TWO ERRORS
    Warning: Trying to access array offset on value of type null in /Applications/XAMPP/xamppfiles/htdocs/WebDevelopment/inspirationalArt/wp-content/themes/storeone-pro/admin/inc/class-themefarmer-about-page.php on line 42

    Warning: Trying to access array offset on value of type null in /Applications/XAMPP/xamppfiles/htdocs/WebDevelopment/inspirationalArt/wp-content/themes/storeone-pro/admin/inc/class-themefarmer-about-page.php on line 43

    THE CODE FROM LINES 42 and 43 IS:
    $this->action_count = $actions[‘count’];
    $this->recommended_actions = $actions[‘actions’];

    HERE IS THE WHOLE SECTION OF CODE FROM THE ABOVE PHP DOC (the first line is line 32 and the last line 49

    function __construct() {
    			$this->theme            = wp_get_theme();
    			
    			$this->demo_link  = 'https://demo.themefarmer.com/storeone-pro/?utm_source=storeone-dashboard&utm_medium=demo-scope&utm_campaign=welcome-page';
    			$this->docs_link  = 'https://docs.themefarmer.com/storeone-pro-documentation/?utm_source=storeone-dashboard&utm_medium=documentation-scope&utm_campaign=welcome-page';
    			$this->theme_page = 'https://www.themefarmer.com/product/storeone-pro/?utm_source=storeone-pro-dashboard&utm_medium=storeone-pro-link&utm_campaign=visie-theme-page';
    			$this->pro_link   = '';
    			$this->support_link = 'https://www.themefarmer.com/support/';
    
    			$actions                   = $this->get_recommended_actions();
    			$this->action_count        = $actions['count'];
    			$this->recommended_actions = $actions['actions'];
    
    			add_action('admin_menu', array($this, 'add_theme_info_menu'));
    			add_action('admin_enqueue_scripts', array($this, 'enqueue'));
    			add_action('wp_ajax_storeone_update_rec_acts', array($this, 'update_recommended_actions_watch'));
    			add_action('load-themes.php', array($this, 'activation_admin_notice'));
    		}

    ——————

    THIRD AND FOURTH ERRORS
    Deprecated: Required parameter $args follows optional parameter $depth in /Applications/XAMPP/xamppfiles/htdocs/WebDevelopment/inspirationalArt/wp-content/themes/storeone-pro/inc/menu-walker.php on line 43

    Deprecated: Required parameter $output follows optional parameter $depth in /Applications/XAMPP/xamppfiles/htdocs/WebDevelopment/inspirationalArt/wp-content/themes/storeone-pro/inc/menu-walker.php on line 43

    HERE IS THE SECTION OF CODE FROM THE ABOVE PHP DOC (the first line of this copied code is line 43)

    function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) {
    
    		if (!$element) {
    			return;
    		}
    
    		$id_field = $this->db_fields['id'];
    
    		//display this element
    		if (is_array($args[0])) {
    			$args[0]['has_children'] = !empty($children_elements[$element->$id_field]);
    		} else if (is_object($args[0])) {
    			$args[0]->has_children = !empty($children_elements[$element->$id_field]);
    		}
    
    		$cb_args = array_merge(array(&$output, $element, $depth), $args);
    		call_user_func_array(array($this, 'start_el'), $cb_args);
    
    		$id = $element->$id_field;
    
    		// descend only when the depth is right and there are childrens for this element
    		if (($max_depth == 0 || $max_depth > $depth + 1) && isset($children_elements[$id])) {
    
    			foreach ($children_elements[$id] as $child) {
    
    				if (!isset($newlevel)) {
    					$newlevel = true;
    					//start the child delimiter
    					$cb_args = array_merge(array(&$output, $depth), $args);
    					call_user_func_array(array($this, 'start_lvl'), $cb_args);
    				}
    				$this->display_element($child, $children_elements, $max_depth, $depth + 1, $args, $output);
    			}
    			unset($children_elements[$id]);
    		}
    
    		if (isset($newlevel) && $newlevel) {
    			//end the child delimiter
    			$cb_args = array_merge(array(&$output, $depth), $args);
    			call_user_func_array(array($this, 'end_lvl'), $cb_args);
    		}
    
    		//end this element
    		$cb_args = array_merge(array(&$output, $element, $depth), $args);
    		call_user_func_array(array($this, 'end_el'), $cb_args);
    	}

    I am using the ‘Open Store child theme’
    I am not familiar with php so I do not know how to fix this – please help.
    I contacted ThemeFarmer (who I purchased the theme from) a week ago and have not had any response.
    Thank you
    Jilly

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    First, I would guess that Store One Pro is a paid for theme, and these forums are not for commercial support.

    However, generally, some advice:

    Warnings and Notices are not Errors, and don’t necessarily need fixing as they have no functional impact.

    You should change your PHP settings so you don’t see them, just log them.

    I wrote a support article on that here

    https://fullworks.net/docs/plugins-general/troubleshooting-plugins-general/php-notices-and-warnings/

    Thread Starter jilly123

    (@jilly123)

    Hi Alan,

    Thank you for your ‘quick’ very helpful reply.

    I was concerned about spending lots of time setting up a news site only for it to crash or not work when I uploaded to hosting account. Your reply was reassuring.

    I have changed the PHP settings as the advice in your link.

    Thank you
    Jilly

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘StoreOne Pro PHP Warnings/Errors’ is closed to new replies.