DrLightman
Forum Replies Created
-
Forum: Networking WordPress
In reply to: update_site_option( ) fails for (pretty) large dataFurther local testing results:
$v = array(); for( $i=0; $i<34181; $i++ ) { $v[] = uniqid( ); } if( !update_option( 'foobar', $v ) ) { echo 'FFFFFFFUUUUUUUUUUUUUUUU'; }With values lesser of about 34181 update_option WORKS, above 34180 it fails. The serialized version size turns out to be 980120 bytes when it works. Above, it fails.
Forum: Plugins
In reply to: [Plugin: W3 Total Cache] W3 TC changing .htaccess not working on MU@c3mdigital ok, I did. At least nothing is broken 🙂
This is my .htaccess now:
RewriteEngine On RewriteBase / AddDefaultCharset UTF-8 # let add www if: RewriteCond %{HTTP_HOST} !localhost [NC] # not ends with an foo.bar.org domain (catch main foo.bar.org itself) RewriteCond %{HTTP_HOST} !foo\.bar.\org$ [NC] # url not starts with www already RewriteCond %{HTTP_HOST} !^www\. [NC] # do the rewrite RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L] # BEGIN W3TC Page Cache <IfModule mod_rewrite.c> RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9\-\.]+\.[a-z]+)\.?(:[0-9]+)?$ RewriteRule .* - [E=W3TC_DOMAIN:%2] RewriteCond %{HTTP_USER_AGENT} (2\.0\ mmp|240x320|alcatel|amoi|asus|au\-mic|audiovox|avantgo|benq|bird|blackberry|blazer|cdm|cellphone|danger|ddipocket|docomo|dopod|elaine/3\.0|ericsson|eudoraweb|fly|haier|hiptop|hp\.ipaq|htc|huawei|i\-mobile|iemobile|j\-phone|kddi|konka|kwc|kyocera/wx310k|lenovo|lg|lg/u990|lge\ vx|midp|midp\-2\.0|mmef20|mmp|mobilephone|mot\-v|motorola|netfront|newgen|newt|nintendo\ ds|nintendo\ wii|nitro|nokia|novarra|o2|openweb|opera\ mobi|opera\.mobi|palm|panasonic|pantech|pdxgw|pg|philips|phone|playstation\ portable|portalmmm|ppc|proxinet|psp|pt|qtek|sagem|samsung|sanyo|sch|sec|sendo|sgh|sharp|sharp\-tq\-gx10|small|smartphone|softbank|sonyericsson|sph|symbian|symbian\ os|symbianos|toshiba|treo|ts21i\-10|up\.browser|up\.link|uts|vertu|vodafone|wap|willcome|windows\ ce|windows\.ce|winwap|xda|zte) [NC] RewriteRule .* - [E=W3TC_UA:_low] RewriteCond %{HTTP_USER_AGENT} (acer\ s100|android|archos5|blackberry9500|blackberry9530|blackberry9550|cupcake|docomo\ ht\-03a|dream|htc\ hero|htc\ magic|htc_dream|htc_magic|incognito|ipad|iphone|ipod|lg\-gw620|liquid\ build|maemo|mot\-mb200|mot\-mb300|nexus\ one|opera\ mini|samsung\-s8000|series60.*webkit|series60/5\.0|sonyericssone10|sonyericssonu20|sonyericssonx10|t\-mobile\ mytouch\ 3g|t\-mobile\ opal|tattoo|webmate|webos) [NC] RewriteRule .* - [E=W3TC_UA:_high] RewriteCond %{HTTPS} =on RewriteRule .* - [E=W3TC_SSL:_ssl] RewriteCond %{SERVER_PORT} =443 RewriteRule .* - [E=W3TC_SSL:_ssl] RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule .* - [E=W3TC_ENC:.gzip] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} ="" RewriteCond %{REQUEST_URI} \/$ RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php) [NC,OR] RewriteCond %{REQUEST_URI} (wp-comments-popup\.php|wp-links-opml\.php|wp-locations\.php) [NC] RewriteCond %{HTTP_COOKIE} !(comment_author|wp-postpass|wordpress_\[a-f0-9\]\+|wordpress_logged_in) [NC] RewriteCond "/home/blogpub/public_html/wp-content/w3tc-%{ENV:W3TC_DOMAIN}/pgcache/$1/_index%{ENV:W3TC_UA}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" -f RewriteRule (.*) "/wp-content/w3tc-%{ENV:W3TC_DOMAIN}/pgcache/$1/_index%{ENV:W3TC_UA}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" [L] </IfModule> # END W3TC Page Cache # WPMU default starts: #uploaded files RewriteRule ^(.*/)?files/$ index.php [L] RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteCond %{REQUEST_URI} ^.*/wp-admin$ RewriteRule ^(.+)$ $1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule . - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] <IfModule mod_security.c> <Files async-upload.php> SecFilterEngine Off SecFilterScanPOST Off </Files> </IfModule>At the top there are some rr to handle some redirections.
However the message in the dashboard remains (“Enhanced mode page cache is not operational. …”). Below, Page Cache is ON, Page Cache Method is set to “Disk (enanched)”. Individual /wp-content/w3tc-BLOGNAME.EXT/pgcache/ folders are empty, only an .htaccess inside them, this let me think it’s not working as it should, maybe.
Forgot to mention, in “Compatibily check” I got those errors, maybe they are responsible for this:
PHP Timezone: Not set Opcode cache: Not installed Memcache extension: Not installedForum: Plugins
In reply to: [Plugin: W3 Total Cache] W3 TC changing .htaccess not working on MUI’d like to add that the above rewrite rules are the default ones shipped with WPMU 2.9.2, which whole .htaccess is:
RewriteEngine On RewriteBase BASE/ #uploaded files RewriteRule ^(.*/)?files/$ index.php [L] RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteCond %{REQUEST_URI} ^.*/wp-admin$ RewriteRule ^(.+)$ $1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule . - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] <IfModule mod_security.c> <Files async-upload.php> SecFilterEngine Off SecFilterScanPOST Off </Files> </IfModule>Forum: Plugins
In reply to: [Plugin: W3 Total Cache] W3 TC changing .htaccess not working on MUHi, I just came across this step on MU.
Entering the w3tc settings, it says I have to edit .htaccess myself, okay, no problem. But how do I merge the rules? Or I may overwrite them?
These are my current working rules:
#uploaded files RewriteRule ^(.*/)?files/$ index.php [L] RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteCond %{REQUEST_URI} ^.*/wp-admin$ RewriteRule ^(.+)$ $1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule . - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L]These are the w3tc suggested rules:
# BEGIN W3TC Page Cache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9\-\.]+\.[a-z]+)\.?(:[0-9]+)?$ RewriteRule .* - [E=W3TC_DOMAIN:%2] RewriteCond %{HTTP_USER_AGENT} (2\.0\ mmp|240x320|alcatel|amoi|asus|au\-mic|audiovox|avantgo|benq|bird|blackberry|blazer|cdm|cellphone|danger|ddipocket|docomo|dopod|elaine/3\.0|ericsson|eudoraweb|fly|haier|hiptop|hp\.ipaq|htc|huawei|i\-mobile|iemobile|j\-phone|kddi|konka|kwc|kyocera/wx310k|lenovo|lg|lg/u990|lge\ vx|midp|midp\-2\.0|mmef20|mmp|mobilephone|mot\-v|motorola|netfront|newgen|newt|nintendo\ ds|nintendo\ wii|nitro|nokia|novarra|o2|openweb|opera\ mobi|opera\.mobi|palm|panasonic|pantech|pdxgw|pg|philips|phone|playstation\ portable|portalmmm|ppc|proxinet|psp|pt|qtek|sagem|samsung|sanyo|sch|sec|sendo|sgh|sharp|sharp\-tq\-gx10|small|smartphone|softbank|sonyericsson|sph|symbian|symbian\ os|symbianos|toshiba|treo|ts21i\-10|up\.browser|up\.link|uts|vertu|vodafone|wap|willcome|windows\ ce|windows\.ce|winwap|xda|zte) [NC] RewriteRule .* - [E=W3TC_UA:_low] RewriteCond %{HTTP_USER_AGENT} (acer\ s100|android|archos5|blackberry9500|blackberry9530|blackberry9550|cupcake|docomo\ ht\-03a|dream|htc\ hero|htc\ magic|htc_dream|htc_magic|incognito|ipad|iphone|ipod|lg\-gw620|liquid\ build|maemo|mot\-mb200|mot\-mb300|nexus\ one|opera\ mini|samsung\-s8000|series60.*webkit|series60/5\.0|sonyericssone10|sonyericssonu20|sonyericssonx10|t\-mobile\ mytouch\ 3g|t\-mobile\ opal|tattoo|webmate|webos) [NC] RewriteRule .* - [E=W3TC_UA:_high] RewriteCond %{HTTPS} =on RewriteRule .* - [E=W3TC_SSL:_ssl] RewriteCond %{SERVER_PORT} =443 RewriteRule .* - [E=W3TC_SSL:_ssl] RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule .* - [E=W3TC_ENC:.gzip] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} ="" RewriteCond %{REQUEST_URI} \/$ RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php) [NC,OR] RewriteCond %{REQUEST_URI} (wp-comments-popup\.php|wp-links-opml\.php|wp-locations\.php) [NC] RewriteCond %{HTTP_COOKIE} !(comment_author|wp-postpass|wordpress_\[a-f0-9\]\+|wordpress_logged_in) [NC] RewriteCond "/home/blogpub/public_html/wp-content/w3tc-%{ENV:W3TC_DOMAIN}/pgcache/$1/_index%{ENV:W3TC_UA}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" -f RewriteRule (.*) "/wp-content/w3tc-%{ENV:W3TC_DOMAIN}/pgcache/$1/_index%{ENV:W3TC_UA}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" [L] </IfModule> # END W3TC Page CacheI can’t see any reference at blogs.php in the w3tc rules, will it be fine?
Forum: Fixing WordPress
In reply to: static pages subsetsThat’s great, I didn’t know that, thank you I’ll have a look at it.
Forum: Plugins
In reply to: E-commerce by Instincts (getshopped.org) ???All back to normal… pheeeeeeeeeew.
Forum: Plugins
In reply to: [Plugin: WordPress MU Domain Mapping] Unknown login keyI receive this error while trying to load up the homepage of a blog instead, it happens to be a redirect for I don’t know which reason and it ends up with this message.
Forum: Plugins
In reply to: [Plugin: WordPress MU Domain Mapping] Unknown logout keyThanks for sharing wshq.
But I just noticed that I had the “Unknown login key” not “Unknown logout key”.
What would that mean? It appeared after I changed host, so changing the ip. Maybe the cookies are messed up?
I also like to add if this happens trying to load the homepage of the blog, not even trying to login or logout. Why?
And my $wpdb->dmtablelogins is still empty or presentes a single row with user_id = 0.
This error doesn’t happen in a browser in which I don’t usually login or logout, but only in Firefox where to I login in the admin.
Forum: Plugins
In reply to: [Plugin: New Blog Defaults] dont work with 2.9.2Once in a while I found the settings of this plugin to be resetted, and I have to reinsert them manually 🙁
Using WPMU 2.9.2
Forum: Plugins
In reply to: [Plugin: WordPress MU Domain Mapping] Unknown logout keySame here.
WPMU 2.9.2 and domain mapping 0.5.1 -> “Unknown login key” message after logout.
My domain mapping logins table has only one record:
id user_id blog_id t
(empty) 0 35 0000-00-00 00:00:00pretty strange since I’m running 100+ blogs?
Forum: Fixing WordPress
In reply to: using a static page as frontapage, /page/2 gives me 404erhm, you also are right, my code was quite uncomplete 🙂
Forum: Fixing WordPress
In reply to: using a static page as frontapage, /page/2 gives me 404The total number of rows is always required, where did I tell otherwise?
In my case, I think I’m going to hardcode it in a variable in the template, because the table is pretty much static, I’d have to update it every six months or more through ssh or phpmyadmin.
$rows_count = 3171303;But you can use the SQL_CALC_FOUND_ROWS clause in the sql in the generic case when the data is dynamic, but it’s pretty much off topic to the issue I described here 🙂
Forum: Fixing WordPress
In reply to: using a static page as frontapage, /page/2 gives me 404The pagination code is not big issue, if /page/x/ would have been recognized by WP on the front-static-page (with the own template, yes), I had already set up the code, because I assumed it would work:
<?php /* Template Name: companies listing */ get_header(); global $wpdb; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $offset = ($paged-1)*5; $rows = $wpdb->get_results(" select * from {$wpdb->prefix}companies limit $offset,5 "); ...(regarding the total number of items of the table, I could even hardcode it because the table will not be modified by any backend)
Since the above doesn’t work, I’m on the way of RESOLVING by using the awesome redirection plugin. After installing I create this redirection:
http://img375.imageshack.us/img375/2557/redirpagefrontpage.jpg
/page/([0-9]+)/? -> /?mypage=x
So I can read myself the number in the frontpage template page:
$mypage = isset($_GET['mypage']) ? $_GET['mypage'] : 1;The rest of the code will be similar to the above at the beginning of the post.
Forum: Fixing WordPress
In reply to: using a static page as frontapage, /page/2 gives me 404I really appreciate your efforts in order to help me, but how pagination is done at low PHP level is not my issue, I’m pretty familiar with it, I always use the SQL_CALC_FOUND_ROWS thing by the way 🙂
Regarding this topic, I’ll explain again, the issue is that in a WordPress install with the front page set to a static page:
http://example.org/The above WORKS, page number 1 is assumed
http://example.org/page/2/ http://example.org/page/3/ ... http://example.org/page/x/ (x being a number)The urls above DOES NOT WORK, they all give “404 page not found”
Forum: Fixing WordPress
In reply to: using a static page as frontapage, /page/2 gives me 404I know I know, but it’s better doing it using MySQL “select … limit offset,count” clause to fetch only the required amount of rows from the database, while the total rows be over 3 millions in my case and it’s not praticable.
BUT, the problem is that I cannot pass the page number information from page to page because /page/<x>/ links don’t work, they give 404.