-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin Doctor - List Functions by WP Version in Reverse Order #31
Comments
Hi Daniel, et voilá: https://wpseek.com/pluginfilecheck/ Still putting finishing touches on it, but should be good to go already. |
@AlphawolfWMP - WOW.. Absolutley WOW. When I suggested this I expected a few weeks / months before it would come about (knew you guys rocked and would do it) but never so soon. Looks perfect, though I would add one request: Make it switchable or show both lists. IE the original by file list was useful in its own ways, and this new organization makes it easier to reduce required version in mass quickly. Not a requirement at all, as this new method is 2x as useful I think, but the other does have merit still |
@AlphawolfWMP Question, and I will start another issue if you think its doable. Could PHP version compatibility be factored in? IE checking for PHP 5.2/5.3/5.4/5.5/7 compatibility |
@danieliser I've been thinking about making the lists switchable but came to the conclusion that I wouldn't want to clutter the UI. TBH the UI would be needing an update since it's quite old anyways, and I'm probably bringing the old list (as an alternative) back after redesigning the whole thing some day. As for now, I think your idea works way better and is more useful for devs that the tool is made for. If I'm getting feedback that users are missing the old list, I might overthink my decision. 😃 Regarding PHP compatibility checking... technically it'd be possible, but while I would be able to curate a list of PHP function names (used as source data), what's missing is a source giving me info on when PHP functions were introduced. If you have a source or idea, I'm open for anything. |
@AlphawolfWMP Can you link me the source of your WP functions similar to what you want for PHP? If I know what you need exactly or what your using now for WP I may be able to track it down for you. I think this would be a crucial addition to this tool as those are the two primary version dependencies any theme or plugin needs to know. |
@danieliser Well, basically all I need is an array/CSV/JSON object of PHP functions with @SInCE info for each PHP function like
which holds the functions and the required PHP version it's been introduced. |
@AlphawolfWMP Took a lot of digging, and not sure how much work to convert it to what you need, but seems PHP docs are way behind current technologies ;) Here are the resources I found that may lead the way:
Another possible option would be to use http://php.net/manual/en/function.get-defined-functions.php or similar to build a list of all php functions, then scrape the needed php info. If you decide to try scraping I would suggest doing it from the downloadable versions here: http://php.net/download-docs.php. Namely the single html file or multi html file versions. Be sure to check out the *nix versions of the docs available too on the right sidebar of the download-docs.php page. All of that said, I did not try to get the phd setup working to see how the xml & json exports look. But I would be happy to help build a reference set like this. If we have to scrape it not a problem using the downloadable versions, you can scan for each function using classes pretty easy. IE
As I said no solid immediately ready solution, but I think between the downloadable version & the PHB svn custom format output options we can find a solid solution. Heck I think this would be a valuable tool in general since nobody has done it & made it publicly available yet. |
Oh and there is also the svn where the actual docs are kept, but Its so messy I can't imagine scraping it: http://svn.php.net/viewvc/phpdoc/en/trunk/reference/array/functions/ for instance has all the array based functions. Way simpler to scrape the html itself if thats the way to go. |
Thanks a lot, Daniel! I'm sure I can get something to work from your info. 😃 |
@AlphawolfWMP Awesome, a little more digging showed that most IDEs use the PHD custom exports for their auto complete, so that is likely your best bet at a clean source with minimal hassle. |
On that note, would you want to team up on an official WP plugin-check toolset? Would like to automate some of the plugin review teams efforts using a simple plugin and more advanced build tools. |
@danieliser There already seem to be some kind of "plugin check" plugin https://wordpress.org/plugins/plugincheck/ but feel free to kickstart a WP plugin-check toolset. I'm happy to help whereever I can but I'm pretty much involved in other projects this year so I probably wouldn't be a reliable contributor. Sorry. |
@AlphawolfWMP - Yea the plugin review team said it doesn't cover 5% of whats actually needed. Also the Theme Review Team pointed me to their current workings on automation here: https://github.com/WPTRT/WordPress-Coding-Standards I plan on forking it and starting a rebuild based on plugins as that one is very theme centric. There used to be a plugin-check plugin available but it also wasn't nearly capable enough. https://plugins.svn.wordpress.org/plugin-check/trunk/ I think if you ever get this tool & the php tool packaged into a build tool, I would love to include it in my build routines as I am sure others would. |
@danieliser — You might want to have a look at the WordPress Coding Standards ruleset for PHPCS. There is an open ticket to add checks for deprecated functions, including links to some related tools. |
Okay, so far I managed to compile an array of PHP functions and their version string from the PhD package: https://wpseek.com/test.php Next up: Parsing the version strings. |
@AlphawolfWMP You are awesome. And insanely fast. Or at least have way more time to commit to projects than I do. Though I just made changes to my business that will give me 10x more time to create awesome stuff. Parsing the version strings should be pretty simple for you I'm sure 💯 |
Sorry wrong button. |
Mind telling me / others what setup and arguments you used with PhD? |
@JDGrimes Thanks for the tip, have bookmarked it to reasearch :). |
@danieliser Currently I'm compiling the doc files by running this command:
This results in a list of function names in a single .txt file plus one json file for each PHP function. As for parsing the version strings I'm not exactly sure which info I even want to parse and use in the Plugin Doctor. Strings like |
@AlphawolfWMP I belive the PHP 5 < 5.3.0 represents a function that was deprecated in 5.3.0. So maybe parse them all into something like this array(
Then you can scan for min & max php versions supported. |
The ones that I am not sure about are the PECL functions. Assume that is a php extension, not sure if its relevant to your / our needs. |
@danieliser But what'd be the 'since' part for a statement like Regarding PECL I agree to omit them - at least in the current iteration of the Plugin Doctor. |
@AlphawolfWMP In this case I believe its fair to say PHP 5. Since this is WP specific you could even set it to 5.2 which is the minimum required for WP itself. |
@AlphawolfWMP Found this just now, thought it might be a shortcut to adding this quickly: http://phpduck.com/minimum-php-version-script/ |
@danieliser Thanks! Unfortunately can't really tell when I'll find the time to have a look at it (life and work really keeps me busy atm) but I'll try to continue working on this ASAP. |
Currently finding the functions that make your plugin require a certain version are hidden and organized by file. In a large plugin that makes it extremely difficult to sort & find what your after.
Can you also add the ability to see by version what / how its used?
IE
4.5.3
4.4.0
In this way a plugin dev can easily go through and find ways to lower the required version much more quickly. Same info just organized a bit differently.
The text was updated successfully, but these errors were encountered: