Skip to content
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

Create infrastructure for detecting & installing WP Consent API. #8305

Merged
merged 6 commits into from
Feb 22, 2024

Conversation

techanvil
Copy link
Collaborator

@techanvil techanvil commented Feb 22, 2024

Summary

Addresses issue:

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 5.6.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

Copy link

github-actions bot commented Feb 22, 2024

Build files for 8277b0f have been deleted.

Copy link

github-actions bot commented Feb 22, 2024

Size Change: +81 B (0%)

Total Size: 1.49 MB

Filename Size Change
./dist/assets/js/googlesitekit-activation-********************.js 23.7 kB +1 B (0%)
./dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 52.9 kB -1 B (0%)
./dist/assets/js/googlesitekit-components-gm2-********************.js 5.77 kB +2 B (0%)
./dist/assets/js/googlesitekit-data-********************.js 2.18 kB +1 B (0%)
./dist/assets/js/googlesitekit-datastore-site-********************.js 18.4 kB +76 B (0%)
./dist/assets/js/googlesitekit-entity-dashboard-********************.js 89.5 kB -1 B (0%)
./dist/assets/js/googlesitekit-main-dashboard-********************.js 109 kB +1 B (0%)
./dist/assets/js/googlesitekit-modules-adsense-********************.js 110 kB +1 B (0%)
./dist/assets/js/googlesitekit-modules-analytics-********************.js 89.9 kB +2 B (0%)
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 91.8 kB -2 B (0%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 22.5 kB -3 B (0%)
./dist/assets/js/googlesitekit-modules-search-console-********************.js 58.9 kB -1 B (0%)
./dist/assets/js/googlesitekit-vendor-********************.js 316 kB +1 B (0%)
./dist/assets/js/googlesitekit-widgets-********************.js 33.5 kB +4 B (0%)
ℹ️ View Unchanged
Filename Size
./dist/assets/css/googlesitekit-admin-css-********************.min.css 50.8 kB
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 11.1 kB
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 7.38 kB
./dist/assets/js/29-********************.js 2.8 kB
./dist/assets/js/30-********************.js 2.28 kB
./dist/assets/js/31-********************.js 3.72 kB
./dist/assets/js/32-********************.js 929 B
./dist/assets/js/33-********************.js 888 B
./dist/assets/js/34-********************.js 3.12 kB
./dist/assets/js/analytics-advanced-tracking-********************.js 778 B
./dist/assets/js/googlesitekit-adminbar-********************.js 34.3 kB
./dist/assets/js/googlesitekit-api-********************.js 10.1 kB
./dist/assets/js/googlesitekit-components-gm3-********************.js 10 kB
./dist/assets/js/googlesitekit-datastore-forms-********************.js 9.11 kB
./dist/assets/js/googlesitekit-datastore-location-********************.js 2.09 kB
./dist/assets/js/googlesitekit-datastore-ui-********************.js 9.24 kB
./dist/assets/js/googlesitekit-datastore-user-********************.js 24.2 kB
./dist/assets/js/googlesitekit-i18n-********************.js 3.92 kB
./dist/assets/js/googlesitekit-modules-********************.js 22 kB
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 32.2 kB
./dist/assets/js/googlesitekit-polyfills-********************.js 379 B
./dist/assets/js/googlesitekit-settings-********************.js 50.9 kB
./dist/assets/js/googlesitekit-splash-********************.js 67.3 kB
./dist/assets/js/googlesitekit-user-input-********************.js 42.3 kB
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 61.8 kB
./dist/assets/js/runtime-********************.js 1.3 kB

compressed-size-action

$install_url = $nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug );

$response['wpConsentPlugin'] = array(
'installed' => $installed,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there's no need to include the active field specified in the AC. This is because hasConsentAPI indicates the active status.

Copy link
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @techanvil – this LGTM, I just had one thought about some of the plugin checks but it's not blocking and we can always address that in a follow-up.

Comment on lines +143 to +144
$slug = 'wp-consent-api';
$plugin = "$slug/$slug.php";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could actually be different if it were installed via Composer. See https://packagist.org/packages/rlankhorst/wp-consent-level-api

Definitely an edge case for most of our users I think, but worth keeping in mind that the $plugin can't always be assumed to be $slug/$slug. Not just because of Composer, but the directory can be renamed, or sometimes even the plugin itself can change the name of its entry point php file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aaemnnosttv, that's a good point. I've created #8307 to address this later. Seems like a post-MVP issue to me.

@aaemnnosttv aaemnnosttv merged commit b19bdd5 into develop Feb 22, 2024
24 of 27 checks passed
@aaemnnosttv aaemnnosttv deleted the enhancement/8276-como-wp-consent-api-infra branch February 22, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants