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

Implement WP admin UI for plugin dependencies #1547

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2d7e62d
Implement plugin dependencies using a JSON file.
aristath Aug 5, 2021
d5dec73
move the position of require_once
aristath Aug 5, 2021
0215b46
Coding-standards fix
aristath Aug 5, 2021
c4cec75
Use plugin headers instead of JSON file
aristath Aug 9, 2021
750c5b4
Use str_getcsv
aristath Aug 9, 2021
80c58f3
Early exit if DISALLOW_FILE_MODS is enabled
aristath Aug 12, 2021
de8f452
Early exit it DISALLOW_PLUGIN_DEPENDENCIES is enabled.
aristath Aug 12, 2021
b7e4b47
combine checks
aristath Aug 12, 2021
af43339
handle circular dependencies
aristath Aug 12, 2021
480d9a9
Improve plugin rows notices
aristath Aug 26, 2021
e1ec703
Update src/wp-admin/includes/class-wp-plugin-dependencies.php
aristath Sep 13, 2021
89fb76e
Add extra text for circular dependencies
aristath Sep 13, 2021
ba02dae
improve styling
aristath Sep 13, 2021
dcc8f6e
Add phpcs exception
aristath Sep 13, 2021
41409d0
improve readability
aristath Sep 13, 2021
9c3d199
Add inline comment
aristath Sep 13, 2021
d81677b
mark object vars as private
aristath Sep 13, 2021
babbe6c
tweak visibility for methods
aristath Sep 13, 2021
794b4fc
use a class const for the option-name
aristath Sep 13, 2021
b15adc6
add doc for return
aristath Sep 13, 2021
1959a45
phpcbf
aristath Sep 13, 2021
f2df25e
Add extra check, get_plugin_file_from_slug can be false
aristath Sep 13, 2021
00ca137
more styling tweaks
aristath Sep 13, 2021
90ed6cb
properly detect if plugin is active
aristath Sep 13, 2021
528c09e
more styling tweaks
aristath Sep 13, 2021
fffdcc9
explicitly mention that dependencies can't be deactivated.
aristath Sep 13, 2021
b809cf5
Add has_unmet_dependencies
aristath Sep 13, 2021
19790d9
partially revert previous commit
aristath Sep 13, 2021
0cbd6a8
method no longer needs to return anything
aristath Sep 13, 2021
2c11b63
Revert "method no longer needs to return anything"
aristath Sep 13, 2021
cf7bdf6
Revert "partially revert previous commit"
aristath Sep 13, 2021
1cdea86
Revert "Add has_unmet_dependencies"
aristath Sep 13, 2021
c4c4ec7
This is no longer used
aristath Sep 14, 2021
849172b
minor improvements
aristath Sep 14, 2021
f04ceef
allow defining the notice type
aristath Sep 14, 2021
3d7af17
minor refactor
aristath Sep 14, 2021
141028b
Minor class wp dependencies fixes
dingo-d Sep 16, 2021
b1d7408
We only need 2 params here
aristath Sep 17, 2021
c3cead7
fix @since
aristath Sep 17, 2021
4edbc54
fix comments alignment
aristath Sep 17, 2021
e5afbc6
remove box-shadow
aristath Sep 20, 2021
0c8d01a
fix PHP warnings
aristath Sep 20, 2021
fe99208
Hide checkbox if plugin can't be deactivated.
aristath Sep 20, 2021
f2779af
fix notice for active dependency
aristath Sep 20, 2021
209ee36
Disable checkbox instead of removing it
aristath Sep 20, 2021
1183af5
Update src/wp-admin/includes/class-wp-plugin-dependencies.php
aristath Sep 21, 2021
f671369
prefer protected over private
aristath Sep 21, 2021
d87d8d8
Update src/wp-admin/includes/class-wp-plugin-dependencies.php
aristath Sep 21, 2021
8948025
global was renamed
aristath Sep 21, 2021
1d795d8
tweak for namespaced plugins
aristath Sep 21, 2021
abde99e
missed a comma
aristath Sep 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions src/wp-admin/css/list-tables.css
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,9 @@ ul.cat-checklist {
}

