diff --git a/README.txt b/README.txt index df22c02..89ce740 100644 --- a/README.txt +++ b/README.txt @@ -26,9 +26,9 @@ INSTALLATION AND USAGE SEO Checklist is installed in the usual way. See http://drupal.org/documentation/install/modules-themes/modules-7. To start using -the module, go to admin/config/search/seo-checklist. It will pre-check any -completed items it is able to auto detect. Start working through the rest, and -click "Save" to save your progress! +the module, go to admin/settings/seo-checklist. It will pre-check any completed +items it is able to auto detect. Start working through the rest, and click +"Save" to save your progress! UPGRADING FROM 3.x diff --git a/seo_checklist.info b/seo_checklist.info deleted file mode 100644 index a257281..0000000 --- a/seo_checklist.info +++ /dev/null @@ -1,6 +0,0 @@ -name = SEO Checklist -description = A Search Engine Optimization checklist for Drupal. -core = 7.x -dependencies[] = checklistapi -package = SEO -configure = admin/config/search/seo-checklist diff --git a/seo_checklist.info.yml b/seo_checklist.info.yml new file mode 100644 index 0000000..fdcfc55 --- /dev/null +++ b/seo_checklist.info.yml @@ -0,0 +1,8 @@ +name: 'SEO Checklist' +description: 'A Search Engine Optimization checklist for Drupal.' +core: 8.x +package: QA +dependencies: + - checklistapi +project: seo_checklist +type: module diff --git a/seo_checklist.install b/seo_checklist.install deleted file mode 100644 index 1e72b45..0000000 --- a/seo_checklist.install +++ /dev/null @@ -1,137 +0,0 @@ -rowCount()) { - seo_checklist_update_7400(); - } -} - -/** - * Implements hook_uninstall(). - */ -function seo_checklist_uninstall() { - variable_del('checklistapi_checklist_seo_checklist'); -} - -/** - * Rename module machine name and convert saved progress data to new format. - * - * Note: Drupal won't detect and run this function in the usual way, because - * the change of module machine name causes it to lose track of the current - * schema version, so it's invoked manually by seo_checklist_install(), if - * appropriate. - */ -function seo_checklist_update_7400() { - // Convert saved progress data. - if (db_table_exists('seo_checklist')) { - $result = db_query('SELECT id, completed, uid FROM {seo_checklist}'); - $old_data = $result->fetchAllAssoc('id'); - $data_mapping = array( - 'install_page_title' => 1, - 'enable_clean_urls' => 2, - 'install_pathauto' => 5, - 'install_globalredirect' => 6, - 'get_google_account' => 7, - 'install_google_analytics' => 9, - 'create_google_analytics_analytics' => 11, - 'input_google_analytics_code' => 12, - 'authenticate_with_google_analytics' => 13, - 'install_metatags_quick' => 15, - 'install_scheduler' => 16, - 'install_htmlpurifier' => 17, - 'install_search404' => 18, - 'validate_html' => 19, - 'check_links' => 20, - 'install_xmlsitemap' => 21, - 'authenticate_with_google' => 23, - 'submit_xml_sitemap_to_google' => 24, - 'submit_xml_sitemap_to_bing' => 28, - 'add_to_google_places' => 29, - 'install_addthis' => 30, - 'install_service_links' => 31, - 'install_mollom' => 39, - 'sign_up_for_mollom_account' => 40, - 'authenticate_with_bing' => 43, - 'get_windows_live_id' => 44, - 'install_htmlpurifier' => 45, - 'install_site_map' => 46, - 'install_site_verify' => 47, - 'install_addtoany' => 49, - 'add_geo_meta_tags' => 51, - 'install_admin_menu' => 53, - 'enable_drupal_caching' => 54, - 'install_boost' => 55, - 'install_seo_checker' => 57, - 'install_fb_social' => 58, - 'install_follow' => 59, - 'install_elements' => 60, - 'install_security_review' => 61, - 'install_read_more' => 62, - 'install_ga_tokenizer' => 63, - 'install_contact_google_analytics' => 64, - 'install_context_keywords' => 65, - ); - global $user; - $new_data = array( - '#changed' => $time = time(), - '#changed_by' => $user->uid, - '#completed_items' => 0, - ); - $definitions = seo_checklist_checklistapi_checklist_info(); - $groups = $definitions['seo_checklist']; - foreach (element_children($groups) as $group_key) { - $group = &$groups[$group_key]; - foreach (element_children($group) as $item_key) { - if (!empty($data_mapping[$item_key])) { - $old_item = $old_data[$data_mapping[$item_key]]; - if (!empty($old_item->completed)) { - $new_data[$item_key] = array( - '#completed' => $old_item->completed, - '#uid' => $old_item->uid, - ); - $new_data['#completed_items']++; - } - } - if (!isset($new_data[$item_key])) { - $new_data[$item_key] = 0; - } - } - } - if (variable_get('seo_checklist_link', 0)) { - $new_data['link_to_volacci'] = array( - '#completed' => $time, - '#uid' => $user->uid, - ); - } - ksort($new_data); - variable_set('checklistapi_checklist_seo_checklist', $new_data); - } - - // Remove old database tables. - foreach (array('seo_group', 'seo_checklist') as $table) { - if (db_table_exists($table)) { - db_drop_table($table); - } - } - - // Remove the old "seochecklist" row from the system table. - db_delete('system') - ->condition('name', 'seochecklist') - ->execute(); - - // Remove now unused variables. - variable_del('seo_checklist_book_references'); - variable_del('seo_checklist_link'); - variable_del('seo_checklist_podcast'); - variable_del('seo_checklist_thanks'); -} diff --git a/seo_checklist.js b/seo_checklist.js index fc2f20e..0f38635 100644 --- a/seo_checklist.js +++ b/seo_checklist.js @@ -1,4 +1,4 @@ -(function ($) { +(function ($, Drupal, drupalSettings) { "use strict"; Drupal.behaviors.seo_checklist = { @@ -20,4 +20,4 @@ } }; -})(jQuery); +})(jQuery, Drupal, drupalSettings); diff --git a/seo_checklist.libraries.yml b/seo_checklist.libraries.yml new file mode 100644 index 0000000..f6eda48 --- /dev/null +++ b/seo_checklist.libraries.yml @@ -0,0 +1,15 @@ +seo_checklist_full: + version: 1.x + js: + seo_checklist.js: {} + dependencies: + - core/jquery + - core/drupal + css: + theme: + seo_checklist.css: {} +seo_checklist_css: + version: 1.x + css: + theme: + seo_checklist.css: {} \ No newline at end of file diff --git a/seo_checklist.links.menu.yml b/seo_checklist.links.menu.yml new file mode 100644 index 0000000..9b8bfb4 --- /dev/null +++ b/seo_checklist.links.menu.yml @@ -0,0 +1,5 @@ +seo_checklist.checklist: + title: Performance and Scalability Checklist + description: Performance and Scalability Checklist. + route_name: checklistapi.checklists.seo_checklist + parent: system.admin_config_development diff --git a/seo_checklist.module b/seo_checklist.module index 230531c..78da227 100644 --- a/seo_checklist.module +++ b/seo_checklist.module @@ -5,28 +5,16 @@ * Track important SEO techniques on the website. */ -/** - * Checks whether the Volacci footer link is enabled. - * - * @return bool - * Returns TRUE if the footer link is enabled or FALSE if not. - */ -function _seo_checklist_volacci_link_is_enabled() { - $link_is_enabled = &drupal_static(__FUNCTION__); - if (!isset($link_is_enabled)) { - $saved_progress = variable_get('checklistapi_checklist_seo_checklist', array()); - $link_is_enabled = !empty($saved_progress['link_to_volacci']); - } - return $link_is_enabled; -} +use Drupal\Core\Url; +use Drupal\Core\Form\FormStateInterface; + /** * Implements hook_form_FORM_ID_alter(). */ -function seo_checklist_form_checklistapi_checklist_form_alter(&$form, &$form_state, $form_id) { +function seo_checklist_form_checklistapi_checklist_form_alter(&$form, FormStateInterface $form_state) { if ($form['#checklist']->id == 'seo_checklist') { - $form['checklistapi']['#attached']['js'][] = drupal_get_path('module', 'seo_checklist') . '/seo_checklist.js'; - $form['checklistapi']['#attached']['css'][] = drupal_get_path('module', 'seo_checklist') . '/seo_checklist.css'; + $form['checklistapi']['#attached']['library'][] = 'seo_checklist/seo_checklist_full'; } } @@ -34,45 +22,58 @@ function seo_checklist_form_checklistapi_checklist_form_alter(&$form, &$form_sta * Implements hook_checklistapi_checklist_info(). */ function seo_checklist_checklistapi_checklist_info() { - $modules_page = array('#text' => t('Enable'), '#path' => 'admin/modules'); + $modules_page = array('#text' => t('Enable'), '#url' => Url::fromRoute('system.modules_list', [], ['absolute' => TRUE])); + $image = array( + '#theme' => 'image', + '#uri' => drupal_get_path('module', 'seo_checklist') . '/volacci-logo.png', + '#alt' => t('Volacci'), + '#title' => t('Volacci'), + ); + $tab = array( + '#theme' => 'seo_checklist_intro_tab', + '#volacci_logo' => drupal_render($image), + ); $definitions = array(); $definitions['seo_checklist'] = array( '#title' => t('SEO checklist'), '#description' => t('Keep track of your Drupal Search Engine Optimization tasks.'), '#path' => 'admin/config/search/seo-checklist', - '#help' => t("

Check off each SEO-related task as you complete it. Don't forget to click the Save button!

"), + '#help' => t("Check off each SEO-related task as you complete it. Don't forget to click the Save button!"), // Introduction. 'introduction' => array( '#title' => t('Introduction'), - '#description' => theme('seo_checklist_intro_tab', array( - 'volacci_logo' => theme('image', array( - 'path' => drupal_get_path('module', 'seo_checklist') . '/volacci-logo.png', - 'alt' => t('Volacci'), - 'title' => t('Volacci'), - )), - )), + '#description' => drupal_render($tab), ), // Tools. 'tools' => array( '#title' => t('Tools (optional)'), - '#description' => t('

While not strictly necessary for SEO, these modules will accelerate your work.

'), + '#description' => t('While not strictly necessary for SEO, these modules will accelerate your work.'), + 'install_admin_menu' => array( + '#title' => t('[Optional] Install Administration menu module.'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('admin_menu'), + 'project_page' => array( + '#text' => t('Download'), + '#url' => Url::fromUri('http://drupal.org/project/admin_menu'), + ), + 'modules_page' => $modules_page, + ), 'install_drush' => array( '#title' => t('[Optional] Install Drush.'), '#description' => t('Drush is a command line tool for Drupal that you can use, among other things, to install modules faster.'), 'project_page' => array( '#text' => t('Download and install'), - '#path' => 'http://drupal.org/project/drush', + '#url' => Url::fromUri('http://drupal.org/project/drush'), ), ), 'install_module_filter' => array( '#title' => t('[Optional] Install Module Filter module.'), - '#default_value' => module_exists('module_filter'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('module_filter'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/module_filter', + '#url' => Url::fromUri('http://drupal.org/project/module_filter'), ), 'modules_page' => $modules_page, ), @@ -81,107 +82,78 @@ function seo_checklist_checklistapi_checklist_info() { // Page titles and meta tags. 'page_titles_meta_tags' => array( '#title' => t('Page titles and meta tags'), - '#description' => t('

