Yii2 for WordPress extension

When I first launched my startup Monitor Backlinks, I’ve built it without any PHP framework because I didn’t have a good experience with any that I’ve tried. That was my fault because I didn’t work on very big projects where we could work as a team.

After migrating to Yii2 last year, my development team released today Yii2 for WordPress extension.

Yii2 WordPress is a component for Yii2 framework designed for integration with WordPress CMS via XML-RPC API.

With it, you can easily get new posts from your WordPress blog into your Yii2 application.

You can read more or download the extension on yiiframework.com and packagist.org.

[WordPress SEO] Headspace2 nofollow bug fix

This post will be better understood by PHP developers, but helpful for bloggers and SEO developers.

On wordpress websites that I am building, I am using Headspace2 Plugin for SEO. Some of you prefer Allinone SEO Pack, but it lacks some features that I really need.

Adding nofollow on pages/posts.

Adding nofollow on some links that are not important to Google (like About us, Contact, Privacy …)  can transfer more link juice to the other important pages from your website.

You can add nofollow to pages/posts by enabling the Headspace->Page Modules->Page Links module.

When you add new/edit a page, you will see three new fields:

  1. Page Link Text
  2. Page Link Title
  3. Page Link Options

From Page Link Options you can check the nofollow box to add rel=”nofollow” when generating the page list with wp_list_pages() function.

There is one flaw here. You are required to fill in the Page Link Text field, else it won’t show up any text in the link ( <a href=”” rel=”nofollow”>[TEXT MISSING]</a>).

To fix this and let wordpress show the default page title text if no text is detected there, you have to:

  1. edit /wp-content/plugins/headspace2/modules/page/page-links.php file on your server
  2. go to line 113 and replace
    $text = $this->meta[$id][‘text’];

    with
    $text = $this->meta[$id][‘text’] ? $this->meta[$id][‘text’] : $text;

That’s it!

Super fast WordPress 2.7 with Gears

I upgraded to WordPress 2.7 now, and the best things of all is Gears.

After you upgrade (just copy the files over the old ones, making sure you don’t overwrite any modified files, usualy good thing to backup, access /wp-admin/upgrade.php to complete upgrading), on top right corner you will see a link called Gears.

Download and install Gears, than come back to the Gears link on top right and enable. Your blog admin will work super fast.

Attention! Make sure you enable gears just if you are using it on your home computer/laptop (NOT on  PUBLIC COMPUTER).

WordPress header exploit hidden div viagra links

I had a blog that it dropped down in Google and didn’t know why. I checked the source and I saw a div or another tag with display:none and containing tens of spamming links to viagra sites or other stuff like this.

This solution is for those who have in the template folderheader.php this infected tag. Even if you delete it, it will be back in a few (1-2 days max).

Solution: replace include header.php (or get_header(); ) in index.php with the content of header.php (except the infected tag with links).

Even if the header.php will still be infected, it will not be used. Did it worked ? (I explained in a hurry, I can give more details if you comment here).