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

Disable external HTTP request in wp theme list and wp plugin list command #193

Merged
merged 3 commits into from
Feb 29, 2024

Conversation

weiiwang01
Copy link
Collaborator

The wp-cli commands wp theme list and wp plugin list by default connect to the WordPress website to check for theme and plugin updates. However, this is unnecessary for the charm's use case and can slow down the command, especially in environments without internet connectivity.

Add --exec=define('WP_HTTP_BLOCK_EXTERNAL', TRUE); to disable all external HTTP requests during these two commands. And to my surprise, --skip-update-check does not work.

@weiiwang01 weiiwang01 added the bug Something isn't working label Feb 26, 2024
@weiiwang01 weiiwang01 requested a review from a team as a code owner February 26, 2024 16:17
mthaddon
mthaddon previously approved these changes Feb 27, 2024
arturo-seijas
arturo-seijas previously approved these changes Feb 27, 2024
arturo-seijas
arturo-seijas previously approved these changes Feb 27, 2024
Copy link
Contributor

Test coverage for bfe6e7a

Name                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------
src/charm.py          540     35    182     32    91%   186-189, 353-354, 413->417, 566, 597, 603, 620-624, 654, 689-690, 747, 756, 860->873, 872, 874, 879-880, 940, 958, 965, 1055, 1064, 1076, 1097, 1106, 1125, 1129, 1158, 1211, 1343, 1365, 1372->1374, 1417->exit, 1429, 1445, 1482
src/cos.py             15      0      0      0   100%
src/exceptions.py      17      1      2      1    89%   41
src/state.py           34      0      4      0   100%
src/types_.py          16      0      0      0   100%
---------------------------------------------------------------
TOTAL                 622     36    188     33    91%

Static code analysis report

Run started:2024-02-27 16:21:19.782562

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 4430
  Total lines skipped (#nosec): 1
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@weiiwang01 weiiwang01 merged commit b2d0a97 into main Feb 29, 2024
36 checks passed
@weiiwang01 weiiwang01 deleted the fix-theme-list branch February 29, 2024 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Libraries: Out of sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants