Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#16751 closed enhancement (fixed)

phpdoc breaks plugins in WP 3.1

Reported by: miqrogroove Owned by:
Priority: normal Milestone: 3.1.1
Component: Plugins Version: 3.1
Severity: normal Keywords: has-patch
Cc:

Description (last modified by dd32)

As of #15193, some plugin header styles such as those used here fail to parse correctly (Specifically, @author: Blah)

Ideally, we should support PHP-Doc style comment structures for plugin headers as well as the "standard" style.

Attachments (1)

unhose-plugin-phpdoc.patch (565 bytes) - added by miqrogroove 2 years ago.
Allow phpdoc in php files

Download all attachments as: .zip

Change History (26)

I believe miqrogroove is referring to docblock style @ headers, e.g. http://plugins.trac.wordpress.org/browser/simple-shortlinks/trunk/shortlinks.php#L12

See #15193.

docblock style should work.

Version 0, edited 2 years ago by scribu (next)
  • Keywords reporter-feedback added

Please give a specific example of a plugin that isn't recognized anymore.

Allow phpdoc in php files

If it were up to me I'd revert [16215]

I've attached a patch that will allow phpdoc "docblock style @ headers" as duck_ put it.

And of course you guys could just make me revise all my plugins.

  • Keywords reporter-feedback removed

Patch tested in version 3.1. It works if you want it.

I downloaded the shortlinks.php file duck_ linked to and it works.

Again, give a specific example.

  • Keywords close added
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Ah, you mean you expect @author to be recognized as a plugin header too.

Sorry, but that was never intended functionality. The header name is 'Author'.

okie dokie. Back to version 2.9.

  • Keywords 2nd-opinion has-patch added; close removed
  • Milestone set to Awaiting Review
  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Type changed from defect (bug) to enhancement

Not that your switch back to WP 2.9 caused me to change my mind, but I guess we can consider this, as an enhancement.

  • Summary changed from Plugins Don't Work in WP 3.1 to Allow phpdoc style headers in plugins and themes

(note the difference between an inflammatory title and an accurate one)

As long as my plugins don't work in WP 3.1, I'll be as inflammatory as I like. It's a fact that I'm caught between ignoring support complaints or finding time I don't have to maintain this code. My first inclination is to submit the one-line patch and avoid the hassle.

  • Summary changed from Allow phpdoc style headers in plugins and themes to phpdoc breaks plugins in WP 3.1
  • Keywords 2nd-opinion removed
  • Milestone changed from Awaiting Review to 3.1.1

comment:15 follow-up: ↓ 16   scribu2 years ago

What exactly do you mean by "don't work"?

Do you use a @plugin name header? Because that's the only case that would cause serious problems that I can think of.

Last edited 2 years ago by scribu (previous) (diff)

comment:16 in reply to: ↑ 15   miqrogroove2 years ago

"Don't work" means I have a confirmed defect in the plugins screen of the dashboard.

No I do not use a @plugin name header.

comment:17 follow-up: ↓ 19   dd322 years ago

  • Description modified (diff)

"Don't work" means I have a confirmed defect in the plugins screen of the dashboard.

In the future, mentioning the actual problem in the description is best practice, and attacking developers for changing something is not ideal either. Had you have tested 3.1, or any of your plugin users had tested 3.1, it would've been identified at the time and fixed.

As it is, The problem is that @ is unexpected input, and does not fit with the WordPres "standard" plugin header, whilst the plugin still "Works" it's just the author details are not read correctly, That being said, That style of headers is something worth while supporting, as it is, a very small percentage of plugins use it, which explains why it was missed in the testing.

Thanks for reporting and providing the patch. A very helpful, non-invasive enhancement. Good luck with your userbase!

Patch looks good to me.

comment:19 in reply to: ↑ 17 ; follow-up: ↓ 20   miqrogroove2 years ago

Replying to dd32:

In the future, mentioning the actual problem in the description is best practice

No, I actually did that, whereas your edited version of the ticket makes it look like I'm whining about my name not showing up on my plugins, which is not the reason I reported my plugins don't work in 3.1. As usual, nobody at WordPress is even willing to acknowledge a mistake that needs to be patched and you guys are more concerned with telling me that I filed the ticket wrong.

comment:20 in reply to: ↑ 19 ; follow-up: ↓ 25   nacin2 years ago

Replying to miqrogroove:

Replying to dd32:

In the future, mentioning the actual problem in the description is best practice

No, I actually did that, whereas your edited version of the ticket makes it look like I'm whining about my name not showing up on my plugins, which is not the reason I reported my plugins don't work in 3.1. As usual, nobody at WordPress is even willing to acknowledge a mistake that needs to be patched and you guys are more concerned with telling me that I filed the ticket wrong.

Chill. You're beginning to sound like hakre. Bemoan all you want, but before you said that, I already moved the ticket to 3.1.1.

Side note, is @author: (with the colon) valid phpdoc syntax?

phpxref parses the extra colon like "Version: : 1.0.14". It's not ideal but it's readable.

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [17516]) Make plugin header parsing slightly more liberal (like it was in 3.0), to allow for PHPdoc style headers. props miqrogroove. fixes #16751 for trunk

(In [17517]) Make plugin header parsing slightly more liberal (like it was in 3.0), to allow for PHPdoc style headers. props miqrogroove. fixes #16751 for 3.1

Hurrah!

Thanks Mark :)

comment:25 in reply to: ↑ 20   hakre2 years ago

Replying to nacin:

Replying to miqrogroove:

Replying to dd32:

In the future, mentioning the actual problem in the description is best practice

No, I actually did that, whereas your edited version of the ticket makes it look like I'm whining about my name not showing up on my plugins, which is not the reason I reported my plugins don't work in 3.1. As usual, nobody at WordPress is even willing to acknowledge a mistake that needs to be patched and you guys are more concerned with telling me that I filed the ticket wrong.

Chill. You're beginning to sound like hakre. Bemoan all you want, but before you said that, I already moved the ticket to 3.1.1.

*ouch* (#16464, #16717)

Note: See TracTickets for help on using tickets.