-
Notifications
You must be signed in to change notification settings - Fork 32
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
Integrations: Extract into separate classes #345
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GaryJones
force-pushed
the
experimental/refactor-integrations
branch
5 times, most recently
from
September 18, 2021 16:19
5f5a944
to
c830af5
Compare
pauarge
suggested changes
Sep 20, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, it really improves the plugin structure! I left a minor question
- Move AMP and Facebook Instant Article integrations into separate files. - Improve and add tests that better check for the intended behaviour.
GaryJones
force-pushed
the
experimental/refactor-integrations
branch
from
September 20, 2021 16:24
ebc4900
to
6d38b71
Compare
pauarge
reviewed
Sep 21, 2021
- Move AMP and Facebook Instant Article integrations into separate files. - Improve and add tests that better check for the intended behaviour.
…ly/wp-parsely into experimental/refactor-integrations
pauarge
approved these changes
Sep 21, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Parsely
class.It's the same behaviour for the end-user and site.
See #96.
Motivation and Context
The Parsely class does far too much, and needs to be split out into more logical classes to make it easier to maintain.
One area where this can be done is the extra code that makes the plugin work with other plugins i.e. integrations.
By creating a class for each integration, we logically group related code together, making it easier to see what integrations there are. The use of a collection and an interface (though this interface isn't yet checked for when registering an integration to the collection) provides a structure for built-in and other plugins to create their own integrations between Parse.ly and another plugin.
How Has This Been Tested?
AMP
amp_*
filters won't run, so there are no negative side effects./amp
to the end of the URL.<amp-analytics
opening tag that contains references to Parse.ly.Facebook Instant Articles
instant_articles_*
filter won't run, so there are no negative side effects./wp-admin/admin.php?page=instant-articles-wizard
admin page. If only one field is visible, enter any random string and save to then see many more settings./feed/instant-articles
and you should see XML. Look for the Parsely embed code fromParsely\Integrations\Facebook_Instant_Articles::get_embed_code()
.Screenshots (if appropriate):
Coverage metrics for the new Integrations directory:
Integrations directory coverage compared to the rest of the plugin:
Integrations-related tests:
Types of changes