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

move constants together #2431

Merged
merged 2 commits into from
Oct 6, 2022
Merged

move constants together #2431

merged 2 commits into from
Oct 6, 2022

Conversation

stoyan
Copy link
Contributor

@stoyan stoyan commented Oct 6, 2022

The idea is to have a single place to look for all constants

  • Found a couple (BREAKDOWN_CACHE_VERSION and VIDEO_CODE_VERSION) sprinkled in the codebase and moved them to the new constants.inc
  • Deleted code around ADULT_SITE which is not referred to anywhere
  • Moved EMBED to constants.inc and tweaked references because it's now always defined.
  • Two constants FRIENDLY_URLS and VER_TIMELINE require GetSetting() from common_lib.inc so cannot be in constants.inc. Moved them closer to where constants.inc is required.

Tested by browsing the site with and without ?embed, e.g.
https://www.webpagetest.org/video/compare.php?tests=220926_BiDcVY_E4Z-r:1-c:0-e:filmstrip&embed
vs
https://www.webpagetest.org/video/compare.php?tests=220926_BiDcVY_E4Z-r:1-c:0-e:filmstrip

@jefflembeck
Copy link
Contributor

what's the origin of the adult site part? is there a legal part to that? @pmeenan

@pmeenan
Copy link
Contributor

pmeenan commented Oct 6, 2022

No, you can get rid of all of that. It was from when the site used Adsense for ads, they didn't allow ads to be placed on pages with "adult content" so WPT had to jump through a bunch of hoops and exclude the ad code from those test results.

@stoyan
Copy link
Contributor Author

stoyan commented Oct 6, 2022

oh, that's good to know, thanks @pmeenan! I didn't dig deeper into some of the helper methods and keyword lists, but it's great we clean those up too. Task #2443

@stoyan stoyan merged commit 8e103ee into master Oct 6, 2022
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.

3 participants