Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1040896
    suseque
    Participant

    Hi there-
    I have spent a full day plus trying to figure out an issue with spam site loading on mobile devices. And I believe that some “support” guy at bluehost deleted my plugin “the Grid”

    Now I can not load it AND I lost what I had built.
    This is the error I get when I try to activate:
    “Parse error: syntax error, unexpected T_FUNCTION in….( I will send up rest in a private message)

    Thank you for your help

    Susan

    #1040897
    suseque
    Participant
    This reply has been marked as private.
    #1041279
    Lely
    Moderator

    Hi Susan,

    This is the default content of item-skin.class.php file. You may compare this to what you have so you can see what’s missing:

    <?php
    /**
     * @package   The_Grid
     * @author    Themeone <[email protected]>
     * @copyright 2015 Themeone
     */
    
    // Exit if accessed directly
    if (!defined('ABSPATH')) { 
    	exit;
    }
    
    class The_Grid_Register_Item_Skin {
    
        private $skins = array();
    
        function __construct() {
            $this->skins = apply_filters( 'tg_register_item_skin', $this->skins );
    		$register = array();
    		if (is_array($this->skins)) {
    			foreach($this->skins as $skin => $data) {
    				$name = (is_array($data) && !empty($data)) ? $skin : $data;
    				$data = (is_array($data) && !empty($data)) ? $data : '';		
    				$register[$name] = array(
    					'name'   => $name,
    					'filter' => (isset($data['filter']) && !empty($data['filter'])) ? $data['filter'] : 'Standard',
    					'col'    => (isset($data['col']) && !empty($data['col'])) ? $data['col'] : 1,
    					'row'    => (isset($data['row']) && !empty($data['row'])) ? $data['row'] : 1,
    				);
    			}
    			$this->skins = $register;
    		} else {
    			$this->skins = array();
    		}
    
        }
    
    	// get skin array
    	function get_registered_skins() {
    		return $this->skins;
        }
    
    }
    
    add_filter('tg_register_item_skin', function($skins){
    	
    	$skins = array(
    		// grid skins
    		'alofi',
    		'apia',
    		'bogota' => array(
    			'filter' => 'Instagram'
    		),
    		'brasilia',
    		'camberra',
    		'caracas',
    		'dacca',
    		'honiara',
    		'lisboa',
    		'lome',
    		'malabo',
    		'male',
    		'maputo' => array(
    			'filter' => 'Instagram'
    		),
    		'oslo',
    		'podgorica' => array(
    			'filter' => 'Youtube/Vimeo'
    		),
    		'pracia',
    		'roma',
    		'sofia',
    		'suva' => array(
    			'filter' => 'Woocommerce'
    		),
    		// masonry skins
    		'doha',
    		'kampala',
    		'lima',
    		'lusaka',
    		'maren',
    		'panama',
    		'praia',
    		'quito',
    		'riga',
    		'sanaa' => array(
    			'filter' => 'Woocommerce'
    		),
    		'victoria' => array(
    			'filter' => 'Youtube/Vimeo'
    		),
    		'vaduz' => array(
    			'filter' => 'Youtube/Vimeo'
    		),
    	);
    	
    	return $skins;
    	
    });
     
    class The_Grid_Item_Skin {
    
        private $skins = array();
    
        function __construct() {
            $this->skins = apply_filters( 'tg_add_item_skin', $this->skins );
        }
    
    	// get skin array
    	function get_skin_names() {
    		return $this->skins;
        }
    
    }
    
    add_filter('tg_add_item_skin', function($skins){
    	
    	$plugin_uri    = TG_PLUGIN_URL;
    	$plugin_path   = TG_PLUGIN_PATH;
    	$theme_uri     = get_stylesheet_directory_uri();
    	$theme_path    = get_stylesheet_directory();
    	$wp_upload_dir = wp_upload_dir();
    	
    	// dir path for native skins
    	$dirname1 = TG_PLUGIN_PATH.'includes/item-skins';
    	// dir path for theme skins
    	$dirname2 = get_stylesheet_directory().'/the-grid';
    	// dir path for custom skins
    	$dirname3 = $wp_upload_dir['basedir'] .'/the-grid';
    	
    	$findphp = '*.php';
    	$findcss = '*.css';
    	$types   = array('grid','masonry');
    	
    	$register_skins_base = new The_Grid_Register_Item_Skin();
    	$register_skins = $register_skins_base->get_registered_skins();
    		
    	// get subfolder for native skins	
    	$sub_dirs1 = glob($dirname1.'/*', GLOB_ONLYDIR|GLOB_NOSORT);
    	$sub_dirs1 = ($sub_dirs1) ? $sub_dirs1 : array();
    	// get subfolder for theme skins
    	$sub_dirs2 = glob($dirname2.'/*', GLOB_ONLYDIR|GLOB_NOSORT);
    	$sub_dirs2 = ($sub_dirs2) ? $sub_dirs2 : array();
    	// get subfolder for custom skins
    	$sub_dirs3 = glob($dirname3.'/*', GLOB_ONLYDIR|GLOB_NOSORT);
    	$sub_dirs3 = ($sub_dirs3) ? $sub_dirs3 : array();
    	
    	// merge all kind of source
    	$sub_dirs  = array_merge($sub_dirs1,$sub_dirs2,$sub_dirs3);
    	
    
    	if(count($sub_dirs)) {
    		foreach($sub_dirs as $sub_dir) {
    			$sub_dir_name = basename($sub_dir);	
    			$path = (str_replace('/the-grid/grid','',$sub_dir));
    			$path = (str_replace('/the-grid/masonry','',$path));
    			$filter = ($path == get_stylesheet_directory()) ? wp_get_theme() : 'standard';
    			if (in_array($sub_dir_name,$types)) {
    				$sub_sub_dirs = glob($sub_dir.'/*', GLOB_ONLYDIR|GLOB_NOSORT);
    				if(count($sub_sub_dirs)) {
    					foreach($sub_sub_dirs as $sub_sub_dir) {
    						$php  = glob($sub_sub_dir.'/'.$findphp);
    						$css  = glob($sub_sub_dir.'/'.$findcss);
    						$name = basename($php[0], '.php');
    						$filter = (isset($register_skins[$name]['filter']) && !empty($register_skins[$name]['filter'])) ?  $register_skins[$name]['filter'] : $filter;
    						$sub_sub_dir_name =  basename($sub_sub_dir);
    						if (array_key_exists($name, $register_skins) || strpos($php[0], $dirname3) !== false) {
    							$skins[$sub_sub_dir_name] = array(
    								'type'   => $sub_dir_name,
    								'filter' => $filter,
    								'slug'   => $sub_sub_dir_name,
    								'name'   => $name,
    								'php'    => $php[0],
    								'css'    => $css[0],
    								'col'    => (isset($register_skins[$name]['col'])) ? $register_skins[$name]['col'] : 1,
    								'row'    => (isset($register_skins[$name]['row'])) ? $register_skins[$name]['row'] : 1
    							);
    						}
    					}
    				}
    			}
    		}
    	}
    
        return $skins;
    	
    });
    
    // add a skin in a plugin/theme
    /*add_filter('tg_add_item_skin', function($skins){
    	
    	$URI = get_template_directory();
    	
    	// register a skin and add it to the main skins array
    	$skins['new_skin1'] = array(
    		'type'   => 'masonry',
    		'filter' => 'your-filter',
    		'slug'   => 'your-slug',
    		'name'   => 'new skin 1',
    		'php'    => $URI . '/your_path/new_skin1.php',
    		'css'    => $URI . '/your_path/new_skin1.css'
    	);
    	
    	$skins['new_skin2'] = array(
    		'type'   => 'grid',
    		'filter' => 'your-filter',
    		'slug'   => 'your-slug',
    		'name'   => 'new skin 2',
    		'php'    => $URI . '/your_path/new_skin2.php',
    		'css'    => $URI . '/your_path/new_skin2.css'
    	);	
    	
    	// return the skins array + the new one you added (in this example 2 new skins was added)
    	return $skins;
    	
    });*/

    If that would be difficult, you might want to try to reinstall the GRID instead. Remove it via FTP on this folder: wp-content/plugins then install it again from Addons. Although this is not advisable because you might lost your existing grid.

    Hope this helps.

    #1042714
    suseque
    Participant
    This reply has been marked as private.
    #1042716
    suseque
    Participant

    I removed and deleted- and it still will not install!

    #1042756
    suseque
    Participant

    I replaced the code with the default you gave me in the via edit plug in. Still didn’t work.
    Went to file in plugin – and placed in the code you gave me- and they said no change.
    Perhaps the upgrade to my themeX template may have caused this?

    #1043101
    Paul R
    Moderator

    Hi Susan,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1044028
    suseque
    Participant
    This reply has been marked as private.
    #1044489
    Lely
    Moderator

    Hi There,

    Thank you for the credentials. I tried to login via FTP to check THE GRID code. Unfortunately, I am seeing a limited file only. See attached screenshot. If you tried to reinstall and update the file already and the issue still exists, we might be seeing a cache content. On your plugins page, I can see that you have Wordfence Security. Please try to delete/purge cachec and then activate the GRID plugin again.

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1040896 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>