DrLightman
Forum Replies Created
-
Forum: Plugins
In reply to: [XML Sitemap & Google News] genres can be multipleOkay, but I cant assign multiple default genres, that was I trying to explain maybe I haven’t been specific on the “default” thing.
Forum: Plugins
In reply to: [XML Sitemap & Google News] Getting the Google News City field valueI was asking the same thing, I can’t see geo_locations stuff anywhere in the official docs.
Same applies to image also, nowhere to be found in docs.
https://support.google.com/news/publisher/answer/74288Maybe they decided to simplify the format.
Thank you very much megamurmulis for both the fixes!
Found this filter “wpseo_opengraph_type”
I wonder how that is possibile via the WP SEO plugin. I need to use a custom og:type for posts.
Forum: Plugins
In reply to: Post minimum words count before publish for authorsUsing the hook “transition_post_status” let me control other cases so I managed to fix the issue. Thank you for the invaluable help.
Forum: Plugins
In reply to: Post minimum words count before publish for authorsAfter some tests I discovered that if an author puts a future publish date, when WordPress does automatically publish the post, the function above doesn’t work. Now I have to understand why.
Forum: Fixing WordPress
In reply to: Category checklist hierarchy is brokenMan, I love you. I experienced this annoying bug just now, and your code fixed it instantly.
@krauthaus:
yes, put it in theme’s functions.php file.Forum: Fixing WordPress
In reply to: Error: "ftp_rename() [function.ftp-rename] […]"Getting this me too.
And as always happens, just after I post a question, I found the solution.
wp-content was, for I dont remeber the reason, writable, and it caused this stuff. chmodded back to 755 and the problem is gone.
Forum: Plugins
In reply to: [WP Super Cache] Fails to delete all cacheOk I’ll figure something out, thank you for the reply.
Maybe if you plan to add some custom hooks in the future, such as “wpsc_before_delete” or “wpsc_after_delete” or similar with parameters the cache folder, it would be great for such hacks 😉
Forum: Fixing WordPress
In reply to: Closed meta boxes in "posts – add new"Did anyone experience this problem? I’m facing it again. Clicking the arrow of meta boxes in post page does nothing: closed boxes stay closed, open stay open. It’s like as if I clicked twice. No js error in console, only 2 simultaneous ajax calls.
Forum: Plugins
In reply to: [ByREV WP-PICShield] Backslash in allowed domain gets duplicated in .htaccessto prevent duplicating backslashes in allowed domains
in \byrev-wp-picshield-import-admin.php around line 68 add this:
$byrev_gtfo_hotlink_post_data = array_map( 'stripslashes', $byrev_gtfo_hotlink_post_data );after this:
$byrev_gtfo_hotlink_post_data = array_map( 'esc_attr', $byrev_gtfo_hotlink_post_data );( this works for me if i want to use a regexp for the allowed domain, such as: ([a-z-]+\.)?mydomain\.com, this may be not the case for everyone who maybe will prefer to specify a domain simply by putting “domain.tld”. In this case you may want to use preg_quote to let the PHP escape the . automatically? )
to escape the . in the predefined allowable domains
I personally escaped them manually in the global arrays directly, same file of before, on top:
$__ONLINE_TRANSLATORS = array('translate\.google\.com','translate\.googleusercontent\.com','www\.microsofttranslator\.com'); $__SOCIAL_SHARE_USER_AGENT = array ('facebookexternalhit','facebookplatform','pinterest','feedfetcher','ggpht'); $__SOCIAL_SHARE_REFERER = array ('pinterest\.com','tumblr\.com','facebook\.com','plus\.google','twitter\.com'); $__GOGLE_TEST_REFERER = array ('googleapis\.com','googleusercontent\.com','ytimg\.com','gstatic\.com');Thought of using preg_quote() but did not. Same as before, it must be decided if we want use those string as regexp or not from start. This is my solution but it may be not a solution for everyone.
error_log warnings of failing to passthorugh on non existing files
were caused by many request to those files:
apple-touch-icon.png
apple-touch-icon-precomposed.pngFrom a quick google search it seems they are files requested by android devices for unknown reasons by me. To fix the warnings I put a simply if check such as this:
if( $wm = fopen($watermarked, 'rb') ): fpassthru($wm); else: // dont know what to do here, 404? endif;in place of this:
fpassthru(fopen($watermarked, 'rb'));in /raw_code/byrev-wp-picshield.php (need to do UPDATE OPTIONS of course after that)
for the ‘+’ in the filenames
the fix in my previous reply seems to work so far, in \byrev-wp-picshield-import-admin.php around line 242, by adding the B flag the line becomes:
$htaccess['rewrite_rule'][] = 'RewriteRule (.*) byrev-wp-picshield.php?key='.$data_basic['gtfo_key'].'&src=$1 [B,L]';Forum: Plugins
In reply to: [ByREV WP-PICShield] Backslash in allowed domain gets duplicated in .htaccessThis is related to the fpassthru() Warning of the previous reply.
I have some image files that contain the plus (+) character, for example:
wp-content/uploads/2013/01/foo+bar.jpg
This file will result in an error because after:
RewriteRule (.*) byrev-wp-picshield.php?key=XXXXX&src=$1 [L]
Later when src is accessed via $_GET[‘src’], the + get converted into a space, and the file “foo bar.jpg” is not found in the filesystem!
edit: maybe the SOLUTION to this is adding the B flag to the above rewrite rule:
RewriteRule (.*) byrev-wp-picshield.php?key=XXXXX&src=$1 [B,L]
Forum: Plugins
In reply to: [ByREV WP-PICShield] Backslash in allowed domain gets duplicated in .htaccessI’m using this to notify about other issues I’m finding as I test.
error_log was filled fast with those lines:
[23-May-2013 15:31:22] PHP Warning: Invalid argument supplied for foreach() in /home/…/example.org/byrev-wp-image2url.php on line 62
[23-May-2013 11:32:26] PHP Warning: fopen(/home/…/example.org/~hotlink-cache/wp-content/uploads/2013/01/pic.jpg) [function.fopen]: failed to open stream: No such file or directory in /home/…/example.org/byrev-wp-picshield.php on line 317
[23-May-2013 11:32:26] PHP Warning: fpassthru() expects parameter 1 to be resource, boolean given in /home/…/example.org/byrev-wp-picshield.php on line 317