├── .gitignore ├── Config ├── Migration │ └── 1400686502_add_is_nocache.php ├── Schema │ ├── empty │ └── schema.php ├── seo.php.default └── sql │ └── install.sql ├── Console └── Command │ ├── SeoRedirectsShell.php │ └── SeoUrlsShell.php ├── Controller ├── Component │ ├── ABTestComponent.php │ └── BlackListComponent.php ├── SeoABTestsController.php ├── SeoAppController.php ├── SeoBlacklistsController.php ├── SeoCanonicalsController.php ├── SeoMetaTagsController.php ├── SeoRedirectsController.php ├── SeoStatusCodesController.php ├── SeoTitlesController.php ├── SeoUrisController.php └── SeoUrlsController.php ├── Lib ├── Error │ └── SeoAppError.php ├── SeoUtil.php └── empty ├── Model ├── Behavior │ └── empty ├── Datasource │ └── empty ├── SeoABTest.php ├── SeoAppModel.php ├── SeoBlacklist.php ├── SeoCanonical.php ├── SeoHoneypotVisit.php ├── SeoMetaTag.php ├── SeoRedirect.php ├── SeoSearchTerm.php ├── SeoStatusCode.php ├── SeoTitle.php ├── SeoUri.php └── SeoUrl.php ├── Test ├── Case │ ├── AppErrorTest.php │ ├── Controller │ │ ├── SeoBlacklistsControllerTest.php │ │ ├── SeoUrlsControllerTest.php │ │ └── empty │ ├── Model │ │ ├── SeoABTestTest.php │ │ ├── SeoBlacklistTest.php │ │ ├── SeoCanonicalTest.php │ │ ├── SeoHoneypotVisitTest.php │ │ ├── SeoMetaTagTest.php │ │ ├── SeoRedirectTest.php │ │ ├── SeoSearchTermTest.php │ │ ├── SeoStatusCodeTest.php │ │ ├── SeoTitleTest.php │ │ ├── SeoUriTest.php │ │ └── SeoUrlTest.php │ ├── View │ │ └── Helper │ │ │ ├── SeoHelperTest.php │ │ │ └── empty │ ├── behaviors │ │ └── empty │ ├── components │ │ ├── BlackListTest.php │ │ └── empty │ └── libs │ │ └── SeoUtilTest.php ├── Fixture │ ├── SeoABTestFixture.php │ ├── SeoBlacklistFixture.php │ ├── SeoCanonicalFixture.php │ ├── SeoHoneypotVisitFixture.php │ ├── SeoMetaTagFixture.php │ ├── SeoRedirectFixture.php │ ├── SeoSearchTermFixture.php │ ├── SeoStatusCodeFixture.php │ ├── SeoTitleFixture.php │ ├── SeoUriFixture.php │ ├── SeoUrlFixture.php │ ├── empty │ ├── seo_blacklist_fixture.php │ ├── seo_canonical_fixture.php │ ├── seo_honeypot_visit_fixture.php │ ├── seo_meta_tag_fixture.php │ ├── seo_redirect_fixture.php │ ├── seo_search_term_fixture.php │ ├── seo_status_code_fixture.php │ ├── seo_title_fixture.php │ ├── seo_uri_fixture.php │ └── seo_url_fixture.php └── groups │ └── empty ├── View ├── Elements │ ├── seo_actions.ctp │ ├── seo_admin_filter.ctp │ ├── seo_nav.ctp │ ├── seo_paging.ctp │ └── seo_view_head.ctp ├── Helper │ └── SeoHelper.php ├── SeoABTests │ ├── admin_add.ctp │ ├── admin_edit.ctp │ ├── admin_index.ctp │ └── admin_view.ctp ├── SeoBlacklists │ ├── admin_add.ctp │ ├── admin_edit.ctp │ ├── admin_index.ctp │ ├── admin_view.ctp │ └── banned.ctp ├── SeoCanonicals │ ├── admin_add.ctp │ ├── admin_edit.ctp │ ├── admin_index.ctp │ └── admin_view.ctp ├── SeoMetaTags │ ├── admin_add.ctp │ ├── admin_edit.ctp │ ├── admin_index.ctp │ └── admin_view.ctp ├── SeoRedirects │ ├── admin_add.ctp │ ├── admin_edit.ctp │ ├── admin_index.ctp │ └── admin_view.ctp ├── SeoStatusCodes │ ├── admin_add.ctp │ ├── admin_edit.ctp │ ├── admin_index.ctp │ └── admin_view.ctp ├── SeoTitles │ ├── admin_add.ctp │ ├── admin_edit.ctp │ ├── admin_index.ctp │ └── admin_view.ctp ├── SeoUris │ ├── admin_add.ctp │ ├── admin_edit.ctp │ ├── admin_index.ctp │ └── admin_view.ctp ├── SeoUrls │ ├── admin_add.ctp │ ├── admin_edit.ctp │ ├── admin_index.ctp │ └── admin_view.ctp ├── helpers │ └── empty └── layouts │ └── banned.ctp ├── composer.json ├── readme.markdown └── webroot ├── css └── seo_style.css ├── empty ├── img └── search_button.gif └── js └── clear_default.js /.gitignore: -------------------------------------------------------------------------------- 1 | tmp/* 2 | [Cc]onfig/core.php 3 | [Cc]onfig/database.php 4 | [Cc]onfig/environment.php 5 | app/tmp/* 6 | app/[Cc]onfig/core.php 7 | app/[Cc]onfig/database.php 8 | app/[Cc]onfig/environment.php 9 | app/webroot/coverage/* 10 | app/webroot/cache_js/* 11 | app/webroot/cache_css/* 12 | app/webroot/files/* 13 | !empty 14 | 15 | # application / coding temp files 16 | .sass-cache 17 | .phptidy-cache 18 | *.phptidybak~ 19 | *.un~ 20 | *.swp 21 | *.swo 22 | *.sublime-project 23 | *.sublime-workspace 24 | 25 | # OS files to ignore 26 | *.7z 27 | *.dmg 28 | *.gz 29 | *.iso 30 | *.jar 31 | *.rar 32 | *.tar 33 | *.zip 34 | *.com 35 | *.class 36 | *.dll 37 | *.exe 38 | *.o 39 | *.so 40 | *.log 41 | *.sql 42 | *.sqlite 43 | .DS_Store 44 | ._.DS_Store 45 | .DS_Store? 46 | ehthumbs.db 47 | Icon? 48 | Thumbs.db 49 | .svn 50 | .AppleDouble 51 | ._* 52 | 53 | *.tmproj 54 | /nbproject 55 | /nbproject/private/ 56 | -------------------------------------------------------------------------------- /Config/Migration/1400686502_add_is_nocache.php: -------------------------------------------------------------------------------- 1 | array( 20 | 'create_field' => array( 21 | 'seo_redirects' => array( 22 | 'is_nocache' => array('type' => 'boolean', 'null' => true, 'default' => 0), 23 | ), 24 | ), 25 | ), 26 | 'down' => array( 27 | 'drop_field' => array( 28 | 'seo_redirects' => array('is_nocache'), 29 | ), 30 | ), 31 | ); 32 | 33 | /** 34 | * Before migration callback 35 | * 36 | * @param string $direction, up or down direction of migration process 37 | * @return boolean Should process continue 38 | * @access public 39 | */ 40 | public function before($direction) { 41 | return true; 42 | } 43 | 44 | /** 45 | * After migration callback 46 | * 47 | * @param string $direction, up or down direction of migration process 48 | * @return boolean Should process continue 49 | * @access public 50 | */ 51 | public function after($direction) { 52 | return true; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Config/Schema/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/Config/Schema/empty -------------------------------------------------------------------------------- /Config/seo.php.default: -------------------------------------------------------------------------------- 1 | array( 9 | 'approverEmail' => 'nick@example.com', 10 | 'replyEmail' => 'noreply@example.com', 11 | 'emailConfig' => 'default', //config of your email, if false will use default CakeEmail() 12 | 'parentDomain' => 'http://www.example.com', 13 | 'aggressive' => true, //if false, log affenders for later review instead of autobanning 14 | 'triggerCount' => 2, 15 | 'timeBetweenTriggers' => 60 * 60 * 24, //seconds 16 | 'honeyPot' => array('admin' => false, 'plugin' => 'seo', 'controller' => 'seo_blacklists', 'action' => 'honeypot'), 17 | 'log' => true, 18 | 'cacheEngine' => false, // optionally cache things to save on DB requests - eg: 'default' 19 | 'searchTerms' => true, //turn on term finding 20 | 'levenshtein' => array( 21 | 'active' => false, 22 | 'threshold' => 5, //-1 to ALWAYS find the closest match 23 | 'cost_add' => 1, //cost to add a character, higher the amount the less you can add to find a match 24 | 'cost_change' => 1, //cost to change a character, higher the amount the less you can change to find a match 25 | 'cost_delete' => 1, //cost to delete a character, higher the ammount the less you can delete to find a match 26 | 'source' => '/sitemap.xml' //URL to list of urls in a sitemap 27 | ), 28 | 'abTesting' => array( 29 | 'category' => 'ABTest', //Category for your ABTesting in Google Analytics 30 | 'scope' => 3, //Scope for your ABTesting in Google Analytics 31 | 'slot' => 4, //Slot for your ABTesting in Google Analytics 32 | 'legacy' => false, //Uses Legacy verion of Google Analytics JS code pageTracker._setCustomVar(...) 33 | 'session' => true, //will use sessions to store tests for users who've already seen them. 34 | 'redmine' => false, //or the full URL if your redmine http://www.redmine-example.com/issues/ 35 | ), 36 | 'dnsPrefetch' => array( 37 | //Default prefixes Examples. make sure to start each one with // or http:// or https:// 38 | //'//use.typekit.net', 39 | //'//maps.google.com', 40 | //'//fonts.googleapis.com', 41 | //'//maps.googleapis.com', 42 | //'//www.google-analytics.com', 43 | //'//www.googletagmanager.com', 44 | ), 45 | ) 46 | ); 47 | -------------------------------------------------------------------------------- /Config/sql/install.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 3.3.7deb3build0.10.10.1 3 | -- http://www.phpmyadmin.net 4 | -- 5 | -- Host: localhost 6 | -- Generation Time: Feb 02, 2011 at 01:48 PM 7 | -- Server version: 5.1.49 8 | -- PHP Version: 5.3.3-1ubuntu9.3 9 | 10 | SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; 11 | 12 | -- -------------------------------------------------------- 13 | 14 | -- 15 | -- Table structure for table `seo_blacklists` 16 | -- 17 | 18 | CREATE TABLE IF NOT EXISTS `seo_blacklists` ( 19 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 20 | `ip_range_start` bigint(20) unsigned NOT NULL, 21 | `ip_range_end` bigint(20) unsigned NOT NULL, 22 | `note` text, 23 | `is_active` tinyint(1) NOT NULL DEFAULT '1', 24 | `created` datetime DEFAULT NULL, 25 | `modified` datetime DEFAULT NULL, 26 | PRIMARY KEY (`id`), 27 | KEY `ip_range_start` (`ip_range_start`), 28 | KEY `ip_range_end` (`ip_range_end`) 29 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 30 | 31 | -- -------------------------------------------------------- 32 | 33 | -- 34 | -- Table structure for table `seo_meta_tags` 35 | -- 36 | 37 | CREATE TABLE IF NOT EXISTS `seo_meta_tags` ( 38 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 39 | `seo_uri_id` int(11) NOT NULL, 40 | `name` varchar(255) DEFAULT NULL, 41 | `content` varchar(255) DEFAULT NULL, 42 | `is_http_equiv` tinyint(1) NOT NULL DEFAULT '0', 43 | `created` datetime DEFAULT NULL, 44 | `modified` datetime DEFAULT NULL, 45 | PRIMARY KEY (`id`), 46 | KEY `seo_uri_id` (`seo_uri_id`) 47 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 48 | 49 | -- -------------------------------------------------------- 50 | 51 | -- 52 | -- Table structure for table `seo_redirects` 53 | -- 54 | 55 | CREATE TABLE IF NOT EXISTS `seo_redirects` ( 56 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 57 | `seo_uri_id` int(11) NOT NULL, 58 | `redirect` varchar(255) DEFAULT NULL, 59 | `priority` int(11) NOT NULL DEFAULT '100', 60 | `is_active` tinyint(1) NOT NULL DEFAULT '1', 61 | `callback` varchar(255) DEFAULT NULL, 62 | `created` datetime DEFAULT NULL, 63 | `modified` datetime DEFAULT NULL, 64 | PRIMARY KEY (`id`), 65 | KEY `seo_uri_id` (`seo_uri_id`) 66 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 67 | 68 | -- -------------------------------------------------------- 69 | 70 | -- 71 | -- Table structure for table `seo_titles` 72 | -- 73 | 74 | CREATE TABLE IF NOT EXISTS `seo_titles` ( 75 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 76 | `seo_uri_id` int(11) unsigned NOT NULL, 77 | `title` varchar(255) NOT NULL, 78 | `created` datetime DEFAULT NULL, 79 | `modified` datetime DEFAULT NULL, 80 | PRIMARY KEY (`id`), 81 | KEY `seo_uri_id` (`seo_uri_id`) 82 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 83 | 84 | -- -------------------------------------------------------- 85 | 86 | -- 87 | -- Table structure for table `seo_uris` 88 | -- 89 | 90 | CREATE TABLE IF NOT EXISTS `seo_uris` ( 91 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 92 | `uri` varchar(255) DEFAULT NULL, 93 | `is_approved` tinyint(1) NOT NULL DEFAULT '1', 94 | `created` datetime DEFAULT NULL, 95 | `modified` datetime DEFAULT NULL, 96 | PRIMARY KEY (`id`), 97 | UNIQUE KEY `uri` (`uri`) 98 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 99 | 100 | -- 101 | -- Table structure for table `seo_honeypot_visits` 102 | -- 103 | 104 | CREATE TABLE IF NOT EXISTS `seo_honeypot_visits` ( 105 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 106 | `ip` bigint(20) unsigned NOT NULL, 107 | `created` datetime DEFAULT NULL, 108 | PRIMARY KEY (`id`) 109 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 110 | -------------------------------------------------------------------------------- /Console/Command/SeoUrlsShell.php: -------------------------------------------------------------------------------- 1 | out("SeoUrl Shell"); 7 | $this->hr(); 8 | $this->help(); 9 | } 10 | 11 | function help(){ 12 | $this->out(" cake seo_urls import Import from the source in config"); 13 | $this->out(" cake seo_urls add Add a url to use as levenshtien"); 14 | } 15 | 16 | function import(){ 17 | $this->out("Importing."); 18 | $count = $this->SeoUrl->import(null, true, true); 19 | $this->out(); 20 | $this->out("Import finished. $count Imported."); 21 | } 22 | 23 | function add(){ 24 | $url = array_shift($this->args); 25 | $priority = array_shift($this->args); 26 | if(!$url){ 27 | $this->errorAndExit("Url not set, please set a url."); 28 | } 29 | if(!$priority){ 30 | $this->errorAndExit("Priority not set, please set a priority.\n\n cake seo_urls add $url 1"); 31 | } 32 | $save_data = array( 33 | 'url' => $url, 34 | 'priority' => $priority 35 | ); 36 | if($this->SeoUrl->hasAny(array('SeoUrl.url' => $url))){ 37 | $save_data['id'] = $this->SeoUrl->field('id', array('SeoUrl.url' => $url)); 38 | } 39 | $this->SeoUrl->clear(); 40 | if($this->SeoUrl->save($save_data)){ 41 | $this->out("$url $priority added."); 42 | } 43 | else { 44 | $this->out("Errors"); 45 | print_r($this->SeoUrl->validationErrors); 46 | $this->out(); 47 | } 48 | } 49 | /** 50 | * Private method to output the error and exit(1) 51 | * @param string message to output 52 | * @return void 53 | * @access private 54 | */ 55 | protected function errorAndExit($message) { 56 | $this->out("Error: $message"); 57 | exit(1); 58 | } 59 | } 60 | ?> -------------------------------------------------------------------------------- /Controller/Component/ABTestComponent.php: -------------------------------------------------------------------------------- 1 | ABTest = null; 16 | CakeSession::delete('Seo.ABTests'); 17 | } 18 | 19 | /** 20 | * Find, setup, and get the AB test, if we're using Sessions setup in the config, look at that first. 21 | * @param array of options 22 | * - debug (if true, will always return the test even if it's not active, and regardless of roll) 23 | * - return (test|roll|both) default test. 24 | * - refresh (will preform the search as normal without the cached test result) default false 25 | * @return mixed array test if found and rolled, or boolean depending on return option. 26 | */ 27 | public function getTest($options = array()){ 28 | $options = array_merge(array( 29 | 'debug' => false, 30 | 'return' => 'test', 31 | 'refresh' => false, 32 | ), (array) $options); 33 | 34 | $retval = array( 35 | 'test' => false, 36 | 'roll' => false, 37 | ); 38 | 39 | if(!$options['refresh'] && $this->test){ 40 | return $this->test; 41 | } 42 | 43 | $this->loadModel('SeoABTest'); 44 | if($test = $this->SeoABTest->findTestByUri(null, $options['debug'])){ 45 | if($this->SeoABTest->isTestable($test)){ 46 | $retval['test'] = $test; 47 | if(SeoUtil::getConfig('abTesting.session')){ 48 | $ab_tests = CakeSession::check('Seo.ABTests') ? CakeSession::read('Seo.ABTests') : array(); 49 | } else { 50 | $ab_tests = array(); 51 | } 52 | if(is_array($ab_tests) && isset($ab_tests[$test['SeoABTest']['id']])) { 53 | $retval['roll'] = !!($ab_tests[$test['SeoABTest']['id']]); 54 | } elseif($options['debug'] || $this->SeoABTest->roll($test)) { 55 | $ab_tests[$test['SeoABTest']['id']] = $test; 56 | $retval['roll'] = true; 57 | } else { 58 | $ab_tests[$test['SeoABTest']['id']] = false; 59 | $retval['roll'] = false; 60 | } 61 | if(SeoUtil::getConfig('abTesting.session')){ 62 | CakeSession::write('Seo.ABTests', $ab_tests); 63 | } 64 | $this->test = $retval; 65 | } 66 | } 67 | 68 | switch($options['return']){ 69 | case 'test' : return $retval['test']; 70 | case 'roll' : return $retval['roll']; 71 | default : return $retval; 72 | } 73 | } 74 | 75 | /** 76 | * Load a plugin model 77 | * @param string modelname 78 | * @return void 79 | */ 80 | private function loadModel($model = null){ 81 | if($model && $this->$model == null){ 82 | $this->$model = ClassRegistry::init("Seo.$model"); 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /Controller/Component/BlackListComponent.php: -------------------------------------------------------------------------------- 1 | false, 'plugin' => 'seo', 'controller' => 'seo_blacklists', 'action' => 'banned'); 9 | 10 | /** 11 | * CakePHP based URL to the honeypot action setup in config 12 | */ 13 | var $honeyPot = null; 14 | 15 | /** 16 | * Error log 17 | */ 18 | var $errors = array(); 19 | 20 | /** 21 | * Placeholder for the SeoBlacklist Model 22 | */ 23 | var $SeoBlacklist = null; 24 | 25 | /** 26 | * Placeholder for the SeoHoneypotVisit Model 27 | */ 28 | var $SeoHoneypotVisit = null; 29 | 30 | /** 31 | * Initialize the component, set the settings 32 | */ 33 | function initialize(&$controller, $settings = array()){ 34 | $this->Controller = $controller; 35 | $this->_set($settings); 36 | $this->honeyPot = SeoUtil::getConfig('honeyPot'); 37 | 38 | if(!$this->__isBanned()){ 39 | $this->__handleIfHoneyPot(); 40 | } 41 | } 42 | 43 | /** 44 | * Handle the banned user, decide if banned, 45 | * if so, redirect the user. 46 | */ 47 | function __isBanned(){ 48 | $this->loadModel('SeoBlacklist'); 49 | if($this->SeoBlacklist->isBanned()){ 50 | if($this->Controller->here != Router::url($this->redirect)){ 51 | $this->Controller->redirect($this->redirect); 52 | } 53 | return true; 54 | } 55 | return false; 56 | } 57 | 58 | /** 59 | * Handle if honeypot action. 60 | */ 61 | function __handleIfHoneyPot(){ 62 | if($this->Controller->here == Router::url($this->honeyPot)){ 63 | $this->loadModel('SeoHoneypotVisit'); 64 | $this->SeoHoneypotVisit->add(); 65 | if($this->SeoHoneypotVisit->isTriggered()){ 66 | $this->SeoBlacklist->addToBanned(); 67 | $this->isBanned(); 68 | } else { 69 | $this->Controller->redirect('/'); 70 | } 71 | } 72 | } 73 | 74 | /** 75 | * Load a plugin model 76 | * @param string modelname 77 | * @return void 78 | */ 79 | private function loadModel($model = null){ 80 | if($model && $this->$model == null){ 81 | App::import('Model',"Seo.$model"); 82 | $this->$model = ClassRegistry::init("Seo.$model"); 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /Controller/SeoABTestsController.php: -------------------------------------------------------------------------------- 1 | 'SeoABTest.created DESC' 9 | ); 10 | 11 | function beforeFilter(){ 12 | parent::beforeFilter(); 13 | $this->set('slots', $this->SeoABTest->slots); 14 | } 15 | 16 | function admin_index($filter = null) { 17 | if(!empty($this->data)){ 18 | $filter = $this->data['SeoABTest']['filter']; 19 | } 20 | $conditions = $this->SeoABTest->generateFilterConditions($filter); 21 | $this->set('seoABTests',$this->paginate($conditions)); 22 | $this->set('filter', $filter); 23 | } 24 | 25 | function admin_view($id = null) { 26 | if (!$id) { 27 | $this->Session->setFlash(__('Invalid seo AB Test')); 28 | $this->redirect(array('action' => 'index')); 29 | } 30 | $this->set('seoABTest', $this->SeoABTest->read(null, $id)); 31 | $this->set('id', $id); 32 | } 33 | 34 | function admin_add() { 35 | if (!empty($this->data)) { 36 | $this->SeoABTest->clear(); 37 | if ($this->SeoABTest->save($this->data)) { 38 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 39 | $this->Session->setFlash(__('The seo AB Test has been saved'), $goodFlash); 40 | $this->redirect(array('action' => 'index')); 41 | } else { 42 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 43 | $this->Session->setFlash(__('The seo AB Test could not be saved. Please, try again.'), $badFlash); 44 | } 45 | } 46 | } 47 | 48 | function admin_edit($id = null) { 49 | if (!$id && empty($this->data)) { 50 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 51 | $this->Session->setFlash(__('Invalid seo AB Test'), $badFlash); 52 | $this->redirect(array('action' => 'index')); 53 | } 54 | if (!empty($this->data)) { 55 | if ($this->SeoABTest->save($this->data)) { 56 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 57 | $this->Session->setFlash(__('The seo AB Test has been saved'), $goodFlash); 58 | $this->redirect(array('action' => 'index')); 59 | } else { 60 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 61 | $this->Session->setFlash(__('The seo AB Test could not be saved. Please, try again.'), $badFlash); 62 | } 63 | } 64 | if (empty($this->data)) { 65 | $this->data = $this->SeoABTest->read(null, $id); 66 | } 67 | $this->set('id', $id); 68 | } 69 | 70 | function admin_delete($id = null) { 71 | if (!$id) { 72 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 73 | $this->Session->setFlash(__('Invalid id for seo AB Test'), $badFlash); 74 | $this->redirect(array('action'=>'index')); 75 | } 76 | if ($this->SeoABTest->delete($id)) { 77 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 78 | $this->Session->setFlash(__('Seo AB Test deleted'), $goodFlash); 79 | $this->redirect(array('action'=>'index')); 80 | } 81 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 82 | $this->Session->setFlash(__('Seo AB Test was not deleted'), $badFlash); 83 | $this->redirect(array('action' => 'index')); 84 | } 85 | } 86 | ?> -------------------------------------------------------------------------------- /Controller/SeoAppController.php: -------------------------------------------------------------------------------- 1 | Auth)){ 10 | $this->Auth->allow('banned'); 11 | } 12 | } 13 | 14 | /** 15 | * Banned action 16 | */ 17 | function banned(){ 18 | $this->layout = 'banned'; 19 | } 20 | 21 | /** 22 | * Admin actions 23 | */ 24 | function admin_index($filter = null) { 25 | if(!empty($this->data)){ 26 | $filter = $this->data['Location']['filter']; 27 | } 28 | $conditions = $this->SeoBlacklist->generateFilterConditions($filter); 29 | $this->set('seoBlacklists',$this->paginate($conditions)); 30 | $this->set('filter', $filter); 31 | } 32 | 33 | function admin_view($id = null) { 34 | if (!$id) { 35 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 36 | $this->Session->setFlash(__('Invalid seo blacklist'), $badFlash); 37 | $this->redirect(array('action' => 'index')); 38 | } 39 | $this->set('seoBlacklist', $this->SeoBlacklist->read(null, $id)); 40 | $this->set('id', $id); 41 | } 42 | 43 | function admin_add() { 44 | if (!empty($this->data)) { 45 | $this->SeoBlacklist->clear(); 46 | if ($this->SeoBlacklist->save($this->data)) { 47 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 48 | $this->Session->setFlash(__('The seo blacklist has been saved'), $goodFlash); 49 | $this->redirect(array('action' => 'index')); 50 | } else { 51 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 52 | $this->Session->setFlash(__('The seo blacklist could not be saved. Please, try again.'), $badFlash); 53 | } 54 | } 55 | } 56 | 57 | function admin_edit($id = null) { 58 | if (!$id && empty($this->data)) { 59 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 60 | $this->Session->setFlash(__('Invalid seo blacklist'), $badFlash); 61 | $this->redirect(array('action' => 'index')); 62 | } 63 | if (!empty($this->data)) { 64 | if ($this->SeoBlacklist->save($this->data)) { 65 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 66 | $this->Session->setFlash(__('The seo blacklist has been saved'), $goodFlash); 67 | $this->redirect(array('action' => 'index')); 68 | } else { 69 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 70 | $this->Session->setFlash(__('The seo blacklist could not be saved. Please, try again.'), $badFlash); 71 | } 72 | } 73 | if (empty($this->data)) { 74 | $this->data = $this->SeoBlacklist->read(null, $id); 75 | } 76 | $this->set('id', $id); 77 | } 78 | 79 | function admin_delete($id = null) { 80 | if (!$id) { 81 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 82 | $this->Session->setFlash(__('Invalid id for seo blacklist'), $badFlash); 83 | $this->redirect(array('action'=>'index')); 84 | } 85 | if ($this->SeoBlacklist->delete($id)) { 86 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 87 | $this->Session->setFlash(__('Seo blacklist deleted'), $goodFlash); 88 | $this->redirect(array('action'=>'index')); 89 | } 90 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 91 | $this->Session->setFlash(__('Seo blacklist was not deleted'), $badFlash); 92 | $this->redirect(array('action' => 'index')); 93 | } 94 | } 95 | ?> -------------------------------------------------------------------------------- /Controller/SeoCanonicalsController.php: -------------------------------------------------------------------------------- 1 | data)){ 10 | $filter = $this->data['SeoCanonical']['filter']; 11 | } 12 | $conditions = $this->SeoCanonical->generateFilterConditions($filter); 13 | $this->set('seoCanonicals',$this->paginate($conditions)); 14 | $this->set('filter', $filter); 15 | } 16 | 17 | function admin_view($id = null) { 18 | if (!$id) { 19 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 20 | $this->Session->setFlash(__('Invalid seo canonical'), $badFlash); 21 | $this->redirect(array('action' => 'index')); 22 | } 23 | $this->set('seoCanonical', $this->SeoCanonical->read(null, $id)); 24 | $this->set('id', $id); 25 | } 26 | 27 | function admin_add() { 28 | if (!empty($this->data)) { 29 | $this->SeoCanonical->clear(); 30 | if ($this->SeoCanonical->save($this->data)) { 31 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 32 | $this->Session->setFlash(__('The seo canonical has been saved'), $goodFlash); 33 | $this->redirect(array('action' => 'index')); 34 | } else { 35 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 36 | $this->Session->setFlash(__('The seo canonical could not be saved. Please, try again.'), $badFlash); 37 | } 38 | } 39 | } 40 | 41 | function admin_edit($id = null) { 42 | if (!$id && empty($this->data)) { 43 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 44 | $this->Session->setFlash(__('Invalid seo canonical'), $badFlash); 45 | $this->redirect(array('action' => 'index')); 46 | } 47 | if (!empty($this->data)) { 48 | if ($this->SeoCanonical->save($this->data)) { 49 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 50 | $this->Session->setFlash(__('The seo canonical has been saved'), $goodFlash); 51 | $this->redirect(array('action' => 'index')); 52 | } else { 53 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 54 | $this->Session->setFlash(__('The seo canonical could not be saved. Please, try again.'), $badFlash); 55 | } 56 | } 57 | if (empty($this->data)) { 58 | $this->data = $this->SeoCanonical->read(null, $id); 59 | } 60 | $this->set('id', $id); 61 | } 62 | 63 | function admin_delete($id = null) { 64 | if (!$id) { 65 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 66 | $this->Session->setFlash(__('Invalid id for seo canonical'), $badFlash); 67 | $this->redirect(array('action'=>'index')); 68 | } 69 | if ($this->SeoCanonical->delete($id)) { 70 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 71 | $this->Session->setFlash(__('Seo canonical deleted'), $goodFlash); 72 | $this->redirect(array('action'=>'index')); 73 | } 74 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 75 | $this->Session->setFlash(__('Seo canonical was not deleted'), $badFlash); 76 | $this->redirect(array('action' => 'index')); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Controller/SeoMetaTagsController.php: -------------------------------------------------------------------------------- 1 | data)){ 9 | $filter = $this->data['SeoMetaTag']['filter']; 10 | } 11 | $conditions = $this->SeoMetaTag->generateFilterConditions($filter); 12 | $this->set('seoMetaTags',$this->paginate($conditions)); 13 | $this->set('filter', $filter); 14 | } 15 | 16 | function admin_view($id = null) { 17 | if (!$id) { 18 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 19 | $this->Session->setFlash(__('Invalid seo meta tag'), $badFlash); 20 | $this->redirect(array('action' => 'index')); 21 | } 22 | $this->set('seoMetaTag', $this->SeoMetaTag->read(null, $id)); 23 | $this->set('id', $id); 24 | } 25 | 26 | function admin_add() { 27 | if (!empty($this->data)) { 28 | $this->SeoMetaTag->clear(); 29 | if ($this->SeoMetaTag->save($this->data)) { 30 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 31 | $this->Session->setFlash(__('The seo meta tag has been saved'), $goodFlash); 32 | $this->redirect(array('action' => 'index')); 33 | } else { 34 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 35 | $this->Session->setFlash(__('The seo meta tag could not be saved. Please, try again.'), $badFlash); 36 | } 37 | } 38 | } 39 | 40 | function admin_edit($id = null) { 41 | if (!$id && empty($this->data)) { 42 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 43 | $this->Session->setFlash(__('Invalid seo meta tag'), $badFlash); 44 | $this->redirect(array('action' => 'index')); 45 | } 46 | if (!empty($this->data)) { 47 | if ($this->SeoMetaTag->save($this->data)) { 48 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 49 | $this->Session->setFlash(__('The seo meta tag has been saved'), $goodFlash); 50 | $this->redirect(array('action' => 'index')); 51 | } else { 52 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 53 | $this->Session->setFlash(__('The seo meta tag could not be saved. Please, try again.'), $badFlash); 54 | } 55 | } 56 | if (empty($this->data)) { 57 | $this->data = $this->SeoMetaTag->read(null, $id); 58 | } 59 | $this->set('id', $id); 60 | } 61 | 62 | function admin_delete($id = null) { 63 | if (!$id) { 64 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 65 | $this->Session->setFlash(__('Invalid id for seo meta tag'), $badFlash); 66 | $this->redirect(array('action'=>'index')); 67 | } 68 | if ($this->SeoMetaTag->delete($id)) { 69 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 70 | $this->Session->setFlash(__('Seo meta tag deleted'), $goodFlash); 71 | $this->redirect(array('action'=>'index')); 72 | } 73 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 74 | $this->Session->setFlash(__('Seo meta tag was not deleted'), $badFlash); 75 | $this->redirect(array('action' => 'index')); 76 | } 77 | } 78 | ?> -------------------------------------------------------------------------------- /Controller/SeoRedirectsController.php: -------------------------------------------------------------------------------- 1 | data)){ 9 | $filter = $this->data['SeoRedirect']['filter']; 10 | } 11 | $conditions = $this->SeoRedirect->generateFilterConditions($filter); 12 | $this->set('seoRedirects',$this->paginate($conditions)); 13 | $this->set('filter', $filter); 14 | } 15 | 16 | function admin_view($id = null) { 17 | if (!$id) { 18 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 19 | $this->Session->setFlash(__('Invalid seo redirect'), $badFlash); 20 | $this->redirect(array('action' => 'index')); 21 | } 22 | $this->set('seoRedirect', $this->SeoRedirect->read(null, $id)); 23 | $this->set('id', $id); 24 | } 25 | 26 | function admin_add() { 27 | if (!empty($this->data)) { 28 | $this->SeoRedirect->clear(); 29 | if ($this->SeoRedirect->save($this->data)) { 30 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 31 | $this->Session->setFlash(__('The seo redirect has been saved'), $goodFlash); 32 | $this->redirect(array('action' => 'index')); 33 | } else { 34 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 35 | $this->Session->setFlash(__('The seo redirect could not be saved. Please, try again.'), $badFlash); 36 | } 37 | } 38 | } 39 | 40 | function admin_edit($id = null) { 41 | if (!$id && empty($this->data)) { 42 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 43 | $this->Session->setFlash(__('Invalid seo redirect'), $badFlash); 44 | $this->redirect(array('action' => 'index')); 45 | } 46 | if (!empty($this->data)) { 47 | if ($this->SeoRedirect->save($this->data)) { 48 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 49 | $this->Session->setFlash(__('The seo redirect has been saved'), $goodFlash); 50 | $this->redirect(array('action' => 'index')); 51 | } else { 52 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 53 | $this->Session->setFlash(__('The seo redirect could not be saved. Please, try again.'), $badFlash); 54 | } 55 | } 56 | if (empty($this->data)) { 57 | $this->data = $this->SeoRedirect->read(null, $id); 58 | } 59 | $this->set('id', $id); 60 | } 61 | 62 | function admin_delete($id = null) { 63 | if (!$id) { 64 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 65 | $this->Session->setFlash(__('Invalid id for seo redirect'), $badFlash); 66 | $this->redirect(array('action'=>'index')); 67 | } 68 | if ($this->SeoRedirect->delete($id)) { 69 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 70 | $this->Session->setFlash(__('Seo redirect deleted'), $goodFlash); 71 | $this->redirect(array('action'=>'index')); 72 | } 73 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 74 | $this->Session->setFlash(__('Seo redirect was not deleted'), $badFlash); 75 | $this->redirect(array('action' => 'index')); 76 | } 77 | } 78 | ?> -------------------------------------------------------------------------------- /Controller/SeoStatusCodesController.php: -------------------------------------------------------------------------------- 1 | data)){ 9 | $filter = $this->data['SeoStatusCode']['filter']; 10 | } 11 | $conditions = $this->SeoStatusCode->generateFilterConditions($filter); 12 | $this->set('seoStatusCodes',$this->paginate($conditions)); 13 | $this->set('filter', $filter); 14 | } 15 | 16 | function admin_view($id = null) { 17 | if (!$id) { 18 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 19 | $this->Session->setFlash(__('Invalid seo status code'), $badFlash); 20 | $this->redirect(array('action' => 'index')); 21 | } 22 | $this->set('seoStatusCode', $this->SeoStatusCode->read(null, $id)); 23 | $this->set('id', $id); 24 | } 25 | 26 | function admin_add() { 27 | if (!empty($this->data)) { 28 | $this->SeoStatusCode->clear(); 29 | if ($this->SeoStatusCode->save($this->data)) { 30 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 31 | $this->Session->setFlash(__('The seo status code has been saved'), $goodFlash); 32 | $this->redirect(array('action' => 'index')); 33 | } else { 34 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 35 | $this->Session->setFlash(__('The seo status code could not be saved. Please, try again.'), $badFlash); 36 | } 37 | } 38 | $this->set('status_codes', $this->SeoStatusCode->findCodeList()); 39 | } 40 | 41 | function admin_edit($id = null) { 42 | if (!$id && empty($this->data)) { 43 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 44 | $this->Session->setFlash(__('Invalid seo status code'), $badFlash); 45 | $this->redirect(array('action' => 'index')); 46 | } 47 | if (!empty($this->data)) { 48 | if ($this->SeoStatusCode->save($this->data)) { 49 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 50 | $this->Session->setFlash(__('The seo status code has been saved'), $goodFlash); 51 | $this->redirect(array('action' => 'index')); 52 | } else { 53 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 54 | $this->Session->setFlash(__('The seo status code could not be saved. Please, try again.'), $badFlash); 55 | } 56 | } 57 | if (empty($this->data)) { 58 | $this->data = $this->SeoStatusCode->read(null, $id); 59 | } 60 | $this->set('status_codes', $this->SeoStatusCode->findCodeList()); 61 | $this->set('id', $id); 62 | } 63 | 64 | function admin_delete($id = null) { 65 | if (!$id) { 66 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 67 | $this->Session->setFlash(__('Invalid id for seo status code'), $badFlash); 68 | $this->redirect(array('action'=>'index')); 69 | } 70 | if ($this->SeoStatusCode->delete($id)) { 71 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 72 | $this->Session->setFlash(__('Seo status code deleted'), $goodFlash); 73 | $this->redirect(array('action'=>'index')); 74 | } 75 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 76 | $this->Session->setFlash(__('Seo status code was not deleted'), $badFlash); 77 | $this->redirect(array('action' => 'index')); 78 | } 79 | } 80 | ?> -------------------------------------------------------------------------------- /Controller/SeoTitlesController.php: -------------------------------------------------------------------------------- 1 | data)){ 9 | $filter = $this->data['SeoTitle']['filter']; 10 | } 11 | $conditions = $this->SeoTitle->generateFilterConditions($filter); 12 | $this->set('seoTitles',$this->paginate($conditions)); 13 | $this->set('filter', $filter); 14 | } 15 | 16 | function admin_view($id = null) { 17 | if (!$id) { 18 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 19 | $this->Session->setFlash(__('Invalid seo title'), $badFlash); 20 | $this->redirect(array('action' => 'index')); 21 | } 22 | $this->set('seoTitle', $this->SeoTitle->read(null, $id)); 23 | $this->set('id', $id); 24 | } 25 | 26 | function admin_add() { 27 | if (!empty($this->data)) { 28 | $this->SeoTitle->clear(); 29 | if ($this->SeoTitle->save($this->data)) { 30 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 31 | $this->Session->setFlash(__('The seo title has been saved'), $goodFlash); 32 | $this->redirect(array('action' => 'index')); 33 | } else { 34 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 35 | $this->Session->setFlash(__('The seo title could not be saved. Please, try again.'), $badFlash); 36 | } 37 | } 38 | $seoUris = $this->SeoTitle->SeoUri->find('list'); 39 | $this->set(compact('seoUris')); 40 | } 41 | 42 | function admin_edit($id = null) { 43 | if (!$id && empty($this->data)) { 44 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 45 | $this->Session->setFlash(__('Invalid seo title'), $badFlash); 46 | $this->redirect(array('action' => 'index')); 47 | } 48 | if (!empty($this->data)) { 49 | if ($this->SeoTitle->save($this->data)) { 50 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 51 | $this->Session->setFlash(__('The seo title has been saved'), $goodFlash); 52 | $this->redirect(array('action' => 'index')); 53 | } else { 54 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 55 | $this->Session->setFlash(__('The seo title could not be saved. Please, try again.'), $badFlash); 56 | } 57 | } 58 | if (empty($this->data)) { 59 | $this->data = $this->SeoTitle->read(null, $id); 60 | } 61 | $seoUris = $this->SeoTitle->SeoUri->find('list'); 62 | $this->set(compact('seoUris')); 63 | $this->set('id', $id); 64 | } 65 | 66 | function admin_delete($id = null) { 67 | if (!$id) { 68 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 69 | $this->Session->setFlash(__('Invalid id for seo title'), $badFlash); 70 | $this->redirect(array('action'=>'index')); 71 | } 72 | if ($this->SeoTitle->delete($id)) { 73 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 74 | $this->Session->setFlash(__('Seo title deleted'), $goodFlash); 75 | $this->redirect(array('action'=>'index')); 76 | } 77 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 78 | $this->Session->setFlash(__('Seo title was not deleted'), $badFlash); 79 | $this->redirect(array('action' => 'index')); 80 | } 81 | } 82 | ?> -------------------------------------------------------------------------------- /Controller/SeoUrisController.php: -------------------------------------------------------------------------------- 1 | request->data['SeoMetaTag'] as $key => $metatag){ 10 | if(isset($metatag['name']) && empty($metatag['name'])){ 11 | unset($this->request->data['SeoMetaTag'][$key]); 12 | } 13 | } 14 | if(empty($this->request->data['SeoMetaTag'])){ 15 | unset($this->request->data['SeoMetaTag']); 16 | } 17 | if(isset($this->request->data['SeoTitle']['title']) && empty($this->request->data['SeoTitle']['title'])){ 18 | unset($this->request->data['SeoTitle']); 19 | } 20 | } 21 | 22 | function admin_index($filter = null) { 23 | if(!empty($this->request->data)){ 24 | $filter = $this->request->data['SeoUri']['filter']; 25 | } 26 | $conditions = $this->SeoUri->generateFilterConditions($filter); 27 | $this->set('seoUris',$this->paginate($conditions)); 28 | $this->set('filter', $filter); 29 | } 30 | 31 | function admin_urlencode($id = null){ 32 | if($this->SeoUri->urlEncode($id)){ 33 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 34 | $this->Session->setFlash("uri Successfully Url Encoded.", $goodFlash); 35 | } 36 | else { 37 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 38 | $this->Session->setFlash("Erorr URL Encoding uri", $badFlash); 39 | } 40 | $this->redirect(array('action' => 'edit', $id)); 41 | } 42 | 43 | function admin_view($id = null) { 44 | if (!$id) { 45 | $this->Session->setFlash(__('Invalid seo uri')); 46 | $this->redirect(array('action' => 'index')); 47 | } 48 | $this->set('seoUri', $this->SeoUri->findForViewById($id)); 49 | $this->set('id', $id); 50 | } 51 | 52 | function admin_add() { 53 | if (!empty($this->request->data)) { 54 | $this->SeoUri->clear(); 55 | $this->clearAssociatesIfEmpty(); 56 | if ($this->SeoUri->saveAll($this->request->data)) { 57 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 58 | $this->Session->setFlash(__('The seo uri has been saved'), $goodFlash); 59 | $this->redirect(array('action' => 'index')); 60 | } else { 61 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 62 | $this->Session->setFlash(__('The seo uri could not be saved. Please, try again.'), $badFlash); 63 | } 64 | } 65 | } 66 | 67 | function admin_edit($id = null) { 68 | if (!$id && empty($this->request->data)) { 69 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 70 | $this->Session->setFlash(__('Invalid seo uri'), $badFlash); 71 | $this->redirect(array('action' => 'index')); 72 | } 73 | if (!empty($this->request->data)) { 74 | $this->clearAssociatesIfEmpty(); 75 | if ($this->SeoUri->save($this->request->data)) { 76 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 77 | $this->Session->setFlash(__('The seo uri has been saved'), $goodFlash); 78 | $this->redirect(array('action' => 'index')); 79 | } else { 80 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 81 | $this->Session->setFlash(__('The seo uri could not be saved. Please, try again.'), $badFlash); 82 | } 83 | } 84 | if (empty($this->request->data)) { 85 | $this->request->data = $this->SeoUri->findForViewById($id); 86 | } 87 | $this->set('status_codes', $this->SeoUri->SeoStatusCode->findCodeList()); 88 | $this->set('id', $id); 89 | } 90 | 91 | function admin_delete($id = null) { 92 | if (!$id) { 93 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 94 | $this->Session->setFlash(__('Invalid id for seo uri'), $badFlash); 95 | $this->redirect(array('action'=>'index')); 96 | } 97 | if ($this->SeoUri->delete($id)) { 98 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 99 | $this->Session->setFlash(__('Seo uri deleted'), $goodFlash); 100 | $this->redirect(array('action'=>'index')); 101 | } 102 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 103 | $this->Session->setFlash(__('Seo uri was not deleted')); 104 | $this->redirect(array('action' => 'index'), $badFlash); 105 | } 106 | 107 | function admin_approve($id = null){ 108 | if(!$id) { 109 | $this->Session->setFlash(__('Invalid id for seo uri')); 110 | } 111 | elseif($this->SeoUri->setApproved($id)) { 112 | $this->Session->setFlash(__('Seo Uri approved')); 113 | } 114 | $this->redirect(array('admin' => true, 'action' => 'index')); 115 | } 116 | } 117 | ?> 118 | -------------------------------------------------------------------------------- /Controller/SeoUrlsController.php: -------------------------------------------------------------------------------- 1 | data)){ 8 | $filter = $this->data['SeoUrl']['filter']; 9 | } 10 | $conditions = $this->SeoUrl->generateFilterConditions($filter); 11 | $this->set('seoUrls',$this->paginate($conditions)); 12 | $this->set('filter', $filter); 13 | } 14 | 15 | function admin_view($id = null) { 16 | if (!$id) { 17 | $this->Session->setFlash(__('Invalid seo url')); 18 | $this->redirect(array('action' => 'index')); 19 | } 20 | $this->set('seoUri', $this->SeoUrl->findById($id)); 21 | $this->set('id', $id); 22 | } 23 | 24 | function admin_add() { 25 | if (!empty($this->data)) { 26 | $this->SeoUrl->clear(); 27 | if ($this->SeoUrl->saveAll($this->data)) { 28 | $this->Session->setFlash(__('The seo url has been saved')); 29 | $this->redirect(array('action' => 'index')); 30 | } else { 31 | $this->Session->setFlash(__('The seo url could not be saved. Please, try again.')); 32 | } 33 | } 34 | } 35 | 36 | function admin_edit($id = null) { 37 | if (!$id && empty($this->data)) { 38 | $this->Session->setFlash(__('Invalid seo url')); 39 | $this->redirect(array('action' => 'index')); 40 | } 41 | if (!empty($this->data)) { 42 | if ($this->SeoUrl->save($this->data)) { 43 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 44 | $this->Session->setFlash(__('The seo url has been saved'), $goodFlash); 45 | $this->redirect(array('action' => 'index')); 46 | } else { 47 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 48 | $this->Session->setFlash(__('The seo url could not be saved. Please, try again.'), $badFlash); 49 | } 50 | } 51 | if (empty($this->data)) { 52 | $this->data = $this->SeoUrl->findById($id); 53 | } 54 | $this->set('id', $id); 55 | } 56 | 57 | function admin_delete($id = null) { 58 | if (!$id) { 59 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 60 | $this->Session->setFlash(__('Invalid id for seo url'), $badFlash); 61 | $this->redirect(array('action'=>'index')); 62 | } 63 | if ($this->SeoUrl->delete($id)) { 64 | $goodFlash = $this->_getViewObject()->elementExists('goodFlash') ? 'goodFlash' : 'default'; 65 | $this->Session->setFlash(__('Seo url deleted'), $goodFlash); 66 | $this->redirect(array('action'=>'index')); 67 | } 68 | $badFlash = $this->_getViewObject()->elementExists('badFlash') ? 'badFlash' : 'default'; 69 | $this->Session->setFlash(__('Seo url was not deleted'), $badFlash); 70 | $this->redirect(array('action' => 'index')); 71 | } 72 | 73 | function admin_approve($id = null){ 74 | if(!$id) { 75 | $this->Session->setFlash(__('Invalid id for seo url')); 76 | } 77 | elseif($this->SeoUrl->setApproved($id)) { 78 | $this->Session->setFlash(__('Seo Uri approved')); 79 | } 80 | $this->redirect(array('admin' => true, 'action' => 'index')); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Lib/SeoUtil.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'numeric' => array( 8 | 'rule' => array('isIp'), 9 | 'message' => 'Please specify a valid IP start range', 10 | ), 11 | ), 12 | 'ip_range_end' => array( 13 | 'numeric' => array( 14 | 'rule' => array('isIp'), 15 | 'message' => 'Please specify a valid IP end range', 16 | ), 17 | ), 18 | ); 19 | 20 | /** 21 | * Fields to IP 22 | */ 23 | var $fieldsToLong = array( 24 | 'ip_range_start', 25 | 'ip_range_end' 26 | ); 27 | 28 | var $searchFields = array('SeoBlacklist.note'); 29 | 30 | /** 31 | * Add the IP to the banned list. 32 | * @param string ip to ban 33 | * @param string note to add to this ban 34 | * @return boolean success of save 35 | */ 36 | function addToBanned($ip = null, $note = "AutoBanned", $is_active = null){ 37 | if(!$ip){ 38 | $ip = $this->getIpFromServer(); 39 | } 40 | 41 | if($is_active === null){ 42 | $is_active = SeoUtil::getConfig('aggressive'); 43 | } 44 | 45 | return $this->save(array( 46 | $this->alias => array( 47 | 'ip_range_start' => $ip, 48 | 'ip_range_end' => $ip, 49 | 'note' => $note, 50 | 'is_active' => $is_active 51 | ) 52 | )); 53 | } 54 | 55 | /** 56 | * Return true depending on the incomming IP 57 | * @param string $ip to check if banned 58 | * @return boolean true or false 59 | */ 60 | function isBanned($ip = null){ 61 | if(!$ip){ 62 | $ip = $this->getIpFromServer(); 63 | } 64 | $ip_query = is_numeric($ip) ? $ip : ip2long($ip); 65 | 66 | //Check if exists in blacklist 67 | return $this->hasAny(array( 68 | "{$this->alias}.ip_range_start <=" => $ip_query, 69 | "{$this->alias}.ip_range_end >=" => $ip_query, 70 | "{$this->alias}.is_active" => true 71 | )); 72 | } 73 | 74 | } 75 | ?> -------------------------------------------------------------------------------- /Model/SeoCanonical.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'numeric' => array( 8 | 'rule' => array('numeric'), 9 | 'message' => 'Uri Must be present', 10 | ), 11 | ), 12 | 'canonical' => array( 13 | 'notBlank' => array( 14 | 'rule' => array('notBlank'), 15 | 'message' => 'A canonical link must be entered', 16 | ), 17 | ), 18 | 'is_active' => array( 19 | 'boolean' => array( 20 | 'rule' => array('boolean'), 21 | 'message' => 'Your custom message here', 22 | ), 23 | ), 24 | ); 25 | //The Associations below have been created with all possible keys, those that are not needed can be removed 26 | 27 | var $belongsTo = array( 28 | 'SeoUri' => array( 29 | 'className' => 'Seo.SeoUri', 30 | 'foreignKey' => 'seo_uri_id', 31 | ) 32 | ); 33 | 34 | /** 35 | * Filter fields 36 | */ 37 | var $searchFields = array( 38 | 'SeoCanonical.id','SeoCanonical.canonical','SeoUri.uri' 39 | ); 40 | 41 | /** 42 | * Assign or create the url. 43 | */ 44 | function beforeSave($options = array()){ 45 | $this->createOrSetUri(); 46 | return true; 47 | } 48 | 49 | /** 50 | * Find the first canonical link that matches this requesting URI 51 | * @param string incoming reuqest uri 52 | * @return the first canonical link to match 53 | */ 54 | function findByUri($request = null){ 55 | return $this->field('canonical', array( 56 | "{$this->SeoUri->alias}.uri" => $request, 57 | "{$this->SeoUri->alias}.is_approved" => true, 58 | "{$this->alias}.is_active" => true, 59 | )); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Model/SeoHoneypotVisit.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'numeric' => array( 8 | 'rule' => array('isIp'), 9 | 'message' => 'Specify valid IP', 10 | ), 11 | ), 12 | ); 13 | 14 | 15 | /** 16 | * Fields to IP 17 | */ 18 | var $fieldsToLong = array( 19 | 'ip' 20 | ); 21 | 22 | /** 23 | * HoneyPot visit triggered, log the visit in the database. 24 | * @param string ip 25 | * @return boolean success 26 | */ 27 | function add($ip = null){ 28 | if(!$ip){ 29 | $ip = $this->getIpFromServer(); 30 | } 31 | 32 | $this->clear(); 33 | return $this->save(array( 34 | $this->alias => array( 35 | 'ip' => $ip 36 | ) 37 | )); 38 | } 39 | 40 | /** 41 | * Decide if the trap should be triggered 42 | * @param string ip to check (default current IP) 43 | * @return boolean 44 | */ 45 | function isTriggered($ip = null){ 46 | if(!$ip){ 47 | $ip = $this->getIpFromServer(); 48 | } 49 | $ip_query = is_numeric($ip) ? $ip : ip2long($ip); 50 | 51 | //Clear the database of old trigger count 52 | $this->clear(); 53 | 54 | //Find the count of triggers within the (not allowed) time frame 55 | $count = $this->find('count', array( 56 | 'conditions' => array( 57 | "{$this->alias}.ip" => $ip_query 58 | ) 59 | )); 60 | 61 | return (SeoUtil::getConfig('triggerCount') <= $count); 62 | } 63 | 64 | /** 65 | * Clear the list of old visits baesd on the current time. 66 | * @return boolean success 67 | */ 68 | function clear(){ 69 | $cutoff = time() - SeoUtil::getConfig('timeBetweenTriggers'); 70 | return $this->deleteAll(array( 71 | "{$this->alias}.created <=" => date('Y-m-d g:i:s', $cutoff) 72 | )); 73 | } 74 | 75 | } 76 | ?> -------------------------------------------------------------------------------- /Model/SeoMetaTag.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'numeric' => array( 8 | 'rule' => array('numeric'), 9 | 'message' => 'must be numeric', 10 | ), 11 | ), 12 | 'name' => array( 13 | 'notBlank' => array( 14 | 'rule' => array('notBlank'), 15 | 'message' => 'Name must be present.', 16 | ), 17 | ), 18 | 'content' => array( 19 | 'notBlank' => array( 20 | 'rule' => array('notBlank'), 21 | 'message' => 'Content must be present.', 22 | ), 23 | ), 24 | 'is_http_equiv' => array( 25 | 'boolean' => array( 26 | 'rule' => array('boolean'), 27 | 'message' => 'Must be true or false', 28 | ), 29 | ), 30 | ); 31 | var $belongsTo = array( 32 | 'SeoUri' => array( 33 | 'className' => 'Seo.SeoUri', 34 | 'foreignKey' => 'seo_uri_id', 35 | ) 36 | ); 37 | 38 | /** 39 | * Filter fields 40 | */ 41 | var $searchFields = array( 42 | 'SeoMetaTag.name','SeoMetaTag.content','SeoMetaTag.id','SeoUri.uri' 43 | ); 44 | 45 | function beforeSave($options = array()){ 46 | $this->createOrSetUri(); 47 | return true; 48 | } 49 | 50 | /** 51 | * Find all the tags by a specific reuqest, 52 | * This takes in a request URI and finds all matching meta_tags for this URI 53 | * @param incoming request URI 54 | * @return array of results 55 | */ 56 | function findAllTagsByUri($request = null){ 57 | $retval = $this->find('all', array( 58 | 'conditions' => array( 59 | "{$this->SeoUri->alias}.uri" => $request, 60 | "{$this->SeoUri->alias}.is_approved" => true 61 | ), 62 | 'contain' => array("{$this->SeoUri->alias}.uri") 63 | )); 64 | 65 | if(!empty($retval)){ 66 | return $retval; 67 | } 68 | 69 | $uri_ids = $this->SeoUri->findRegexUri($request); 70 | 71 | if(empty($uri_ids)){ 72 | return array(); 73 | } 74 | 75 | $retval = $this->find('all', array( 76 | 'conditions' => array( 77 | "{$this->alias}.seo_uri_id" => $uri_ids 78 | ), 79 | 'contain' => array() 80 | )); 81 | 82 | return $retval; 83 | } 84 | } -------------------------------------------------------------------------------- /Model/SeoRedirect.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'notBlank' => array( 8 | 'rule' => array('notBlank'), 9 | 'message' => 'Redirect must not be empty', 10 | ), 11 | ), 12 | 'priority' => array( 13 | 'numeric' => array( 14 | 'rule' => array('numeric'), 15 | 'message' => 'Priorty must be an integer number', 16 | ), 17 | ), 18 | ); 19 | 20 | var $belongsTo = array( 21 | 'Seo.SeoUri' 22 | ); 23 | 24 | /** 25 | * Filter fields 26 | */ 27 | var $searchFields = array( 28 | 'SeoRedirect.redirect','SeoRedirect.callback','SeoRedirect.id','SeoUri.uri' 29 | ); 30 | 31 | /** 32 | * Check if SEO already exists, if so, unset it and set the ID then save. 33 | */ 34 | function beforeSave($options = array()){ 35 | $this->createOrSetUri(); 36 | return true; 37 | } 38 | 39 | /** 40 | * This is a helper function for testing. 41 | */ 42 | function callbackTest($request){ 43 | $this->uri_request = $request; 44 | return 'ran_callback'; 45 | } 46 | 47 | /** 48 | * Named scope to find list of uri -> redirect by order and approved/active 49 | * @return list of active and approved uri -> redirects ordered by priority 50 | */ 51 | function findRedirectListByPriority(){ 52 | return $this->find('all', array( 53 | 'contain' => array($this->SeoUri->alias => 'uri'), 54 | 'fields' => array( 55 | "{$this->alias}.redirect", 56 | "{$this->alias}.id", 57 | "{$this->alias}.callback", 58 | "{$this->alias}.is_nocache", 59 | ), 60 | 'order' => array("{$this->alias}.priority" => 'ASC'), 61 | 'conditions' => array( 62 | "{$this->alias}.is_active" => true, 63 | "{$this->SeoUri->alias}.is_approved" => true, 64 | ) 65 | )); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Model/SeoSearchTerm.php: -------------------------------------------------------------------------------- 1 | array( 13 | 'notBlank' => array( 14 | 'rule' => array('notBlank'), 15 | ), 16 | ), 17 | 'uri' => array( 18 | 'notBlank' => array( 19 | 'rule' => array('notBlank'), 20 | ), 21 | ), 22 | 'count' => array( 23 | 'numeric' => array( 24 | 'rule' => array('numeric'), 25 | ), 26 | ), 27 | ); 28 | 29 | /** 30 | * Take the incomming request referrer and decide if we should save this term in our 31 | * database 32 | * @param incoming request usually $this->here 33 | * @return void 34 | * @access public 35 | */ 36 | function parseRequest($request = null){ 37 | if($request){ 38 | $referrer = env('HTTP_REFERER'); 39 | // Check if from google and page 2 40 | if(strpos($referrer,"google.com")) { 41 | if(!SeoUtil::getConfig('searchTerms')){ 42 | return; 43 | } 44 | //parse the term out. 45 | if(strpos($referrer, "q=")){ 46 | list($ignore, $term) = explode("q=", $referrer); 47 | if(strpos($term, "&")){ 48 | list($term, $ignore) = explode("&", $term); 49 | } 50 | $term = trim(urldecode($term)); 51 | if($term && strpos($referrer,"start=")){ 52 | //Only proceed if we have a valid term 53 | if($id = $this->field('id', array('SeoSearchTerm.term' => $term))){ 54 | $this->itterateCount($id); 55 | } 56 | else { 57 | $data = array( 58 | 'SeoSearchTerm' => array( 59 | 'term' => $term, 60 | 'uri' => $request, 61 | 'count' => 1 62 | ) 63 | ); 64 | $this->save($data); 65 | } 66 | } 67 | elseif($term) { 68 | //Delete the term if this was found on the first page. 69 | if($id = $this->field('id', array('SeoSearchTerm.term' => $term))){ 70 | $this->delete($id); 71 | } 72 | } 73 | } 74 | } 75 | } 76 | } 77 | 78 | /** 79 | * Pull out random terms 80 | * @param int limit 81 | * @param array set of results 82 | */ 83 | function findRandomTerms($limit = 6){ 84 | return $this->find('all', array( 85 | 'limit' => $limit, 86 | 'order' => 'RAND()' 87 | )); 88 | } 89 | 90 | /** 91 | * Find the top terms 92 | * @param int limit 93 | * @return array set of results 94 | */ 95 | function findTopTerms($limit = 6){ 96 | return $this->find('all', array( 97 | 'limit' => $limit, 98 | 'order' => 'SeoSearchTerm.count DESC' 99 | )); 100 | } 101 | 102 | /** 103 | * Itterate the count on a specific term. 104 | * @param int id (optional) 105 | * @return boolean success 106 | */ 107 | function itterateCount($id = null){ 108 | if($id) $this->id = $id; 109 | if($this->id){ 110 | return $this->saveField('count', $this->field('count') + 1); 111 | } 112 | return false; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Model/SeoStatusCode.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'numeric' => array( 8 | 'rule' => array('numeric'), 9 | 'message' => 'Must be assigned to a SeoUri', 10 | ), 11 | ), 12 | 'status_code' => array( 13 | 'numeric' => array( 14 | 'rule' => array('numeric'), 15 | 'message' => 'Please enter a status code', 16 | ), 17 | ), 18 | 'priority' => array( 19 | 'numeric' => array( 20 | 'rule' => array('numeric'), 21 | 'message' => 'Priorty must be an integer number', 22 | ), 23 | ), 24 | ); 25 | 26 | var $belongsTo = array( 27 | 'SeoUri' => array( 28 | 'className' => 'Seo.SeoUri', 29 | 'foreignKey' => 'seo_uri_id', 30 | ) 31 | ); 32 | 33 | /** 34 | * Status codes 35 | */ 36 | var $codes = array( 37 | '200' => 'OK', //if 200, we're going to return a very small amount of noindex data 38 | '204' => 'No Content', 39 | '205' => 'Reset Content', 40 | '400' => 'Bad Request', 41 | '401' => 'Unauthorized', 42 | '402' => 'Payment Required', 43 | '403' => 'Forbidden', 44 | '404' => 'Not Found', 45 | '405' => 'Method Not Allowed', 46 | '406' => 'Not Acceptable', 47 | '407' => 'Proxy Authentication Required', 48 | '408' => 'Request Timeout', 49 | '409' => 'Conflict', 50 | '410' => 'Gone', 51 | '411' => 'Length Required', 52 | '412' => 'Preconditon Failed', 53 | '413' => 'Request Entity Too Large', 54 | '414' => 'Request-URI Too Long', 55 | '415' => 'Unsupported Media Type', 56 | '416' => 'Requested Range Not Satisfiable', 57 | '417' => 'Expectation Failed', 58 | ); 59 | 60 | /** 61 | * Filter fields 62 | */ 63 | var $searchFields = array( 64 | 'SeoStatusCode.status_code','SeoStatusCode.id','SeoUri.uri' 65 | ); 66 | 67 | /** 68 | * Check if SEO already exists, if so, unset it and set the ID then save. 69 | */ 70 | function beforeSave($options = array()){ 71 | $this->createOrSetUri(); 72 | return true; 73 | } 74 | 75 | function findCodeList(){ 76 | $retval = array(); 77 | foreach($this->codes as $code => $text){ 78 | $retval[$code] = "$code : $text"; 79 | } 80 | return $retval; 81 | } 82 | 83 | /** 84 | * Named scope to find list of uri -> status_codes and order by priority only approved/active 85 | * @return list of active and approved uri => status_codes ordered by priority 86 | */ 87 | function findStatusCodeListByPriority(){ 88 | return $this->find('all', array( 89 | 'contain' => array($this->SeoUri->alias => 'uri'), 90 | 'fields' => array("{$this->alias}.status_code"), 91 | 'order' => array("{$this->alias}.priority" => 'ASC'), 92 | 'conditions' => array( 93 | "{$this->alias}.is_active" => true, 94 | "{$this->SeoUri->alias}.is_approved" => true, 95 | ) 96 | )); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Model/SeoTitle.php: -------------------------------------------------------------------------------- 1 | array( 32 | 'unique' => array( 33 | 'rule' => array('isUnique'), 34 | 'message' => 'Only one title tag per URI allowed' 35 | ) 36 | ), 37 | 'title' => array( 38 | 'notBlank' => array( 39 | 'rule' => array('notBlank'), 40 | 'message' => 'Title must be present', 41 | ), 42 | ), 43 | ); 44 | 45 | /** 46 | * Belongs To Association 47 | * 48 | * @var array 49 | */ 50 | public $belongsTo = array( 51 | 'SeoUri' => array( 52 | 'className' => 'Seo.SeoUri', 53 | 'foreignKey' => 'seo_uri_id', 54 | ) 55 | ); 56 | 57 | /** 58 | * Filter fields 59 | * 60 | * @var array 61 | */ 62 | public $searchFields = array( 63 | 'SeoTitle.id','SeoTitle.title','SeoTitle.id','SeoUri.uri' 64 | ); 65 | 66 | /** 67 | * Assign or create the url. 68 | * 69 | * @return boolean 70 | */ 71 | public function beforeSave($options = array()) { 72 | $this->createOrSetUri(); 73 | return parent::beforeSave($options); 74 | } 75 | 76 | /** 77 | * Find the first title tag that matches this URI 78 | * 79 | * @param string incoming reuqest uri 80 | * @return the first title tag to match 81 | */ 82 | public function findTitleByUri($request = null) { 83 | return $this->find('first', array( 84 | 'conditions' => array( 85 | "{$this->SeoUri->alias}.uri" => $request, 86 | "{$this->SeoUri->alias}.is_approved" => true 87 | ), 88 | 'contain' => array("{$this->SeoUri->alias}.uri"), 89 | 'fields' => array("{$this->alias}.title"), 90 | )); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Model/SeoUrl.php: -------------------------------------------------------------------------------- 1 | array( 8 | 'notBlank' => array( 9 | 'rule' => array('notBlank'), 10 | 'message' => 'Must not be empty', 11 | ), 12 | 'unique' => array( 13 | 'rule' => array('isUnique'), 14 | 'message' => 'Url already being used' 15 | ) 16 | ), 17 | ); 18 | 19 | var $searchFields = array('SeoUrl.id','SeoUrl.url'); 20 | 21 | /** 22 | * Configuration settings 23 | */ 24 | var $settings = array(); 25 | 26 | /** 27 | * Load the settings 28 | */ 29 | function __construct($id = false, $table = null, $ds = null){ 30 | parent::__construct($id, $table, $ds); 31 | $this->settings = SeoUtil::getConfig('levenshtein'); 32 | } 33 | 34 | /** 35 | * Import a set of valid URLS from a sitemap 36 | * 37 | * @param string path to sitemap we want to parse 38 | * @param boolean clear the set first, then import. 39 | * @param boolean verbose 40 | * @param int count of imported urls 41 | */ 42 | function import($sitemap = null, $clear_all = true, $verbose = false){ 43 | $count = 0; 44 | if($this->settings['active']){ 45 | if($sitemap){ 46 | $this->settings['source'] = $sitemap; 47 | } 48 | if($clear_all){ 49 | $this->deleteAll(1); 50 | } 51 | 52 | $xml = simplexml_load_file($this->getPathToSiteMap()); 53 | foreach($xml->url as $url){ 54 | $this->clear(); 55 | $save_data = array( 56 | 'url' => parse_url((string) $url->loc, PHP_URL_PATH), 57 | 'priority' => (string) $url->priority 58 | ); 59 | if($this->save($save_data)){ 60 | if($verbose) echo "."; 61 | $count++; 62 | } 63 | elseif($verbose){ 64 | echo "f"; 65 | debug($this->validationErrors); 66 | } 67 | } 68 | 69 | } 70 | return $count; 71 | } 72 | 73 | 74 | /** 75 | * Use levenshtein's distance to decide what "good" url is most closest to the incomming request 76 | * 77 | * @param string request 78 | * @return array of result 79 | * - redirect the actually redirect to point to 80 | * - shortest how close this came 81 | */ 82 | function findRedirectByRequest($request){ 83 | if($this->settings['active']){ 84 | $retval = array( 85 | 'redirect' => '/', 86 | 'shortest' => -1 87 | ); 88 | 89 | //Run import if we have no urls to look at. 90 | if($this->find('count') == 0){ 91 | if($this->import() == 0){ 92 | return $retval; 93 | } 94 | } 95 | 96 | $urls = $this->find('all', array( 97 | 'fields' => array('SeoUrl.url'), 98 | 'recursive' => -1, 99 | 'order' => 'SeoUrl.priority ASC' 100 | )); 101 | 102 | foreach($urls as $url){ 103 | //Less efficent to use constants, if they're all the same don't use them 104 | if($this->settings['cost_add'] == $this->settings['cost_change'] && $this->settings['cost_change'] == $this->settings['cost_delete']){ 105 | $lev = levenshtein($request, $url['SeoUrl']['url']); 106 | } 107 | else { 108 | $lev = levenshtein($request, $url['SeoUrl']['url'], $this->settings['cost_add'], $this->settings['cost_change'], $this->settings['cost_delete']); 109 | } 110 | if($lev <= $retval['shortest'] || $retval['shortest'] < 0){ 111 | $retval['redirect'] = $url['SeoUrl']['url']; 112 | $retval['shortest'] = $lev; 113 | } 114 | if($retval['shortest'] < $this->settings['threshold'] || $lev == 0){ 115 | break; 116 | } 117 | } 118 | return $retval; 119 | } 120 | return false; 121 | } 122 | 123 | /** 124 | * Get the file out of the source config 125 | * 126 | * @return string file path to source. 127 | */ 128 | private function getPathToSiteMap(){ 129 | if(strpos($this->settings['source'], '/') === 0){ 130 | return WWW_ROOT . substr($this->settings['source'], 1, strlen($this->settings['source'])); 131 | } 132 | else { 133 | return $this->settings['source']; 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /Test/Case/AppErrorTest.php: -------------------------------------------------------------------------------- 1 | AppError = new SeoAppError('ignore', 'ignore', /* test */ true); 25 | Mock::generate('Controller'); 26 | $this->AppError->controller = new MockController(); 27 | } 28 | 29 | function test_uriToLevenshtein(){ 30 | $_SERVER['REQUEST_URI'] = '/some_url'; // /some is the closest 31 | $this->AppError->controller->expectOnce('redirect', array('/some', 301)); 32 | $this->AppError->__uriToLevenshtein(); 33 | } 34 | 35 | function testUriToRedirectWildCard(){ 36 | $_SERVER['REQUEST_URI'] = '/blahblahtest'; // /blahblah* will catch this one 37 | $this->AppError->controller->expectOnce('redirect', array('/new', 301)); 38 | $this->AppError->__uriToRedirect(); 39 | } 40 | 41 | function testUriToRedirectWildCardNotMatch(){ 42 | $_SERVER['REQUEST_URI'] = '/admin/blahblahtest'; // /blahblah* should NOT catch this one 43 | $this->AppError->controller->expectNever('redirect'); 44 | $this->AppError->__uriToRedirect(); 45 | } 46 | 47 | function testUriToStatusCodeGone(){ 48 | $_SERVER['REQUEST_URI'] = '/status_gone'; 49 | $result = $this->AppError->__uriToStatusCode(true); 50 | $this->assertEqual('410', $result); 51 | } 52 | 53 | function testUriToStatusCodeOk(){ 54 | $_SERVER['REQUEST_URI'] = '/ok_request'; 55 | $result = $this->AppError->__uriToStatusCode(true); 56 | $this->assertEqual('', $result); 57 | } 58 | 59 | function testUriToRedirectWithCallbackFull(){ 60 | $_SERVER['REQUEST_URI'] = '/uri'; 61 | $this->AppError->controller->expectOnce('redirect', array('/ran_callback', 301)); 62 | $this->AppError->__uriToRedirect(); 63 | } 64 | 65 | function testUriToRedirectWithRegEx(){ 66 | $_SERVER['REQUEST_URI'] = '/hearing-aids/558-virginia-beach-virginia-va-23454-virginia-audiology?from=sb-tracked:23457'; 67 | $this->AppError->controller->expectOnce('redirect', array('/hearing-aids/558-virginia-beach-virginia-va-23454-virginia-audiology', 301)); 68 | $this->AppError->__uriToRedirect(); 69 | } 70 | 71 | function testUriToRedirectWithRegExTwo(){ 72 | $_SERVER['REQUEST_URI'] = '/some_url_to?from=sb-tracked:2345'; 73 | $this->AppError->controller->expectOnce('redirect', array('/some_url_to', 301)); 74 | $this->AppError->__uriToRedirect(); 75 | } 76 | 77 | function testUriToRedirectWithRegExThree(){ 78 | $_SERVER['REQUEST_URI'] = '/qas/32074-i-told-hearing-aids'; 79 | $this->AppError->controller->expectOnce('redirect', array('/questions/32074-i-told-hearing-aids', 301)); 80 | $this->AppError->__uriToRedirect(); 81 | } 82 | 83 | function testUriToRedirect(){ 84 | $_SERVER['REQUEST_URI'] = '/blah'; 85 | $this->AppError->controller->expectOnce('redirect', array('/', 301)); 86 | $this->AppError->__uriToRedirect(); 87 | } 88 | 89 | function testUriToRedirectNotActive(){ 90 | $_SERVER['REQUEST_URI'] = '/not_active'; 91 | $this->AppError->controller->expectNever('redirect'); 92 | $this->AppError->__uriToRedirect(); 93 | } 94 | 95 | function testPriority(){ 96 | $_SERVER['REQUEST_URI'] = '/blahblahblah'; 97 | $this->AppError->controller->expectOnce('redirect', array('/priority', 301)); 98 | $this->AppError->__uriToRedirect(); 99 | } 100 | 101 | } 102 | ?> 103 | -------------------------------------------------------------------------------- /Test/Case/Controller/SeoBlacklistsControllerTest.php: -------------------------------------------------------------------------------- 1 | redirectUrl = $url; 10 | } 11 | } 12 | 13 | class SeoBlacklistsControllerTest extends CakeTestCase { 14 | function startTest() { 15 | $this->SeoBlacklists = new TestSeoBlacklistsController(); 16 | $this->SeoBlacklists->constructClasses(); 17 | } 18 | 19 | function endTest() { 20 | unset($this->SeoBlacklists); 21 | ClassRegistry::flush(); 22 | } 23 | 24 | } 25 | ?> -------------------------------------------------------------------------------- /Test/Case/Controller/SeoUrlsControllerTest.php: -------------------------------------------------------------------------------- 1 | redirectUrl = $url; 10 | } 11 | } 12 | 13 | class SeoUrlsControllerTest extends CakeTestCase { 14 | function startTest() { 15 | $this->SeoUrls = new TestSeoUrlsController(); 16 | $this->SeoUrls->constructClasses(); 17 | } 18 | 19 | function endTest() { 20 | unset($this->SeoUrls); 21 | ClassRegistry::flush(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Test/Case/Controller/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/Test/Case/Controller/empty -------------------------------------------------------------------------------- /Test/Case/Model/SeoABTestTest.php: -------------------------------------------------------------------------------- 1 | SeoABTest = ClassRegistry::init('Seo.SeoABTest'); 28 | } 29 | 30 | /** 31 | * tearDown method 32 | * 33 | * @return void 34 | */ 35 | public function tearDown() { 36 | unset($this->SeoABTest); 37 | 38 | parent::tearDown(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Test/Case/Model/SeoBlacklistTest.php: -------------------------------------------------------------------------------- 1 | SeoBlacklist = ClassRegistry::init('SeoBlacklist'); 10 | } 11 | 12 | function testIpValidCheck(){ 13 | $this->assertTrue($this->SeoBlacklist->isIp(array('192.168.1.100'))); 14 | $this->assertFalse($this->SeoBlacklist->isIp(array('100'))); 15 | } 16 | 17 | function testSaveShouldLongTheIP(){ 18 | $this->SeoBlacklist->data = array( 19 | 'SeoBlacklist' => array( 20 | 'ip_range_start' => '127.255.253.220', 21 | 'ip_range_end' => '127.255.253.222', 22 | ) 23 | ); 24 | 25 | $count = $this->SeoBlacklist->find('count'); 26 | $this->assertTrue($this->SeoBlacklist->save()); 27 | $result = $this->SeoBlacklist->find('last'); 28 | $this->assertEqual($count + 1, $this->SeoBlacklist->find('count')); 29 | $this->assertEqual('127.255.253.220', $result['SeoBlacklist']['ip_range_start']); 30 | $this->assertEqual('127.255.253.222', $result['SeoBlacklist']['ip_range_end']); 31 | } 32 | 33 | function testIsBannedByIp(){ 34 | $this->assertTrue($this->SeoBlacklist->isBanned('127.255.253.120')); 35 | $this->assertTrue($this->SeoBlacklist->isBanned('127.255.253.121')); 36 | $this->assertTrue($this->SeoBlacklist->isBanned('127.255.253.122')); 37 | $this->assertFalse($this->SeoBlacklist->isBanned('127.255.253.123')); 38 | } 39 | 40 | function testIsBannedByInt(){ 41 | $this->assertTrue($this->SeoBlacklist->isBanned(2147483000)); 42 | $this->assertTrue($this->SeoBlacklist->isBanned(2147483001)); 43 | $this->assertTrue($this->SeoBlacklist->isBanned(2147483002)); 44 | $this->assertFalse($this->SeoBlacklist->isBanned(2147483003)); 45 | $this->assertFalse($this->SeoBlacklist->isBanned(2147483100)); 46 | } 47 | 48 | function testAddSingleIp(){ 49 | $this->assertFalse($this->SeoBlacklist->isBanned('127.255.253.125')); 50 | $this->assertTrue($this->SeoBlacklist->addToBanned('127.255.253.125', "note", true)); 51 | $this->assertTrue($this->SeoBlacklist->isBanned('127.255.253.125')); 52 | } 53 | 54 | function testAddSingleIpIfNotAggressive(){ 55 | $this->assertFalse($this->SeoBlacklist->isBanned('127.255.253.125')); 56 | $this->assertTrue($this->SeoBlacklist->addToBanned('127.255.253.125', "note", false)); 57 | $this->assertFalse($this->SeoBlacklist->isBanned('127.255.253.125')); 58 | } 59 | 60 | function testGetIpFromServer(){ 61 | $_SERVER['HTTP_CLIENT_IP'] = 'client'; 62 | $_SERVER['HTTP_X_FORWARDED_FOR'] = 'forwarded'; 63 | $_SERVER['REMOTE_ADDR'] = 'remote'; 64 | 65 | $this->assertEqual('client', $this->SeoBlacklist->getIpFromServer()); 66 | unset($_SERVER['HTTP_CLIENT_IP']); 67 | $this->assertEqual('forwarded', $this->SeoBlacklist->getIpFromServer()); 68 | unset($_SERVER['HTTP_X_FORWARDED_FOR']); 69 | $this->assertEqual('remote', $this->SeoBlacklist->getIpFromServer()); 70 | } 71 | 72 | function endTest() { 73 | unset($this->SeoBlacklist); 74 | ClassRegistry::flush(); 75 | } 76 | 77 | } 78 | ?> -------------------------------------------------------------------------------- /Test/Case/Model/SeoCanonicalTest.php: -------------------------------------------------------------------------------- 1 | SeoCanonical = ClassRegistry::init('SeoCanonical'); 17 | $this->SeoRedirect->SeoUri->Email = new MockEmailComponent(); 18 | } 19 | 20 | function endTest() { 21 | unset($this->SeoCanonical); 22 | ClassRegistry::flush(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Test/Case/Model/SeoHoneypotVisitTest.php: -------------------------------------------------------------------------------- 1 | SeoHoneypotVisit = ClassRegistry::init('SeoHoneypotVisit'); 9 | } 10 | 11 | function testAdd(){ 12 | $this->assertTrue($this->SeoHoneypotVisit->add('127.255.253.120')); 13 | } 14 | 15 | function testClear(){ 16 | $this->assertEqual(1, $this->SeoHoneypotVisit->find('count')); 17 | $this->assertTrue($this->SeoHoneypotVisit->clear()); 18 | $this->assertEqual(0, $this->SeoHoneypotVisit->find('count')); 19 | } 20 | 21 | function testClearAfterAdding(){ 22 | $this->assertEqual(1, $this->SeoHoneypotVisit->find('count')); 23 | $this->assertTrue($this->SeoHoneypotVisit->add('127.255.253.120')); 24 | $this->assertTrue($this->SeoHoneypotVisit->add('127.255.253.120')); 25 | $this->assertTrue($this->SeoHoneypotVisit->clear()); 26 | $this->assertEqual(2, $this->SeoHoneypotVisit->find('count')); 27 | } 28 | 29 | function testIsTriggered(){ 30 | $this->assertFalse($this->SeoHoneypotVisit->isTriggered('127.255.253.120')); 31 | $this->assertTrue($this->SeoHoneypotVisit->add('127.255.253.120')); 32 | $this->assertTrue($this->SeoHoneypotVisit->add('127.255.253.120')); 33 | $this->assertTrue($this->SeoHoneypotVisit->add('127.255.253.120')); 34 | $this->assertTrue($this->SeoHoneypotVisit->add('127.255.253.120')); 35 | $this->assertTrue($this->SeoHoneypotVisit->add('127.255.253.120')); 36 | $this->assertTrue($this->SeoHoneypotVisit->add('127.255.253.120')); 37 | $this->assertTrue($this->SeoHoneypotVisit->isTriggered('127.255.253.120')); 38 | } 39 | 40 | function endTest() { 41 | unset($this->SeoHoneypotVisit); 42 | ClassRegistry::flush(); 43 | } 44 | 45 | } 46 | ?> -------------------------------------------------------------------------------- /Test/Case/Model/SeoMetaTagTest.php: -------------------------------------------------------------------------------- 1 | SeoMetaTag = ClassRegistry::init('SeoMetaTag'); 19 | $this->SeoMetaTag->SeoUri->Email = new MockEmailComponent(); 20 | } 21 | 22 | function testFindAllTagsByUri(){ 23 | $results = $this->SeoMetaTag->findAllTagsByUri('/uri_for_meta'); 24 | $this->assertEqual(2, count($results)); 25 | } 26 | 27 | function testFindAllTagsByUriRegEx(){ 28 | $results = $this->SeoMetaTag->findAllTagsByUri('/uri_for_meta_reg_ex/regex'); 29 | $this->assertEqual(2, count($results)); 30 | } 31 | 32 | function testFindAllTagsByUriWildCard(){ 33 | $results = $this->SeoMetaTag->findAllTagsByUri('/uri_for_meta_wild_card/wild'); 34 | $this->assertEqual(1, count($results)); 35 | } 36 | 37 | function testBeforeSaveShouldLinkToExistinUri(){ 38 | $this->SeoMetaTag->data = array( 39 | 'SeoMetaTag' => array( 40 | 'name' => 'New', 41 | 'content' => 'Content' 42 | ), 43 | 'SeoUri' => array( 44 | 'uri' => '/uri_for_meta', 45 | ) 46 | ); 47 | 48 | $count = $this->SeoMetaTag->SeoUri->find('count'); 49 | $this->assertTrue($this->SeoMetaTag->save()); 50 | $this->assertEqual($count, $this->SeoMetaTag->SeoUri->find('count')); 51 | $results = $this->SeoMetaTag->find('last'); 52 | $this->assertEqual('New', $results['SeoMetaTag']['name']); 53 | $this->assertEqual('Content', $results['SeoMetaTag']['content']); 54 | $this->assertEqual(9, $results['SeoMetaTag']['seo_uri_id']); 55 | } 56 | 57 | function testBeforeSaveShouldLinkToCreatUri(){ 58 | $this->SeoMetaTag->data = array( 59 | 'SeoMetaTag' => array( 60 | 'name' => 'New', 61 | 'content' => 'Content' 62 | ), 63 | 'SeoUri' => array( 64 | 'uri' => '/uri_for_meta_new', 65 | ) 66 | ); 67 | 68 | $count = $this->SeoMetaTag->SeoUri->find('count'); 69 | $this->assertTrue($this->SeoMetaTag->save()); 70 | $this->assertEqual($count + 1, $this->SeoMetaTag->SeoUri->find('count')); 71 | $results = $this->SeoMetaTag->find('last'); 72 | $this->assertEqual('New', $results['SeoMetaTag']['name']); 73 | $this->assertEqual('Content', $results['SeoMetaTag']['content']); 74 | } 75 | 76 | function endTest() { 77 | unset($this->SeoMetaTag); 78 | ClassRegistry::flush(); 79 | } 80 | 81 | } 82 | ?> -------------------------------------------------------------------------------- /Test/Case/Model/SeoRedirectTest.php: -------------------------------------------------------------------------------- 1 | SeoRedirect = ClassRegistry::init('Seo.SeoRedirect'); 19 | $this->SeoRedirect->SeoUri->Email = new MockEmailComponent(); 20 | } 21 | 22 | function testIsRegEx(){ 23 | $this->assertTrue($this->SeoRedirect->isRegEx('#(.*)\?from\=sb\-tracked\:(.*)#i')); 24 | $this->assertTrue($this->SeoRedirect->isRegEx('#(.*)#')); 25 | $this->assertFalse($this->SeoRedirect->isRegEx('/blah')); 26 | $this->assertFalse($this->SeoRedirect->isRegEx('/blah#anchor')); 27 | } 28 | 29 | function testBeforeSaveShouldSetApproved(){ 30 | $this->SeoRedirect->data = array( 31 | 'SeoRedirect' => array( 32 | 'redirect' => '/', 33 | 'priority' => '5', 34 | 'is_active' => 1, 35 | ), 36 | 'SeoUri' => array( 37 | 'uri' => '/newuri' 38 | ) 39 | ); 40 | $this->assertTrue($this->SeoRedirect->saveAll()); 41 | $result = $this->SeoRedirect->find('last'); 42 | $this->assertTrue($result['SeoUri']['is_approved']); 43 | $this->SeoRedirect->SeoUri->Email->expectNever('send'); 44 | } 45 | 46 | function testBeforeSaveShouldNotSetApprovedOnRegEx(){ 47 | $this->SeoRedirect->data = array( 48 | 'SeoRedirect' => array( 49 | 'redirect' => '/', 50 | 'priority' => '5', 51 | 'is_active' => 1, 52 | ), 53 | 'SeoUri' => array( 54 | 'uri' => '#(somenewregex)#i', 55 | ) 56 | ); 57 | $this->assertTrue($this->SeoRedirect->saveAll()); 58 | $result = $this->SeoRedirect->find('last'); 59 | $this->assertFalse($result['SeoUri']['is_approved']); 60 | $this->SeoRedirect->SeoUri->Email->expectOnce('send'); 61 | } 62 | 63 | function testFindRedirectListByPriority(){ 64 | $results = $this->SeoRedirect->findRedirectListByPriority(); 65 | $this->assertEqual(6, count($results)); 66 | } 67 | 68 | function endTest() { 69 | unset($this->SeoRedirect); 70 | ClassRegistry::flush(); 71 | } 72 | 73 | } 74 | ?> -------------------------------------------------------------------------------- /Test/Case/Model/SeoSearchTermTest.php: -------------------------------------------------------------------------------- 1 | SeoSearchTerm = ClassRegistry::init('SeoSearchTerm'); 10 | } 11 | 12 | function testParseRequest(){ 13 | $_SERVER['HTTP_REFERER'] = 'https://www.google.com/#q=Some+search&hl=en&safe=off&prmd=imvns&ei=mUrHTuWSJo73sQLl5ZQ8&start=10&sa=N&bav=on.2,or.r_gc.r_pw.r_cp.,cf.osb&fp=5e5b3f07d49aeae4&biw=1397&bih=907'; 14 | $this->SeoSearchTerm->parseRequest("/some_url"); 15 | $result = $this->SeoSearchTerm->find('last'); 16 | $this->assertEqual('Some search', $result['SeoSearchTerm']['term']); 17 | $this->assertEqual('/some_url', $result['SeoSearchTerm']['uri']); 18 | $this->assertEqual(1, $result['SeoSearchTerm']['count']); 19 | } 20 | 21 | function testParseRequestCount(){ 22 | $_SERVER['HTTP_REFERER'] = 'https://www.google.com/#q=Lorem+ipsum&hl=en&safe=off&prmd=imvns&ei=mUrHTuWSJo73sQLl5ZQ8&start=10&sa=N&bav=on.2,or.r_gc.r_pw.r_cp.,cf.osb&fp=5e5b3f07d49aeae4&biw=1397&bih=907'; 23 | $count = $this->SeoSearchTerm->find('count'); 24 | $this->SeoSearchTerm->parseRequest("/some_url"); 25 | $result = $this->SeoSearchTerm->findById(1); 26 | $this->assertEqual($count, $this->SeoSearchTerm->find('count')); 27 | $this->assertEqual('Lorem ipsum', $result['SeoSearchTerm']['term']); 28 | $this->assertEqual('/some_url', $result['SeoSearchTerm']['uri']); 29 | $this->assertEqual(2, $result['SeoSearchTerm']['count']); 30 | } 31 | 32 | function testParseRequestIgnore(){ 33 | $_SERVER['HTTP_REFERER'] = 'https://www.google.com/'; 34 | $count = $this->SeoSearchTerm->find('count'); 35 | $this->SeoSearchTerm->parseRequest("/some_url"); 36 | $result = $this->SeoSearchTerm->findById(1); 37 | $this->assertEqual($count, $this->SeoSearchTerm->find('count')); 38 | $this->assertEqual(1, $result['SeoSearchTerm']['count']); 39 | } 40 | 41 | function testParseRequestDelete(){ 42 | $_SERVER['HTTP_REFERER'] = 'https://www.google.com/#q=Lorem+ipsum&hl=en&safe=off&prmd=imvns&ei=mUrHTuWSJo73sQLl5ZQ8&sa=N&bav=on.2,or.r_gc.r_pw.r_cp.,cf.osb&fp=5e5b3f07d49aeae4&biw=1397&bih=907'; 43 | $count = $this->SeoSearchTerm->find('count'); 44 | $this->SeoSearchTerm->parseRequest("/some_url"); 45 | $result = $this->SeoSearchTerm->findById(1); 46 | $this->assertTrue(empty($result)); 47 | $this->assertEqual($count - 1, $this->SeoSearchTerm->find('count')); 48 | } 49 | 50 | function endTest() { 51 | unset($this->SeoSearchTerm); 52 | ClassRegistry::flush(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /Test/Case/Model/SeoStatusCodeTest.php: -------------------------------------------------------------------------------- 1 | SeoStatusCode = ClassRegistry::init('SeoStatusCode'); 19 | $this->SeoRedirect->SeoUri->Email = new MockEmailComponent(); 20 | } 21 | 22 | 23 | 24 | function endTest() { 25 | unset($this->SeoStatusCode); 26 | ClassRegistry::flush(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Test/Case/Model/SeoTitleTest.php: -------------------------------------------------------------------------------- 1 | SeoTitle = ClassRegistry::init('SeoTitle'); 17 | } 18 | 19 | function endTest() { 20 | unset($this->SeoTitle); 21 | ClassRegistry::flush(); 22 | } 23 | 24 | } 25 | ?> -------------------------------------------------------------------------------- /Test/Case/Model/SeoUriTest.php: -------------------------------------------------------------------------------- 1 | SeoUri = ClassRegistry::init('Seo.SeoUri'); 19 | $this->SeoUri->Email = new MockEmailComponent(); 20 | } 21 | 22 | function testUrlEncode(){ 23 | $uri = $this->SeoUri->findById(1); 24 | $this->assertEqual('/blah', $uri['SeoUri']['uri']); 25 | $this->assertTrue($this->SeoUri->urlEncode(1)); 26 | $result = $this->SeoUri->findById(1); 27 | $this->assertEqual('/blah', $result['SeoUri']['uri']); 28 | 29 | $uri = $this->SeoUri->findById(14); 30 | $this->assertEqual('/uri with spaces', $uri['SeoUri']['uri']); 31 | $this->assertTrue($this->SeoUri->urlEncode(14)); 32 | $result = $this->SeoUri->findById(14); 33 | $this->assertEqual('/uri%20with%20spaces', $result['SeoUri']['uri']); 34 | } 35 | 36 | function testSetApproved(){ 37 | $this->SeoUri->id = 6; 38 | $this->assertFalse($this->SeoUri->field('is_approved')); 39 | $this->SeoUri->setApproved(); 40 | $this->assertTrue($this->SeoUri->field('is_approved')); 41 | } 42 | 43 | function testSendNotification(){ 44 | $this->SeoUri->id = 6; 45 | $this->SeoUri->Email->expectOnce('send'); 46 | $this->SeoUri->sendNotification(); 47 | $this->assertEqual('301 Redirect: #(.*)#i to / needs approval', $this->SeoUri->Email->subject); 48 | $this->assertEqual('html', $this->SeoUri->Email->sendAs); 49 | } 50 | 51 | function testDeleteUriDeletsMeta(){ 52 | $this->assertTrue($this->SeoUri->SeoMetaTag->hasAny(array('id' => 1))); 53 | $this->assertTrue($this->SeoUri->SeoMetaTag->hasAny(array('id' => 2))); 54 | $this->SeoUri->delete(9); 55 | $this->assertFalse($this->SeoUri->SeoMetaTag->hasAny(array('id' => 1))); 56 | $this->assertFalse($this->SeoUri->SeoMetaTag->hasAny(array('id' => 2))); 57 | } 58 | 59 | function testDeleteUriDeleteRedirect(){ 60 | $this->assertTrue($this->SeoUri->SeoRedirect->hasAny(array('id' => 7))); 61 | $this->SeoUri->delete(7); 62 | $this->assertFalse($this->SeoUri->SeoRedirect->hasAny(array('id' => 7))); 63 | } 64 | 65 | function endTest() { 66 | unset($this->SeoUri); 67 | ClassRegistry::flush(); 68 | } 69 | 70 | } 71 | ?> -------------------------------------------------------------------------------- /Test/Case/Model/SeoUrlTest.php: -------------------------------------------------------------------------------- 1 | SeoUrl = ClassRegistry::init('SeoUrl'); 11 | } 12 | 13 | function test_findRedirectByRequest(){ 14 | $this->SeoUrl->settings['cost_add'] = 1; 15 | $this->SeoUrl->settings['cost_change'] = 1; 16 | $this->SeoUrl->settings['cost_delete'] = 1; 17 | $result = $this->SeoUrl->findRedirectByRequest("/some_url"); 18 | $this->assertEqual($result, array('redirect' => '/some', 'shortest' => 4)); 19 | $result = $this->SeoUrl->findRedirectByRequest("/some_other_blah"); 20 | $this->assertEqual($result, array('redirect' => '/some_other_url', 'shortest' => 4)); 21 | $result = $this->SeoUrl->findRedirectByRequest("/some_other"); 22 | $this->assertEqual($result, array('redirect' => '/some_other', 'shortest' => 0)); 23 | } 24 | 25 | function test_levenshtien(){ 26 | $request = "/content/Hearing-loss/Treatment"; 27 | $add = 1; 28 | $change = 2; 29 | $delete = 3; 30 | $lev = levenshtein($request,"/content/Hearing-loss/Treatments", $add, $change, $delete); 31 | $this->assertEqual(1, $lev); 32 | 33 | $lev = levenshtein($request,"/content/articles/Hearing-loss/Protection/30207-Attention-couch-potatoes-time", $add, $change, $delete); 34 | $this->assertEqual(52, $lev); 35 | } 36 | 37 | function test_import(){ 38 | $result = $this->SeoUrl->import("/custom-sitemap.xml"); 39 | $this->assertEqual('269', $result); 40 | } 41 | 42 | function endTest() { 43 | unset($this->SeoUrl); 44 | ClassRegistry::flush(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Test/Case/View/Helper/SeoHelperTest.php: -------------------------------------------------------------------------------- 1 | Seo = new SeoHelper($View); 20 | $this->Seo->Html = new HtmlHelper($View); 21 | $cacheEngine = SeoUtil::getConfig('cacheEngine'); 22 | if (!empty($cacheEngine)) { 23 | Cache::clear($cacheEngine); 24 | } 25 | } 26 | 27 | function testGetABTestJS(){ 28 | $result = $this->Seo->getABTestJS(); 29 | 30 | } 31 | 32 | function test_dnsPrefetch() { 33 | //With Default DNS 34 | $result = $this->Seo->dnsPrefetch(); 35 | $this->assertEqual(null, $result); 36 | 37 | $result = $this->Seo->dnsPrefetch(array( 38 | '//www.facebook.com', 39 | '//use.typekit.net' 40 | )); 41 | $this->assertEual($result, ''); 42 | } 43 | 44 | function testCanonical(){ 45 | $result = $this->Seo->canonical('/example-url'); 46 | $this->assertEqual('', $result); 47 | 48 | $result = $this->Seo->canonical(); 49 | $this->assertEqual('', $result); 50 | 51 | $_SERVER['REQUEST_URI'] = '/canonical'; 52 | $result = $this->Seo->canonical(); 53 | $this->assertEqual('', $result); 54 | } 55 | 56 | function testHoneyPot(){ 57 | $result = $this->Seo->honeyPot(); 58 | $this->assertTrue(!empty($result)); 59 | } 60 | 61 | function testmetaTagsTags(){ 62 | $_SERVER['REQUEST_URI'] = '/uri_for_meta'; 63 | $results = $this->Seo->metaTags(); 64 | $this->assertEqual('', $results); 65 | 66 | $results = $this->Seo->metaTags(array('keywords' => 'ignore me')); 67 | $this->assertEqual('', $results); 68 | 69 | $results = $this->Seo->metaTags(array('no_ignore' => 'showme')); 70 | $this->assertEqual('', $results); 71 | } 72 | 73 | function testmetaTagsTagsWithHttpEquiv(){ 74 | $_SERVER['REQUEST_URI'] = '/uri_for_meta_equiv'; 75 | $results = $this->Seo->metaTags(); 76 | $this->assertEqual('', $results); 77 | } 78 | 79 | function testmetaTagsTagsWithOutAny(){ 80 | $_SERVER['REQUEST_URI'] = '/uri_has_not_meta'; 81 | $results = $this->Seo->metaTags(); 82 | $this->assertEqual('', $results); 83 | } 84 | 85 | function testmetaTagsTagsWithRegEx(){ 86 | $_SERVER['REQUEST_URI'] = '/uri_for_meta_reg_ex/this_should_match'; 87 | $results = $this->Seo->metaTags(); 88 | $this->assertEqual('', $results); 89 | } 90 | 91 | function testmetaTagsTagsDirectMatchShouldOverwrite(){ 92 | $_SERVER['REQUEST_URI'] = '/uri_for_meta_reg_ex/this_is_direct_match'; 93 | $results = $this->Seo->metaTags(); 94 | $this->assertEqual('', $results); 95 | } 96 | 97 | function testmetaTagsTagsWithWildCard(){ 98 | $_SERVER['REQUEST_URI'] = '/uri_for_meta_wild_card/wild_card'; 99 | $results = $this->Seo->metaTags(); 100 | $this->assertEqual('', $results); 101 | } 102 | 103 | function testTitleForUri(){ 104 | $_SERVER['REQUEST_URI'] = '/blah'; 105 | $results = $this->Seo->title(); 106 | $this->assertEqual('Title', $results); 107 | } 108 | 109 | function testTitleForUriWithDefault(){ 110 | $_SERVER['REQUEST_URI'] = '/blahNotDefined'; 111 | $results = $this->Seo->title('default'); 112 | $this->assertEqual('default', $results); 113 | } 114 | 115 | function endTest() { 116 | unset($this->SeometaTagsTag); 117 | ClassRegistry::flush(); 118 | } 119 | 120 | } 121 | ?> -------------------------------------------------------------------------------- /Test/Case/View/Helper/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/Test/Case/View/Helper/empty -------------------------------------------------------------------------------- /Test/Case/behaviors/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/Test/Case/behaviors/empty -------------------------------------------------------------------------------- /Test/Case/components/BlackListTest.php: -------------------------------------------------------------------------------- 1 | BlackList = new BlackListComponent(); 36 | $this->BlackList->Controller = new MockController(); 37 | $this->BlackList->SeoBlacklist = new TestBlacklist(); 38 | $this->BlackList->SeoHoneypotVisit = new TestHoneyPotVisit(); 39 | } 40 | 41 | function testIsBannedRedirect(){ 42 | $this->BlackList->Controller->here = '/'; 43 | $this->BlackList->Controller->expectOnce('redirect'); 44 | $this->assertTrue($this->BlackList->__isBanned()); 45 | } 46 | 47 | function testIsBannedOnBannedPage(){ 48 | $this->BlackList->Controller->here = '/seo/seo_blacklists/banned'; 49 | $this->BlackList->Controller->expectNever('redirect'); 50 | $this->assertTrue($this->BlackList->__isBanned()); 51 | } 52 | 53 | function testHandleHoneyPot(){ 54 | $this->BlackList->Controller->here = '/seo/seo_blacklists/honeypot'; 55 | $this->BlackList->Controller->expectOnce('redirect'); 56 | $this->assertTrue($this->BlackList->__isBanned()); 57 | } 58 | 59 | function endTest(){ 60 | unset($this->BlackList); 61 | } 62 | } 63 | ?> -------------------------------------------------------------------------------- /Test/Case/components/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/Test/Case/components/empty -------------------------------------------------------------------------------- /Test/Case/libs/SeoUtilTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(SeoUtil::loadSeoError()); 6 | } 7 | } 8 | ?> -------------------------------------------------------------------------------- /Test/Fixture/SeoABTestFixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 15 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'index'), 16 | 'is_active' => array('type' => 'boolean', 'null' => false, 'default' => '1', 'key' => 'index'), 17 | 'slug' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 50, 'key' => 'unique', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 18 | 'roll' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 200, 'collate' => 'utf8_general_ci', 'comment' => 'int based roll or Model::function callback', 'charset' => 'utf8'), 19 | 'testable' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 200, 'collate' => 'utf8_general_ci', 'comment' => 'int based roll or Model::function callback', 'charset' => 'utf8'), 20 | 'priority' => array('type' => 'integer', 'null' => false, 'default' => '999', 'length' => 4, 'key' => 'index', 'comment' => 'lower the priority, the more priority it has over the other tests.'), 21 | 'redmine' => array('type' => 'integer', 'null' => true, 'default' => null, 'comment' => 'redmine ticket id'), 22 | 'description' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 23 | 'start_date' => array('type' => 'date', 'null' => true, 'default' => null, 'key' => 'index', 'comment' => 'if null, we ignore it.'), 24 | 'end_date' => array('type' => 'date', 'null' => true, 'default' => null, 'key' => 'index', 'comment' => 'if null, we ignore it.'), 25 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 26 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), 27 | 'indexes' => array( 28 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), 29 | 'slug' => array('column' => 'slug', 'unique' => 1), 30 | 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0), 31 | 'is_active' => array('column' => 'is_active', 'unique' => 0), 32 | 'priority' => array('column' => 'priority', 'unique' => 0), 33 | 'end_date' => array('column' => 'end_date', 'unique' => 0), 34 | 'start_date' => array('column' => 'start_date', 'unique' => 0) 35 | ), 36 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 37 | ); 38 | 39 | /** 40 | * Records 41 | * 42 | * @var array 43 | */ 44 | public $records = array( 45 | array( 46 | 'id' => 1, 47 | 'seo_uri_id' => 1, 48 | 'is_active' => 1, 49 | 'slug' => 'Lorem ipsum dolor sit amet', 50 | 'roll' => '100', 51 | 'testable' => null, 52 | 'priority' => 1, 53 | 'redmine' => 1, 54 | 'description' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', 55 | 'start_date' => '2013-05-10', 56 | 'end_date' => '2013-05-10', 57 | 'created' => '2013-05-10 11:57:58', 58 | 'modified' => '2013-05-10 11:57:58' 59 | ), 60 | ); 61 | } 62 | -------------------------------------------------------------------------------- /Test/Fixture/SeoCanonicalFixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 15 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'index'), 16 | 'canonical' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 17 | 'is_active' => array('type' => 'boolean', 'null' => false, 'default' => '1'), 18 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 19 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), 20 | 'indexes' => array( 21 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), 22 | 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0) 23 | ), 24 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 25 | ); 26 | 27 | /** 28 | * Records 29 | * 30 | * @var array 31 | */ 32 | public $records = array( 33 | array( 34 | 'id' => 1, 35 | 'seo_uri_id' => 1, 36 | 'canonical' => 'Lorem ipsum dolor sit amet', 37 | 'is_active' => 1, 38 | 'created' => '2013-04-19 11:42:14', 39 | 'modified' => '2013-04-19 11:42:14' 40 | ), 41 | array( 42 | 'id' => 2, 43 | 'seo_uri_id' => 2, 44 | 'canonical' => 'Lorem ipsum dolor sit amet', 45 | 'is_active' => 1, 46 | 'created' => '2013-04-19 11:42:14', 47 | 'modified' => '2013-04-19 11:42:14' 48 | ), 49 | array( 50 | 'id' => 3, 51 | 'seo_uri_id' => 3, 52 | 'canonical' => 'Lorem ipsum dolor sit amet', 53 | 'is_active' => 1, 54 | 'created' => '2013-04-19 11:42:14', 55 | 'modified' => '2013-04-19 11:42:14' 56 | ), 57 | array( 58 | 'id' => 4, 59 | 'seo_uri_id' => 4, 60 | 'canonical' => 'Lorem ipsum dolor sit amet', 61 | 'is_active' => 1, 62 | 'created' => '2013-04-19 11:42:14', 63 | 'modified' => '2013-04-19 11:42:14' 64 | ), 65 | array( 66 | 'id' => 5, 67 | 'seo_uri_id' => 5, 68 | 'canonical' => 'Lorem ipsum dolor sit amet', 69 | 'is_active' => 1, 70 | 'created' => '2013-04-19 11:42:14', 71 | 'modified' => '2013-04-19 11:42:14' 72 | ), 73 | array( 74 | 'id' => 6, 75 | 'seo_uri_id' => 6, 76 | 'canonical' => 'Lorem ipsum dolor sit amet', 77 | 'is_active' => 1, 78 | 'created' => '2013-04-19 11:42:14', 79 | 'modified' => '2013-04-19 11:42:14' 80 | ), 81 | array( 82 | 'id' => 7, 83 | 'seo_uri_id' => 7, 84 | 'canonical' => 'Lorem ipsum dolor sit amet', 85 | 'is_active' => 1, 86 | 'created' => '2013-04-19 11:42:14', 87 | 'modified' => '2013-04-19 11:42:14' 88 | ), 89 | array( 90 | 'id' => 8, 91 | 'seo_uri_id' => 8, 92 | 'canonical' => 'Lorem ipsum dolor sit amet', 93 | 'is_active' => 1, 94 | 'created' => '2013-04-19 11:42:14', 95 | 'modified' => '2013-04-19 11:42:14' 96 | ), 97 | array( 98 | 'id' => 9, 99 | 'seo_uri_id' => 9, 100 | 'canonical' => 'Lorem ipsum dolor sit amet', 101 | 'is_active' => 1, 102 | 'created' => '2013-04-19 11:42:14', 103 | 'modified' => '2013-04-19 11:42:14' 104 | ), 105 | array( 106 | 'id' => 10, 107 | 'seo_uri_id' => 10, 108 | 'canonical' => 'Lorem ipsum dolor sit amet', 109 | 'is_active' => 1, 110 | 'created' => '2013-04-19 11:42:14', 111 | 'modified' => '2013-04-19 11:42:14' 112 | ), 113 | ); 114 | 115 | } 116 | -------------------------------------------------------------------------------- /Test/Fixture/SeoHoneypotVisitFixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 15 | 'ip' => array('type' => 'biginteger', 'null' => false, 'default' => null, 'key' => 'index'), 16 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 17 | 'indexes' => array( 18 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), 19 | 'ip' => array('column' => 'ip', 'unique' => 0) 20 | ), 21 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 22 | ); 23 | 24 | /** 25 | * Records 26 | * 27 | * @var array 28 | */ 29 | public $records = array( 30 | array( 31 | 'id' => 1, 32 | 'ip' => '', 33 | 'created' => '2013-04-19 11:42:25' 34 | ), 35 | array( 36 | 'id' => 2, 37 | 'ip' => '', 38 | 'created' => '2013-04-19 11:42:25' 39 | ), 40 | array( 41 | 'id' => 3, 42 | 'ip' => '', 43 | 'created' => '2013-04-19 11:42:25' 44 | ), 45 | array( 46 | 'id' => 4, 47 | 'ip' => '', 48 | 'created' => '2013-04-19 11:42:25' 49 | ), 50 | array( 51 | 'id' => 5, 52 | 'ip' => '', 53 | 'created' => '2013-04-19 11:42:25' 54 | ), 55 | array( 56 | 'id' => 6, 57 | 'ip' => '', 58 | 'created' => '2013-04-19 11:42:25' 59 | ), 60 | array( 61 | 'id' => 7, 62 | 'ip' => '', 63 | 'created' => '2013-04-19 11:42:25' 64 | ), 65 | array( 66 | 'id' => 8, 67 | 'ip' => '', 68 | 'created' => '2013-04-19 11:42:25' 69 | ), 70 | array( 71 | 'id' => 9, 72 | 'ip' => '', 73 | 'created' => '2013-04-19 11:42:25' 74 | ), 75 | array( 76 | 'id' => 10, 77 | 'ip' => '', 78 | 'created' => '2013-04-19 11:42:25' 79 | ), 80 | ); 81 | 82 | } 83 | -------------------------------------------------------------------------------- /Test/Fixture/SeoMetaTagFixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 15 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'index'), 16 | 'name' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 17 | 'content' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 18 | 'is_http_equiv' => array('type' => 'boolean', 'null' => false, 'default' => '0'), 19 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 20 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), 21 | 'indexes' => array( 22 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), 23 | 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0) 24 | ), 25 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 26 | ); 27 | 28 | /** 29 | * Records 30 | * 31 | * @var array 32 | */ 33 | public $records = array( 34 | array( 35 | 'id' => 1, 36 | 'seo_uri_id' => 1, 37 | 'name' => 'Lorem ipsum dolor sit amet', 38 | 'content' => 'Lorem ipsum dolor sit amet', 39 | 'is_http_equiv' => 1, 40 | 'created' => '2013-04-19 11:42:34', 41 | 'modified' => '2013-04-19 11:42:34' 42 | ), 43 | array( 44 | 'id' => 2, 45 | 'seo_uri_id' => 2, 46 | 'name' => 'Lorem ipsum dolor sit amet', 47 | 'content' => 'Lorem ipsum dolor sit amet', 48 | 'is_http_equiv' => 1, 49 | 'created' => '2013-04-19 11:42:34', 50 | 'modified' => '2013-04-19 11:42:34' 51 | ), 52 | array( 53 | 'id' => 3, 54 | 'seo_uri_id' => 3, 55 | 'name' => 'Lorem ipsum dolor sit amet', 56 | 'content' => 'Lorem ipsum dolor sit amet', 57 | 'is_http_equiv' => 1, 58 | 'created' => '2013-04-19 11:42:34', 59 | 'modified' => '2013-04-19 11:42:34' 60 | ), 61 | array( 62 | 'id' => 4, 63 | 'seo_uri_id' => 4, 64 | 'name' => 'Lorem ipsum dolor sit amet', 65 | 'content' => 'Lorem ipsum dolor sit amet', 66 | 'is_http_equiv' => 1, 67 | 'created' => '2013-04-19 11:42:34', 68 | 'modified' => '2013-04-19 11:42:34' 69 | ), 70 | array( 71 | 'id' => 5, 72 | 'seo_uri_id' => 5, 73 | 'name' => 'Lorem ipsum dolor sit amet', 74 | 'content' => 'Lorem ipsum dolor sit amet', 75 | 'is_http_equiv' => 1, 76 | 'created' => '2013-04-19 11:42:34', 77 | 'modified' => '2013-04-19 11:42:34' 78 | ), 79 | array( 80 | 'id' => 6, 81 | 'seo_uri_id' => 6, 82 | 'name' => 'Lorem ipsum dolor sit amet', 83 | 'content' => 'Lorem ipsum dolor sit amet', 84 | 'is_http_equiv' => 1, 85 | 'created' => '2013-04-19 11:42:34', 86 | 'modified' => '2013-04-19 11:42:34' 87 | ), 88 | array( 89 | 'id' => 7, 90 | 'seo_uri_id' => 7, 91 | 'name' => 'Lorem ipsum dolor sit amet', 92 | 'content' => 'Lorem ipsum dolor sit amet', 93 | 'is_http_equiv' => 1, 94 | 'created' => '2013-04-19 11:42:34', 95 | 'modified' => '2013-04-19 11:42:34' 96 | ), 97 | array( 98 | 'id' => 8, 99 | 'seo_uri_id' => 8, 100 | 'name' => 'Lorem ipsum dolor sit amet', 101 | 'content' => 'Lorem ipsum dolor sit amet', 102 | 'is_http_equiv' => 1, 103 | 'created' => '2013-04-19 11:42:34', 104 | 'modified' => '2013-04-19 11:42:34' 105 | ), 106 | array( 107 | 'id' => 9, 108 | 'seo_uri_id' => 9, 109 | 'name' => 'Lorem ipsum dolor sit amet', 110 | 'content' => 'Lorem ipsum dolor sit amet', 111 | 'is_http_equiv' => 1, 112 | 'created' => '2013-04-19 11:42:34', 113 | 'modified' => '2013-04-19 11:42:34' 114 | ), 115 | array( 116 | 'id' => 10, 117 | 'seo_uri_id' => 10, 118 | 'name' => 'Lorem ipsum dolor sit amet', 119 | 'content' => 'Lorem ipsum dolor sit amet', 120 | 'is_http_equiv' => 1, 121 | 'created' => '2013-04-19 11:42:34', 122 | 'modified' => '2013-04-19 11:42:34' 123 | ), 124 | ); 125 | 126 | } 127 | -------------------------------------------------------------------------------- /Test/Fixture/SeoSearchTermFixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 15 | 'term' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'The term found by Google', 'charset' => 'utf8'), 16 | 'uri' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'The URL this term points to', 'charset' => 'utf8'), 17 | 'count' => array('type' => 'integer', 'null' => false, 'default' => null, 'comment' => 'how many times this term has been searched for'), 18 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 19 | 'indexes' => array( 20 | 'PRIMARY' => array('column' => 'id', 'unique' => 1) 21 | ), 22 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 23 | ); 24 | 25 | /** 26 | * Records 27 | * 28 | * @var array 29 | */ 30 | public $records = array( 31 | array( 32 | 'id' => 1, 33 | 'term' => 'Lorem ipsum dolor sit amet', 34 | 'uri' => 'Lorem ipsum dolor sit amet', 35 | 'count' => 1, 36 | 'created' => '2013-04-19 11:43:06' 37 | ), 38 | array( 39 | 'id' => 2, 40 | 'term' => 'Lorem ipsum dolor sit amet', 41 | 'uri' => 'Lorem ipsum dolor sit amet', 42 | 'count' => 2, 43 | 'created' => '2013-04-19 11:43:06' 44 | ), 45 | array( 46 | 'id' => 3, 47 | 'term' => 'Lorem ipsum dolor sit amet', 48 | 'uri' => 'Lorem ipsum dolor sit amet', 49 | 'count' => 3, 50 | 'created' => '2013-04-19 11:43:06' 51 | ), 52 | array( 53 | 'id' => 4, 54 | 'term' => 'Lorem ipsum dolor sit amet', 55 | 'uri' => 'Lorem ipsum dolor sit amet', 56 | 'count' => 4, 57 | 'created' => '2013-04-19 11:43:06' 58 | ), 59 | array( 60 | 'id' => 5, 61 | 'term' => 'Lorem ipsum dolor sit amet', 62 | 'uri' => 'Lorem ipsum dolor sit amet', 63 | 'count' => 5, 64 | 'created' => '2013-04-19 11:43:06' 65 | ), 66 | array( 67 | 'id' => 6, 68 | 'term' => 'Lorem ipsum dolor sit amet', 69 | 'uri' => 'Lorem ipsum dolor sit amet', 70 | 'count' => 6, 71 | 'created' => '2013-04-19 11:43:06' 72 | ), 73 | array( 74 | 'id' => 7, 75 | 'term' => 'Lorem ipsum dolor sit amet', 76 | 'uri' => 'Lorem ipsum dolor sit amet', 77 | 'count' => 7, 78 | 'created' => '2013-04-19 11:43:06' 79 | ), 80 | array( 81 | 'id' => 8, 82 | 'term' => 'Lorem ipsum dolor sit amet', 83 | 'uri' => 'Lorem ipsum dolor sit amet', 84 | 'count' => 8, 85 | 'created' => '2013-04-19 11:43:06' 86 | ), 87 | array( 88 | 'id' => 9, 89 | 'term' => 'Lorem ipsum dolor sit amet', 90 | 'uri' => 'Lorem ipsum dolor sit amet', 91 | 'count' => 9, 92 | 'created' => '2013-04-19 11:43:06' 93 | ), 94 | array( 95 | 'id' => 10, 96 | 'term' => 'Lorem ipsum dolor sit amet', 97 | 'uri' => 'Lorem ipsum dolor sit amet', 98 | 'count' => 10, 99 | 'created' => '2013-04-19 11:43:06' 100 | ), 101 | ); 102 | 103 | } 104 | -------------------------------------------------------------------------------- /Test/Fixture/SeoStatusCodeFixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 15 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'index'), 16 | 'status_code' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 3), 17 | 'priority' => array('type' => 'integer', 'null' => false, 'default' => '100', 'length' => 4), 18 | 'is_active' => array('type' => 'boolean', 'null' => false, 'default' => '1'), 19 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 20 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), 21 | 'indexes' => array( 22 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), 23 | 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0) 24 | ), 25 | 'tableParameters' => array('charset' => 'latin1', 'collate' => 'latin1_swedish_ci', 'engine' => 'MyISAM') 26 | ); 27 | 28 | /** 29 | * Records 30 | * 31 | * @var array 32 | */ 33 | public $records = array( 34 | array( 35 | 'id' => 1, 36 | 'seo_uri_id' => 1, 37 | 'status_code' => 1, 38 | 'priority' => 1, 39 | 'is_active' => 1, 40 | 'created' => '2013-04-19 11:43:13', 41 | 'modified' => '2013-04-19 11:43:13' 42 | ), 43 | array( 44 | 'id' => 2, 45 | 'seo_uri_id' => 2, 46 | 'status_code' => 2, 47 | 'priority' => 2, 48 | 'is_active' => 1, 49 | 'created' => '2013-04-19 11:43:13', 50 | 'modified' => '2013-04-19 11:43:13' 51 | ), 52 | array( 53 | 'id' => 3, 54 | 'seo_uri_id' => 3, 55 | 'status_code' => 3, 56 | 'priority' => 3, 57 | 'is_active' => 1, 58 | 'created' => '2013-04-19 11:43:13', 59 | 'modified' => '2013-04-19 11:43:13' 60 | ), 61 | array( 62 | 'id' => 4, 63 | 'seo_uri_id' => 4, 64 | 'status_code' => 4, 65 | 'priority' => 4, 66 | 'is_active' => 1, 67 | 'created' => '2013-04-19 11:43:13', 68 | 'modified' => '2013-04-19 11:43:13' 69 | ), 70 | array( 71 | 'id' => 5, 72 | 'seo_uri_id' => 5, 73 | 'status_code' => 5, 74 | 'priority' => 5, 75 | 'is_active' => 1, 76 | 'created' => '2013-04-19 11:43:13', 77 | 'modified' => '2013-04-19 11:43:13' 78 | ), 79 | array( 80 | 'id' => 6, 81 | 'seo_uri_id' => 6, 82 | 'status_code' => 6, 83 | 'priority' => 6, 84 | 'is_active' => 1, 85 | 'created' => '2013-04-19 11:43:13', 86 | 'modified' => '2013-04-19 11:43:13' 87 | ), 88 | array( 89 | 'id' => 7, 90 | 'seo_uri_id' => 7, 91 | 'status_code' => 7, 92 | 'priority' => 7, 93 | 'is_active' => 1, 94 | 'created' => '2013-04-19 11:43:13', 95 | 'modified' => '2013-04-19 11:43:13' 96 | ), 97 | array( 98 | 'id' => 8, 99 | 'seo_uri_id' => 8, 100 | 'status_code' => 8, 101 | 'priority' => 8, 102 | 'is_active' => 1, 103 | 'created' => '2013-04-19 11:43:13', 104 | 'modified' => '2013-04-19 11:43:13' 105 | ), 106 | array( 107 | 'id' => 9, 108 | 'seo_uri_id' => 9, 109 | 'status_code' => 9, 110 | 'priority' => 9, 111 | 'is_active' => 1, 112 | 'created' => '2013-04-19 11:43:13', 113 | 'modified' => '2013-04-19 11:43:13' 114 | ), 115 | array( 116 | 'id' => 10, 117 | 'seo_uri_id' => 10, 118 | 'status_code' => 10, 119 | 'priority' => 10, 120 | 'is_active' => 1, 121 | 'created' => '2013-04-19 11:43:13', 122 | 'modified' => '2013-04-19 11:43:13' 123 | ), 124 | ); 125 | 126 | } 127 | -------------------------------------------------------------------------------- /Test/Fixture/SeoTitleFixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 15 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'index'), 16 | 'title' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 17 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 18 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), 19 | 'indexes' => array( 20 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), 21 | 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0) 22 | ), 23 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 24 | ); 25 | 26 | /** 27 | * Records 28 | * 29 | * @var array 30 | */ 31 | public $records = array( 32 | array( 33 | 'id' => 1, 34 | 'seo_uri_id' => 1, 35 | 'title' => 'Lorem ipsum dolor sit amet', 36 | 'created' => '2013-04-19 11:41:34', 37 | 'modified' => '2013-04-19 11:41:34' 38 | ), 39 | array( 40 | 'id' => 2, 41 | 'seo_uri_id' => 2, 42 | 'title' => 'Lorem ipsum dolor sit amet', 43 | 'created' => '2013-04-19 11:41:34', 44 | 'modified' => '2013-04-19 11:41:34' 45 | ), 46 | array( 47 | 'id' => 3, 48 | 'seo_uri_id' => 3, 49 | 'title' => 'Lorem ipsum dolor sit amet', 50 | 'created' => '2013-04-19 11:41:34', 51 | 'modified' => '2013-04-19 11:41:34' 52 | ), 53 | array( 54 | 'id' => 4, 55 | 'seo_uri_id' => 4, 56 | 'title' => 'Lorem ipsum dolor sit amet', 57 | 'created' => '2013-04-19 11:41:34', 58 | 'modified' => '2013-04-19 11:41:34' 59 | ), 60 | array( 61 | 'id' => 5, 62 | 'seo_uri_id' => 5, 63 | 'title' => 'Lorem ipsum dolor sit amet', 64 | 'created' => '2013-04-19 11:41:34', 65 | 'modified' => '2013-04-19 11:41:34' 66 | ), 67 | array( 68 | 'id' => 6, 69 | 'seo_uri_id' => 6, 70 | 'title' => 'Lorem ipsum dolor sit amet', 71 | 'created' => '2013-04-19 11:41:34', 72 | 'modified' => '2013-04-19 11:41:34' 73 | ), 74 | array( 75 | 'id' => 7, 76 | 'seo_uri_id' => 7, 77 | 'title' => 'Lorem ipsum dolor sit amet', 78 | 'created' => '2013-04-19 11:41:34', 79 | 'modified' => '2013-04-19 11:41:34' 80 | ), 81 | array( 82 | 'id' => 8, 83 | 'seo_uri_id' => 8, 84 | 'title' => 'Lorem ipsum dolor sit amet', 85 | 'created' => '2013-04-19 11:41:34', 86 | 'modified' => '2013-04-19 11:41:34' 87 | ), 88 | array( 89 | 'id' => 9, 90 | 'seo_uri_id' => 9, 91 | 'title' => 'Lorem ipsum dolor sit amet', 92 | 'created' => '2013-04-19 11:41:34', 93 | 'modified' => '2013-04-19 11:41:34' 94 | ), 95 | array( 96 | 'id' => 10, 97 | 'seo_uri_id' => 10, 98 | 'title' => 'Lorem ipsum dolor sit amet', 99 | 'created' => '2013-04-19 11:41:34', 100 | 'modified' => '2013-04-19 11:41:34' 101 | ), 102 | ); 103 | 104 | } 105 | -------------------------------------------------------------------------------- /Test/Fixture/SeoUriFixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 15 | 'uri' => array('type' => 'string', 'null' => true, 'default' => null, 'key' => 'unique', 'collate' => 'utf8_bin', 'charset' => 'utf8'), 16 | 'is_approved' => array('type' => 'boolean', 'null' => false, 'default' => '1'), 17 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 18 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), 19 | 'indexes' => array( 20 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), 21 | 'uri' => array('column' => 'uri', 'unique' => 1) 22 | ), 23 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 24 | ); 25 | 26 | /** 27 | * Records 28 | * 29 | * @var array 30 | */ 31 | public $records = array( 32 | array( 33 | 'id' => 1, 34 | 'uri' => 'Lorem ipsum dolor sit amet', 35 | 'is_approved' => 1, 36 | 'created' => '2013-04-19 11:43:24', 37 | 'modified' => '2013-04-19 11:43:24' 38 | ), 39 | ); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Test/Fixture/SeoUrlFixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 15 | 'url' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'unique', 'collate' => 'utf8_bin', 'charset' => 'utf8'), 16 | 'priority' => array('type' => 'float', 'null' => false, 'default' => null, 'key' => 'index'), 17 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 18 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), 19 | 'indexes' => array( 20 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), 21 | 'url' => array('column' => 'url', 'unique' => 1), 22 | 'priority' => array('column' => 'priority', 'unique' => 0) 23 | ), 24 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_bin', 'engine' => 'MyISAM') 25 | ); 26 | 27 | /** 28 | * Records 29 | * 30 | * @var array 31 | */ 32 | public $records = array( 33 | array( 34 | 'id' => 1, 35 | 'url' => 'Lorem ipsum dolor sit amet', 36 | 'priority' => 1, 37 | 'created' => '2013-04-19 11:43:35', 38 | 'modified' => '2013-04-19 11:43:35' 39 | ), 40 | array( 41 | 'id' => 2, 42 | 'url' => 'Lorem ipsum dolor sit amet', 43 | 'priority' => 2, 44 | 'created' => '2013-04-19 11:43:35', 45 | 'modified' => '2013-04-19 11:43:35' 46 | ), 47 | array( 48 | 'id' => 3, 49 | 'url' => 'Lorem ipsum dolor sit amet', 50 | 'priority' => 3, 51 | 'created' => '2013-04-19 11:43:35', 52 | 'modified' => '2013-04-19 11:43:35' 53 | ), 54 | array( 55 | 'id' => 4, 56 | 'url' => 'Lorem ipsum dolor sit amet', 57 | 'priority' => 4, 58 | 'created' => '2013-04-19 11:43:35', 59 | 'modified' => '2013-04-19 11:43:35' 60 | ), 61 | array( 62 | 'id' => 5, 63 | 'url' => 'Lorem ipsum dolor sit amet', 64 | 'priority' => 5, 65 | 'created' => '2013-04-19 11:43:35', 66 | 'modified' => '2013-04-19 11:43:35' 67 | ), 68 | array( 69 | 'id' => 6, 70 | 'url' => 'Lorem ipsum dolor sit amet', 71 | 'priority' => 6, 72 | 'created' => '2013-04-19 11:43:35', 73 | 'modified' => '2013-04-19 11:43:35' 74 | ), 75 | array( 76 | 'id' => 7, 77 | 'url' => 'Lorem ipsum dolor sit amet', 78 | 'priority' => 7, 79 | 'created' => '2013-04-19 11:43:35', 80 | 'modified' => '2013-04-19 11:43:35' 81 | ), 82 | array( 83 | 'id' => 8, 84 | 'url' => 'Lorem ipsum dolor sit amet', 85 | 'priority' => 8, 86 | 'created' => '2013-04-19 11:43:35', 87 | 'modified' => '2013-04-19 11:43:35' 88 | ), 89 | array( 90 | 'id' => 9, 91 | 'url' => 'Lorem ipsum dolor sit amet', 92 | 'priority' => 9, 93 | 'created' => '2013-04-19 11:43:35', 94 | 'modified' => '2013-04-19 11:43:35' 95 | ), 96 | array( 97 | 'id' => 10, 98 | 'url' => 'Lorem ipsum dolor sit amet', 99 | 'priority' => 10, 100 | 'created' => '2013-04-19 11:43:35', 101 | 'modified' => '2013-04-19 11:43:35' 102 | ), 103 | ); 104 | 105 | } 106 | -------------------------------------------------------------------------------- /Test/Fixture/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/Test/Fixture/empty -------------------------------------------------------------------------------- /Test/Fixture/seo_blacklist_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'ip_range_start' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 20, 'key' => 'index'), 9 | 'ip_range_end' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 20, 'key' => 'index'), 10 | 'note' => array('type' => 'text', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 11 | 'is_active' => array('type' => 'boolean', 'null' => false, 'default' => '1'), 12 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 13 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 14 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ip_range_start' => array('column' => 'ip_range_start', 'unique' => 0), 'ip_range_end' => array('column' => 'ip_range_end', 'unique' => 0)), 15 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 16 | ); 17 | 18 | var $records = array( 19 | array( 20 | 'id' => 1, 21 | 'ip_range_start' => 2147483000, 22 | 'ip_range_end' => 2147483002, 23 | 'note' => 'This is a note', 24 | 'is_active' => 1, 25 | 'created' => '2011-02-02 11:19:31', 26 | 'modified' => '2011-02-02 11:19:31' 27 | ), 28 | array( 29 | 'id' => 2, 30 | 'ip_range_start' => 2147483100, 31 | 'ip_range_end' => 2147483100, 32 | 'note' => 'This is a note', 33 | 'is_active' => 0, //not active 34 | 'created' => '2011-02-02 11:19:31', 35 | 'modified' => '2011-02-02 11:19:31' 36 | ), 37 | ); 38 | } 39 | ?> -------------------------------------------------------------------------------- /Test/Fixture/seo_canonical_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'index'), 9 | 'canonical' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 10 | 'is_active' => array('type' => 'boolean', 'null' => false, 'default' => '1'), 11 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 12 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 13 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0)), 14 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 15 | ); 16 | 17 | var $records = array( 18 | array( 19 | 'id' => 1, 20 | 'seo_uri_id' => 16, 21 | 'canonical' => '/new_canonical_link', 22 | 'is_active' => 1, 23 | 'created' => '2011-07-27 11:26:10', 24 | 'modified' => '2011-07-27 11:26:10' 25 | ), 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /Test/Fixture/seo_honeypot_visit_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'ip' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 20), 9 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 10 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)), 11 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 12 | ); 13 | 14 | var $records = array( 15 | array( 16 | 'id' => 1, 17 | 'ip' => 2147483000, 18 | 'created' => '2011-01-01 19:03:42' 19 | ), 20 | ); 21 | } 22 | ?> -------------------------------------------------------------------------------- /Test/Fixture/seo_meta_tag_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'index'), 9 | 'name' => array('type' => 'string', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 10 | 'content' => array('type' => 'string', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 11 | 'is_http_equiv' => array('type' => 'boolean', 'null' => false, 'default' => '0'), 12 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 13 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 14 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0)), 15 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 16 | ); 17 | 18 | var $records = array( 19 | array( 20 | 'id' => 1, 21 | 'seo_uri_id' => 9, 22 | 'name' => 'keywords', 23 | 'content' => 'content_1', 24 | 'is_http_equiv' => 0, 25 | 'created' => '2011-01-03 10:04:07', 26 | 'modified' => '2011-01-03 10:04:07' 27 | ), 28 | array( 29 | 'id' => 2, 30 | 'seo_uri_id' => 9, 31 | 'name' => 'description', 32 | 'content' => 'content_2', 33 | 'is_http_equiv' => 0, 34 | 'created' => '2011-01-03 10:04:07', 35 | 'modified' => '2011-01-03 10:04:07' 36 | ), 37 | array( 38 | 'id' =>3, 39 | 'seo_uri_id' => 10, 40 | 'name' => 'content-type', 41 | 'content' => 'text/html', 42 | 'is_http_equiv' => 1, 43 | 'created' => '2011-01-03 10:04:07', 44 | 'modified' => '2011-01-03 10:04:07' 45 | ), 46 | array( 47 | 'id' => 4, 48 | 'seo_uri_id' => 11, 49 | 'name' => 'default', 50 | 'content' => 'content_default', 51 | 'is_http_equiv' => 0, 52 | 'created' => '2011-01-03 10:04:07', 53 | 'modified' => '2011-01-03 10:04:07' 54 | ), 55 | array( 56 | 'id' => 5, 57 | 'seo_uri_id' => 11, 58 | 'name' => 'description_default', 59 | 'content' => 'content_default_2', 60 | 'is_http_equiv' => 0, 61 | 'created' => '2011-01-03 10:04:07', 62 | 'modified' => '2011-01-03 10:04:07' 63 | ), 64 | array( 65 | 'id' => 6, 66 | 'seo_uri_id' => 12, 67 | 'name' => 'direct_match', 68 | 'content' => 'direct_match_content', 69 | 'is_http_equiv' => 0, 70 | 'created' => '2011-01-03 10:04:07', 71 | 'modified' => '2011-01-03 10:04:07' 72 | ), 73 | array( 74 | 'id' => 7, 75 | 'seo_uri_id' => 13, 76 | 'name' => 'wild_card_match', 77 | 'content' => 'wild_card_match_content', 78 | 'is_http_equiv' => 0, 79 | 'created' => '2011-01-03 10:04:07', 80 | 'modified' => '2011-01-03 10:04:07' 81 | ), 82 | ); 83 | } 84 | ?> -------------------------------------------------------------------------------- /Test/Fixture/seo_redirect_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'index'), 9 | 'redirect' => array('type' => 'string', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 10 | 'priority' => array('type' => 'integer', 'null' => false, 'default' => '100'), 11 | 'is_active' => array('type' => 'boolean', 'null' => false, 'default' => '1'), 12 | 'callback' => array('type' => 'string', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 13 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 14 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 15 | 'is_nocache' => array('type' => 'boolean', 'null' => false, 'default' => '0'), 16 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0)), 17 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 18 | ); 19 | 20 | var $records = array( 21 | array( 22 | 'id' => 1, 23 | 'seo_uri_id' => 1, 24 | 'redirect' => '/', 25 | 'callback' => '', 26 | 'priority' => 10, 27 | 'is_active' => 1, 28 | 'created' => '2010-10-05 18:08:19', 29 | 'is_nocache' => 0 30 | ), 31 | array( 32 | 'id' => 2, 33 | 'seo_uri_id' => 2, 34 | 'redirect' => '/new', 35 | 'callback' => '', 36 | 'priority' => 5, 37 | 'is_active' => 1, 38 | 'created' => '2010-10-05 18:08:19', 39 | 'is_nocache' => 0 40 | ), 41 | array( 42 | 'id' => 3, 43 | 'seo_uri_id' => 3, 44 | 'redirect' => '/', 45 | 'callback' => '', 46 | 'priority' => 1, 47 | 'is_active' => 0, 48 | 'created' => '2010-10-05 18:08:19', 49 | 'is_nocache' => 0 50 | ), 51 | array( 52 | 'id' => 4, 53 | 'seo_uri_id' => 4, 54 | 'redirect' => '/priority', 55 | 'callback' => '', 56 | 'priority' => 1, 57 | 'is_active' => 1, 58 | 'created' => '2010-10-05 18:08:19', 59 | 'is_nocache' => 0 60 | ), 61 | array( 62 | 'id' => 5, 63 | 'seo_uri_id' => 5, 64 | 'redirect' => '$1', 65 | 'callback' => '', 66 | 'priority' => 10, 67 | 'is_active' => 1, 68 | 'created' => '2010-10-05 18:08:19', 69 | 'is_nocache' => 0 70 | ), 71 | array( 72 | 'id' => 6, 73 | 'seo_uri_id' => 6, 74 | 'redirect' => '/', 75 | 'callback' => '', 76 | 'priority' => 1, 77 | 'is_active' => 1, 78 | 'created' => '2010-10-05 18:08:19', 79 | 'is_nocache' => 0 80 | ), 81 | array( 82 | 'id' => 7, 83 | 'seo_uri_id' => 7, 84 | 'redirect' => '/questions/$1', 85 | 'callback' => '', 86 | 'priority' => 1, 87 | 'is_active' => 1, 88 | 'created' => '2010-10-05 18:08:19', 89 | 'is_nocache' => 0 90 | ), 91 | array( 92 | 'id' => 8, 93 | 'seo_uri_id' => 8, 94 | 'redirect' => '/{callback}', 95 | 'callback' => 'SeoRedirect::callbackTest', 96 | 'priority' => 1, 97 | 'is_active' => 1, 98 | 'created' => '2010-10-05 18:08:19', 99 | 'is_nocache' => 0 100 | ), 101 | ); 102 | } 103 | ?> 104 | -------------------------------------------------------------------------------- /Test/Fixture/seo_search_term_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'term' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'comment' => 'The term found by Google', 'charset' => 'utf8'), 9 | 'uri' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'comment' => 'The URL this term points to', 'charset' => 'utf8'), 10 | 'count' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'comment' => 'how many times this term has been searched for'), 11 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 12 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)), 13 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 14 | ); 15 | 16 | var $records = array( 17 | array( 18 | 'id' => 1, 19 | 'term' => 'Lorem ipsum', 20 | 'uri' => '/some_url', 21 | 'count' => 1, 22 | 'created' => '2011-11-18 23:27:41' 23 | ), 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /Test/Fixture/seo_status_code_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'index'), 9 | 'status_code' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 3), 10 | 'priority' => array('type' => 'integer', 'null' => false, 'default' => '100', 'length' => 4), 11 | 'is_active' => array('type' => 'boolean', 'null' => false, 'default' => '1'), 12 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 13 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 14 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0)), 15 | 'tableParameters' => array('charset' => 'latin1', 'collate' => 'latin1_swedish_ci', 'engine' => 'MyISAM') 16 | ); 17 | 18 | var $records = array( 19 | array( 20 | 'id' => 1, 21 | 'seo_uri_id' => 15, 22 | 'status_code' => 410, 23 | 'priority' => 100, 24 | 'is_active' => 1, 25 | 'created' => '2011-07-25 17:06:20', 26 | 'modified' => '2011-07-25 17:06:20' 27 | ), 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /Test/Fixture/seo_title_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'seo_uri_id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'index'), 9 | 'title' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 10 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 11 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 12 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'seo_uri_id' => array('column' => 'seo_uri_id', 'unique' => 0)), 13 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 14 | ); 15 | 16 | var $records = array( 17 | array( 18 | 'id' => 1, 19 | 'seo_uri_id' => 1, 20 | 'title' => 'Title', 21 | 'created' => '2011-01-05 18:15:00', 22 | 'modified' => '2011-01-05 18:15:00' 23 | ), 24 | ); 25 | } 26 | ?> -------------------------------------------------------------------------------- /Test/Fixture/seo_uri_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'uri' => array('type' => 'string', 'null' => true, 'default' => NULL, 'key' => 'unique', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 9 | 'is_approved' => array('type' => 'boolean', 'null' => false, 'default' => '1'), 10 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 11 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 12 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'uri' => array('column' => 'uri', 'unique' => 1)), 13 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') 14 | ); 15 | 16 | 17 | var $records = array( 18 | array( 19 | 'id' => 1, 20 | 'uri' => '/blah', 21 | 'is_approved' => 1, 22 | 'created' => '2011-01-03 10:04:34', 23 | 'modified' => '2011-01-03 10:04:34' 24 | ), 25 | array( 26 | 'id' => 2, 27 | 'uri' => '/blahblah*', 28 | 'is_approved' => 1, 29 | 'created' => '2011-01-03 10:04:34', 30 | 'modified' => '2011-01-03 10:04:34' 31 | ), 32 | array( 33 | 'id' => 3, 34 | 'uri' => '/not_active', 35 | 'is_approved' => 0, 36 | 'created' => '2011-01-03 10:04:34', 37 | 'modified' => '2011-01-03 10:04:34' 38 | ), 39 | array( 40 | 'id' => 4, 41 | 'uri' => '/blahblahblah*', 42 | 'is_approved' => 1, 43 | 'created' => '2011-01-03 10:04:34', 44 | 'modified' => '2011-01-03 10:04:34' 45 | ), 46 | array( 47 | 'id' => 5, 48 | 'uri' => '#(.*)\?from\=sb\-tracked\:(.*)#i', 49 | 'is_approved' => 1, 50 | 'created' => '2011-01-03 10:04:34', 51 | 'modified' => '2011-01-03 10:04:34' 52 | ), 53 | array( 54 | 'id' => 6, 55 | 'uri' => '#(.*)#i', 56 | 'is_approved' => 0, 57 | 'created' => '2011-01-03 10:04:34', 58 | 'modified' => '2011-01-03 10:04:34' 59 | ), 60 | array( 61 | 'id' => 7, 62 | 'uri' => '#/qas/(.*)#', 63 | 'is_approved' => 1, 64 | 'created' => '2011-01-03 10:04:34', 65 | 'modified' => '2011-01-03 10:04:34' 66 | ), 67 | array( 68 | 'id' => 8, 69 | 'uri' => '/uri', 70 | 'is_approved' => 1, 71 | 'created' => '2011-01-03 10:04:34', 72 | 'modified' => '2011-01-03 10:04:34' 73 | ), 74 | array( 75 | 'id' => 9, 76 | 'uri' => '/uri_for_meta', 77 | 'is_approved' => 1, 78 | 'created' => '2011-01-03 10:04:34', 79 | 'modified' => '2011-01-03 10:04:34' 80 | ), 81 | array( 82 | 'id' => 10, 83 | 'uri' => '/uri_for_meta_equiv', 84 | 'is_approved' => 1, 85 | 'created' => '2011-01-03 10:04:34', 86 | 'modified' => '2011-01-03 10:04:34' 87 | ), 88 | array( 89 | 'id' => 11, 90 | 'uri' => '#/uri_for_meta_reg_ex/(.*)#', 91 | 'is_approved' => 1, 92 | 'created' => '2011-01-03 10:04:34', 93 | 'modified' => '2011-01-03 10:04:34' 94 | ), 95 | array( 96 | 'id' => 12, 97 | 'uri' => '/uri_for_meta_reg_ex/this_is_direct_match', 98 | 'is_approved' => 1, 99 | 'created' => '2011-01-03 10:04:34', 100 | 'modified' => '2011-01-03 10:04:34' 101 | ), 102 | array( 103 | 'id' => 13, 104 | 'uri' => '/uri_for_meta_wild_card/*', 105 | 'is_approved' => 1, 106 | 'created' => '2011-01-03 10:04:34', 107 | 'modified' => '2011-01-03 10:04:34' 108 | ), 109 | array( 110 | 'id' => 14, 111 | 'uri' => '/uri with spaces', 112 | 'is_approved' => 0, 113 | 'created' => '2011-01-03 10:04:34', 114 | 'modified' => '2011-01-03 10:04:34' 115 | ), 116 | array( 117 | 'id' => 15, 118 | 'uri' => '/status_gone', 119 | 'is_approved' => 1, 120 | 'created' => '2011-01-03 10:04:34', 121 | 'modified' => '2011-01-03 10:04:34' 122 | ), 123 | array( 124 | 'id' => 16, 125 | 'uri' => '/canonical', 126 | 'is_approved' => 1, 127 | 'created' => '2011-01-03 10:04:34', 128 | 'modified' => '2011-01-03 10:04:34' 129 | ), 130 | ); 131 | } 132 | ?> -------------------------------------------------------------------------------- /Test/Fixture/seo_url_fixture.php: -------------------------------------------------------------------------------- 1 | array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 8 | 'url' => array('type' => 'string', 'null' => false, 'default' => NULL, 'key' => 'unique', 'collate' => 'utf8_bin', 'charset' => 'utf8'), 9 | 'priority' => array('type' => 'float', 'null' => false, 'default' => NULL, 'key' => 'index'), 10 | 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 11 | 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), 12 | 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'url' => array('column' => 'url', 'unique' => 1), 'priority' => array('column' => 'priority', 'unique' => 0)), 13 | 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_bin', 'engine' => 'MyISAM') 14 | ); 15 | 16 | var $records = array( 17 | array( 18 | 'id' => 1, 19 | 'url' => '/some_other_url', 20 | 'priority' => .5, 21 | 'created' => '2011-10-10 16:42:47', 22 | 'modified' => '2011-10-10 16:42:47' 23 | ), 24 | array( 25 | 'id' => 2, 26 | 'url' => '/some_other', 27 | 'priority' => .5, 28 | 'created' => '2011-10-10 16:42:47', 29 | 'modified' => '2011-10-10 16:42:47' 30 | ), 31 | array( 32 | 'id' => 3, 33 | 'url' => '/some', 34 | 'priority' => .5, 35 | 'created' => '2011-10-10 16:42:47', 36 | 'modified' => '2011-10-10 16:42:47' 37 | ), 38 | array( 39 | 'id' => 4, 40 | 'url' => '/', 41 | 'priority' => 1, 42 | 'created' => '2011-10-10 16:42:47', 43 | 'modified' => '2011-10-10 16:42:47' 44 | ), 45 | array( 46 | 'id' => 5, 47 | 'url' => '/content/Hearing-loss/Treatments', 48 | 'priority' => 1, 49 | 'created' => '2011-10-10 16:42:47', 50 | 'modified' => '2011-10-10 16:42:47' 51 | ), 52 | array( 53 | 'id' => 6, 54 | 'url' => '/content/articles/Hearing-loss/Protection/30207-Attention-couch-potatoes-time', 55 | 'priority' => 1, 56 | 'created' => '2011-10-10 16:42:47', 57 | 'modified' => '2011-10-10 16:42:47' 58 | ), 59 | ); 60 | } 61 | -------------------------------------------------------------------------------- /Test/groups/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/Test/groups/empty -------------------------------------------------------------------------------- /View/Elements/seo_actions.ctp: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('Seo Redirects'), array('action' => 'index'));?>
  • 5 |
  • Html->link(__('Seo Meta Tags'), array('action' => 'index'));?>
  • 6 |
  • Html->link(__('Seo Uris'), array('controller' => 'seo_uris', 'action' => 'index')); ?>
  • 7 |
8 |
-------------------------------------------------------------------------------- /View/Elements/seo_admin_filter.ctp: -------------------------------------------------------------------------------- 1 | Html->script('/seo/js/clear_default'); ?> 2 |
3 | Form->create($model, array('inputDefaults' => array('label' => false,'div' => false))); 8 | echo $this->Form->input('filter', array('label' => false, 'value' => "$model Search", 'class' => 'clear_default')); 9 | echo $this->Form->submit('/seo/img/search_button.gif', array('div' => false)); 10 | echo $this->Form->end(); 11 | } 12 | ?> 13 |
-------------------------------------------------------------------------------- /View/Elements/seo_nav.ctp: -------------------------------------------------------------------------------- 1 |
2 |

3 | 13 |
-------------------------------------------------------------------------------- /View/Elements/seo_paging.ctp: -------------------------------------------------------------------------------- 1 |

2 | Paginator->counter(array( 4 | 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%') 5 | )); 6 | if(isset($filter)){ 7 | $this->Paginator->options(array('url' => array($filter))); 8 | } 9 | ?>

10 | 11 |
12 | Paginator->prev('<< ' . __('previous'), array(), null, array('class'=>'disabled'));?> 13 | Paginator->numbers();?> 14 | Paginator->next(__('next') . ' >>', array(), null, array('class' => 'disabled'));?> 15 |
-------------------------------------------------------------------------------- /View/Elements/seo_view_head.ctp: -------------------------------------------------------------------------------- 1 | Html->css('/seo/css/seo_style'); 3 | echo $this->element('seo_nav', array('plugins' => 'seo')); 4 | ?> -------------------------------------------------------------------------------- /View/SeoABTests/admin_add.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoABTest');?> 5 |
6 | 7 | Form->input('SeoUri.uri', array('after' => 'The URL or URI expression you want this test to run on.')); 9 | echo $this->Form->input('slug', array('after' => 'The slug for the your GA custom variable. Cannot contain a \' mark.')); 10 | echo $this->Form->input('roll', array('after' => 'The roll must be a number between 1 and 100 (100 being 100% roll success), or a callback function with Model::function syntax.')); 11 | echo $this->Form->input('testable', array('after' => 'testable defaults to true, but you can add a callback if you need more granularity other than off URI (Model::function syntax).')); 12 | echo $this->Form->input('priority', array('default' => 999, 'after' => 'The lower the priority the more important the test is in regards to others.')); 13 | echo $this->Form->input('redmine', array('after' => 'The Redmine ticket ID')); 14 | echo $this->Form->input('start_date'); 15 | echo $this->Form->input('end_date'); 16 | echo $this->Form->input('description'); 17 | echo $this->Form->input('is_active'); 18 | ?> 19 |
20 | Form->end(__('Submit'));?> 21 |
22 |
-------------------------------------------------------------------------------- /View/SeoABTests/admin_edit.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoABTest');?> 5 |
6 | 7 | Form->input('id'); 9 | echo $this->Form->input('SeoUri.uri', array('after' => 'The URL or URI expression you want this test to run on.')); 10 | echo $this->Form->input('slug', array('after' => 'The slug for the your GA custom variable. Cannot contain a \' mark.')); 11 | echo $this->Form->input('roll', array('after' => 'The roll must be a number between 1 and 100 (100 being 100% roll success), or a callback function with Model::function syntax.')); 12 | echo $this->Form->input('testable', array('after' => 'testable defaults to true, but you can add a callback if you need more granularity other than off URI (Model::function syntax).')); 13 | echo $this->Form->input('priority', array('default' => 999, 'after' => 'The lower the priority the more important the test is in regards to others.')); 14 | echo $this->Form->input('redmine', array('after' => 'The Redmine ticket ID')); 15 | echo $this->Form->input('start_date'); 16 | echo $this->Form->input('end_date'); 17 | echo $this->Form->input('description'); 18 | echo $this->Form->input('is_active'); 19 | ?> 20 |
21 | Form->end(__('Submit'));?> 22 |
23 |
24 |

25 |
    26 |
  • Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoABTest.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoABTest.id'))); ?>
  • 27 |
28 |
29 |
-------------------------------------------------------------------------------- /View/SeoABTests/admin_index.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_admin_filter', array('plugin' => 'seo', 'model' => 'SeoMetaTag')); ?> 3 | element('seo_view_head', array('plugin' => 'seo')); ?> 4 |
5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 |
Paginator->sort('seo_uri_id'); ?>Paginator->sort('is_active'); ?>Paginator->sort('slug'); ?>Paginator->sort('roll'); ?>Paginator->sort('start_date'); ?>
Paginator->sort('end_date'); ?>
  19 | Html->link($seoABTest['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoABTest['SeoUri']['id'])); ?> 20 |    
26 | Html->link(__('View'), array('action' => 'view', $seoABTest['SeoABTest']['id'])); ?> 27 | Html->link(__('Edit'), array('action' => 'edit', $seoABTest['SeoABTest']['id'])); ?> 28 | Form->postLink(__('Delete'), array('action' => 'delete', $seoABTest['SeoABTest']['id']), null, __('Are you sure you want to delete # %s?', $seoABTest['SeoABTest']['id'])); ?> 29 |
33 |

34 | Paginator->counter(array( 36 | 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') 37 | )); 38 | ?>

39 |
40 | Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); 42 | echo $this->Paginator->numbers(array('separator' => '')); 43 | echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); 44 | ?> 45 |
46 |
47 |
48 |

49 |
    50 |
  • Html->link(__('New Seo A B Test'), array('action' => 'add')); ?>
  • 51 |
52 |
53 |
54 | -------------------------------------------------------------------------------- /View/SeoABTests/admin_view.ctp: -------------------------------------------------------------------------------- 1 |
2 |

3 |
4 |
5 |
6 | 7 |   8 |
9 |
10 |
11 | Html->link($seoABTest['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoABTest['SeoUri']['id'])); ?> 12 |   13 |
14 |
15 |
16 | 17 |   18 |
19 |
20 |
21 | 22 |   23 |
24 |
25 |
26 | 27 |   28 |
29 |
30 |
31 | 32 |   33 |
34 |
35 |
36 | 37 |   38 |
39 |
40 |
41 | 42 |   43 |
44 |
45 |
46 | 47 |   48 |
49 |
50 |
51 |
52 |

53 |
    54 |
  • Html->link(__('Edit Seo A B Test'), array('action' => 'edit', $seoABTest['SeoABTest']['id'])); ?>
  • 55 |
  • Form->postLink(__('Delete Seo A B Test'), array('action' => 'delete', $seoABTest['SeoABTest']['id']), null, __('Are you sure you want to delete # %s?', $seoABTest['SeoABTest']['id'])); ?>
  • 56 |
  • Html->link(__('List Seo A B Tests'), array('action' => 'index')); ?>
  • 57 |
  • Html->link(__('New Seo A B Test'), array('action' => 'add')); ?>
  • 58 |
  • Html->link(__('List Seo Uris'), array('controller' => 'seo_uris', 'action' => 'index')); ?>
  • 59 |
  • Html->link(__('New Seo Uri'), array('controller' => 'seo_uris', 'action' => 'add')); ?>
  • 60 |
61 |
62 | -------------------------------------------------------------------------------- /View/SeoBlacklists/admin_add.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoBlacklist');?> 5 |
6 | 7 | Form->input('ip_range_start', array('type' => 'text')); 9 | echo $this->Form->input('ip_range_end', array('type' => 'text')); 10 | echo $this->Form->input('note'); 11 | echo $this->Form->input('is_active'); 12 | ?> 13 |
14 | Form->end(__('Save BlackList'));?> 15 |
16 |
-------------------------------------------------------------------------------- /View/SeoBlacklists/admin_edit.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoBlacklist');?> 5 |
6 | 7 | Form->input('id'); 9 | echo $this->Form->input('ip_range_start'); 10 | echo $this->Form->input('ip_range_end'); 11 | echo $this->Form->input('note'); 12 | echo $this->Form->input('is_active'); 13 | ?> 14 |
15 | Form->end(__('Submit'));?> 16 | Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoBlacklist.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoBlacklist.id'))); ?> 17 |
18 |
19 |

20 |
    21 |
  • Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoBlacklist.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoBlacklist.id'))); ?>
  • 22 |
23 |
24 |
-------------------------------------------------------------------------------- /View/SeoBlacklists/admin_index.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_admin_filter', array('plugin' => 'seo', 'model' => 'SeoBlacklist')); ?> 3 | element('seo_view_head', array('plugin' => 'seo')); ?> 4 |
5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | > 23 | 24 | 25 | 26 | 27 | 32 | 33 | 34 |
Paginator->sort('ip_range_start');?>Paginator->sort('ip_range_end');?>Paginator->sort('is_active');?>Paginator->sort('modified');?>
   Time->niceShort($seoBlacklist['SeoBlacklist']['modified']); ?>  28 | Html->link(__('View'), array('action' => 'view', $seoBlacklist['SeoBlacklist']['id'])); ?> 29 | Html->link(__('Edit'), array('action' => 'edit', $seoBlacklist['SeoBlacklist']['id'])); ?> 30 | Html->link(__('Delete'), array('action' => 'delete', $seoBlacklist['SeoBlacklist']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoBlacklist['SeoBlacklist']['id'])); ?> 31 |
35 | element('seo_paging', array('plugin' => 'seo')); ?> 36 |
37 |
38 |

39 |
    40 |
  • Html->link(__('New Seo Blacklist'), array('action' => 'add')); ?>
  • 41 |
42 |
43 |
-------------------------------------------------------------------------------- /View/SeoBlacklists/admin_view.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 |

5 |
6 | > 7 | > 8 | 9 |   10 | 11 | > 12 | > 13 | 14 |   15 | 16 | > 17 | > 18 | 19 |   20 | 21 | > 22 | > 23 | 24 |   25 | 26 | > 27 | > 28 | 29 |   30 | 31 | > 32 | > 33 | 34 |   35 | 36 | > 37 | > 38 | 39 |   40 | 41 |
42 |
43 |
44 |

45 |
    46 |
  • Html->link(__('Edit Seo Blacklist'), array('action' => 'edit', $seoBlacklist['SeoBlacklist']['id'])); ?>
  • 47 |
  • Html->link(__('Delete Seo Blacklist'), array('action' => 'delete', $seoBlacklist['SeoBlacklist']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoBlacklist['SeoBlacklist']['id'])); ?>
  • 48 |
49 |
50 |
-------------------------------------------------------------------------------- /View/SeoBlacklists/banned.ctp: -------------------------------------------------------------------------------- 1 |

You are BANNED!

2 | 3 |

If you feel this is an error, please email Html->link(Configure::read('Seo.approverEmail'), "mailto:" . Configure::read('Seo.approverEmail')); ?>

-------------------------------------------------------------------------------- /View/SeoCanonicals/admin_add.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoCanonical');?> 5 |
6 | 7 | Form->input('SeoUri.uri'); 9 | echo $this->Form->input('canonical', array('label' => 'Canonical Link')); 10 | echo $this->Form->input('is_active'); 11 | ?> 12 |
13 | Form->end(__('Submit'));?> 14 |
15 |
-------------------------------------------------------------------------------- /View/SeoCanonicals/admin_edit.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoCanonical');?> 5 |
6 | 7 | Form->input('id'); 9 | echo $this->Form->input('SeoUri.uri'); 10 | echo $this->Form->input('canonical', array('label' => 'Canonical Link')); 11 | echo $this->Form->input('is_active'); 12 | ?> 13 |
14 | Form->end(__('Submit'));?> 15 |
16 |
17 |

18 |
    19 |
  • Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoCanonical.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoCanonical.id'))); ?>
  • 20 |
21 |
22 |
-------------------------------------------------------------------------------- /View/SeoCanonicals/admin_index.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_admin_filter', array('plugin' => 'seo', 'model' => 'SeoCanonical')); ?> 3 | element('seo_view_head', array('plugin' => 'seo')); ?> 4 |
5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | > 22 | 25 | 26 | 27 | 32 | 33 | 34 |
Paginator->sort('seo_uri_id');?>Paginator->sort('canonical');?>Paginator->sort('modified');?>
23 | Html->link($seoCanonical['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoCanonical['SeoUri']['id'])); ?> 24 |  Time->niceShort($seoCanonical['SeoCanonical']['modified']); ?>  28 | Html->link(__('View'), array('action' => 'view', $seoCanonical['SeoCanonical']['id'])); ?> 29 | Html->link(__('Edit'), array('action' => 'edit', $seoCanonical['SeoCanonical']['id'])); ?> 30 | Html->link(__('Delete'), array('action' => 'delete', $seoCanonical['SeoCanonical']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoCanonical['SeoCanonical']['id'])); ?> 31 |
35 | element('seo_paging', array('plugin' => 'seo')); ?> 36 |
37 |
38 |

39 |
    40 |
  • Html->link(__('New Seo Canonical'), array('action' => 'add')); ?>
  • 41 |
42 |
43 |
-------------------------------------------------------------------------------- /View/SeoCanonicals/admin_view.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 |

5 |
6 | > 7 | > 8 | 9 |   10 | 11 | > 12 | > 13 | Html->link($seoCanonical['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoCanonical['SeoUri']['id'])); ?> 14 |   15 | 16 | > 17 | > 18 | 19 |   20 | 21 | > 22 | > 23 | 24 |   25 | 26 | > 27 | > 28 | 29 |   30 | 31 | > 32 | > 33 | 34 |   35 | 36 |
37 |
38 |
39 |

40 |
    41 |
  • Html->link(__('Edit Seo Canonical'), array('action' => 'edit', $seoCanonical['SeoCanonical']['id'])); ?>
  • 42 |
  • Html->link(__('Delete Seo Canonical'), array('action' => 'delete', $seoCanonical['SeoCanonical']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoCanonical['SeoCanonical']['id'])); ?>
  • 43 |
44 |
45 |
-------------------------------------------------------------------------------- /View/SeoMetaTags/admin_add.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoMetaTag');?> 5 |
6 | 7 | Form->input('SeoUri.uri'); 9 | echo $this->Form->input('name'); 10 | echo $this->Form->input('content'); 11 | echo $this->Form->input('is_http_equiv'); 12 | ?> 13 |
14 | Form->end(__('Submit'));?> 15 |
16 |
-------------------------------------------------------------------------------- /View/SeoMetaTags/admin_edit.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoMetaTag');?> 5 |
6 | 7 | Form->input('id'); 9 | echo $this->Form->input('SeoUri.uri'); 10 | echo $this->Form->input('name'); 11 | echo $this->Form->input('content'); 12 | echo $this->Form->input('is_http_equiv'); 13 | ?> 14 |
15 | Form->end(__('Submit'));?> 16 | Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoMetaTag.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoMetaTag.id'))); ?> 17 |
18 |
19 |

20 |
    21 |
  • Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoMetaTag.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoMetaTag.id'))); ?>
  • 22 |
23 |
24 |
-------------------------------------------------------------------------------- /View/SeoMetaTags/admin_index.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_admin_filter', array('plugin' => 'seo', 'model' => 'SeoMetaTag')); ?> 3 | element('seo_view_head', array('plugin' => 'seo')); ?> 4 |
5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 23 | > 24 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 |
Paginator->sort('seo_uri_id');?>Paginator->sort('name');?>Paginator->sort('content');?>Paginator->sort('is_http_equiv');?>Paginator->sort('modified');?>
25 | Html->link($seoMetaTag['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoMetaTag['SeoUri']['id'])); ?> 26 |    Time->niceShort($seoMetaTag['SeoMetaTag']['modified']); ?>  32 | Html->link(__('View'), array('action' => 'view', $seoMetaTag['SeoMetaTag']['id'])); ?> 33 | Html->link(__('Edit'), array('action' => 'edit', $seoMetaTag['SeoMetaTag']['id'])); ?> 34 | Html->link(__('Delete'), array('action' => 'delete', $seoMetaTag['SeoMetaTag']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoMetaTag['SeoMetaTag']['id'])); ?> 35 |
39 | element('seo_paging', array('plugin' => 'seo')); ?> 40 |
41 |
42 |

43 |
    44 |
  • Html->link(__('New Seo Meta Tag'), array('action' => 'add')); ?>
  • 45 |
46 |
47 |
-------------------------------------------------------------------------------- /View/SeoMetaTags/admin_view.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 |

5 |
6 | > 7 | > 8 | 9 |   10 | 11 | > 12 | > 13 | Html->link($seoMetaTag['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoMetaTag['SeoUri']['id'])); ?> 14 |   15 | 16 | > 17 | > 18 | 19 |   20 | 21 | > 22 | > 23 | 24 |   25 | 26 | > 27 | > 28 | 29 |   30 | 31 | > 32 | > 33 | 34 |   35 | 36 | > 37 | > 38 | 39 |   40 | 41 |
42 |
43 |
44 |

45 |
    46 |
  • Html->link(__('Edit Seo Meta Tag'), array('action' => 'edit', $seoMetaTag['SeoMetaTag']['id'])); ?>
  • 47 |
  • Html->link(__('Delete Seo Meta Tag'), array('action' => 'delete', $seoMetaTag['SeoMetaTag']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoMetaTag['SeoMetaTag']['id'])); ?>
  • 48 |
49 |
50 |
-------------------------------------------------------------------------------- /View/SeoRedirects/admin_add.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoRedirect');?> 5 |
6 | 7 | Form->input('SeoUri.uri'); 9 | echo $this->Form->input('redirect'); 10 | echo $this->Form->input('priority', array('default' => 100)); 11 | echo $this->Form->input('is_active'); 12 | echo $this->Form->input('callback'); 13 | ?> 14 |
15 | Form->end(__('Save Seo Redirect'));?> 16 |
17 |
-------------------------------------------------------------------------------- /View/SeoRedirects/admin_edit.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoRedirect');?> 5 |
6 | 7 | Form->input('id'); 9 | echo $this->Form->input('SeoUri.uri'); 10 | echo $this->Form->input('redirect'); 11 | ?> 12 | Redirect via SeoAppError->catch404() will always be 301. 13 | Form->input('priority'); 15 | echo $this->Form->input('is_active'); 16 | echo $this->Form->input('is_nocache', array( 17 | 'label' => 'Instruct the browser to not cache the 301 redirect via cache headers.', 18 | )); 19 | ?> 20 | Form->input('callback'); 22 | ?> 23 |
24 | Form->end(__('Submit'));?> 25 |
26 |
27 |

28 |
    29 |
  • Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoRedirect.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoRedirect.id'))); ?>
  • 30 |
31 |
32 |
33 | -------------------------------------------------------------------------------- /View/SeoRedirects/admin_index.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_admin_filter', array('plugin' => 'seo', 'model' => 'SeoRedirect')); ?> 3 | element('seo_view_head', array('plugin' => 'seo')); ?> 4 |
5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 24 | > 25 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 40 |
Paginator->sort('seo_uri_id');?>Paginator->sort('redirect');?>Paginator->sort('Queue','priority');?>Paginator->sort('Active','is_active');?>Paginator->sort('callback');?>Paginator->sort('modified');?>
26 | Html->link($seoRedirect['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoRedirect['SeoUri']['id'])); ?> 27 |     Time->niceShort($seoRedirect['SeoRedirect']['modified']); ?>  34 | Html->link(__('View'), array('action' => 'view', $seoRedirect['SeoRedirect']['id'])); ?> 35 | Html->link(__('Edit'), array('action' => 'edit', $seoRedirect['SeoRedirect']['id'])); ?> 36 | Html->link(__('Delete'), array('action' => 'delete', $seoRedirect['SeoRedirect']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoRedirect['SeoRedirect']['id'])); ?> 37 |
41 | element('seo_paging', array('plugin' => 'seo')); ?> 42 |
43 |
44 |

45 |
    46 |
  • Html->link(__('New Seo Redirect'), array('action' => 'add')); ?>
  • 47 |
48 |
49 |
-------------------------------------------------------------------------------- /View/SeoRedirects/admin_view.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 |

5 |
6 | > 7 | > 8 | 9 |   10 | 11 | > 12 | > 13 | Html->link($seoRedirect['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoRedirect['SeoUri']['id'])); ?> 14 |   15 | 16 | > 17 | > 18 | 19 |   20 | 21 | > 22 | > 23 | 24 |   25 | 26 | > 27 | > 28 | 29 |   30 | 31 | > 32 | > 33 | 34 |   35 | 36 | > 37 | > 38 | 39 |   40 | 41 | > 42 | > 43 | 44 |   45 | 46 |
47 |
48 |
49 |

50 |
    51 |
  • Html->link(__('Edit Seo Redirect'), array('action' => 'edit', $seoRedirect['SeoRedirect']['id'])); ?>
  • 52 |
  • Html->link(__('Delete Seo Redirect'), array('action' => 'delete', $seoRedirect['SeoRedirect']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoRedirect['SeoRedirect']['id'])); ?>
  • 53 |
54 |
55 |
-------------------------------------------------------------------------------- /View/SeoStatusCodes/admin_add.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoStatusCode');?> 5 |
6 | 7 | Form->input('SeoUri.uri'); 9 | echo $this->Form->input('status_code', array('type' => 'select', 'options' => $status_codes)); 10 | echo $this->Form->input('priority', array('default' => 100)); 11 | echo $this->Form->input('is_active'); 12 | ?> 13 |
14 | Form->end(__('Save Seo Status Code'));?> 15 |
16 |
-------------------------------------------------------------------------------- /View/SeoStatusCodes/admin_edit.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoStatusCode');?> 5 |
6 | 7 | Form->input('id'); 9 | echo $this->Form->input('SeoUri.uri'); 10 | echo $this->Form->input('status_code', array('type' => 'select', 'options' => $status_codes)); 11 | echo $this->Form->input('priority'); 12 | echo $this->Form->input('is_active'); 13 | ?> 14 |
15 | Form->end(__('Submit'));?> 16 |
17 |
18 |

19 |
    20 |
  • Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoStatusCode.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoStatusCode.id'))); ?>
  • 21 |
22 |
23 |
-------------------------------------------------------------------------------- /View/SeoStatusCodes/admin_index.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_admin_filter', array('plugin' => 'seo', 'model' => 'SeoStatusCode')); ?> 3 | element('seo_view_head', array('plugin' => 'seo')); ?> 4 |
5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 24 | > 25 | 28 | 29 | 30 | 31 | 32 | 37 | 38 | 39 |
Paginator->sort('seo_uri_id');?>Paginator->sort('status_code');?>Paginator->sort('Queue','priority');?>Paginator->sort('Active','is_active');?>Paginator->sort('callback');?>Paginator->sort('modified');?>
26 | Html->link($seoStatusCode['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoStatusCode['SeoUri']['id'])); ?> 27 |    Time->niceShort($seoStatusCode['SeoStatusCode']['modified']); ?>  33 | Html->link(__('View'), array('action' => 'view', $seoStatusCode['SeoStatusCode']['id'])); ?> 34 | Html->link(__('Edit'), array('action' => 'edit', $seoStatusCode['SeoStatusCode']['id'])); ?> 35 | Html->link(__('Delete'), array('action' => 'delete', $seoStatusCode['SeoStatusCode']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoStatusCode['SeoStatusCode']['id'])); ?> 36 |
40 | element('seo_paging', array('plugin' => 'seo')); ?> 41 |
42 |
43 |

44 |
    45 |
  • Html->link(__('New Seo Status Code'), array('action' => 'add')); ?>
  • 46 |
47 |
48 |
-------------------------------------------------------------------------------- /View/SeoStatusCodes/admin_view.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 |

5 |
6 | > 7 | > 8 | 9 |   10 | 11 | > 12 | > 13 | Html->link($seoStatusCode['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoStatusCode['SeoUri']['id'])); ?> 14 |   15 | 16 | > 17 | > 18 | 19 |   20 | 21 | > 22 | > 23 | 24 |   25 | 26 | > 27 | > 28 | 29 |   30 | 31 | > 32 | > 33 | 34 |   35 | 36 | > 37 | > 38 | 39 |   40 | 41 |
42 |
43 |
44 |

45 |
    46 |
  • Html->link(__('Edit Seo Status Code'), array('action' => 'edit', $seoStatusCode['SeoStatusCode']['id'])); ?>
  • 47 |
  • Html->link(__('Delete Seo Status Code'), array('action' => 'delete', $seoStatusCode['SeoStatusCode']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoStatusCode['SeoStatusCode']['id'])); ?>
  • 48 |
49 |
50 |
-------------------------------------------------------------------------------- /View/SeoTitles/admin_add.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoTitle');?> 5 |
6 | 7 | Form->input('SeoUri.uri'); 9 | echo $this->Form->input('title'); 10 | ?> 11 |
12 | Form->end(__('Submit'));?> 13 |
14 |
-------------------------------------------------------------------------------- /View/SeoTitles/admin_edit.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoTitle');?> 5 |
6 | 7 | Form->input('id'); 9 | echo $this->Form->input('SeoUri.uri'); 10 | echo $this->Form->input('title'); 11 | ?> 12 |
13 | Form->end(__('Submit'));?> 14 |
15 |
16 |

17 |
    18 |
  • Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoTitle.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoTitle.id'))); ?>
  • 19 |
20 |
21 |
-------------------------------------------------------------------------------- /View/SeoTitles/admin_index.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_admin_filter', array('plugin' => 'seo', 'model' => 'SeoTitle')); ?> 3 | element('seo_view_head', array('plugin' => 'seo')); ?> 4 |
5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | > 22 | 25 | 26 | 27 | 32 | 33 | 34 |
Paginator->sort('seo_uri_id');?>Paginator->sort('title');?>Paginator->sort('modified');?>
23 | Html->link($seoTitle['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoTitle['SeoUri']['id'])); ?> 24 |  Time->niceShort($seoTitle['SeoTitle']['modified']); ?>  28 | Html->link(__('View'), array('action' => 'view', $seoTitle['SeoTitle']['id'])); ?> 29 | Html->link(__('Edit'), array('action' => 'edit', $seoTitle['SeoTitle']['id'])); ?> 30 | Html->link(__('Delete'), array('action' => 'delete', $seoTitle['SeoTitle']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoTitle['SeoTitle']['id'])); ?> 31 |
35 | element('seo_paging', array('plugin' => 'seo')); ?> 36 |
37 |
38 |

39 |
    40 |
  • Html->link(__('New Seo Title'), array('action' => 'add')); ?>
  • 41 |
42 |
43 |
-------------------------------------------------------------------------------- /View/SeoTitles/admin_view.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 |

5 |
6 | > 7 | > 8 | 9 |   10 | 11 | > 12 | > 13 | Html->link($seoTitle['SeoUri']['uri'], array('controller' => 'seo_uris', 'action' => 'view', $seoTitle['SeoUri']['id'])); ?> 14 |   15 | 16 | > 17 | > 18 | 19 |   20 | 21 | > 22 | > 23 | 24 |   25 | 26 | > 27 | > 28 | 29 |   30 | 31 |
32 |
33 |
34 |

35 |
    36 |
  • Html->link(__('Edit Seo Title'), array('action' => 'edit', $seoTitle['SeoTitle']['id'])); ?>
  • 37 |
  • Html->link(__('Delete Seo Title'), array('action' => 'delete', $seoTitle['SeoTitle']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoTitle['SeoTitle']['id'])); ?>
  • 38 |
39 |
40 |
-------------------------------------------------------------------------------- /View/SeoUris/admin_add.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoUri');?> 5 |
6 | 7 | Form->input('SeoUri.uri'); 9 | echo $this->Form->input('SeoUri.is_approved'); 10 | ?> 11 |

Title Tag

12 | Form->input('SeoTitle.title'); 14 | ?> 15 |

Meta Tags

16 |
17 | Form->input('SeoMetaTag.0.name'); 19 | echo $this->Form->input('SeoMetaTag.0.content'); 20 | echo $this->Form->input('SeoMetaTag.0.is_http_equiv'); 21 | ?> 22 |
23 |
24 | Form->input('SeoMetaTag.1.name'); 26 | echo $this->Form->input('SeoMetaTag.1.content'); 27 | echo $this->Form->input('SeoMetaTag.1.is_http_equiv'); 28 | ?> 29 |
30 |
31 | Form->input('SeoMetaTag.2.name'); 33 | echo $this->Form->input('SeoMetaTag.2.content'); 34 | echo $this->Form->input('SeoMetaTag.2.is_http_equiv'); 35 | ?> 36 |
37 |
38 | Form->end(__('Save All'));?> 39 |
40 |
-------------------------------------------------------------------------------- /View/SeoUris/admin_edit.ctp: -------------------------------------------------------------------------------- 1 | false); 3 | ?> 4 |
5 | element('seo_view_head', array('plugin' => 'seo')); ?> 6 |
7 | Form->create('SeoUri');?> 8 |
9 | 10 | Form->input('SeoUri.id'); 12 | echo $this->Form->input('SeoUri.uri'); 13 | echo $this->Form->input('SeoUri.is_approved'); 14 | ?> 15 |
16 |

Title Tag

17 | Form->input('SeoTitle.id'); 19 | echo $this->Form->input('SeoTitle.title', $opt_nr); 20 | ?> 21 |
22 |

Meta Tags

23 |
24 | Form->input('SeoMetaTag.0.id'); 26 | echo $this->Form->input('SeoMetaTag.0.name', $opt_nr); 27 | echo $this->Form->input('SeoMetaTag.0.content', $opt_nr); 28 | echo $this->Form->input('SeoMetaTag.0.is_http_equiv', $opt_nr); 29 | ?> 30 |
31 |
32 | Form->input('SeoMetaTag.1.id'); 34 | echo $this->Form->input('SeoMetaTag.1.name', $opt_nr); 35 | echo $this->Form->input('SeoMetaTag.1.content', $opt_nr); 36 | echo $this->Form->input('SeoMetaTag.1.is_http_equiv', $opt_nr); 37 | ?> 38 |
39 |
40 | Form->input('SeoMetaTag.2.id'); 42 | echo $this->Form->input('SeoMetaTag.2.name', $opt_nr); 43 | echo $this->Form->input('SeoMetaTag.2.content', $opt_nr); 44 | echo $this->Form->input('SeoMetaTag.2.is_http_equiv', $opt_nr); 45 | ?> 46 |
47 |
48 | Form->end(__('Save All'));?> 49 |
50 |
51 |

52 |
    53 |
  • Html->link(__('URL Encode'), array('action' => 'urlencode', $this->Form->value('SeoUri.id')), null, sprintf(__('Are you sure you want to url encode # %s?'), $this->Form->value('SeoUri.id'))); ?>
  • 54 |
  • Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoUri.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoUri.id'))); ?>
  • 55 |
56 |
57 |
58 | -------------------------------------------------------------------------------- /View/SeoUris/admin_index.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_admin_filter', array('plugin' => 'seo', 'model' => 'SeoUri')); ?> 3 | element('seo_view_head', array('plugin' => 'seo')); ?> 4 |
5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | > 22 | 23 | 24 | 25 | 30 | 31 | 32 |
Paginator->sort('uri');?>Paginator->sort('is_approved');?>Paginator->sort('modified');?>
  Time->niceShort($seoUri['SeoUri']['modified']); ?>  26 | Html->link(__('View'), array('action' => 'view', $seoUri['SeoUri']['id'])); ?> 27 | Html->link(__('Edit'), array('action' => 'edit', $seoUri['SeoUri']['id'])); ?> 28 | Html->link(__('Delete'), array('action' => 'delete', $seoUri['SeoUri']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoUri['SeoUri']['id'])); ?> 29 |
33 | element('seo_paging', array('plugin' => 'seo')); ?> 34 |
35 |
36 |

37 |
    38 |
  • Html->link(__('New Seo Uri'), array('action' => 'add')); ?>
  • 39 |
40 |
41 |
-------------------------------------------------------------------------------- /View/SeoUrls/admin_add.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoUrl');?> 5 |
6 | 7 | Form->input('SeoUrl.url'); 9 | echo $this->Form->input('SeoUrl.priority'); 10 | ?> 11 |
12 | Form->end(__('Save All'));?> 13 |
14 |
-------------------------------------------------------------------------------- /View/SeoUrls/admin_edit.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 | Form->create('SeoUrl');?> 5 |
6 | 7 | Form->input('SeoUrl.id'); 9 | echo $this->Form->input('SeoUrl.url'); 10 | echo $this->Form->input('SeoUrl.priority'); 11 | ?> 12 |
13 | Form->end(__('Save All'));?> 14 |
15 |
16 |

17 |
    18 |
  • Html->link(__('Delete'), array('action' => 'delete', $this->Form->value('SeoUrl.id')), null, sprintf(__('Are you sure you want to delete # %s?'), $this->Form->value('SeoUrl.id'))); ?>
  • 19 |
20 |
21 |
-------------------------------------------------------------------------------- /View/SeoUrls/admin_index.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_admin_filter', array('plugin' => 'seo', 'model' => 'SeoUrl')); ?> 3 | element('seo_view_head', array('plugin' => 'seo')); ?> 4 |
5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | > 22 | 23 | 24 | 25 | 30 | 31 | 32 |
Paginator->sort('url');?>Paginator->sort('priority');?>Paginator->sort('modified');?>
  Time->niceShort($seoUrl['SeoUrl']['modified']); ?>  26 | Html->link(__('View'), array('action' => 'view', $seoUrl['SeoUrl']['id'])); ?> 27 | Html->link(__('Edit'), array('action' => 'edit', $seoUrl['SeoUrl']['id'])); ?> 28 | Html->link(__('Delete'), array('action' => 'delete', $seoUrl['SeoUrl']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoUrl['SeoUrl']['id'])); ?> 29 |
33 | element('seo_paging', array('plugin' => 'seo')); ?> 34 |
35 |
36 |

37 |
    38 |
  • Html->link(__('New Seo Url'), array('action' => 'add')); ?>
  • 39 |
40 |
41 |
-------------------------------------------------------------------------------- /View/SeoUrls/admin_view.ctp: -------------------------------------------------------------------------------- 1 |
2 | element('seo_view_head', array('plugin' => 'seo')); ?> 3 |
4 |

5 |
6 | > 7 | > 8 | 9 |   10 | 11 | > 12 | > 13 | 14 |   15 | 16 | > 17 | > 18 | 19 |   20 | 21 | > 22 | > 23 | 24 |   25 | 26 | > 27 | > 28 | 29 |   30 | 31 |
32 |
33 |
34 |

35 |
    36 |
  • Html->link(__('Edit Seo Url'), array('action' => 'edit', $seoUrl['SeoUrl']['id'])); ?>
  • 37 |
  • Html->link(__('Delete Seo Url'), array('action' => 'delete', $seoUrl['SeoUrl']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $seoUrl['SeoUrl']['id'])); ?>
  • 38 |
39 |
40 |
-------------------------------------------------------------------------------- /View/helpers/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/View/helpers/empty -------------------------------------------------------------------------------- /View/layouts/banned.ctp: -------------------------------------------------------------------------------- 1 | 2 | 3 | You are Banned 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webtechnick/cakephp-seo-plugin", 3 | "description": "CakePHP Search Engine Optimization Plugin", 4 | "type": "cakephp-plugin", 5 | "keywords": ["cakephp", "seo", "meta tags", "title tags", "banning", "redirects", "ab test", "canonical", "blacklist", "levenshtein", "404 handling"], 6 | "homepage": "https://github.com/webtechnick/CakePHP-Seo-Plugin", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nick Baker", 11 | "homepage": "http://www.webtechnick.com", 12 | "role": "Author" 13 | } 14 | ], 15 | "support": { 16 | "issues": "https://github.com/webtechnick/CakePHP-Seo-Plugin/issues", 17 | "irc": "irc://irc.freenode.org/cakephp", 18 | "source": "https://github.com/webtechnick/CakePHP-Seo-Plugin" 19 | }, 20 | "require": { 21 | "php": ">=5.3.0", 22 | "composer/installers": "*" 23 | }, 24 | "extra": { 25 | "branch-alias": { 26 | "dev-master": "2.x-dev", 27 | "1.3": "1.3-dev" 28 | }, 29 | "installer-name": "Seo" 30 | } 31 | } -------------------------------------------------------------------------------- /webroot/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/webroot/empty -------------------------------------------------------------------------------- /webroot/img/search_button.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webtechnick/CakePHP-Seo-Plugin/64f6e4b4d0e3d3672cefe3e34ec35a1d777b7dcd/webroot/img/search_button.gif -------------------------------------------------------------------------------- /webroot/js/clear_default.js: -------------------------------------------------------------------------------- 1 | (function($){ 2 | $.fn.clearDefault = function(){ 3 | return this.each(function(){ 4 | 5 | var default_value = $(this).val(); 6 | $(this).focus(function(){ 7 | if ($(this).val() == default_value) $(this).val(""); 8 | }); 9 | $(this).blur(function(){ 10 | if ($(this).val() == "") $(this).val(default_value); 11 | }); 12 | }); 13 | }; 14 | })(jQuery); 15 | 16 | $(document).ready(function() { 17 | $('input:text.clear_default').clearDefault(); 18 | }); --------------------------------------------------------------------------------