Alex (SirShurf) Frenkel's Blog

A web log of a PHP professional

Posts Tagged ‘wordpress

WPML makes the user logged out on 3.1.8.1 upgrade

with one comment

WPML rolled out an update to their plugin version 3.1.8.1.

But since the update you cannot work in the admin panel any more, each url will have more then one slash in it.

Here is my fix for the problem (until thy will issue an update).

The problem is in the sitepress.class.php file on line 6464, and created by in the addition of line 6463.

In line 6463 they have added a selection of site_url paramtere from the global parameter set of wordpress:

$this->settings[ ‘language_domains’ ][ $default_language ] = $wpdb->get_var( “SELECT option_value FROM $wpdb->options WHERE option_name = ‘siteurl'”);

This selection have an url of the website WITH the trailing slash in it.

And this data is sent to the next line: 6464

$new_url = str_replace( $absolute_home_url, $this->settings[ ‘language_domains’ ][ $code ], $new_url );

What this creates is a URL with next features:http://localhost//wp-admin/?lang=frAnd the double slash created the logout problem.By addint my lines of code, the error can be managed, untill a more permanent fix will be applied by WPML team:Simple add next code between 6463 and 6464 (inclusive)

                        $this->settings[ ‘language_domains’ ][ $default_language ] = $wpdb->get_var( “SELECT option_value FROM $wpdb->options WHERE option_name = ‘siteurl'”);
$arrUrl = parse_url($absolute_home_url);
if(!isset($arrUrl[‘path’])) $arrUrl[‘path’] = ‘/’;
$absolute_home_url = $arrUrl[‘scheme’].”://”.$arrUrl[‘host’].$arrUrl[‘path’];
if(!isset($arrUrl[‘query’])) $absolute_home_url .= ‘?’.$arrUrl[‘query’];
if(!isset($arrUrl[‘fragment’])) $absolute_home_url .= ‘#’.$arrUrl[‘fragment’];

$arrUrl = parse_url($this->settings[ ‘language_domains’ ][ $code ]);
if(!isset($arrUrl[‘path’])) $arrUrl[‘path’] = ‘/’;
$this->settings[ ‘language_domains’ ][ $code ] = $arrUrl[‘scheme’].”://”.$arrUrl[‘host’].$arrUrl[‘path’];
if(!isset($arrUrl[‘query’])) $this->settings[ ‘language_domains’ ][ $code ] .= ‘?’.$arrUrl[‘query’];
if(!isset($arrUrl[‘fragment’])) $this->settings[ ‘language_domains’ ][ $code ] .= ‘#’.$arrUrl[‘fragment’];

$new_url = str_replace( $absolute_home_url, $this->settings[ ‘language_domains’ ][ $code ], $new_url );

Advertisements

Written by Alex (Shurf) Frenkel

October 26, 2014 at 11:03 am

Posted in Wordpress, wpml

Tagged with

WordPress gone Green – 3.4 is out!

leave a comment »

The latest point release of WordPress was just launched to the masses a few hours ago.

We’re most excited about all the nifty new theme customization tools.

Written by Alex (Shurf) Frenkel

June 14, 2012 at 7:51 am

Posted in Uncategorized

Tagged with

WPMU Infinite SEO plugin fix

with 7 comments

As you where able to see from my previous post’s I was quite made at some of the development decisions of WPMU stuff and I was stuck with a problem that was not possible (at least I did not know how) to fix.

Well I fixed it and here is the result.
My new plugin was approved by wordpress.org and can be downloaded here: http://wordpress.org/extend/plugins/wpmu-dev-seo-addon/

This plugin fix multibite problems with the description and fixes usage of caption.

Comments are welcomed.

Written by Alex (Shurf) Frenkel

February 22, 2012 at 10:41 pm

WPMU Ultimate Facebook plugin Fix

with one comment

In addition to this post:Problem with UTF, Excepts — AND GOOD CODING PRACTICES!

I have created a fix to Ultimate Facebook:
This fix address next things:
* Facebook OpenGraph fails if the text in description is incorrect – especially in Hebrew
* Current version of the plugin sends in wall post description blog tag line. In my fix I am sending Excerpts.

The plugin can be downloaded at wordpres.org.

http://wordpress.org/extend/plugins/wpmu-dev-facebook-addon/

Written by Alex (Shurf) Frenkel

February 20, 2012 at 9:42 pm

WPMU MarketPress and “Comments are closed” – or a new WordPress plugin

with 3 comments

Laitly I desided to try and to move form Magento to a something simplier.

Since I had an account on WPMU I desided on MarketPress, a plugin that adds eCommerce to WordPress, but came to a problem that I had a “Comments are closed” on the theme they provided (at first I desided no to make a custom theme)

Searching the forum gave me nothing usefull (except a notification that “it is planned”) so I desided to hack it a bit.

The conclution of this hack us a plugin that re enables a comment on a product listing: WPMU MarketPress Allow Comments

Well, have fun 🙂

Written by Alex (Shurf) Frenkel

February 6, 2012 at 10:36 pm

Zopim Live Chat Addon – WordPress Plugin – Updated

with 3 comments

One of the users of my Zopim Live Chat Addon, activated the addon before he activated the Zopim itself.

What it did was adding a submenu before the menu was created and as such it was not working.

I have added a code that is allways moving this plugin to be the last on the list.

Good luck.

Written by Alex (Shurf) Frenkel

January 12, 2012 at 1:36 am

Zopim Live Chat Addon – WordPress Plugin

with 4 comments

A few weeks ago I have found a nice chat that can be installed in a website.

I called a client that I think can be interested in and we tested the chat on the clients WordPress.

One of the thigs that was missing was an option to exclude special pages from the chat and from that a new plugin came up.

I give you the Zopim Live Chat Addon Plugin (Zopim Live Chat Addon – WordPress Plugin).

P.S. If you consider to get you a new Zopim Live Chat please use my reference for a referal: Zopim Free registration page

Written by Alex (Shurf) Frenkel

December 24, 2011 at 12:30 am