-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add Schema to AMP plugin #2879
Add Schema to AMP plugin #2879
Conversation
This has been tested and can be code reviewed. I've also made sure to validate the output structured data with Google's validator tool. |
@semperfiwebdesign/aioseop-core-committers Currently, this PR allows Do we want the filter to disable schema as well, or should I refactor it further to only effect meta description? |
My opinion is that we should have a separate new filter for disabling Schema on AMP pages. The existing filter should only disable meta descriptions on AMP pages. |
This is approved and can be merged. |
* Add support for Google Tag Manager #2983 * 3.3 (#17) * Add PHPCompatibility sniffs to PHPCS & fix issues (#2907) * Add PHPCompatibility sniffs to PHPCS #2851 * Ignore Composer & VScode for Git #2851 * Fix PHP compatibility issues (1) #2851 * Don't check PHP compatibility of unit tests #2851 * Fix PHP compatibility issues (2) #2851 * Move parse_ini_string() to compatibility/php-functions.php #2851 * Fix typo #2851 * Fix typo (2) #2851 * Add Grunt task set for Travis CI builds #2851 * Add Travis CI support for PHPCompatibility #2851 * Print installed sniffs after "composer install" in Travis CI #2851 * Delete composer.lock #2851 * Move parse_ini_string() from aioseop_functions.php to compatibility/php-functions.php #2851 * Remove compat-gutenberg.php * Readd compat-gutenberg.php * Fix Grunt #2851 * Fix path to compat files #2851 * Add package-lock.json to .gitignore #2851 * Add composer.lock to .gitignore #2851 * Fix phpDoc in compatibility/php-funcitons.php #2851 * Change schema person's name & logo to add the option of manually ente… (#2920) * Change schema person's name & logo to add the option of manually entered name & image * Grunt * Add Schema to AMP plugin (#2879) * Fix loose comparator in AMP Head causing a return with empty description * Move AMP hooks to separate function for AMP hooks * Add remove hook for AMP Schema * Add AIOSEOP's Schema to AMP * Dev-change aioseop_amp_description filter to only affect meta descriptions * Add filter aioseop_amp_schema to enable/disable schema on AMP posts * Dev-Fix disable schema filter and no meta desc. * Invert if statement and add third decimal to phpDoc since tags #506 * Add third decimal to phpDoc since tag (2) #506 * Fix Grunt issue * Fix Grunt issue (2) * Change bin path for phpcs (#2966) * Change bin path for phpcs #2965 * Delete phpcs and phpcompatibility script entries #2965 * Add new line to init-grunt.sh #2965 * Refactor operations in All_in_One_SEO_Pack_Opengraph::add_meta() (#2941) * Change variable variables to direct variables * Change early initialize thumbnail variable to use image variable * Change operations from call filter to call method * Add filter documentation * Change to group operations together * Add dev notes * Grunt * Dev-Fix filter params * Dev-Add dev note * Dev-Fix error on SSL enabled site * Dev-Change duplicate code to function * Only output meta descriptions if autogenerate descriptions is enabled (#2947) * Fix issue 2439 * Dev-Change to strict comparator * Dev-Fix empty value check * Dev-Change applied changes The excerpt was being added elsewhere as a final fallback * Revert previous changes #2439 * Refactor code #2439 * Remove unneeded check #2439 * Fix Grunt issue * Fix SEO for search results page (#2964) * Added/updated help text for new Schema fields (#2959) * #2958 Added/updated help text for new Schema fields * Add missing i18n domains #2958 * Resolves #2411 (#2955) * 3.2.10 to 3.3 (#2986) * Update help text for Sitemap Indexes setting (#2961) * Only show Welcome Screen on major version updates (#2922) * add get_major_version function #2662 * only show welcome screen on major version updates #2662 * remove function * move function to aioseop_functions.php * Remove class keywords #2662 * Grunt & WPCS * Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921) * Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914 * Grunt fixes #2914 * Revert removed package tag #2914 * Target WP 5.0 <= X < 5.3 #2914 * Move echo statement inside version check #2914 * Do proper version checks #2914 * Fix phpDoc #2914 * Add filter hook to disable schema.org markup (#2915) * Add filter hook to disable schema.org markup * fix return value for schema filter * Grunt fix #2913 * reversing schema filter logic and using a boolean instead of string * Update help text for Sitemap Indexes setting #2954 * Remove version check for Gutenberg/Chrome compatibility fix and check if user agent is set (#2928) * Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914 * Grunt fixes #2914 * Revert removed package tag #2914 * Target WP 5.0 <= X < 5.3 #2914 * Move echo statement inside version check #2914 * Do proper version checks #2914 * Fix phpDoc #2914 * Only show Welcome Screen on major version updates (#2922) * add get_major_version function #2662 * only show welcome screen on major version updates #2662 * remove function * move function to aioseop_functions.php * Remove class keywords #2662 * Grunt & WPCS * Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921) * Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914 * Grunt fixes #2914 * Revert removed package tag #2914 * Target WP 5.0 <= X < 5.3 #2914 * Move echo statement inside version check #2914 * Do proper version checks #2914 * Fix phpDoc #2914 * Add filter hook to disable schema.org markup (#2915) * Add filter hook to disable schema.org markup * fix return value for schema filter * Grunt fix #2913 * reversing schema filter logic and using a boolean instead of string * Remove WP v5.3 version check and move function out of action hook #2914 * Invert version_compare and prefix functions #2914 * Fix phpDocs #2914 * Rename compat-gutenberg.php to gutenberg-chrome.php #2914 * Fix undefined index HTTP_USER_AGENT #2952 * version bump to 3.2.10 * Update readme.txt * Delete duplicate file * Fix file paths * Fix Grunt issues #2990 * Fix Grunt issues #2983 * Fix undefined class error #2983
* Refactor & move get_robots_meta() #2684 * Grunt fixes #2684 * PHPCS fixes #2684 * Fix minor bugs #2684 * tmp * Remove tmp unit tests #2684 * Fix Grunt issues #2684 * Fix Scrutinizer issues #2684 * Fix phpDoc * Add remote XDebug listener script for VScode #2684 * Skip test_title_format_macros #2684 * Fix fatal error and Grunt #2684 * Remove check for AIOSEOP Pro #2684 * PR comments #2684 * 3.3 (#17) * Add PHPCompatibility sniffs to PHPCS & fix issues (#2907) * Add PHPCompatibility sniffs to PHPCS #2851 * Ignore Composer & VScode for Git #2851 * Fix PHP compatibility issues (1) #2851 * Don't check PHP compatibility of unit tests #2851 * Fix PHP compatibility issues (2) #2851 * Move parse_ini_string() to compatibility/php-functions.php #2851 * Fix typo #2851 * Fix typo (2) #2851 * Add Grunt task set for Travis CI builds #2851 * Add Travis CI support for PHPCompatibility #2851 * Print installed sniffs after "composer install" in Travis CI #2851 * Delete composer.lock #2851 * Move parse_ini_string() from aioseop_functions.php to compatibility/php-functions.php #2851 * Remove compat-gutenberg.php * Readd compat-gutenberg.php * Fix Grunt #2851 * Fix path to compat files #2851 * Add package-lock.json to .gitignore #2851 * Add composer.lock to .gitignore #2851 * Fix phpDoc in compatibility/php-funcitons.php #2851 * Change schema person's name & logo to add the option of manually ente… (#2920) * Change schema person's name & logo to add the option of manually entered name & image * Grunt * Add Schema to AMP plugin (#2879) * Fix loose comparator in AMP Head causing a return with empty description * Move AMP hooks to separate function for AMP hooks * Add remove hook for AMP Schema * Add AIOSEOP's Schema to AMP * Dev-change aioseop_amp_description filter to only affect meta descriptions * Add filter aioseop_amp_schema to enable/disable schema on AMP posts * Dev-Fix disable schema filter and no meta desc. * Invert if statement and add third decimal to phpDoc since tags #506 * Add third decimal to phpDoc since tag (2) #506 * Fix Grunt issue * Fix Grunt issue (2) * Change bin path for phpcs (#2966) * Change bin path for phpcs #2965 * Delete phpcs and phpcompatibility script entries #2965 * Add new line to init-grunt.sh #2965 * Refactor operations in All_in_One_SEO_Pack_Opengraph::add_meta() (#2941) * Change variable variables to direct variables * Change early initialize thumbnail variable to use image variable * Change operations from call filter to call method * Add filter documentation * Change to group operations together * Add dev notes * Grunt * Dev-Fix filter params * Dev-Add dev note * Dev-Fix error on SSL enabled site * Dev-Change duplicate code to function * Only output meta descriptions if autogenerate descriptions is enabled (#2947) * Fix issue 2439 * Dev-Change to strict comparator * Dev-Fix empty value check * Dev-Change applied changes The excerpt was being added elsewhere as a final fallback * Revert previous changes #2439 * Refactor code #2439 * Remove unneeded check #2439 * Fix Grunt issue * Fix SEO for search results page (#2964) * Added/updated help text for new Schema fields (#2959) * #2958 Added/updated help text for new Schema fields * Add missing i18n domains #2958 * Resolves #2411 (#2955) * 3.2.10 to 3.3 (#2986) * Update help text for Sitemap Indexes setting (#2961) * Only show Welcome Screen on major version updates (#2922) * add get_major_version function #2662 * only show welcome screen on major version updates #2662 * remove function * move function to aioseop_functions.php * Remove class keywords #2662 * Grunt & WPCS * Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921) * Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914 * Grunt fixes #2914 * Revert removed package tag #2914 * Target WP 5.0 <= X < 5.3 #2914 * Move echo statement inside version check #2914 * Do proper version checks #2914 * Fix phpDoc #2914 * Add filter hook to disable schema.org markup (#2915) * Add filter hook to disable schema.org markup * fix return value for schema filter * Grunt fix #2913 * reversing schema filter logic and using a boolean instead of string * Update help text for Sitemap Indexes setting #2954 * Remove version check for Gutenberg/Chrome compatibility fix and check if user agent is set (#2928) * Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914 * Grunt fixes #2914 * Revert removed package tag #2914 * Target WP 5.0 <= X < 5.3 #2914 * Move echo statement inside version check #2914 * Do proper version checks #2914 * Fix phpDoc #2914 * Only show Welcome Screen on major version updates (#2922) * add get_major_version function #2662 * only show welcome screen on major version updates #2662 * remove function * move function to aioseop_functions.php * Remove class keywords #2662 * Grunt & WPCS * Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921) * Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914 * Grunt fixes #2914 * Revert removed package tag #2914 * Target WP 5.0 <= X < 5.3 #2914 * Move echo statement inside version check #2914 * Do proper version checks #2914 * Fix phpDoc #2914 * Add filter hook to disable schema.org markup (#2915) * Add filter hook to disable schema.org markup * fix return value for schema filter * Grunt fix #2913 * reversing schema filter logic and using a boolean instead of string * Remove WP v5.3 version check and move function out of action hook #2914 * Invert version_compare and prefix functions #2914 * Fix phpDocs #2914 * Rename compat-gutenberg.php to gutenberg-chrome.php #2914 * Fix undefined index HTTP_USER_AGENT #2952 * version bump to 3.2.10 * Update readme.txt * Delete duplicate file * Fix file paths * Fix Grunt issues #2990 * Skip failing unit test #2684 * Remove launch.json * PR comments #2684 * Change identation * Grunt fixes
* Refactor aioseop-count-chars.js #2755 * Clear preview snippet description when "Autogenerated Descriptions" is disabled #2975 * Fix #2927, #2747, #2337 * Set character treshold to 55 for OG:title and OG:description #2413 * Change let to var + minify * Use minified JavaScript files instead * Fix variable naming * Fix Grunt issues * Revert minified js * 3.3 (#17) * Add PHPCompatibility sniffs to PHPCS & fix issues (#2907) * Add PHPCompatibility sniffs to PHPCS #2851 * Ignore Composer & VScode for Git #2851 * Fix PHP compatibility issues (1) #2851 * Don't check PHP compatibility of unit tests #2851 * Fix PHP compatibility issues (2) #2851 * Move parse_ini_string() to compatibility/php-functions.php #2851 * Fix typo #2851 * Fix typo (2) #2851 * Add Grunt task set for Travis CI builds #2851 * Add Travis CI support for PHPCompatibility #2851 * Print installed sniffs after "composer install" in Travis CI #2851 * Delete composer.lock #2851 * Move parse_ini_string() from aioseop_functions.php to compatibility/php-functions.php #2851 * Remove compat-gutenberg.php * Readd compat-gutenberg.php * Fix Grunt #2851 * Fix path to compat files #2851 * Add package-lock.json to .gitignore #2851 * Add composer.lock to .gitignore #2851 * Fix phpDoc in compatibility/php-funcitons.php #2851 * Change schema person's name & logo to add the option of manually ente… (#2920) * Change schema person's name & logo to add the option of manually entered name & image * Grunt * Add Schema to AMP plugin (#2879) * Fix loose comparator in AMP Head causing a return with empty description * Move AMP hooks to separate function for AMP hooks * Add remove hook for AMP Schema * Add AIOSEOP's Schema to AMP * Dev-change aioseop_amp_description filter to only affect meta descriptions * Add filter aioseop_amp_schema to enable/disable schema on AMP posts * Dev-Fix disable schema filter and no meta desc. * Invert if statement and add third decimal to phpDoc since tags #506 * Add third decimal to phpDoc since tag (2) #506 * Fix Grunt issue * Fix Grunt issue (2) * Change bin path for phpcs (#2966) * Change bin path for phpcs #2965 * Delete phpcs and phpcompatibility script entries #2965 * Add new line to init-grunt.sh #2965 * Refactor operations in All_in_One_SEO_Pack_Opengraph::add_meta() (#2941) * Change variable variables to direct variables * Change early initialize thumbnail variable to use image variable * Change operations from call filter to call method * Add filter documentation * Change to group operations together * Add dev notes * Grunt * Dev-Fix filter params * Dev-Add dev note * Dev-Fix error on SSL enabled site * Dev-Change duplicate code to function * Only output meta descriptions if autogenerate descriptions is enabled (#2947) * Fix issue 2439 * Dev-Change to strict comparator * Dev-Fix empty value check * Dev-Change applied changes The excerpt was being added elsewhere as a final fallback * Revert previous changes #2439 * Refactor code #2439 * Remove unneeded check #2439 * Fix Grunt issue * Fix SEO for search results page (#2964) * Added/updated help text for new Schema fields (#2959) * #2958 Added/updated help text for new Schema fields * Add missing i18n domains #2958 * Resolves #2411 (#2955) * 3.2.10 to 3.3 (#2986) * Update help text for Sitemap Indexes setting (#2961) * Only show Welcome Screen on major version updates (#2922) * add get_major_version function #2662 * only show welcome screen on major version updates #2662 * remove function * move function to aioseop_functions.php * Remove class keywords #2662 * Grunt & WPCS * Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921) * Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914 * Grunt fixes #2914 * Revert removed package tag #2914 * Target WP 5.0 <= X < 5.3 #2914 * Move echo statement inside version check #2914 * Do proper version checks #2914 * Fix phpDoc #2914 * Add filter hook to disable schema.org markup (#2915) * Add filter hook to disable schema.org markup * fix return value for schema filter * Grunt fix #2913 * reversing schema filter logic and using a boolean instead of string * Update help text for Sitemap Indexes setting #2954 * Remove version check for Gutenberg/Chrome compatibility fix and check if user agent is set (#2928) * Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914 * Grunt fixes #2914 * Revert removed package tag #2914 * Target WP 5.0 <= X < 5.3 #2914 * Move echo statement inside version check #2914 * Do proper version checks #2914 * Fix phpDoc #2914 * Only show Welcome Screen on major version updates (#2922) * add get_major_version function #2662 * only show welcome screen on major version updates #2662 * remove function * move function to aioseop_functions.php * Remove class keywords #2662 * Grunt & WPCS * Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921) * Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914 * Grunt fixes #2914 * Revert removed package tag #2914 * Target WP 5.0 <= X < 5.3 #2914 * Move echo statement inside version check #2914 * Do proper version checks #2914 * Fix phpDoc #2914 * Add filter hook to disable schema.org markup (#2915) * Add filter hook to disable schema.org markup * fix return value for schema filter * Grunt fix #2913 * reversing schema filter logic and using a boolean instead of string * Remove WP v5.3 version check and move function out of action hook #2914 * Invert version_compare and prefix functions #2914 * Fix phpDocs #2914 * Rename compat-gutenberg.php to gutenberg-chrome.php #2914 * Fix undefined index HTTP_USER_AGENT #2952 * version bump to 3.2.10 * Update readme.txt * Delete duplicate file * Fix file paths * Fix Grunt issues #2990 * Add characterCounter to ignored JS variables * Fix bugs * Update character counter when editor changes #2977 * Fix bug where counter background colour doesn't change * PR comments * Support non-default plugin path * Remove unused code * Remove unneeded variable declaration * Include post-new.php as edit page * Use legacy code for taxonomies * Fix Grunt issues * Revert minified scripts * Variable alignment * Use let (ES6) and align variables
Issue #506 & #2875
Proposed changes
This add AIOSEOP's Schema data to the AMP plugin, and disables AMP's Schema.
This also fixes a loose comparator causing an unexpected return; which is intended for aioseop_amp_description filter. #2875
Both issues have been included since #2875 is more of a refactor, and #506 is dependant on #2875 changes.
Types of changes
Checklist
Testing instructions
<script type="application/ld+json">
.There should be AIOSEOP's Schema, and AMP's Schema should not exist on the post/page.
Disable AIOSEOP's Schema on AMP Hook Test
functions.php
.add_filter( 'aioseop_amp_schema', '__return_false' );
Test aioseop_amp_description Hook only affects meta descriptions
functions.php
.add_filter( 'aioseop_amp_description', '__return_false' );
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...