Zen Cart Logo
Forums / All Other Contributions/Addons / Ultimate SEO v3 (and v2.200) [Support Thread]

Ultimate SEO v3 (and v2.200) [Support Thread]

Views: 427,325

Results 441 to 460 of 1,706
12 Jul 2013, 7:40 PM
#441
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

The server name being an IP versus a domain name should not affect this module directly... However some Zen Cart users have reported issues in general when not using a domain name (unrelated to this plugin)... There are some ways to tell just your computer to assign a name to a specific IP address to avoid using an IP address directly... Are you testing on a "local" environment (WampServer, Xampp, Mamp, etc)? Or are you testing on a hosted server (with internet access)?

If you decide to use Ultimate (SEO) URLs, keep in mind the category and product "titles" are placed in the URLs (and typically used in h1 tags by most themes). You will want to make sure these "titles" reflect accurately what you want visitors (and SEs) to see. You can use filters to manually "change" what is placed in the URLs - but it takes a bit of work at this time - so best to think about this early in the process.

General Advice (website development and testing)
My advice when it comes to installing, configuring, customizing, modifying, and / or preparing any content for the internet: First set up the software (or updates) in a "development" or "testing" location (not indexed by Search Engines - or - viewable to the general public). Once you have the site (or changes) ready for general consumption (and of course tested), then migrate (copy) the changes to the live website / location (and re-test).

General Advice (some potential impacts of changing URLs)
As your website does not sound to already be "well established" on Search Engines (SEs)... This is a good time for you to pick your URL scheme (always better to avoid ever needing a 301 redirect). If you plan at launch to use Ultimate (SEO) URLs, I would install the plugin on a "development" copy of your Zen Cart installation. This will let you see the direct impact of your "titles" and also play around with filters (such as having USU convert " in titles to in / inch / inches in URLs).

One can install Ultimate URLs at a later date (or disable the module if installed). Ultimate URLs will automatically handle adding a "canonical" page reference for search engines (unless your theme disables this head tag). This allows search engines to access your pages at either the standard Zen Cart URLs or the URLs generated by this plugin. The "canonical" head tag also lets SEs know the two pages should be treated as the same page (most SEs will also combines the two pages in the search engine index and treats them as one URL).

Ultimate URLs does also have an option to enable "automatic redirects" to issue 301s to aid in switching from the stock Zen Cart URLs (will tell the SEs to use the new URLs as the main URL and send visitors to only the new URL). But keep in mind (at the time this was written) most SEO experts agree well established URLs in Search Engines may take a 1-3% hit if a 301 redirect is issued.**General Advice (website development and testing)
**I always setup my test sites as a subdomain. This way the behavior on the dev site is the same as if it was your "live" top level domain.. This will require few to zero changes to modify things such as URL paths, etc..

5 Aug 2013, 12:52 AM
#442
tech_ebooks avatar

tech_ebooks

New Zenner

Join Date:
Aug 2013
Location:
china
Posts:
6
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Hi friends,i really met a big problem for my site:
It worked perfectly on my zencart 1.51 site,but with the increase of the products,i could not open the main page and admin page right now,it reminds me error message,when i checked the log file,i found the following information:

[02-Aug-2013 10:31:14] PHP Fatal error: 1153:Got a packet bigger than 'max_allowed_packet' bytes :: INSERT INTO seo_cache (cache_id, cache_language_id, cache_name, cache_data, cache_global, cache_gzip, cache_method, cache_date, cache_expires) VALUES ('ca34fbe5f9a075091ad59abf02c259a7', '1', 'seo_urls_v2_products'

The problem now is i could not change the max_allowed_packet bytes,even i changed it,the problem will happen again with the increase of the products,anymore have cure on this, i really appreciate your help,thanks

5 Aug 2013, 5:35 AM
#443
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Background:
There are tradeoffs involved with caching (and with different caching mechanisms). There is no one "perfect" setting for all environments and stores. Some of the many factors include: your HTTP/HTTPS server settings, PHP settings, MySQL server settings, network / bandwidth limitations, the size of your database, available processing power, available memory, and desired site performance.

With this in mind, the ability of "Ultimate (SEO) URLs" to use multiple different caching mechanisms both internal and external (as well as disabling all supported cache mechanisms) can be configured. You can choose which to enable based upon the hosting environment and needs of an individual store.

Externally, this module will attempt to utilize and configured Zen Cart caching mechanisms if enabled in Zen Cart. There are two main types in Zen Cart 1.5.1. The first stores answers to the SQL requests in a file or an additional table in the database (is used across requests). The second is query cache which stores requests in memory (only for the current request). I will not discuss these further in this thread, but wanted to mention these will be used if configured globally for Zen Cart 1.5.1.

Internally, this module uses two different caching mechanisms if enabled. The first layer stores the result of generating the URL into memory (only for the current request). The second layer (where it sounds like you are running into issues) stores a compressed copy of entire blocks of generated URL results (such as products, categories, OR ez-pages). This second cache stores the data in the database and is used across multiple requests. Both layers can be enabled or disabled by changing this module's settings.

I've listed a couple of different items you may wish to experiment with when trying to find the settings which work best for your specific hosting environment and store needs.

Change the compression level:
By default this module only uses compression level 1 (on a scale from 0 = none to 9 = max). If your server can handle higher levels of compression w/o a large impact, you can try using higher levels of compression. To change the compression level find the "save_cache" function and bump the level up.

Disable the internal products SQL cache:
You can disable this plugin's internal product SQL cache (as this stores every product name into a single entry in the database). Other cache mechanisms will remain active. This will avoid attempting to cache a large number of generated URL fragments using a single SQL command.

Disable the internal cache completely:
You can disable all internal caches, both memory and SQL based, by setting "Enable cache (globally)" to true. This will leave any external cache mechanisms active. A little extreme and probably not necessary unless the server is getting hammered and exceeding memory limits.

Experiment with an external Zen Cart cache:
You can enable or disable these in your Zen Cart configure.php files. More information can be found by searching the forums and faqs on http://www.zen-cart.com/. This typically is used by Zen Cart to store longer running SQL commands. This module uses the cache if enabled to store requests (can reduce the number of executed SQL JOINS).

Change the settings for MySQL (server and client):
MySQL can typically handle a packet size up to 1G (one would need to modify both the MySQL client and server settings). This is only an option if you have access to change server settings and have enough memory available to the server(s). I would not necessarily bump all the way up to 1G, but you could try 32M, 64M, or even 128M. Performance impact(s) will vary depending upon if MySQL is talking locally or remotely.

Configure other caching:
For a very large site (or site running on a cluster), it may be beneficial to configure separate caches (via proxy, memcached, etc). This is not something simple to set up, but for VERY busy websites the benefit may outweigh the costs. Changes to enable such as setup are outside the scope of this thread.

5 Aug 2013, 8:30 AM
#444
tech_ebooks avatar

tech_ebooks

New Zenner

Join Date:
Aug 2013
Location:
china
Posts:
6
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

Background:
There are tradeoffs involved with caching (and with different caching mechanisms). There is no one "perfect" setting for all environments and stores. Some of the many factors include: your HTTP/HTTPS server settings, PHP settings, MySQL server settings, network / bandwidth limitations, the size of your database, available processing power, available memory, and desired site performance.

With this in mind, the ability of "Ultimate (SEO) URLs" to use multiple different caching mechanisms both internal and external (as well as disabling all supported cache mechanisms) can be configured. You can choose which to enable based upon the hosting environment and needs of an individual store.

Externally, this module will attempt to utilize and configured Zen Cart caching mechanisms if enabled in Zen Cart. There are two main types in Zen Cart 1.5.1. The first stores answers to the SQL requests in a file or an additional table in the database (is used across requests). The second is query cache which stores requests in memory (only for the current request). I will not discuss these further in this thread, but wanted to mention these will be used if configured globally for Zen Cart 1.5.1.

Internally, this module uses two different caching mechanisms if enabled. The first layer stores the result of generating the URL into memory (only for the current request). The second layer (where it sounds like you are running into issues) stores a compressed copy of entire blocks of generated URL results (such as products, categories, OR ez-pages). This second cache stores the data in the database and is used across multiple requests. Both layers can be enabled or disabled by changing this module's settings.

I've listed a couple of different items you may wish to experiment with when trying to find the settings which work best for your specific hosting environment and store needs.

Change the compression level:
By default this module only uses compression level 1 (on a scale from 0 = none to 9 = max). If your server can handle higher levels of compression w/o a large impact, you can try using higher levels of compression. To change the compression level find the "save_cache" function and bump the level up.

Disable the internal products SQL cache:
You can disable this plugin's internal product SQL cache (as this stores every product name into a single entry in the database). Other cache mechanisms will remain active. This will avoid attempting to cache a large number of generated URL fragments using a single SQL command.

Disable the internal cache completely:
You can disable all internal caches, both memory and SQL based, by setting "Enable cache (globally)" to true. This will leave any external cache mechanisms active. A little extreme and probably not necessary unless the server is getting hammered and exceeding memory limits.

Experiment with an external Zen Cart cache:
You can enable or disable these in your Zen Cart configure.php files. More information can be found by searching the forums and faqs on http://www.zen-cart.com/. This typically is used by Zen Cart to store longer running SQL commands. This module uses the cache if enabled to store requests (can reduce the number of executed SQL JOINS).

Change the settings for MySQL (server and client):
MySQL can typically handle a packet size up to 1G (one would need to modify both the MySQL client and server settings). This is only an option if you have access to change server settings and have enough memory available to the server(s). I would not necessarily bump all the way up to 1G, but you could try 32M, 64M, or even 128M. Performance impact(s) will vary depending upon if MySQL is talking locally or remotely.

Configure other caching:
For a very large site (or site running on a cluster), it may be beneficial to configure separate caches (via proxy, memcached, etc). This is not something simple to set up, but for VERY busy websites the benefit may outweigh the costs. Changes to enable such as setup are outside the scope of this thread.

Thanks for your reply,but i am really new here,i don't know how to make the changes,when i open the website,it only remind me"WARNING: An Error occurred, please refresh the page and try again",how should i disable the cache per your information? i have modified the following links from init_seo_config.php,i am doing right,but still not working for me,what should i do?

return array(

	'USU_VERSION' => array('configuration_value' => '\'' . $version . '\'', 'use_function' => '', 'set_function' => 'zen_cfg_select_option(array(\\\'' . $version . '\\\'),'),

	'SEO_ENABLED' => array('configuration_value' => 'false', 'use_function' => '', 'set_function' => 'zen_cfg_select_option(array(\\\'true\\\', \\\'false\\\'),'),
	'SEO_URL_CPATH' => array('configuration_value' => 'auto', 'use_function' => 'usu_check_cpath_option', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-auto\\\', \\\'disable\\\'),'),
	'SEO_URL_END' => array('configuration_value' => '.html', 'use_function' => '', 'set_function' => ''),

	'SEO_URL_FORMAT' => array('configuration_value' => 'original', 'use_function' => 'usu_check_url_format_option', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-original\\\', \\\'enable-parent\\\'),'),

	'SEO_URL_CATEGORY_DIR' => array('configuration_value' => 'short', 'use_function' => 'usu_check_category_dir_option', 'set_function' => 'zen_cfg_select_option(array(\\\'disable\\\', \\\'enable-short\\\', \\\'enable-full\\\'),'),

	'SEO_URLS_FILTER_PCRE' => array('configuration_value' => '', 'use_function' => '', 'set_function' => ''),

	'SEO_URLS_FILTER_CHARS' => array('configuration_value' => '', 'use_function' => '', 'set_function' => ''),

	'SEO_URLS_REMOVE_CHARS' => array('configuration_value' => 'punctuation', 'use_function' => 'usu_check_remove_chars_option', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-non-alphanumerical\\\', \\\'enable-punctuation\\\'),'),

	'SEO_URLS_FILTER_SHORT_WORDS' => array('configuration_value' => '0', 'use_function' => '', 'set_function' => ''),

	'SEO_URLS_ONLY_IN' => array('configuration_value' => 'index, product_info, product_music_info, document_general_info, document_product_info, product_free_shipping_info, products_new, products_all, shopping_cart, featured_products, specials, contact_us, conditions, privacy, reviews, shippinginfo, faqs_all, site_map, gv_faq, discount_coupon, page, page_2, page_3, page_4', 'use_function' => '', 'set_function' => ''),

	'SEO_REWRITE_TYPE' => array('configuration_value' => 'rewrite', 'use_function' => '', 'set_function' => 'zen_cfg_select_option(array(\\\'rewrite\\\'),'),

	'SEO_USE_REDIRECT' => array('configuration_value' => 'false', 'use_function' => '', 'set_function' => 'zen_cfg_select_option(array(\\\'true\\\', \\\'false\\\'),'),

	'SEO_USE_CACHE_GLOBAL' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable\\\', \\\'disable\\\'),'),

	'SEO_USE_CACHE_PRODUCTS' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-products\\\', \\\'disable-products\\\'),'),

	'SEO_USE_CACHE_CATEGORIES' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-categories\\\', \\\'disable-categories\\\'),'),

	'SEO_USE_CACHE_MANUFACTURERS' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-manufacturers\\\', \\\'disable-manufacturers\\\'),'),

	'SEO_USE_CACHE_EZ_PAGES' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-ez_pages\\\', \\\'disable-ez_pages\\\'),'),
	'SEO_URLS_CACHE_RESET' => array('configuration_value' => 'false', 'use_function' => 'usu_reset_cache_data', 'set_function' => 'zen_cfg_select_option(array(\\\'true\\\', \\\'false\\\'),'),

);
5 Aug 2013, 8:43 AM
#445
tech_ebooks avatar

tech_ebooks

New Zenner

Join Date:
Aug 2013
Location:
china
Posts:
6
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

to be more specific:

Change the compression level:
By default this module only uses compression level 1 (on a scale from 0 = none to 9 = max). If your server can handle higher levels of compression w/o a large impact, you can try using higher levels of compression. To change the compression level find the "save_cache" function and bump the level up.===
=====My question,which file shall i modify?

Disable the internal products SQL cache:
You can disable this plugin's internal product SQL cache (as this stores every product name into a single entry in the database). Other cache mechanisms will remain active. This will avoid attempting to cache a large number of generated URL fragments using a single SQL command.
====Which file shall i modify?

Disable the internal cache completely:
You can disable all internal caches, both memory and SQL based, by setting "Enable cache (globally)" to true. This will leave any external cache mechanisms active. A little extreme and probably not necessary unless the server is getting hammered and exceeding memory limits.
===Which file shall i modify?

please save my ###### out of here!

5 Aug 2013, 1:45 PM
#446
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

tech-ebooks:

to be more specific:

Change the compression level: ...
This can be found by doing a file search. If you have to ask... Better you do not attempt.

tech-ebooks:

...
Disable the internal products SQL cache: ...
You configure this using the Zen Cart admin (configure -> Ultimate (SEO) URLs). DO NOT TRY TO MANUALLY EDIT FILES.

