Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#100 closed New feature (fixed)

Plugin for SEO piwik: alexa, google pagerank, incoming links

Reported by: julien Owned by:
Priority: critical Milestone: Future releases
Component: Plugins Wishlist Keywords:
Cc: Sensitive: no

Description (last modified by matt)

Plugin to display general statistics about the site SEO:

  • Google Pagerank, Alexa, Compete,
  • number of incoming links on google, yahoo, live. Page from google/yahoo fetched in php, grep for the number of links; maybe php library exists to do this

SEO PLUGIN

see #1459 for the new ticket

(old) SEO widget proposal

Widget would be really simple, providing a form for URL customizable below, like the feedburner widget. URL would be auto-completed with main website URL.

Widget would display the 3 ranks + 3 number of incoming links.

Plugin would expose the alexarank, google pagerank, all other data in the API.

Optionally, results could be cached for days in the db so that lookup is fast.

See 15 Tools for Monitoring a Website’s Popularity

Attachments (5)

SEOPlugin.2.zip (7.1 KB) - added by chuvidi2003 4 years ago.
This Plugin extracts and displays Google Ragerank, Alexa web ranking as well as backlinks of the currently selected website. Users are also able to check rankings of any websites by providing the appropriate url.
seoplugin.jpg (68.3 KB) - added by chuvidi2003 4 years ago.
Screenshot of Piwik SEO Plugin.
SEOPlugin.zip (7.1 KB) - added by chuvidi2003 4 years ago.
This Plugin extracts and displays Google Ragerank, Alexa web ranking as well as backlinks and pages indexed of the currently selected website. Users are also able to check rankings of any websites by providing the appropriate url.
SEOplugin.patch (4.6 KB) - added by halfdan 4 years ago.
SEOplugin-bug.png (12.0 KB) - added by halfdan 4 years ago.

Download all attachments as: .zip

Change History (23)

comment:1 Changed 5 years ago by matt (mattab)

  • Description modified (diff)
  • Summary changed from Plugin for website introspection to Plugin for SEO piwik: alexa, google pagerank, incoming links

comment:2 Changed 5 years ago by matt (mattab)

  • Description modified (diff)
  • Priority changed from low to major

comment:3 Changed 5 years ago by matt (mattab)

  • Priority changed from major to critical

comment:4 Changed 4 years ago by chuvidi2003

Hello matt ..
I definitely agree with the need for SEO rankings on the piwik plugin.
As part of a study I am looking into, I have developed a plugin that almost fully satisfied this requirement and would like to contribute it to the piwik base.

Its attached .. Please look at it and give me feedback.
(Currently it fetches alexa rankings and backlinks. )

Thanks,
Victor Dibia.

comment:5 Changed 4 years ago by matt (mattab)

  • Sensitive unset

Thanks Victor, very good start!! Here is the feedback

  • there is some useless code here and there in the plugin (controller.index, controller.boolToString,
  • the API should return a datatable rather than strings
  • the widget should be built by calling the API, fetching the datatable, and then building the HTML
  • you can reuse the loading-blue.gif from the piwik core
  • is the functions.class.php and rank.class.php open source GPL compatible code?
  • can you also add the following metrics:
    • google pagerank
    • compete rank
    • yahoo backlinks

What do you think? let me know when you want me to do another code review. I think this plugin can be included in Core, as long as all code is open source :)

Changed 4 years ago by chuvidi2003

This Plugin extracts and displays Google Ragerank, Alexa web ranking as well as backlinks of the currently selected website. Users are also able to check rankings of any websites by providing the appropriate url.

comment:6 Changed 4 years ago by chuvidi2003

Dear Matt,

I have included uploaded the reviewed code and make changes as suggested in your initial review.

  • useless code exterminated
  • datatable used in place of strings
  • widget built by calling api, datatable and building html
  • loading-blue.gif reused from core
  • code used (as indicated in source files) are gpl compatible, and all code is open source!
  • page rank added, yahoo backlinks added
  • screen shot included too!

There are a few issues though –
-A checksum value is required to compute the Google PR value. The method used in computing this checksum value changes at googles discretion meaning this plugin will have to be updated with such changes (part of the reason why it was not included initially).
-Obtaining google backlinks needs an api key (obtained at http://code.google.com/apis/ajaxsearch/key.html) and works per website. Thus it is not included for now.
Thanks for the initial code review, and I look forward to the next (and any other advice).

Victor Dibia

Changed 4 years ago by chuvidi2003

Screenshot of Piwik SEO Plugin.

comment:7 Changed 4 years ago by matt (mattab)

Great stuff!

I just have little feedback

  • Maybe we can display logo in front of each metric? (similarly to http://www.webrankstats.com/webstats/piwik.org ) Logos could be in SEOPlugin/images/ (icons for Google alexa and yahoo can be found in Referers/images/searchEngines/ already).
  • when adding the widget on the dashboard, the API is executed. The widget loads a bit slowly. Instead, could you just load the INPUT field and trigger the ajax request, exactly like when you type a new URL?
  • Are altavista and all the web really relevant? it seems only Yahoo! gives a more accurate numbers (the others seem way off)
  • can you also please remove the author name and replace with Piwik (like other core plugins). Of course we will credit you on the page: http://piwik.org/the-piwik-team/ and we will also credit you in the changelog :)
  • What do you think about the metrics 'Indexed pages'? this might be interesting to have, for Yahoo/Google/Bing.

In the future, I could see this plugin being executed during archiving. We could then have a report with a graph at the top, and sparklines for each metric. You could see how the alexa rank, page rank, indexed pages evolve over time... this would be sweet!

Changed 4 years ago by chuvidi2003

This Plugin extracts and displays Google Ragerank, Alexa web ranking as well as backlinks and pages indexed of the currently selected website. Users are also able to check rankings of any websites by providing the appropriate url.

comment:8 Changed 4 years ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

(In [2381]) Fixes #100
Committing v1 of SEO plugin, thanks Victor Dibia for your work!

  • Renamed plugin to SEO (instead of SEOPlugin)
  • uses Piwik_Http instead of doing curl manipulations
  • removed number_format calls (this will be handled by Piwik in the future)
  • moved functions.php into the class as protected members
  • renamed few classes and cleaned code according to Piwik coding guidelines
  • added check for permissions in API call
  • added icons
  • i18n
  • cleaned up pagerank lib so it works when php displays NOTICE

Also

  • Fixing i18n Example feedburner plugin
  • adding unit tests to getPrettyTimeFromSeconds

comment:9 Changed 4 years ago by matt (mattab)

(In [2382]) Enable SEO plugin by default refs #100

comment:10 Changed 4 years ago by halfdan

The SEO plugins RankChecker uses heaps of ereg_* calls which are deprecated in 5.3 and later - this is throwing notices.

Notice: Use of undefined constant E_EXCEPTION - assumed 'E_EXCEPTION' in C:\Users\halfdan\Documents\NetBeansProjects\Piwik\core\Log\Error.php on line 105
Call Stack
#	Time	Memory	Function	Location
1	0.0006	341440	{main}( )	..\index.php:0
2	0.2337	6068288	Piwik_FrontController->dispatch( )	..\index.php:59
3	0.2404	6238768	call_user_func_array ( )	..\FrontController.php:126
4	0.2404	6238904	Piwik_SEO_Controller->getRank( )	..\FrontController.php:0
5	0.2427	6285104	Piwik_SEO_API->getRank( )	..\Controller.php:21
6	18.6542	6471712	Piwik_SEO_RankChecker->getAge( )	..\API.php:62
7	18.6542	6472264	Piwik_ErrorHandler( )	..\ErrorHandler.php:0
8	18.6544	6474304	Piwik_Log_Error->logEvent( )	..\ErrorHandler.php:51
9	18.6544	6474768	Piwik_Log->log( )	..\Error.php:54
10	18.6545	6475344	Zend_Log_Writer_Abstract->write( )	..\Log.php:113
11	18.6545	6475344	Zend_Log_Writer_Stream->_write( )	..\Abstract.php:77
12	18.6545	6475344	Piwik_Log_Error_Formatter_ScreenFormatter->format( )

comment:11 Changed 4 years ago by halfdan

RankChecker.php is totally PHP4 code - ereg_*, "var" keyword no visibility attributes for functions. Copy/Pasting this class without refactoring it was not that good of a idea.

comment:12 Changed 4 years ago by matt (mattab)

I already did many modifications to the class, I missed the 5.3 compat. I don't have 5.3 avail on my dev box, do you mind submitting patch? Thanks :)

comment:13 Changed 4 years ago by halfdan

Can do that. Will take a couple of days though as it needs some testing which I can't do right now. Will add it asap.

comment:14 Changed 4 years ago by halfdan

Attachment brings RankChecker up to PHP5 compatibility (removing all the ereg_* crap). I also found a "bug" which I did not fix.

When requesting SEO info for another page (using the input field) the result shows the URL urlencoded.

Changed 4 years ago by halfdan

Changed 4 years ago by halfdan

comment:15 Changed 4 years ago by matt (mattab)

(In [2396]) Refs #100

  • php5 compatibility thanks halfdan for patch!
  • fixing issue URL double encoded

comment:16 Changed 4 years ago by matt (mattab)

(In [2401]) Refs #100 Click on Rank or press enter now submit forms + adding JS

comment:17 Changed 4 years ago by matt (mattab)

SEO PLUGIN

see #1459 for the new ticket

comment:18 Changed 4 years ago by matt (mattab)

  • Description modified (diff)
Note: See TracTickets for help on using tickets.