Search engines look at your TITLE tags and certain meta data to determine what your site is about. These modules give you control over this important information.

'), + '#description' => t('Search engines look at your TITLE tags and certain meta data to determine what your site is about. These modules give you control over this important information.'), 'install_metatag' => array( '#title' => t('Install Meta tags module.'), - '#default_value' => module_exists('metatag'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('metatag'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/metatag', + '#url' => Url::fromUri('http://drupal.org/project/metatag'), ), 'modules_page' => $modules_page, ), - 'configure_metatag' => array( - '#title' => t('Configure Meta tags module.'), - '#description' => t('If local SEO is important to you, add geo meta tags.'), - 'config_page' => array( - '#text' => t('Configure'), - '#path' => 'admin/config/search/metatags', - ), - ), - 'install_page_title' => array( - '#title' => t('[Optional] Install Page Title module.'), - '#description' => t('Until Meta tags adds the functionality, Page Title is necessary for paged Views.'), - '#default_value' => module_exists('page_title'), - 'project_page' => array( - '#text' => t('Download'), - '#path' => 'http://drupal.org/project/page_title', - ), - 'modules_page' => $modules_page, - ), - 'configure_page_title' => array( - '#title' => t('[Optional] Configure Page Title module.'), - 'config_page' => array( - '#text' => t('Configure'), - '#path' => 'admin/config/search/page-title', - ), - ), +// 'configure_metatag' => array( +// '#title' => t('Configure Meta tags module.'), +// '#description' => t('If local SEO is important to you, add geo meta tags.'), +// 'config_page' => array( +// '#text' => t('Configure'), +// '#url' => 'admin/config/search/metatags', +// ), +// ), 'install_metatags_quick' => array( '#title' => t('[Optional] Install Meta tags quick module.'), '#description' => t("If you want to add meta tags to non-node entities, you'll need this module for now."), - '#default_value' => module_exists('metatags_quick'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('metatags_quick'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/metatags_quick', + '#url' => Url::fromUri('http://drupal.org/project/metatags_quick'), ), 'modules_page' => $modules_page, ), - 'configure_metatags_quick' => array( - '#title' => t('[Optional] Configure Meta tags quick module.'), - 'config_page' => array( - '#text' => t('Configure'), - '#path' => 'admin/config/search/metatags_quick', - ), - ), +// 'configure_metatags_quick' => array( +// '#title' => t('[Optional] Configure Meta tags quick module.'), +// 'config_page' => array( +// '#text' => t('Configure'), +// '#url' => 'admin/config/search/metatags_quick', +// ), +// ), ), // URL paths. 'url_paths' => array( '#title' => t('URL paths'), - '#description' => t("

Search engines use your site's URLs to help determine structure, organization, and topical relevance.