tech-ebooks:

...
Disable the internal cache completely: ...
You configure this using the Zen Cart admin (configure -> Ultimate (SEO) URLs). DO NOT TRY TO MANUALLY EDIT FILES.

6 Aug 2013, 7:20 AM
#447
tech_ebooks avatar

tech_ebooks

New Zenner

Join Date:
Aug 2013
Location:
china
Posts:
6
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

This can be found by doing a file search. If you have to ask... Better you do not attempt.

You configure this using the Zen Cart admin (configure -> Ultimate (SEO) URLs). DO NOT TRY TO MANUALLY EDIT FILES.

You configure this using the Zen Cart admin (configure -> Ultimate (SEO) URLs). DO NOT TRY TO MANUALLY EDIT FILES.

================
Thank you very much for your reply,the problem is i could not login in admin page because it show erros,anyway,when i use the older version of SEO URL,it working as a magic,i don't know the reason,but i still get the following issue when i check the log,would be appreciate if you could provide more help,which file i could modify to eliminate this problem? thank you.

[06-Aug-2013 14:41:00] PHP Warning: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Empty regular expression in /home/techeboo/public_html/includes/classes/seo.url.php on line 803

6 Aug 2013, 3:25 PM
#448
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

It sounds like you have been trying to just muck around changing files... And may have just overwritten files which are part of this plugin (or Zen Cart) with copies from different versions. This will get you into trouble. Zen Cart is not just files - it is files + a database. Both the database and files need to be in sync for everything to work correctly - and this applies to plugins as well. In the long run thinking you can just "change files" and ignoring the database will lead to a large number of potential issues. You need to take both into consideration.

You should also NOT just start editing files which are part of the plugin to TRY to change stuff in the database. This can break the plugin and installer. Modifying things without knowing the ramifications can be disastrous. If you need to alter the database (and understand the ramifications of every change you make) you should directly edit the database using a tool such as phpMyAdmin.

It also sounds like you may have some invalid configuration settings for this module (possibly from mixing versions, changes you made to the installer, or changes made from the admin interface). The best long term solution is to completely remove this plugin and re-install.

tech-ebooks:

... when i use the older version of SEO URL,it working ...
First and foremost, did you install "Ultimate (SEO) URLs"? or some other "SEO URL" add-on. I ask because when people try to shorten the name of an add-on... Well lets just say there are at least three different add-ons which modify the URLs generated by Zen Cart people incorrectly refer to as "SEO URL".

tech-ebooks:

... which file i could modify to eliminate this problem? ...
Start by reverting your site to "known good" backup (files and database). Now verify you can get into the admin and also view the site. You should be able to unless there were problems which existed prior to attempting to install this plugin.

If for some reason you did not follow the instructions to make a backup of the files and database for Zen Cart... You will need to find and remove all files and database changes made by ALL versions of this plugin (and any added by changes you made to the installer). As you have been copying files from various versions (and probably breaking some of the upgrade scripts) you may need to do this by HAND.

Once everything is back to a VERIFIED working status (with ALL traces of this plugin removed)... Follow the instructions to install this plugin again. Do NOT take any shortcuts. Do NOT skip anything. Note any and all installation messages...

7 Aug 2013, 9:08 AM
#449
tech_ebooks avatar

tech_ebooks

New Zenner

Join Date:
Aug 2013
Location:
china
Posts:
6
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

It sounds like you have been trying to just muck around changing files... And may have just overwritten files which are part of this plugin (or Zen Cart) with copies from different versions. This will get you into trouble. Zen Cart is not just files - it is files + a database. Both the database and files need to be in sync for everything to work correctly - and this applies to plugins as well. In the long run thinking you can just "change files" and ignoring the database will lead to a large number of potential issues. You need to take both into consideration.

You should also NOT just start editing files which are part of the plugin to TRY to change stuff in the database. This can break the plugin and installer. Modifying things without knowing the ramifications can be disastrous. If you need to alter the database (and understand the ramifications of every change you make) you should directly edit the database using a tool such as phpMyAdmin.

It also sounds like you may have some invalid configuration settings for this module (possibly from mixing versions, changes you made to the installer, or changes made from the admin interface). The best long term solution is to completely remove this plugin and re-install.

First and foremost, did you install "Ultimate (SEO) URLs"? or some other "SEO URL" add-on. I ask because when people try to shorten the name of an add-on... Well lets just say there are at least three different add-ons which modify the URLs generated by Zen Cart people incorrectly refer to as "SEO URL".

Start by reverting your site to "known good" backup (files and database). Now verify you can get into the admin and also view the site. You should be able to unless there were problems which existed prior to attempting to install this plugin.

If for some reason you did not follow the instructions to make a backup of the files and database for Zen Cart... You will need to find and remove all files and database changes made by ALL versions of this plugin (and any added by changes you made to the installer). As you have been copying files from various versions (and probably breaking some of the upgrade scripts) you may need to do this by HAND.

Once everything is back to a VERIFIED working status (with ALL traces of this plugin removed)... Follow the instructions to install this plugin again. Do NOT take any shortcuts. Do NOT skip anything. Note any and all installation messages...

Thank you,i did not modify the files and follow all the instructions to install the latest version for SEO URL,I did not install any other SEO plugin,it worked good for me before,but when the qty of the products increase it suddenly went down and both the main page and admin page could not be opened,so that's why i want to make some changes on the file,but i did not make any changes.

I did not remove the latest SEO URL,i just the older version for SEO url to replace the exting new SEO url file,because the error reminds me there is something wrong in seo.url.php on line 803 ,so i am wondering if i could simply modify seo.url.php to solve the problem?

7 Aug 2013, 2:35 PM
#450
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

tech-ebooks:

... I did not modify the files ...
You cannot say you modified files (post #444)... Wanted to know what additional files to change to alter settings (post #445)... Replaced individual files with files from a different version (post #449)... All of these conflict directly with the statement "I did not modify the files".

tech-ebooks:

... I did not remove the latest SEO URL,i just the older version for SEO url to replace the exting new SEO url file ...
Selectively grabbing parts from one version and mixing with another version will result in issues and errors. This "cherry picking" you have been doing results in the FILES and DATABASE parts of Ultimate (SEO) URLs being out of sync. This is probably 90% of your problem.

If you upgraded from a version of this plugin prior to v2.150, did you first completely remove the old version? Failure to first remove old (and unsupported) versions of this plugin before "upgrading" can also result in things not quite working correctly.

tech-ebooks:

... because the error reminds me there is something wrong in seo.url.php on line 803 ,so i am wondering if i could simply modify seo.url.php to solve the problem? ...
What leads you to conclude this? The error you reported shows either: A) You have an invalid setting (settings for Ultimate URLs are stored in the Zen Cart database). B) You have mixed different versions of the FILES and DATABASE for this module.

At this point the fix is to re-install Ultimate (SEO) URLs from scratch. Please stop trying to find a "shortcut".

tech-ebooks:

... I ... follow all the instructions to install the latest version.
Good. Restore your files and database from the backup you made (Making a backup is the first step listed in the instructions for installing this module). Now go back through the files and database and uninstall / remove any files or database entries from older versions of this plugin.

Once all the traces of this (or other alternate URL generators) have been removed, download a CLEAN zip file of this plugin. Unpack the CLEAN zip file to a NEW folder. Start the installation process again using the files and instructions in the NEW folder.

Note: I will not be responding to any further posts from you until: A) You have shown you have followed the instructions I've given. B) You are not trying to take "shortcuts". C) You apologize for continuing to call this plugin "SEO URLs" after being asked not to.

10 Aug 2013, 11:56 AM
#451
mohandas avatar

mohandas

New Zenner

Join Date:
Oct 2012
Posts:
3
Plugin Contributions:
1

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Hi all,
I've been using Ultimate SEO for a while now and now and I am finally happy with it after figuring out how to configure it to my needs. I have recently added directory-based language differentiation for SEO and clarification (since I have both Dutch and English versions of all pages), and I am trying to correctly inform search engines about the different forms of my pages in the different languages, using 'canonical' and 'hreflang' in common/html_header.php
On fixed-url pages this works perfectly how I want it:

<link rel="canonical" href="http://art.horisense.com/en/" />
<link rel="alternate" href="http://art.horisense.com/" hreflang="x-default" />
<link rel="alternate" href="http://art.horisense.com/nl/" hreflang="nl" />
<link rel="alternate" href="http://art.horisense.com/en/" hreflang="en" />

However, on product- and category pages I cannot notify about any other language pages than the active language:

<link rel="canonical" href="http://art.horisense.com/en/canvas-c-8/canvas-40x30-pastel-poppy-dancer-p-31.html " />
<link rel="alternate" href="http://art.horisense.com/-p-31" hreflang="x-default" />
<link rel="alternate" href="http://art.horisense.com/en/canvas-c-8/canvas-40x30-pastel-poppy-dancer-p-31.html" hreflang="en" />