.plugins .update th,
.plugins .update td {
.plugins .update td,
.plugins .dependency th,
.plugins .dependency td {
border-bottom: 0;
}

Expand All @@ -1188,16 +1190,20 @@ ul.cat-checklist {
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.plugins tr.active.plugin-update-tr + tr.inactive th,
.plugins tr.active.plugin-update-tr + tr.inactive td,
.plugins tr.active + tr.inactive th,
.plugins tr.active + tr.inactive td {
.plugins tr.active.plugin-update-tr + tr.inactive:not(.dependency) th,
.plugins tr.active.plugin-update-tr + tr.inactive:not(.dependency) td,
.plugins tr.active.plugin-dependencies-tr + tr.inactive:not(.dependency) th,
.plugins tr.active.plugin-dependencies-tr + tr.inactive:not(.dependency) td,
.plugins tr.active + tr.inactive:not(.dependency) th,
.plugins tr.active + tr.inactive:not(.dependency) td {
border-top: 1px solid rgba(0, 0, 0, 0.03);
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02), inset 0 -1px 0 #dcdcde;
}

.plugins .update td,
.plugins .update th,
.plugins tr.dependency td,
.plugins tr.dependency th,
.upgrade .plugins tr:last-of-type td,
.upgrade .plugins tr:last-of-type th,
.plugins tr.active + tr.inactive.update th,
Expand All @@ -1210,7 +1216,8 @@ ul.cat-checklist {
}

.plugins .active th.check-column,
.plugin-update-tr.active td {
.plugin-update-tr.active td,
.plugin-dependencies-tr.active td {
border-left: 4px solid #72aee6;
}

Expand Down Expand Up @@ -1267,13 +1274,20 @@ ul.cat-checklist {
border-top-width: 1px;
}

.plugins .plugin-update-tr .plugin-update {
.plugins .plugin-update-tr .plugin-update,
.plugins .plugin-dependencies-tr .plugin-dependencies {
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
overflow: hidden; /* clearfix */
padding: 0;
}

.plugins .plugin-dependencies-tr.active .dependencies-message.notice-info {
border: none;
padding-left: 0;
}

.plugins .plugin-update-tr .notice,
.plugins .plugin-dependencies-tr .notice,
.plugins .plugin-update-tr div[class="update-message"] { /* back-compat for pre-4.6 */
margin: 5px 20px 15px 40px;
}
Expand Down Expand Up @@ -2039,6 +2053,8 @@ div.action-links,
.plugins #the-list tr > td:not(:last-child),
.plugins #the-list .update th,
.plugins #the-list .update td,
.plugins #the-list .dependency th,
.plugins #the-list .dependency td,
.wp-list-table.plugins #the-list .theme-title {
box-shadow: none;
border-top: none;
Expand All @@ -2054,7 +2070,8 @@ div.action-links,

.plugins tr.active + tr.inactive th.check-column,
.plugins tr.active + tr.inactive td.column-description,
.plugins .plugin-update-tr:before {
.plugins .plugin-update-tr:before,
.plugins .plugin-dependencies-tr:before {
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

Expand All @@ -2064,12 +2081,14 @@ div.action-links,
}

/* mimic the checkbox th */
.plugins .plugin-update-tr:before {
.plugins .plugin-update-tr:before,
.plugins .plugin-dependencies-tr:before {
content: "";
display: table-cell;
}

.plugins #the-list .plugin-update-tr .plugin-update {
.plugins #the-list .plugin-update-tr .plugin-update,
.plugins #the-list .plugin-dependencies-tr .plugin-dependencies {
border-left: none;
}

Expand All @@ -2078,12 +2097,14 @@ div.action-links,
}

.plugins .active.update + .plugin-update-tr:before,
.plugins .active.updated + .plugin-update-tr:before {
.plugins .active.updated + .plugin-update-tr:before,
.plugins .active + .plugin-dependencies-tr:before {
background-color: #f0f6fc;
border-left: 4px solid #72aee6;
}

.plugins .plugin-update-tr .update-message {
.plugins .plugin-update-tr .update-message,
.plugins .plugin-dependencies-tr .dependencies-message {
margin-left: 0;
}

Expand Down
1 change: 1 addition & 0 deletions src/wp-admin/includes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
require_once ABSPATH . 'wp-admin/includes/options.php';

/** WordPress Plugin Administration API */
require_once ABSPATH . 'wp-admin/includes/class-wp-plugin-dependencies.php';
require_once ABSPATH . 'wp-admin/includes/plugin.php';

/** WordPress Post Administration API */
Expand Down
Loading