« first day (548 days earlier)      last day (4695 days later) » 

08:11
morning
 
4 hours later…
12:37
hey guys
how do i debug something i can't replicate on my local.. See here the menu isn't showing.. citystirlakeview.com/event-category/major-league-baseball
@Kaiser: This wordpress.org/extend/plugins/wordpress-reset seems to be delete all contents too..
13:07
@Sisir do you know PHP?
yeah
@Sisir You seem to be using CloudFlare. It's showing me an alert screen with captcha
I think you need to lower the strictness the security settings in CF dashboard
Anyway, are you busy right now? I have a small problem with a plugin.
what is it..
I am using 'Markdown on Save' plugin
The thing is the plugin stores html in one column and markdown in another column. It comes with an option in the post window. If checked the plugin will pull Markdown content when editing a post.
I would like to make the plugin think that all my posts are markdown formatted by default
For that, I need to make changes in this file (160 lines of code) : pastebin.com/nyBaky3x
Can you take a look at the code and see if it makes any sense?
okey.. let me see..
13:16
thanks man!
go to line 121
Okay, I think tried that
`echo '<p><input type="checkbox" name="cws_using_markdown" id="cws_using_markdown" value="1" ';
checked( !! get_post_meta( $post->ID, self::PM, true ) );
echo ' />`
remove the checked part and only use the raw html checked="checked" that should do
Yes I did that
already
worked?
13:18
It has the option checked by default
but nothing happens
not works when you save?
See that's the problem: The plugin should think that my posts are already formatted in markdown. Let me explain
i see..
When I write a post in markdown, the plugin saves the markdown content in one column of the database table, and corresponding HTML in another table
If the plugin this that my post is formatted in markdown, it will pull the content from the markdown column for me to edit
If not, it will show me the HTML content
am I clear now?
i guess.. don't know anything about markdown though.. i am not much advanced in wordpress..
did you try posting it on wordpress.org forum so plugin developer can help? Hey might have something easier
13:22
It question has been asked by someone else about 2 months ago. I asked it a few days ago
Looks like the plugin's author is inactive as well
sucks..
yeah!
and I am stuck here...
wait for other people to come by :)
I don't think so. Helping me out means looking at 160 lines of code :(
thanks by the way, for your time.
@geekpanth3r why should it think that?
13:25
here we go..
@Rarst I don't understand
@geekpanth3r hover on my message to see line I am replying to
okay, got it
160 lines aren't much for people who codes thousands..
Here the thing (I explained that already... actually)
@Rarst When I write a post in markdown, the plugin saves the markdown content in one column of the database table, and corresponding HTML in another table
If the plugin this that my post is formatted in markdown, it will pull the content from the markdown column for me to edit
If not, it will show me the HTML content
13:27
I read that, I am asking because I don't get what exactly is your issue with how plugin works
See... why am I using the plugin in the first place? Because I want to write my posts in Markdown, right?
makes sense
The weird thing is, while the plugin was developed for people like me, it was written in a way that we have to manually check an option in each post that confirms to the plugin that I am writing in Markdown
he don't want to check the box everytime he post rather the plugin doing it automatically..
that really sounds silly to me
It's not just that I have to check the box everytime
Think about it. I have 50 posts written before I installed the plugin
Now all my posts show HTML in edit window. But the plugin requires me to check the markdown option when the post is showing markdown formatting
@Rarst See in what kind of a fix I am?
13:35
still not... are your 50 posts written in HTML or Markdown?
50 post (normal wordpress post) that are written before plugin installed..
so? as far as plugin is concerned they are not Markdown
@Sisir and @Rarst: No.
Let me explain this story
I was using "Markdown on save improved" prior to using this plugin
It has the option checked by default.
But it has other features that were bbuggy
so, I had to switch to "markdown on save"
and now this plugin doesn;t have the option checked by default
Am i clear?
Anyone block uploads dir with htaccess and only allow access if logged into wordpress?
another idea.. perhaps you can write a small javascript to check that box..
13:41
I already have 50 posts
unless the plugin considers that all posts are written in markdown, it won';t show the markdown version of the posts --
it will simply show the html version
I am having a hard time trying to explain it clearly... I am trying my best
i think those 50 post have to re-saved again. because both plugins have diffrent method to save the settings on database..
The difference is only that option. "Markdown on saved improved" is based on "Markdown on save" -- and the latter is what I am using now
yeah... I think you have assumption here that two plugins are compatible and expect them to be interchangeable. I don't think they are from quick look at code
being based on another plugin is not a promise that you can switch between them
I understand that, but in this case, I am sure they are compatible. They both write to the same table
yes.. the database structure may be different.. (even though the checkbox may looks same)
13:48
What markdown on save improved does is disable the visual editor and stuff like that
It's the same when it comes to the db
trust me
WP doesn't have an API for alternative representations of post content.
@geekpanth3r good that you are, but it doesn't work like you expect it to, right?
@toscho Yes. That is why the plugin saves the markdown version in a separate table, and retrieves it when editing a post
@Rarst I think you actually forgot my problem. :) Let me repeat...
See, unless this option is checked, the plugin doesn't know that my posts also have a markdown version.
If the option is checked, the plugin looks into the other database table column, and retrieves the markdown formatted post content for me. Since it;'s unchecked by default it pulls the HTML content from the other table
your problem seems to be "why does plugin A doesn't understand post saved in plugin B". as for me it has little to do with front-end checkbox and a lot to do with how plugins save and identify data internally
No, that's not my problem.
13:53
now i need a cup of coffee..
I want the plugin to just show me the content from the markdown column by default without depending on the checkbox
I think you will understand better if you take a look at the code
in that case write a jQuery code which checks the checkbox..
checkbox it representation of some internal data. nothing "depends" on checkbox when data is displayed. the only point where checkbox matters is when form is submitted and saved
@toscho curious what is post_content_filtered these plugins use then... it seems native, Codex is useless as usual
@Rarst Exactly!
@Rarst That's the database table column which has the markdown formatted post content
the usual content column has HTML formatted post content
@geekpanth3r back to above - you want plugin to recognize something saved in different plugin. nothing to do with checkbox, everything to do with how they save information
14:06
@Rarst It is a regular column in the post table. But there seems to be not official way how to use it.
they seem to save status in meta, but use different keys... I'd look into changing keys, but not up for experimenting with it
@Rarst : No. I want the plugin to simply retrieve content from post_content_filtered column of the database table, and not from the default column (which has HTML formatted post content)
@toscho probably ancient leftover... can't find meaningful usage in core
@geekpanth3r fantastic. if you don't see how my suggestion applies to accomplish exactly that - then I am done :)
suggestion? I probably missed it. Please come again. (I was on a call)
Let me try to explain one more time
in a different way this time
@Rarst The oldest ticket I can find is #1595. The column did already exist then.
14:09
@geekpanth3r which you said "No" to - look into markdown status in meta and convert from one plugin format to another
Maybe inherited from blog/2cafe?
@Rarst I want this code to retrieve content from post_content_filtered column in the posts database table by default, like this code does.
@Brady remember that lightbulb about true in checked() ? everything is cast to string internally, which is kinda weird...
@Rarst huh
@Rarst Sorry. I replied to the wrong one
14:11
i remember the lightbulb
@Rarst That reply was for this
@Rarst oh... different keys. I wonder why the dev did it like this.
@Brady since (string) true is 1 that might end up in weird stuff in edge cases...
ah ok
well what I was doing worked for me anyway
but good to know
thanks
yeah, doesn't matter most of the time, but it's weird why make such explicit cast and against actual default value...
@Rarst Was this reply to me?
14:14
Ah, read #19387.
@geekpanth3r nope
> post_content_filtered column exists to cache expensive content transformations
> I've used it during content migrations. Mark implemented it for Markdown: wordpress.org/extend/plugins/markdown-on-save.
@toscho hm... anyway I am not using poorly documented crap, since they screwed up GUIDs for me and long done client project turned into timebomb
Thanks for the try @Rarst. Thanks to you too @toscho . I will do everything all over again. A Good lesson in the end. :)
Moral of the story: Don't use crappy forks unless you really know it's not, well, crap. :D
14:17
@geekpanth3r indeed
@Rarst The only real problem I see: You cannot protect the column from other plugins. But that's a BIG problem. Think importers.
especially when original plugin done by core developer. as close to "knows his stuff" badge as it gets
@Rarst yeah
I don't understand why people that write plugins for a paid project make it available via the repository. They don't support it, they don't fix the bugs, after a few months. I am going to learn PHP. I hope I will not become one of them.
@geekpanth3r To make the code available for others. That's a good thing if you want to figure out how something works.
@geekpanth3r why not? unsupported code is better than nothing
14:22
@toscho I don't think that's the sole reason. If that's what is exactly in their mind, why would they abandon the plugin a few months after releasing it?
@Rarst Oh yeah, of course. But probably for those who know how to code, and can fix thinks. See how I've been f'd in the end.
@geekpanth3r Why not? I have written around 200 plugins. Support is impossible.
Okay... I am not trying to judge. It just what I think
so, plz dont get me wrong.
no problem :) it's just that maintenance/support/bugfixes is taken for granted way too often and developers are commonly irked by that
hmm... I will understand when I become one. :)
Anyway, have a great day guys. Loads of work to do -- gotta build the whole blog all over again.
Client: What would it take for you to add this feature to the site?

Me: Money.

Client: Um … what else?

Me: Cash.

Client: I’m not getting this for free, am I?
14:26
lol!
I think that's made up
@geekpanth3r Unfortunately: no. Had almost the same debates often enough.
oh... weird world.
Last week: I really appreciate your work, especially since you do it in your spare time. Me: Uhm, no, not exactly.
I lol'd
I doubled the price.
14:31
and then...?
Will see.
No response so far.
14:50
1
Q: Prevent Hacking of Wordpress Site

Kishore JangidMy Wordpress site is beign hacked by some hackers of Saudi Arabia. How can i prevent them from hacking. I have also found that many other Wordpress sites have also been hacked.

Somehow this is a crappy question. Thoughts?
@toscho too generic. security hardening is broad topic, no definitive answer possible
@Rarst Exactly. Close? Community?
@toscho I'd close as not constructive with comment why
@Rarst People will shout at me. :D
@toscho they had their chance to vote :)
14:55
Ah, you did it already. Now wait for complaints. :)
There are enough tuts on the web about security hardening WP
But IMO a community Wiki would be great. Everyone can chip in with their knowledge
@geekpanth3r which is usually useless since people don't get bullet №1 - "don't use cheap hosting"
Then you should write about it. How will they know if someone doesnt tell them?
Usually you get security by obscurity answers. We don't need that.
hmm...
Yeah, that's the worst of them all
Hiding wordpress version? really? That's the first thing I see everywhere
14:58
@geekpanth3r I am not nearly close to security expert
These are the only things I do.
(1) Latest version of WP and the plugins
(2) plugins by good authors
(3) dedicated server, and latest versions of software
(4) captcha at logins.
Good enough for me.
Hiding the fact that you are using WP is a lot of work. And it doesn't help anything.
But that's the kind of advise that's readily available on the web. When I first installed wordpress that's what I followed too.
Once you know how stuff work, you'll know what to do, and what you need to do.
@geekpanth3r Use the native [gallery] and look at the generated source code. ;)
Yeah, yeah. I asked that question on WP.SE :)
I think I contacted you on chat at that time? Don;t remember exactly
0
Q: How to manually fix the WordPress gallery code using PHP in functions.php?