"), - 'enable_clean_urls' => array( - '#title' => t('Enable clean URLs.'), - '#default_value' => variable_get('clean_url', 0), - 'config_page' => array( - '#text' => t('Configure'), - '#path' => 'admin/config/search/clean-urls', - ), - 'more_info' => array( - '#text' => t('More info'), - '#path' => 'http://drupal.org/getting-started/clean-urls', - ), - ), + '#description' => t("Search engines use your site's URLs to help determine structure, organization, and topical relevance."), 'install_pathauto' => array( '#title' => t('Install Pathauto module.'), - '#default_value' => module_exists('pathauto'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('pathauto'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/pathauto', + '#url' => Url::fromUri('http://drupal.org/project/pathauto'), ), 'modules_page' => $modules_page, ), - 'configure_pathauto' => array( - '#title' => t('Configure Pathauto module.'), - 'config_page' => array( - '#text' => t('Configure'), - '#path' => 'admin/config/search/path/patterns', - ), - ), +// 'configure_pathauto' => array( +// '#title' => t('Configure Pathauto module.'), +// 'config_page' => array( +// '#text' => t('Configure'), +// '#url' => 'admin/config/search/path/patterns', +// ), +// ), 'install_globalredirect' => array( '#title' => t('Install Global Redirect module.'), - '#default_value' => module_exists('globalredirect'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('globalredirect'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/globalredirect', + '#url' => Url::fromUri('http://drupal.org/project/globalredirect'), ), 'modules_page' => $modules_page, ), 'install_redirect' => array( '#title' => t('Install Redirect module.'), - '#default_value' => module_exists('redirect'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('redirect'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/redirect', + '#url' => Url::fromUri('http://drupal.org/project/redirect'), ), 'modules_page' => $modules_page, ), @@ -190,19 +162,19 @@ function seo_checklist_checklistapi_checklist_info() { // Create search engine accounts. 'search_engine_accounts' => array( '#title' => t('Create search engine accounts'), - '#description' => t("

Set your site up with the search engines. You'll need these accounts for later steps in the SEO Checklist but also to help you communicate and evaluate your site on an ongoing basis.

"), + '#description' => t("Set your site up with the search engines. You'll need these accounts for later steps in the SEO Checklist but also to help you communicate and evaluate your site on an ongoing basis."), 'get_google_account' => array( '#title' => t('Get a Google account.'), 'create_account' => array( '#text' => t('Create account'), - '#path' => 'https://www.google.com/accounts/NewAccount', + '#url' => Url::fromUri('https://www.google.com/accounts/NewAccount'), ), ), 'get_windows_live_id' => array( '#title' => t('Get a Windows Live ID.'), 'create_account' => array( '#text' => t('Create account'), - '#path' => 'https://signup.live.com/', + '#url' => Url::fromUri('https://signup.live.com/'), ), ), ), @@ -210,70 +182,70 @@ function seo_checklist_checklistapi_checklist_info() { // Track your visitors. 'track_visitors' => array( '#title' => t('Track your visitors'), - '#description' => t('

See where your visitors are coming from and what they do while visiting your site.

'), + '#description' => t('See where your visitors are coming from and what they do while visiting your site.'), 'install_google_analytics' => array( '#title' => t('Install Google Analytics module.'), - '#default_value' => module_exists('googleanalytics'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('googleanalytics'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/google_analytics', + '#url' => Url::fromUri('http://drupal.org/project/google_analytics'), ), 'modules_page' => $modules_page, ), - 'create_google_analytics_analytics' => array( - '#title' => t('Sign in to your Google Analytics account and create an Analytics for your website.'), - '#default_value' => $googleanalytics_account = (bool) variable_get('googleanalytics_account', 0), - 'web_site' => array( - '#text' => t('Google Analytics'), - '#path' => 'http://www.google.com/analytics', - ), - ), - 'input_google_analytics_code' => array( - '#title' => t('Copy and paste your new Google Analytics code into the Google Analytics module.'), - '#default_value' => $googleanalytics_account = (bool) variable_get('googleanalytics_account', 0), - 'project_page' => array( - '#text' => t('Module settings'), - '#path' => 'admin/config/system/googleanalytics', - ), - ), +// 'create_google_analytics_analytics' => array( +// '#title' => t('Sign in to your Google Analytics account and create an Analytics for your website.'), +// '#default_value' => $googleanalytics_account = (bool) variable_get('googleanalytics_account', 0), +// 'web_site' => array( +// '#text' => t('Google Analytics'), +// '#url' => Url::fromUri('http://www.google.com/analytics'), +// ), +// ), +// 'input_google_analytics_code' => array( +// '#title' => t('Copy and paste your new Google Analytics code into the Google Analytics module.'), +// '#default_value' => $googleanalytics_account = (bool) variable_get('googleanalytics_account', 0), +// 'project_page' => array( +// '#text' => t('Module settings'), +// '#url' => 'admin/config/system/googleanalytics', +// ), +// ), 'authenticate_with_google_analytics' => array( '#title' => t('Authenticate your site with Google Analytics.'), 'web_site' => array( '#text' => t('Google Analytics'), - '#path' => 'http://www.google.com/analytics', + '#url' => Url::fromUri('http://www.google.com/analytics'), ), ), 'install_ga_tokenizer' => array( '#title' => t('Install Google Analytics Tokenizer module.'), - '#default_value' => module_exists('ga_tokenizer'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('ga_tokenizer'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/ga_tokenizer', + '#url' => Url::fromUri('http://drupal.org/project/ga_tokenizer'), ), ), 'install_contact_google_analytics' => array( '#title' => t('Install Google Analytics Contact Form, Webform, Rules Email module.'), - '#default_value' => module_exists('contact_google_analytics'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('contact_google_analytics'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/contact_google_analytics', + '#url' => Url::fromUri('http://drupal.org/project/contact_google_analytics'), ), 'modules_page' => $modules_page, ), - 'configure_contact_google_analytics' => array( - '#title' => t('Configure Google Analytics Contact Form, Webform, Rules Email module.'), - '#default_value' => variable_get('contact_google_analytics_allowed_recipients', 'all') != 'all', - 'config_page' => array( - '#text' => t('Configure'), - '#path' => 'admin/config/contact-google-analytics', - ), - ), +// 'configure_contact_google_analytics' => array( +// '#title' => t('Configure Google Analytics Contact Form, Webform, Rules Email module.'), +// '#default_value' => variable_get('contact_google_analytics_allowed_recipients', 'all') != 'all', +// 'config_page' => array( +// '#text' => t('Configure'), +// '#url' => 'admin/config/contact-google-analytics', +// ), +// ), 'install_context_keywords' => array( '#title' => t('Install Context Keywords module.'), - '#default_value' => module_exists('context_keywords'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('context_keywords'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/context_keywords', + '#url' => Url::fromUri('http://drupal.org/project/context_keywords'), ), ), ), @@ -281,57 +253,57 @@ function seo_checklist_checklistapi_checklist_info() { // Content. 'content' => array( '#title' => t('Content'), - '#description' => t('

