HongPong / broken-link-checker

This plugin will check your posts, comments and other content for broken links and missing images, and notify you if any are found. (non-commercial community fork of broken-link-checker)
10 stars 4 forks source link

Better scraping: switch to HTTPlug + Guzzle #24

Open HongPong opened 5 years ago

HongPong commented 5 years ago

It is not easy necessarily to include libraries from Composer, they may have to be manually namespaced.

See also #21 as this plugin will need a composer.json file as well to operate this correctly (and thus will need to know its namespace if it has the original or a new fork one)

Recommended by @mlang38 here:

We have switched to HTTP/2 with Let's Encrypt recently.

I guess the problem comes from the Snoopy library which doesn't seem to be really maintained anymore. I suggest switching to HTTPlug with something like Guzzle to implement it.

Don't know if it will solve HTTP/2 and encryption issues, but I think it will be more reliable for the future.

HongPong commented 5 years ago
mlang38 commented 4 years ago

If you want to manage your dependencies with Composer, like HTTPlug/Guzzle or else, you can use a scoper/prefixer like PHP-Scoper to automate the prefixing build task, as suggested here. It seems to be used by well-know popular plugins like Yoast etc...

HongPong commented 4 years ago

I hadn't heard of PHP-scoper thank you @mlang38 . Been using Composer in Drupal world a while however I don't have a clear sense of whether its a good solution for WP plugins (i suppose the plugin would be distributed with the build artifact version of it)

mundschenk-at commented 4 years ago

PHP-Scoper works well once you learn to steer clear of some of its limitations. For an example configuration, see what I've done in wp-Typography (especially the .scoper.inc.php and the Grunt-based build process).

HongPong commented 4 years ago

Sweet thanks - looks like someone pulled your PHP library into drupal world also https://www.drupal.org/project/twig_typography ... gotta check em both out.