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

3.19 - Preload Fonts - Data insertion part #7242

Open
piotrbak opened this issue Jan 26, 2025 · 5 comments · Fixed by #7274
Open

3.19 - Preload Fonts - Data insertion part #7242

piotrbak opened this issue Jan 26, 2025 · 5 comments · Fixed by #7274
Assignees
Labels
effort: [S] 1-2 days of estimated development time
Milestone

Comments

@piotrbak
Copy link
Contributor

User Story
As an admin, I want to see the preload fonts data in database when manually visit a page

Acceptance Criteria

  • The table is created with a fresh install/update
  • The following data will be stored in the database:
    • Domain name, ID, device type, status, error message (to be defined)
    • Custom font URLs above the fold (above the fold screensize and threshold are as same as priority elements)
  • Any possible error will be saved into the DB and status set to failed
  • If no fonts are found, we’ll save this fact to the database and set the status to completed
  • Remove failed jobs (the behaviour should be the same as with other priority elements features)
@piotrbak piotrbak added this to the 3.19-prealpha milestone Jan 26, 2025
@piotrbak piotrbak changed the title 3.19 - Data insertion part 3.19 - Preload Fonts - Data insertion part Jan 26, 2025
@Khadreal
Copy link
Contributor

Khadreal commented Jan 27, 2025

Scope a solution

  • Create aFonts class in WP_Rocket\Engine\Media\PreloadFonts\Database\Queries, WP_Rocket\Engine\Media\PreloadFonts\Database\Rows, WP_Rocket\Engine\Media\PreloadFonts\Database\Schemas, WP_Rocket\Engine\Media\PreloadFonts\Database\Tables
  • The table schema should be as followed:
        id                              -  bigint(20)
        url                             -  varchar(2000)
        is_mobile                 -  boolean (tinyint(1))
        fonts	                 -  longtext
        error_message	-  longtext
        status			-  varchar(255)
        modified		        -  timestamp
        last_accessed	        -  timestamp
        created_at		-  timestamp
  • Table should be created if not exists
  • Create a new Controller class if not already created within WP_Rocket\Engine\Media\PreloadFonts\AJAX implementing the interface here WP_Rocket\Engine\Common\PerformanceHints\AJAX\ControllerInterface
  • Implement the function check_data and add_data
  • Add tests

Effort: [S]

@jeawhanlee
Copy link
Contributor

@Khadreal Thanks for the grooming. I believe we still have more areas to cover. We need to add the ajax part that handles the payload from the beacon.

@wordpressfan
Copy link
Contributor

@jeawhanlee
Copy link
Contributor

LGTM

@wordpressfan
Copy link
Contributor

That's merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: [S] 1-2 days of estimated development time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants