pfefferle / wordpress-semantic-linkbacks

More meaningfull linkbacks
https://wordpress.org/plugins/semantic-linkbacks
MIT License
31 stars 18 forks source link

Only load PHP-MF2 when needed instead of globally #211

Closed dshanske closed 5 years ago

dshanske commented 6 years ago

To address the issue with multiple versions of php-mf2 being bundled with multiple libraries, suggesting we retune all plugins that use it to load it conditionally inside the function that needs it.

if ( ! class_exists( 'Mf2\Parser', false ) ) { require_once dirname( FILE ) . '/vendor/mf2/mf2/Mf2/Parser.php'; }

https://github.com/pfefferle/wordpress-semantic-linkbacks/blob/master/includes/class-linkbacks-mf2-handler.php#L135

Namely inside this function. Which would limit the scope of the include.

WordPress has a few libraries that they do this to.

dshanske commented 5 years ago

@pfefferle What do you think?