Upgraded to wpfolio 1.7 and website gone
-
I was running wpfolio1.3. While updating from WP 3.1 to 3.1.1 I noticed am option to update my theme to 1.7.2. This was a new option as previously I had to FTP the theme. But after I did this – BOOM!- the site disappeared and gives me this error message:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ‘)’ in /home/content/k/u/n/kunstenaar/html/wordpress/wp-content/themes/wpfolio/functions.php on line 161
I get the error at my log-in and my homepage.
This site:
https://stephangiannini.com/
host is godaddySince I can’t get the login page up I don’t even know how to reverse it. I guess maybe I could go to the godaddy host and delete the 1.7.2 theme?
-
sounds like the theme didn’t fully update for some reason. I would log in via FTP and delete WPFolio. See if it works. Then reinstall it after.
I did delete the package from my host. And I was able to get the 1.3 reactivated.
I tried again with 1.7.2 through the WP interface. It installed, but the preview of it still showed nothing but the same error code. I did it a couple times just to make sure…
did you delete the folder with 1.72 in it and redownload it through the wordpress interface? If so, then I’m not sure what the error could be.
A friend of mine had the same problem getting WPFolio up and running on a GoDaddy site. I just looked at it this morning. The problem is in the code that registers the WPFolio WIKI dashboard widget. Commenting the dashboard widget code and registration (lines 151-188, or from “// Add WPFolio Wiki site as a Dashboard Feed” to right after “add_action(‘wp_dashboard_setup’, ‘add_custom_dashboard_widget’);” if you’re stuck using the horrid GoDaddy editor) will make the theme work with GoDaddy.
This is a lousy solution, but I think there’s something hinky in GoDaddy’s php setup. The exact same wpfolio/functions.php works perfectly on my test server (MAMP/ WP 3.1.1). The array code causing the error looks pretty kosher to me.
Some servers (GoDaddy) use an older version of PHP and the Wiki Feed function includes features from a newer version, causing the site crash. You can switch to PHP 5 via your account manager on GaDaddy: instructions here.
I’m working on a function to give a nicer error instead of crashing the site. I can’t replicate the error, so @kunstenaar – could you uncomment the function, delete the
add_custom_dashboard_widget()
andadd_action()
functions, then copy and paste this below the main function:if (version_compare(PHP_VERSION, '5.3.0', '>=')) { function add_custom_dashboard_widget() { wp_add_dashboard_widget('custom_dashboard_widget', 'WPFolio News', 'custom_dashboard_widget'); } add_action('wp_dashboard_setup', 'add_custom_dashboard_widget'); } else { $error = "<strong>Invalid PHP version, unable to load WPFolio RSS feed. Check your server's PHP preferences and update to the latest PHP version.</strong>"; echo $error; }
If it works, your site shouldn’t crash and instead of the Dashboard Feed you will the error message. Let me know if it works! Thanks a lot.
Update to the above function (which should work also) – replace the entire function (lines 151-187) with this:
// Testing to see if the PHP version is up to date. If it is, add a WPFolio RSS feed widget, and if it's not, add a widget prompting an upgrade. if (version_compare(PHP_VERSION, '5.3.0', '>=')) { // Add WPFolio Wiki site as a Dashboard Feed // Thanks to bavotasan.com: https://bavotasan.com/tutorials/display-rss-feed-with-php/ function custom_dashboard_widget() { $rss = new DOMDocument(); $rss->load('https://wpfolio.visitsteve.com/wiki/feed'); $feed = array(); foreach ($rss->getElementsByTagName('item') as $node) { $item = array ( 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, // 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, 'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue, ); array_push($feed, $item); } $limit = 5; // change how many posts to display here echo '<ul>'; // wrap in a ul for($x=0;$x<$limit;$x++) { $title = str_replace(' & ', ' & ', $feed[$x]['title']); $link = $feed[$x]['link']; // $description = $feed[$x]['desc']; $date = date('l F d, Y', strtotime($feed[$x]['date'])); echo '<li><p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong>'; echo ' - '.$date.'</p></li>'; // echo '<p>'.$description.'</p>'; } echo '</ul>'; echo '<p class="textright"><a href="https://wpfolio.visitsteve.com/wiki/category/news" class="button">View all</a></p>'; // link to site } function add_custom_dashboard_widget() { wp_add_dashboard_widget('custom_dashboard_widget', 'WPFolio News', 'custom_dashboard_widget'); } add_action('wp_dashboard_setup', 'add_custom_dashboard_widget'); } else { function print_php_error() { $error = "<p style='color:red; font-size: 1.5em;'>You are using an outdated version of PHP. WordPress doesn't support it and neither does WPFolio! Upgrade to the latest version of PHP.</p>"; echo $error; } function add_error_widget() { wp_add_dashboard_widget('error_widget', 'IMPORTANT!', 'print_php_error'); } add_action('wp_dashboard_setup', 'add_error_widget' ); }
This should keep your site from crashing and will instead give you a text widget in the Dashboard prompting you to update to the latest version of PHP.
I’ve done some testing and it works fine, but it would be very helpful for someone with the actual issue to test it out. Good karma for doing so. Thanks!
Hello! I’ve also just updated to WpFolio’s newest version and I?m getting this error:
Warning: require_once(/home/artisan/public_html/wp-content/themes/wpfolio/library/widgets.php) [function.require-once]: failed to open stream: No such file or directory in /home/artisan/public_html/wp-content/themes/wpfolio/functions.php on line 16Fatal error: require_once() [function.require]: Failed opening required ‘/home/artisan/public_html/wp-content/themes/wpfolio/library/widgets.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/artisan/public_html/wp-content/themes/wpfolio/functions.php on line 16
I’m not that techy and hardly have uploaded anything directly to the server, I’ve done everything on wordpress, a friend is hosting my site on his server through Site5.
If you could please help me get my site back up again I would really appreciate it!This is formerly kunsteaar, who started this post. WP forced me to change my password…..
I haven’t had a chance to deal with this in a while. Today, I did change my Godaddy php to 5.2. I’m running WP 3.1.3. I tried and installed WPFolio 1.7.5 both through an FTP client and the WP interface. In both cases I received this error code in the preview and it crashed my site when I activated it:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ‘)’ in /home/content/k/u/n/kunstenaar/html/wordpress/wp-content/themes/wpfolio/functions.php on line 202
As a final try I deleted the Wpfolio 1.3 theme and activated the 1.7.5 with the same result. Maybe there is something wrong with my WP software?
Notlaura: I’d love to try your fix, although maybe it’s outdated now. But I have a limited understanding of code and your instructions were gibberish to me. I wasn’t even sure if you wanted me to change the Wpfolio code or the WP code itself. I don’t know how to access the WP.org code.
I understood that you wanted me to delete and add code but “comment or “function ” mean nothing to me even after I read the Wikipedia pages on them. I’d need instructions for a total layman and non-geek. Sorry, and thanks for your help.
Thanks, All.
https://stephangiannini.com/
host is godaddy.I did successfully update to WPFolio 1.5.2. Still looks good, but it is a shame not to be able to have more control over the Navibar and the drop down menus that later versions have.
I had a friend who installed WPfolio1.7 on Godaddy just yesterday, so Godaddy does seem to support it. I guess I could try de-installing and reinstalling the WP application?
Sorry for the jargon stovetopstephen. WordPress requires 5.2.4, but with the new theme update you should see an error widget in the Dashboard instead of a site crash. I can’t be sure what went wrong without looking into it closer, but you can hire me to do that if you want: [email protected].
- The topic ‘Upgraded to wpfolio 1.7 and website gone’ is closed to new replies.