This is because the 'zen_href_link' and $seo_urls->href_link functions do not have a language choice. I even tried changing $_SESSION['language'], $_SESSION['language_code'], $_SESSION['language_id'] and reconstructing $seo_urls with the other language id, but zen_href_link still kept giving the url with the active language only. It seems the only way is to completely reinitialize all language-specific constants.

Any ideas on the best way to get the page url from another language than the active one?

10 Aug 2013, 5:43 PM
#452
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Mohandas:

Hi all,
I've been using Ultimate SEO for a while now and now and I am finally happy with it after figuring out how to configure it to my needs. I have recently added directory-based language differentiation for SEO and clarification (since I have both Dutch and English versions of all pages)...
Nice. Please consider contributing your changes! If you send them my way (PM or EMAIL) I will look over them further and consider them for inclusion in a future version :smile:

Mohandas:

...
However, on product- and category pages I cannot notify about any other language pages than the active language ...
If you turn off "automatic redirects", you can use something like the following:

$tmp_lng = new language();
foreach($tmp_lng->catalog_languages as $lng) {
	// Initialize a new generator for a specific language (by language_id).
	${'usu_' . $lng['code']} = new SEO_URL($lng['id']);

	// Create a link using the generator for a specific language (make sure to define $excludeParams).
	${'link_' . $lng['code']} = ${'usu_' . $lng['code']}->href_link($current_page, zen_get_all_get_params($excludeParams), $request_type, false);

	// Alternate available for the specified language.
	if(${'link_' . $lng['code']} !== null) {
		// Do something with the link (such as add an alternate).
	}
	unset(${'usu_' . $lng['code']}, ${'link_' . $lng['code']});
}
unset($tml_lng, $lng);

If you installed the "Multilingual Ez-Pages" mod, you will need to change the code on line 652 and 930 of 'seo_url.php' to replace (int)$_SESSION['languages_id'] with $this->languages_id. This only affects generating alternate URLs for a language other than the current language.

11 Aug 2013, 1:56 PM
#453
mohandas avatar

mohandas

New Zenner

Join Date:
Oct 2012
Posts:
3
Plugin Contributions:
1

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

Nice. Please consider contributing your changes! If you send them my way (PM or EMAIL) I will look over them further and consider them for inclusion in a future version :smile:
I can't guarantee compatibility with other settings and plugins though, but it mainly involves adding this to .htaccess before the start of the Ultimate SEO rewrite rules:

RewriteRule ^(en|nl)/(.*)$ $2?language=$1 [QSA,L]

and in functions/html_output.php change:

$href_link = $seo_urls->href_link($page, $parameters, $connection, $add_session_id, $static, $use_dir_ws_catalog);

to

// adds the current language as a directory to all links, 
if (isset($_SESSION['languages_code'])){
	$language_tag_content=$_SESSION['languages_code'];
}else{
	// if no $_SESSION['languages_code'] parameter is found, the default language is added to all links:
	$language_tag_content=DEFAULT_LANGUAGE;
}

// give preference over language code in the language variable
// the language GET variable is extracted and removed in case a language parameter is present in the url 
// (which is the normal case since .htaccess converts the language directory into a language GET variable):
if (strstr($parameters,'language=')){
	$language_pos = strrpos ( $parameters , 'language=');
	$language_code_pos = $language_pos + 9;
	$language_tag_content = substr ( $parameters , $language_code_pos ,2 );
	// remove language tag from parameters:
	$parameters = substr ( $parameters , 0 , $language_pos) . substr ( $parameters , $language_pos+11);
}
// generate the link without language parameter:
$href_link = $seo_urls->href_link($page, $parameters, $connection, $add_session_id, $static, $use_dir_ws_catalog);
if($href_link === null) {
    	$href_link = original_zen_href_link($page, $parameters, $connection, $add_session_id, $search_engine_safe, $static, $use_dir_ws_catalog);
	$href_link = str_replace('%20','+',$href_link);
	$href_link = str_replace('&','&',$href_link);
}

// include the language tag content as a directory in the link url. htaccess will convert this into a regular language GET variable
if (strstr($href_link,HTTPS_SERVER.DIR_WS_HTTPS_CATALOG)){
	$href_link = HTTPS_SERVER.DIR_WS_HTTPS_CATALOG . $language_tag_content .'/'. substr ( $href_link , strlen(HTTPS_SERVER.DIR_WS_HTTPS_CATALOG));
}else{
	if (strstr($href_link,HTTP_SERVER.DIR_WS_CATALOG)){
		$href_link = HTTP_SERVER.DIR_WS_CATALOG . $language_tag_content .'/'. substr ( $href_link , strlen(HTTP_SERVER.DIR_WS_CATALOG) );
	}
}

If you turn off "automatic redirects", you can use something like the following:

$tmp_lng = new language();
foreach($tmp_lng->catalog_languages as $lng) {
// Initialize a new generator for a specific language (by language_id).
${'usu_' . $lng['code']} = new SEO_URL($lng['id']);

// Create a link using the generator for a specific language (make sure to define $excludeParams).
${'link_' . $lng['code']} = ${'usu_' . $lng['code']}->href_link($current_page, zen_get_all_get_params($excludeParams), $request_type, false);

// Alternate available for the specified language.
if(${'link_' . $lng['code']} !== null) {
	// Do something with the link (such as add an alternate).
}
unset(${'usu_' . $lng['code']}, ${'link_' . $lng['code']});

}
unset($tml_lng, $lng);

Your suggestion was sort of what I tried already and doesn't work. 
**But I found out that the problem was caused by the cache. If I turn off the seo url cache it works!**
And also it was helpful to use this way of looping through the languages in order to find the id and the language code together.

I changed my mind about the default language page btw. I use it also for the social media buttons, to combine the like/share counts for all languages. I thought it would be a good idea to have a very short url, so it leaves more room in tweets. However, on second thought I have now chosen to use a slightly shortened version of the English url for the x-default language page and the social media tweets/shares/likes (regardless of the chosen language):
```html
<link rel="canonical" href="http://art.horisense.com/nl/canvas-c-8/canvas-40x30-pastel-papaverdanseres-p-31.html" />
<link rel="alternate" href="http://art.horisense.com/canvas-c-8/canvas-40x30-pastel-poppy-dancer-p-31/" hreflang="x-default" />
<link rel="alternate" href="http://art.horisense.com/nl/canvas-c-8/canvas-40x30-pastel-papaverdanseres-p-31.html" hreflang="nl" />
<link rel="alternate" href="http://art.horisense.com/en/canvas-c-8/canvas-40x30-pastel-poppy-dancer-p-31.html" hreflang="en" />

In this way, I may still at least benefit from the english keywords in the url, when my product url's are shared in tweets.

12 Aug 2013, 4:47 PM
#454
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Mohandas:

...
Your suggestion was sort of what I tried already and doesn't work.
But I found out that the problem was caused by the cache. If I turn off the seo url cache it works!
And also it was helpful to use this way of looping through the languages in order to find the id and the language code together.
...
Ahh, yes - the memory cache assumes the same language for each page request. Forgot about that one. Thanks for reporting back! I'll have to take a look at some changes in a future release :)

12 Aug 2013, 7:44 PM
#455
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

Ahh, yes - the memory cache assumes the same language for each page request. Forgot about that one. Thanks for reporting back! I'll have to take a look at some changes in a future release :)
I used this caching in memory:

$this->cache['PRODUCTS'][$pID][$this->languages_id] = $pName;

and

defined('PRODUCT_NAME_' . $pID . '_lng_' . $this->languages_id)

and so on.

Now I refused to use the constants for caching (strange idea).

And also refused to create a complete in-memory cache every time a class construct. Need to conserve memory.

When you need something - then put in the cache. Cache on demand.

13 Aug 2013, 4:05 AM
#456
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

a_berezin:

I used this caching in memory:

$this->cache['PRODUCTS'][$pID][$this->languages_id] = $pName;

> and
> ```php
defined('PRODUCT_NAME_' . $pID . '_lng_' . $this->languages_id)

and so on.

Now I refused to use the constants for caching (strange idea).

And also refused to create a complete in-memory cache every time a class construct. Need to conserve memory.

When you need something - then put in the cache. Cache on demand.
Yup, The in memory caching code is some of the last remaining inherited code. The inherited code works how you mentioned - minus the language (including both in memory storage using constants and storage using an array).

There are three configuration options for the in memory caches... None, array only, array + constant / SQL... I typically enable the array only based in memory cache. In most cases if you need the constant / SQL method you are better off moving to a different hosting environment (or provider).

To disable the constant based memory cache (loads all items into memory when the class is created) disable the "product cache", "manufacturer cache", "category cache", etc. Leave the "global" cache option enabled. Global is not quite the right word, but is the one used in the configuration at this time.

For Mohandas` scenario using only the array based cache (with no other code changes) and disabling "automatic redirects" should work. My snippet earlier was thrown together on a system with only the array cache enabled.

If one wants to enable the larger "constant" based caching mechanism and needs to be able to pull the same URL for different languages... Changes such as those posted by a_berezin will be needed (thank you for posting).

Removing and / or refactoring the existing code handling caching is part of the "todo" list for the next major release. The constant based caches may be disabled by default in the next minor release... And may be removed completely in favor of some alternative methods...

15 Aug 2013, 4:36 AM
#457
su35 avatar

su35

Zen Follower

Join Date:
Oct 2011
Posts:
168
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

zencart: v1.5.1
USEO: V2.212

Problem: (including all products, new products....)
When set USEO on (ex: domain/products_new.html), the pages were available. However, google (webmaster tools -> fetch as google) shown that the page status was 404, and the firebug said it was 200. If visit the page as domain/index.php?main_page=products_new, there was no issues.
Attachment 12893

I think it may be a .htaccess problem, but I don't understand it. Could anyone help?

###############################################################################
# Common directives
###############################################################################
# NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:

#301 redirects
RewriteEngine On
RewriteCond %{HTTP_HOST} ^my domain name [nc]
RewriteRule ^(.*) http://www.my domain name/$1 [R=301,L]


Options +FollowSymLinks
RewriteEngine on
RewriteBase /

#producttags
RewriteRule ^producttags/([-\w]+)/$ index\.php?main_page=producttags&letter=$1&%{QUERY_STRING} [L]
RewriteRule ^producttags/([\w])/([0-9]+).html$ index\.php?main_page=producttags&letter=$1&page=$2&%{QUERY_STRING} [L]
RewriteRule ^wishlist/$ index\.php?main_page=wishlist [L]
RewriteRule ^wishlist/([\w])/$ index\.php?main_page=wishlist&letter=$1&%{QUERY_STRING} [L]
RewriteRule ^wishlist/([\w])/([0-9]+).html$ index\.php?main_page=wishlist&letter=$1&page=$2&%{QUERY_STRING} [L]

# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]


###############################################################################
# Start Ultimate SEO URLs
###############################################################################

# Handles the new URL formats
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]

# Original (unchanged) URL formats
RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+)(.*)$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]

# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC] 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L]

RewriteRule ^news(.*)$ index.php?main_page=news&$1 [E=VAR1:$1,QSA,L]
15 Aug 2013, 2:06 PM
#458
mohandas avatar

mohandas

New Zenner

Join Date:
Oct 2012
Posts:
3
Plugin Contributions:
1

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

a_berezin and lhungil thank you so much for the detailed help. Yes it was indeed okay to leave on the global cache when I turned off all the page-specific cache options. As far as I could see in the code, indeed the database cache is differentiating between languages. Language differentiation is just not included in naming the constants nor in $this->cache.

I think I also managed to implement the suggestion by a_berezin to modify the constants and memory cache, by modifying all definitions and queries with respect to PRODUCT_NAME_ AND $this->cache['PRODUCTS'] in the functions 'get_product_name', 'get_product_canonical' and 'generate_products_cache' to include a language id. I now finally get the different language urls even when I turn on product name cache. I will do the same for the categories, etc.

And I guess what a_berezin tried to say is that every time a seo class is constructed, all product names are read from the database and put into memory (constant) cache. This seems quite a lot of unnecessary overhead process and memory since most of the names will not be used.

It seems that, in order to replace that by on demand caching, the function get_product_name will need to not only read the product name from the database if it is not cached yet, but also put in the cache at that moment. Am I correct and is this the only thing that would need to be added when removing 'generate_products_cache()' from class construction? Or would there be more modifications necessary?

15 Aug 2013, 3:03 PM
#459
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

I'm sorry that I answer here, in the discussion of the module from lhungil.

Mohandas:

It seems that, in order to replace that by on demand caching, the function get_product_name will need to not only read the product name from the database if it is not cached yet, but also put in the cache at that moment. Am I correct and is this the only thing that would need to be added when removing 'generate_products_cache()' from class construction?
Yes, that's exactly what I'm doing. In get_product_name I check whether the name with requested products_id and current language_id in the cache, if not - read from the database and put it in db_cache/Memcache and (optional) in memory cache.
Also I use very simple structure of DB Cache Table:

    $insert_cache_table = "CREATE TABLE " . TABLE_SEO_CACHE . " (
      cache_name char(32) NOT NULL,
      cache_data text NOT NULL,
      cache_created timestamp NOT NULL,
      PRIMARY KEY  (cache_name),
      KEY idx_cache_created (cache_created)
    ) ENGINE=MyISAM;";
16 Aug 2013, 3:06 PM
#460
vinyl_ninja avatar

vinyl_ninja

New Zenner

Join Date:
Aug 2013
Posts:
4
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Hi

I have an issue that seems a bit unusual and I was hoping somebody might be able to offer some advice as to what's going on.

I'm trying to install Ultimate SEO onto my development site. Its Zen Cart 1.5.1 and the latest USEO (2.212). No .htaccess file was being used and none of the core zen files had been edited so the install was simple - copy over the amended files, copy over the new files, edit the .htaccess file (RewriteBase / to match the location of Zen which is installed to the root of the domain), upload .htaccess, login and finish the install. The install said it was successful.

If I browse to a category or product page the URL is re-written as I expected but the page takes ages to load and seems to be missing all the styling and scripts. Using the developer tools in Chrome I can see a category page takes 20.6 seconds to load, makes 67 requests and transfers 1.6Mb of data.

As a comparison, the same page on the live site (or the dev site if I disable USEO) takes 1.52 seconds to load, makes 75 requests and transfers 96.5Kb of data.

I'm at a bit of a loss as to what's going on. Has anyone else seen this or have any idea as to what the issue might be?

Thanks in advance!

Tom