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

feat: reorganize plugin files to improve plugin performance #3871

Closed
ravinderk opened this issue Nov 26, 2018 · 0 comments

Comments

Projects
None yet
3 participants
@ravinderk
Copy link
Collaborator

commented Nov 26, 2018

Feature Request

User Story

As a developer, I can see that lots of code is loading on each page of the website when Give is activated even it does not need. We can improve plugin loading performance by reorganizing plugin code.

For Example:

  1. tcpdf lib: only needed when generates pdf
  2. background process lib: only needed when run updates
  3. give-metabox-functions.php: only needed when on form edit page
  4. give-readme-parser.php: only needed when update plugin
  5. give-html-elements: only needed in admin
  6. import-functions only needed on tools page
  7. give email functionality mostly needed when send email
  8. load logging lib only if log
  9. license handler mostly needed in backend

Note: After making these changes to code, I can see improvement (check screenshot). but few changes from above list can break addons, so need to discuss it.

Visuals

P3 Plugin Profiler WordPress Plugin

Before
image

After reorganize few files
image

Acceptance Criteria

  • TCPDF loads only when generating pdf report for donation income.
  • Form Metabox functions load only in admin.
  • Give HTML element functions load only in admin.: Not possible now. because tribute is using this in preview card functionality.
  • Import functions load only in admin.
  • License handler class loads only in admin.: Not possible now because most of addon is using Give_License class to register addon.
  • Template loader class loads only on the frontend.
  • Email access class loads only on the frontend.
  • Process donation related file to load only on the frontend. : Not possible now because this file also contains few helpers functions.
  • API key table class loads only on API setting page.
  • ....
  • Testing
    • All WP-CLI commands are working fine
    • PHPUnit testing passes.
    • Addon Testing
      • Recurring
      • PDF receipt
      • Tribute
      • Stripe
      • Currency Switcher
      • Fee Recovery
    • ....

ref: https://docs.google.com/document/d/1t6Q-BanFSCLzZN0J5ygMqNQ2G-s0IjRBzR-kujeBmwQ/edit?usp=sharing

DevinWalker added a commit that referenced this issue Dec 28, 2018

Merge pull request #3896 from impress-org/issue/3871
feat: reorganize plugin files and  auto load common options to improve plugin performance #3871 #3872

@ravinderk ravinderk referenced this issue Feb 4, 2019

Closed

fix: remedy server load for high traffic sites #3713

1 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.