Well-written content is important to the search engines. These modules help.

'), + '#description' => t('Well-written content is important to the search engines. These modules help.'), 'install_microdata' => array( '#title' => t('Install Microdata module.'), '#description' => t("Microdata enables you to share content with other sites and services, like Google's Recipe View, using inline metadata."), - '#default_value' => module_exists('microdata'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('microdata'), 'config_page' => array( '#text' => t('Download module'), - '#path' => 'http://drupal.org/project/microdata', + '#url' => Url::fromUri('http://drupal.org/project/microdata'), ), 'modules_page' => $modules_page, ), - 'configure_microdata' => array( - '#title' => t('Configure Microdata module.'), - 'project_page' => array( - '#text' => t('Configure'), - '#path' => 'admin/config/services/microdata', - ), - ), +// 'configure_microdata' => array( +// '#title' => t('Configure Microdata module.'), +// 'project_page' => array( +// '#text' => t('Configure'), +// '#url' => 'admin/config/services/microdata', +// ), +// ), 'install_htmlpurifier' => array( '#title' => t('Install HTML Purifier module.'), '#description' => t('Follow the README!'), - '#default_value' => module_exists('htmlpurifier'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('htmlpurifier'), 'readme' => array( '#text' => t('README.txt'), - '#path' => 'http://drupalcode.org/project/htmlpurifier.git/blob/refs/heads/7.x-1.x:/INSTALL.txt', + '#url' => Url::fromUri('http://drupalcode.org/project/htmlpurifier.git/blob/refs/heads/7.x-1.x:/INSTALL.txt'), ), 'project_page' => array( '#text' => t('Download module'), - '#path' => 'http://drupal.org/project/htmlpurifier', + '#url' => Url::fromUri('http://drupal.org/project/htmlpurifier'), ), 'library_page' => array( '#text' => t('Download library'), - '#path' => 'http://htmlpurifier.org/download', + '#url' => Url::fromUri('http://htmlpurifier.org/download'), ), 'modules_page' => $modules_page, ), 'install_search404' => array( '#title' => t('Install Search 404 module.'), - '#default_value' => module_exists('search404'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('search404'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/search404', + '#url' => Url::fromUri('http://drupal.org/project/search404'), ), 'modules_page' => $modules_page, ), 'install_seo_checker' => array( '#title' => t('Install SEO Compliance Checker module.'), - '#default_value' => module_exists('seo_checker'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('seo_checker'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/seo_checker', + '#url' => Url::fromUri('http://drupal.org/project/seo_checker'), ), 'modules_page' => $modules_page, ), @@ -339,14 +311,14 @@ function seo_checklist_checklistapi_checklist_info() { '#title' => t('Validate your markup.'), 'w3c_validator' => array( '#text' => t('W3C Markup Validation Service'), - '#path' => 'http://validator.w3.org/', + '#url' => Url::fromUri('http://validator.w3.org/'), ), ), 'check_links' => array( '#title' => t('Check for broken links.'), 'w3c_link_checker' => array( '#text' => t('W3C Link Checker'), - '#path' => 'http://validator.w3.org/checklink', + '#url' => Url::fromUri('http://validator.w3.org/checklink'), ), ), ), @@ -354,38 +326,38 @@ function seo_checklist_checklistapi_checklist_info() { // Submit your site to the search engines. 'submit_to_search_engines' => array( '#title' => t('Submit your site to the search engines'), - '#description' => t("

Now that you've got your site ready for the search engines, use these tools to tell them you're ready for them to visit.

"), + '#description' => t("Now that you've got your site ready for the search engines, use these tools to tell them you're ready for them to visit."), 'install_site_verify' => array( '#title' => t('Install Site verification module.'), - '#default_value' => module_exists('site_verify'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('site_verify'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/site_verify', + '#url' => Url::fromUri('http://drupal.org/project/site_verify'), ), 'modules_page' => $modules_page, ), - 'add_verifications' => array( - '#title' => t('Add verifications.'), - 'config_page' => array( - '#text' => t('Verifications'), - '#path' => 'admin/config/search/verifications', - ), - ), +// 'add_verifications' => array( +// '#title' => t('Add verifications.'), +// 'config_page' => array( +// '#text' => t('Verifications'), +// '#url' => 'admin/config/search/verifications', +// ), +// ), 'install_xmlsitemap' => array( '#title' => t('Install XML Sitemap module.'), - '#default_value' => module_exists('xmlsitemap'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('xmlsitemap'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/xmlsitemap', + '#url' => Url::fromUri('http://drupal.org/project/xmlsitemap'), ), 'modules_page' => $modules_page, ), 'install_site_map' => array( '#title' => t('Install Site map module.'), - '#default_value' => module_exists('site_map'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('site_map'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/site_map', + '#url' => Url::fromUri('http://drupal.org/project/site_map'), ), 'modules_page' => $modules_page, ), @@ -393,39 +365,39 @@ function seo_checklist_checklistapi_checklist_info() { '#title' => t('Authenticate with Google.'), 'webmaster_tools' => array( '#text' => t('Webmaster Tools'), - '#path' => 'http://www.google.com/webmasters/tools', + '#url' => Url::fromUri('http://www.google.com/webmasters/tools'), ), ), 'submit_xml_sitemap_to_google' => array( '#title' => t('Submit your XML sitemap to Google.'), 'webmaster_tools' => array( '#text' => t('Webmaster Tools'), - '#path' => 'http://www.google.com/webmasters/tools', + '#url' => Url::fromUri('http://www.google.com/webmasters/tools'), ), 'help_page' => array( '#text' => t('Help page'), - '#path' => 'http://support.google.com/webmasters/bin/answer.py?hl=en&answer=183669&topic=8476&ctx=topic', + '#url' => Url::fromUri('http://support.google.com/webmasters/bin/answer.py?hl=en&answer=183669&topic=8476&ctx=topic'), ), ), 'authenticate_with_bing' => array( '#title' => t('Authenticate with Bing.'), 'webmaster_tools' => array( '#text' => t('Webmaster Tools'), - '#path' => 'http://www.bing.com/webmaster/', + '#url' => Url::fromUri('http://www.bing.com/webmaster/'), ), ), 'submit_xml_sitemap_to_bing' => array( '#title' => t('Submit your XML sitemap to Bing.'), 'webmaster_tools' => array( '#text' => t('Submission page'), - '#path' => 'http://www.bing.com/webmaster/submitsitepage.aspx', + '#url' => Url::fromUri('http://www.bing.com/webmaster/submitsitepage.aspx'), ), ), 'add_to_google_places' => array( '#title' => t('[Optional] Add your business to Google Places, if appropriate.'), 'google_places' => array( '#text' => t('Google Places'), - '#path' => 'http://www.google.com/local/add/', + '#url' => Url::fromUri('http://www.google.com/local/add/'), ), ), ), @@ -433,14 +405,14 @@ function seo_checklist_checklistapi_checklist_info() { // Other checklists. 'other_checklists' => array( '#title' => t('Other checklists'), - '#description' => t('

These checklists are essential for additional important Internet Marketing related tasks for your website.

'), + '#description' => t('These checklists are essential for additional important Internet Marketing related tasks for your website.'), 'install_security_review' => array( '#title' => t('[Optional] Install Security Review module.'), '#description' => t('The more popular your website becomes, the more important good security will be.'), - '#default_value' => module_exists('security_review'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('security_review'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/security_review', + '#url' => Url::fromUri('http://drupal.org/project/security_review'), ), 'modules_page' => $modules_page, ), @@ -449,44 +421,44 @@ function seo_checklist_checklistapi_checklist_info() { // Paid services. 'paid_services' => array( '#title' => t('Paid services (optional)'), - '#description' => t('

There are many paid tools available to help you with your SEO and website maintenance. Here are some suggestions typically used by top Internet Marketing firms. At Volacci, we have tested and use all of these tools.

'), + '#description' => t('There are many paid tools available to help you with your SEO and website maintenance. Here are some suggestions typically used by top Internet Marketing firms. At Volacci, we have tested and use all of these tools.'), 'mollom_spam_prevention' => array( '#title' => t('[Optional] Mollom spam prevention'), - '#description' => t("

If your site will get heavy use from visitors creating accounts, commenting and/or creating content then use Mollom. It's free for up to 100 legitimate posts a day, which covers most small sites.

"), + '#description' => t('If your site will get heavy use from visitors creating accounts, commenting and/or creating content then use Mollom.'), 'register_page' => array( '#text' => t('Mollom website'), - '#path' => 'http://mollom.com/', + '#url' => Url::fromUri('http://mollom.com/'), ), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/mollom', + '#url' => Url::fromUri('http://drupal.org/project/mollom'), ), 'modules_page' => $modules_page, - 'config_page' => array( - '#text' => t('Configure'), - '#path' => 'admin/config/content/mollom', - ), +// 'config_page' => array( +// '#text' => t('Configure'), +// '#url' => 'admin/config/content/mollom', +// ), ), 'volacci_automatr' => array( '#title' => t('[Optional] Volacci Automatr™ marketing automation'), - '#description' => t('

If you need marketing automation, lead scoring, advanced email marketing, and more, along with SalesForce or SugarCRM integration, then use Volacci Automatr™. If, for some reason, Automatr™ does not work for you, consider Marketo or Eloqua.

', array( - '@automatr_url' => $automatr_url = 'http://automatr.volacci.com/?utm_source=seo_checklist&utm_medium=backend&utm_content=text&utm_campaign=volacci_automatr', + '#description' => t('If you need marketing automation, lead scoring, advanced email marketing, and more, along with SalesForce or SugarCRM integration, then use Volacci Automatr™. If, for some reason, Automatr™ does not work for you, consider Marketo or Eloqua.', array( + '@automatr_url' => $automatr_url = Url::fromUri('http://automatr.volacci.com/?utm_source=seo_checklist&utm_medium=backend&utm_content=text&utm_campaign=volacci_automatr'), '@marketo_url' => 'http://www.marketo.com/', '@eloqua_url' => 'http://www.eloqua.com/', )), 'automatr_website' => array( '#text' => t('Automatr website'), - '#path' => $automatr_url, + '#url' => $automatr_url, ), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/automatr', + '#url' => Url::fromUri('http://drupal.org/project/automatr'), ), 'modules_page' => $modules_page, - 'config_page' => array( - '#text' => t('Configure'), - '#path' => 'admin/config/marketing/automatr', - ), +// 'config_page' => array( +// '#text' => t('Configure'), +// '#url' => 'admin/config/marketing/automatr', +// ), ), ), @@ -495,19 +467,19 @@ function seo_checklist_checklistapi_checklist_info() { '#title' => t('Extras (optional)'), 'install_scheduler' => array( '#title' => t('[Optional] Install Scheduler module.'), - '#default_value' => module_exists('scheduler'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('scheduler'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/scheduler', + '#url' => Url::fromUri('http://drupal.org/project/scheduler'), ), 'modules_page' => $modules_page, ), 'install_read_more' => array( '#title' => t('[Optional] Install Read More Link module.'), - '#default_value' => module_exists('read_more'), + '#default_value' => \Drupal::moduleHandler()->moduleExists('read_more'), 'project_page' => array( '#text' => t('Download'), - '#path' => 'http://drupal.org/project/read_more', + '#url' => Url::fromUri('http://drupal.org/project/read_more'), ), 'modules_page' => $modules_page, ), @@ -523,18 +495,18 @@ function seo_checklist_checklistapi_checklist_info() { '#description' => t("Remember to include your link information in your email. If you don't know why you should link with other websites, read Why links help SEO."), 'email_link' => array( '#text' => t('seochecklist@volacci.com'), - '#path' => 'mailto:seochecklist@volacci.com', + '#url' => Url::fromUri('mailto:seochecklist@volacci.com'), ), ), 'read_drupal_6_seo_book' => array( '#title' => t('[Optional] Read Drupal 6 Search Engine Optimization by Ben Finklea.'), 'buy_from_amazon' => array( '#text' => t('Buy from Amazon'), - '#path' => 'http://www.amazon.com/gp/product/1847198228?ie=UTF8&tag=dvdcentral02&linkCode=as2&camp=1789&creative=390957&creativeASIN=1847198228', + '#url' => Url::fromUri('http://www.amazon.com/gp/product/1847198228?ie=UTF8&tag=dvdcentral02&linkCode=as2&camp=1789&creative=390957&creativeASIN=1847198228'), ), 'buy_from_packt' => array( '#text' => t('Buy from Packt'), - '#path' => 'https://www.packtpub.com/drupal-6-search-engine-optimization-seo/book?mid/170909568gh3', + '#url' => Url::fromUri('https://www.packtpub.com/drupal-6-search-engine-optimization-seo/book?mid/170909568gh3'), ), ), 'watch_drupalize_me_video' => array( @@ -547,24 +519,14 @@ function seo_checklist_checklistapi_checklist_info() { } /** - * Implements hook_init(). + * Implements hook_page_attachments(). */ -function seo_checklist_init() { - if (_seo_checklist_volacci_link_is_enabled()) { - drupal_add_css(drupal_get_path('module', 'seo_checklist') . '/seo_checklist.css'); - } -} - -/** - * Implements hook_page_alter(). - */ -function seo_checklist_page_alter(&$page) { - if (_seo_checklist_volacci_link_is_enabled()) { - $page['page_bottom']['seo_checklist_volacci_link'] = array( - '#type' => 'markup', - '#markup' => '', - ); - } +function seo_checklist_page_alter(array &$attachments) { + $attachments['#attached']['library'][] = 'seo_checklist/seo_checklist_css'; + $attachments['page_bottom']['seo_checklist_volacci_link'] = array( + '#type' => 'markup', + '#markup' => '', + ); } /** diff --git a/seo_checklist_intro_tab.tpl.php b/seo_checklist_intro_tab.tpl.php deleted file mode 100644 index 502e1d8..0000000 --- a/seo_checklist_intro_tab.tpl.php +++ /dev/null @@ -1,42 +0,0 @@ - -

