You are here

README_FOR_DEVELOPERS.txt in SEO Compliance Checker 6.2

---------------------------------------------------------------------------
seo_checker - Version 6.x-2.x
---------------------------------------------------------------------------
Author: Michael Ruoss

About Version 6.2
=================

This version requires jquery_ui and jquery_update and brings support for the
newer versions of jquery and jquery_ui for the threshold administration.

This module currentyl requires jquery_update 6.x-dev because it is the only
one that comes with JQuery v1.3.

Overview:
=========
The SEO Compliance Checker hooks into the node creation and modification 
procedure and checks the submitted content on the compliance of specific 
search engine optimization rules.

seo_checker is the core module that triggers the checks and displays 
their results. The checks for the several SEO rules have to be provided by
separate submodules.

The core module comes along with such a submodule providing checks for some 
basic SEO rules. There is however a simple way to extend the functionality
of the checker by adding more such rules in further submodules.

Installation:
=============
Please have a look at INSTALL.txt

Defining further SEO rules:
===========================
A submodule providing rules for the seo_checker should implement the hook
hook_register_seo_rules() which should return an array providing the most
important informations about the rules which are the following:

  name:                 The name of the rule
  description:          Describes what the rule checks upon
  threshold type:       There are currently two possible types:
                          at_least: The result of the check must reach a 
                                    certain threashold in order to succeed
                          range:    The result must be inside a range 
                                    (e.g. between 20% and 40%)
  default threshold:    Thresholds can be changed on the settings page. 
                        Here you can set a default. use array(20,40) for
                        ranges. 
  callback:             This is the function that implements the check. 
                        It will be called by seo_checker.
  passed feedback:      The feedback the user gets if he passes the check
  failed feedback:      The feedback the user gets if he failed the check


An example for an implementation of this hook:

basic_seo_rules_register_seo_rules() {
  $rules['alt_attributes'] = array(
    'name' => t('Alt attributes in <img> - tags'),
    'description' => t('Checks if all the <img> tags have an alt attribute.'),
    'threshold type' => 'at_least',
    'default threshold' => 100,
    'callback' => 'basic_seo_rules_alt_attribute',
    'passed feedback' => t('Test passed.'),
    'failed feedback' => t('Test failed, please make sure your images contain an alternative text.'), 
  );
return $rules;
}


Implementing the checks:
========================
For the example displayed above we would now implement the
function basic_seo_rules_alt_attribute($form_values) which will be called by
the SEO Checker, passing it the values from the node_form.

As the checker displays percents, the function should return a value between
0 and 100.


Adding a settings tab for your rules:
=====================================
Using hook_menu you can add your own tabs in the default setting page of the
SEO Checker. Just use the same path and the type MENU_LOCAL_TASK:

$items['admin/settings/seo_checker/YOUR_MODULE'] = array( 
 'title' => ...
 ... => ...
 'type' => MENU_LOCAL_TASK,
)

File

README_FOR_DEVELOPERS.txt
View source
  1. ---------------------------------------------------------------------------
  2. seo_checker - Version 6.x-2.x
  3. ---------------------------------------------------------------------------
  4. Author: Michael Ruoss
  5. About Version 6.2
  6. =================
  7. This version requires jquery_ui and jquery_update and brings support for the
  8. newer versions of jquery and jquery_ui for the threshold administration.
  9. This module currentyl requires jquery_update 6.x-dev because it is the only
  10. one that comes with JQuery v1.3.
  11. Overview:
  12. =========
  13. The SEO Compliance Checker hooks into the node creation and modification
  14. procedure and checks the submitted content on the compliance of specific
  15. search engine optimization rules.
  16. seo_checker is the core module that triggers the checks and displays
  17. their results. The checks for the several SEO rules have to be provided by
  18. separate submodules.
  19. The core module comes along with such a submodule providing checks for some
  20. basic SEO rules. There is however a simple way to extend the functionality
  21. of the checker by adding more such rules in further submodules.
  22. Installation:
  23. =============
  24. Please have a look at INSTALL.txt
  25. Defining further SEO rules:
  26. ===========================
  27. A submodule providing rules for the seo_checker should implement the hook
  28. hook_register_seo_rules() which should return an array providing the most
  29. important informations about the rules which are the following:
  30. name: The name of the rule
  31. description: Describes what the rule checks upon
  32. threshold type: There are currently two possible types:
  33. at_least: The result of the check must reach a
  34. certain threashold in order to succeed
  35. range: The result must be inside a range
  36. (e.g. between 20% and 40%)
  37. default threshold: Thresholds can be changed on the settings page.
  38. Here you can set a default. use array(20,40) for
  39. ranges.
  40. callback: This is the function that implements the check.
  41. It will be called by seo_checker.
  42. passed feedback: The feedback the user gets if he passes the check
  43. failed feedback: The feedback the user gets if he failed the check
  44. An example for an implementation of this hook:
  45. basic_seo_rules_register_seo_rules() {
  46. $rules['alt_attributes'] = array(
  47. 'name' => t('Alt attributes in <img> - tags'),
  48. 'description' => t('Checks if all the tags have an alt attribute.'),
  49. 'threshold type' => 'at_least',
  50. 'default threshold' => 100,
  51. 'callback' => 'basic_seo_rules_alt_attribute',
  52. 'passed feedback' => t('Test passed.'),
  53. 'failed feedback' => t('Test failed, please make sure your images contain an alternative text.'),
  54. );
  55. return $rules;
  56. }
  57. Implementing the checks:
  58. ========================
  59. For the example displayed above we would now implement the
  60. function basic_seo_rules_alt_attribute($form_values) which will be called by
  61. the SEO Checker, passing it the values from the node_form.
  62. As the checker displays percents, the function should return a value between
  63. 0 and 100.
  64. Adding a settings tab for your rules:
  65. =====================================
  66. Using hook_menu you can add your own tabs in the default setting page of the
  67. SEO Checker. Just use the same path and the type MENU_LOCAL_TASK:
  68. $items['admin/settings/seo_checker/YOUR_MODULE'] = array(
  69. 'title' => ...
  70. ... => ...
  71. 'type' => MENU_LOCAL_TASK,
  72. )