geekpanth3rIt's been talked many times that Wordpress outputs some really bad code for the built-in gallery function. This is the core code responsible for the gallery output (in /wp-includes/media.php): function gallery_shortcode($attr) { global $post; static $instance = 0; $instance++; ...

see?
15:12
Anyone have look at some PHP code I have done? I want to propose to WP core that they update human_time_diff() with:
public static function human_time_diff( $from, $to = '' )
        {
            $chunks = array(
                array( 60 * 60 * 24 * 365 , '%s year', '%s years' ),
                array( 60 * 60 * 24 * 30 , '%s month', '%s months' ),
                array( 60 * 60 * 24 * 7, '%s week', '%s weeks' ),
                array( 60 * 60 * 24 , '%s day', '%s days' ),
                array( 60 * 60 , '%s hour', '%s hours' ),
                array( 60 , '%s minute', '%s minutes' ),
                array( 1 , '%s second', '%s seconds' ),
The previous function only allows for mins/hours/days
this function caters for all plus shows two strings rather that just one:

eg old: `1 day` new: `1 day 3 hours`
nvm found an existing ticket: core.trac.wordpress.org/ticket/9272
15:34
Hello, i got an error while trying to repair my database : wp_options: Table is marked as crashed
thats not a wordpress issue, it's a general MySQL issue
this probably isn't the most appropriate place to ask =(
Google however has the answer in the first 5 results: recursive-design.com/blog/2009/06/18/…
16:11
@Brady I guess our old ticket still not moved into core. So: Why the effort?
doesnt bother me
I've written the function of which will be used in my plugin until something better makes it into core
@kaiser what old ticket of mine are you refering to?
@Brady Ah, my misstake. That was size_format(), which btw: Works, has a patch ... and didn't move into core for no reason: core.trac.wordpress.org/ticket/19067
> scribu — 6 months ago
Keywords commit added
Milestone changed from Awaiting Review to Future Release
:P
so whats happening with that ticket?
the patch is good how to get them to commit?
16:26
@Brady dunno. had quite some patches at that status and nothing ever happened.
@Brady Run Unit tests, mark the ticket as tested.
@toscho how to unit test?
16:41
Unfortunately there is not much documentation.
.... not worth the effort
-1
Q: Shortcode nija plugin

ItachiDoes someone know how to add same functionality as shortcode ninja plugin from woothemes http://wordpress.org/extend/plugins/shortcode-ninja/ but wihout plugin and woothemes?

That's a gimme teh codez question, isn't it?
18:03
Hi, this has been confusing me for a long time now, and it's time I got it clarified.
Q1) So, post IDs increase by an order of magnitude from post to post because of post revisions alone or auto saves too? Will it stop when I disable revisions?
Q2) will editing, and saving a published post also increase post ID?
post id is field in database table. every time any kind of post is created it needs ID. editing doesn't change ID or it will mess up all the things
But one post has a post id of 24, while the next has 50 something on my blog
My understanding is that the number of revisions or autosaves happening when you edit a post determine the next post's ID
Tell me I am wrong.
@geekpanth3r A post ID is an identifier not a public counter.
Okay, but why does it increase at that rate?
I read that "The ID is an auto-incremented field in the posts table, which includes many things that are not published posts, e.g., drafts, pages, attachments."
But I haven't created any pages for a long time; I don't put an image in every post I make. And no drafts at all. But my post ID increases by a magnitude of 10s from post to post. Any logic that I could be missing here?
Each time you visit the post-new page an autodraft is created.
At least as long as there is a new nonce.
18:13
While I do hit the new post button by mistake, it doesn;'t happen all that frequently.
Does re-editing and saving a published post cause an increase in post ID?
@StephenHarris Got a js-array problem. Time left for some help?
@toscho I have a new test blog setup... I will test it out and see.
Afraid of got to shoot, dinner's on the table. I'll be back on later though - so if you still need help then ... :)
@StephenHarris Hopefully not :)
18:41
Hey guys.. how do i debug this problem.. I have this page (taxonomy.php) citystirlakeview.com/event-category/festivals with the post type "event" the menu doesn't show up. Can't replicate the problem on my local pc with same version of the theme..
19:19
@kaiser Hows the js problem coming along?
@Sisir What menu are you referring too?
found where is the problem but no idea how to fix it..
hold on sending a paste bin
this function sorting the event result according to start time which is in unix..
and its messing up with menu query i think..
because when i comment out the action.. currently the menu is showing in the site but events aren't sorting right
You need to check that its the main query
Your other conditionals are all checking the main query - so they'll return true for every query on that page. You need to use the is_main_query method to determine the query being passed is actually the main one.
19:39
okey.. let me give it a try
19:50
@StephenHarris: Thanks a bunch to pointing it out :) worked! Learned a good thing today.. :)
@StephenHarris <sub>still here</sub> :)
@StephenHarris I need to split up a query string and assign foo=bar parts as key/value pairs to an array.
function getUrlVars()
{
	var vars = [];
	var href = window.location.href;
	var hashIndex = href.indexOf( '#' );
	if ( hashIndex >= 0 )
	{
		href = href.slice( href.indexOf( '#' ) + 1 );
	};
	var hashes = href.slice( href.indexOf( '?' ) + 1 ).split( '&' );

	for ( var i = 0; i < hashes.length; ++i )
	{
		hash = hashes[i].split( '=' );
		vars.push( hash );
		vars[ hash[0] ] = hash[1];
		console.log( vars );
	};

	return vars;
};
↑ doesn't work as expected.
I'll give it a go. In what way doesn't it work?
@StephenHarris Output should be { 'foo': 'bar' }, but output is { 0: 'foo', 1: 'bar' }
@StephenHarris Somehow, the vars[ hash[0] ] = hash[1]; part doesn't work
btw: thx for trying to help
20:10
@kaiser Its because you've declared vars to be an array. You don't get associative arrays in javascript. Should work if vars is an object.
@StephenHarris ...mpf... thanks
should also prevent the need to .push
ok, yes. much better
This works for me: ` function getUrlVars(){
vars ={};
var href = "http://www.example.com?foo=bar&my=test";
var hashIndex = href.indexOf( '#' );
if ( hashIndex >= 0 )
{
href = href.slice( href.indexOf( '#' ) + 1 );
};
var hashes = href.slice( href.indexOf( '?' ) + 1 ).split( '&' );

for ( var i = 0; i < hashes.length; ++i )
{
hash = hashes[i].split( '=' );
vars[hash[0]] = hash[1];
console.log(vars);
};

return vars;
};`
@StephenHarris = me, idiot (dare to fav this)
2
@StephenHarris got that and works
20:14
dare accepted :)
How do you get the line indentation to work in chat?
Btw: You can't start multi line code blocks in chat. You'll have to make a line break, then start code block, press [Ctrl]+[A], then [Ctrl]+[K]
@StephenHarris guess I can read your mind :)
@kaiser It's a light read :)
always a light read for people who got a light sabor, young padavan
@kaiser have you used the P3 Plugin Profiler?
@StephenHarris Yeah. But only partly satisfied. Seems to calculate not only the execution time, but also file sum or something like that. Haven't looked into code so far.
But imho it's ok to give it to beginners, as they will understand that pulling from RESTful sources takes it's time
20:22
mmm... I've been digging into it. Did a few tests and kept getting a distinctive fast/slow result. Their help tab says that this is can be caused when: 'plugin loads its main code, then a follow-up piece of code, like a piece of generated JavaScript.' The Query load jumps between 10 and 38 too - was trying to work out what it was recording
I think it could be an AJAX request
I was right... deactivated the responsible plug-in and it flattened straight out. Its odd that it doesn't omit AJAX calls - typically when you want site load speed you don't care about the AJAX requests
21:12
@StephenHarris Can't you hook in and define AJAX to false to abort before anything get's executed?
@kaiser Well it will start recording load times as soon as WordPress starts loading - it should really check if AJAX is running first and if so,not bother recording it.
@Kaiser Do you know if WP has a function for checking HEX colour values?
@StephenHarris No, but I guess not
@StephenHarris range( 'A', 'E' ) AND range( 0, 9 ) ;)
21:48
@kaiser Nice, never heard of those before

« first day (548 days earlier)      last day (4695 days later) »