How to use the Drupal SEO Checklist

-

Please read these instructions to get the most out of your Drupal Search Engine Optimization efforts.

- -

Important warning

-

This checklist will not search engine optimize your site. It was written as a guide for Drupal SEO experts. If you need help with Drupal SEO best practices, the search engines' latest changes, your brand's target audience, or strategic marketing objectives, consider using a Drupal-specific Internet Marketing consultant like Volacci or ask your Drupal developer for a recommendation.

- -

Getting started

-

Each time you open the SEO Checklist, it will look to see if any tasks have already been completed. For example, if you've already turned on clean URLs then that item will be checked. You still need to click "Save" to time and date stamp the automatically-checked items.

-

The best way to proceed is to start at the top and work your way through each tab until you're done, clicking save after each completed item.

- -

How it's organized

-

The sections are listed from most important to least important. The tasks in each section are also ordered from most to least important. A notable exception to this is the Tools section.

- - -

A note about pre-release modules

-

Some recommended modules may not be considered ready for production websites. These modules are usually marked with "beta" or "dev" or "alpha" on Drupal.org. Please be very careful when installing any module—even those that have been fully tested and released—but be especially careful with dev, alpha, or beta modules.

- -

Credits

-

The Drupal SEO Checklist was created by Ben Finklea, the CEO of Volacci and a long-time Drupal community member. Development was paid for exclusively by Volacci. Special thanks to Travis Carden who created the Checklist API and ported the Drupal SEO Checklist module to use it.

-

- - Marketing Intelligence. -

diff --git a/templates/seo_checklist_intro_tab.html.twig b/templates/seo_checklist_intro_tab.html.twig new file mode 100644 index 0000000..32a6d4c --- /dev/null +++ b/templates/seo_checklist_intro_tab.html.twig @@ -0,0 +1,42 @@ +{# + +/** + * @file + * Default theme implementation for the SEO Checklist "Intro" tab. + * + * Available variables: + * - $volacci_logo: An HTML image tag for the Volacci logo. + * + * @see template_preprocess() + * @see template_preprocess_seo_checklist_intro_tab() + * @see template_process() + */ +#} +

How to use the Drupal SEO Checklist

+

Please read these instructions to get the most out of your Drupal Search Engine Optimization efforts.

+ +

Important warning

+

This checklist will not search engine optimize your site. It was written as a guide for Drupal SEO experts. If you need help with Drupal SEO best practices, the search engines' latest changes, your brand's target audience, or strategic marketing objectives, consider using a Drupal-specific Internet Marketing consultant like Volacci or ask your Drupal developer for a recommendation.

+ +

Getting started

+

Each time you open the SEO Checklist, it will look to see if any tasks have already been completed. For example, if you've already turned on clean URLs then that item will be checked. You still need to click "Save" to time and date stamp the automatically-checked items.

+

The best way to proceed is to start at the top and work your way through each tab until you're done, clicking save after each completed item.

+ +

How it's organized

+

The sections are listed from most important to least important. The tasks in each section are also ordered from most to least important. A notable exception to this is the Tools section.

+ + +

A note about pre-release modules

+

Some recommended modules may not be considered ready for production websites. These modules are usually marked with "beta" or "dev" or "alpha" on Drupal.org. Please be very careful when installing any module—even those that have been fully tested and released—but be especially careful with dev, alpha, or beta modules.

+ +

Credits

+

The Drupal SEO Checklist was created by Ben Finklea, the CEO of Volacci and a long-time Drupal community member. Development was paid for exclusively by Volacci. Special thanks to Travis Carden who created the Checklist API and ported the Drupal SEO Checklist module to use it.

+

+ {{ volacci_logo }} + Marketing Intelligence. +