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

Merge feature/creating-standalone-plugins feature branch #902

Merged
merged 178 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
b3be9f3
Merge branch 'trunk' of github.com:WordPress/performance into trunk
10upsimon Jul 20, 2023
00b04a5
Merge branch 'trunk' of github.com:WordPress/performance into trunk
10upsimon Aug 7, 2023
5e557cc
Merge branch 'trunk' of github.com:WordPress/performance into trunk
10upsimon Aug 10, 2023
6c86689
Merge branch 'trunk' into enhancement/652-migration-ui-from-old-modul…
10upsimon Aug 10, 2023
72dd81f
Merge remote-tracking branch 'origin/trunk' into enhancement/652-migr…
10upsimon Aug 11, 2023
61829fa
WIP add plugin_manager.js POC file to showcase endpoint logic is work…
10upsimon Aug 17, 2023
9f12f4c
Add build command for admin JS assets.
10upsimon Aug 17, 2023
7b40985
WIP Defined class structure and classes (POC) for handling standalone…
10upsimon Aug 17, 2023
622fd8b
Define autoload class mapping in composer.
10upsimon Aug 17, 2023
0b3d019
Instantiate plugin manager class and associated rest class instantes …
10upsimon Aug 17, 2023
918c176
Update gitignore so that built script dir is ignored.
10upsimon Aug 17, 2023
084cd26
Update namespace.
10upsimon Aug 18, 2023
3823c3f
WIP standalone plugins
10upsimon Sep 11, 2023
4f997a5
Merge branch 'trunk' of github.com:WordPress/performance into trunk
10upsimon Oct 18, 2023
b07fa1b
Merge branch 'trunk' into enhancement-v2/652-migration-ui-from-old-mo…
10upsimon Oct 18, 2023
88fc7e3
Add Plugin_Manager class to handle rendering/UI for plugin cards, and…
10upsimon Oct 19, 2023
f79613d
Fix kses error.
10upsimon Oct 19, 2023
139f32c
Ongoing translation tweaks. Redundant code and method removal.
10upsimon Oct 19, 2023
6dc97e1
Remove no longer needed REST controller files.
10upsimon Oct 19, 2023
2037e8e
Remove redundant REST use statements following removal of rest contro…
10upsimon Oct 19, 2023
2b176db
Update package lock file.
10upsimon Oct 19, 2023
7f969b3
Removed redundant admin asset compilation script in package json.
10upsimon Oct 19, 2023
4da908b
Remove redundant src folder.
10upsimon Oct 19, 2023
50a0d2f
Removed update class from update plugin button to avoid ajax update p…
10upsimon Oct 19, 2023
7b6b21c
Merge branch 'trunk' of github.com:WordPress/performance into trunk
10upsimon Oct 19, 2023
b3c6e5b
Merge branch 'trunk' into feature/creating-standalone-plugins
10upsimon Oct 19, 2023
c77bc57
Merge pull request #865 from WordPress/trunk
10upsimon Oct 19, 2023
f6460a6
Merge branch 'feature/creating-standalone-plugins' of github.com:Word…
10upsimon Oct 19, 2023
49faaf2
Merge branch 'feature/creating-standalone-plugins' into issue/651-pl-…
10upsimon Oct 19, 2023
bbcaf9e
Clean up action hook names.
10upsimon Oct 20, 2023
fa14ced
Reduce code complexity dramatically, lean out logic.
10upsimon Oct 20, 2023
5bd759f
Format since docblock properties.
10upsimon Oct 20, 2023
fe4cdd1
Add output escaping where necessary.
10upsimon Oct 20, 2023
c74fb6d
Rename hook callback to have perflab_ prefix.
10upsimon Oct 20, 2023
c21d004
Add performant-translations to standalone plugins reference array.
10upsimon Oct 20, 2023
60a72f7
Update includes/classes/class-plugin-manager.php, replace SQLite plug…
10upsimon Oct 23, 2023
c3af812
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Oct 23, 2023
084c76c
Remove admin assets from gitignore, no longer required.
10upsimon Oct 23, 2023
0370ffc
Update includes/classes/class-plugin-manager.php, include escaping on…
10upsimon Oct 23, 2023
205364b
Update includes/classes/class-plugin-manager.php, include escaping on…
10upsimon Oct 23, 2023
683dd85
Update includes/classes/class-plugin-manager.php, include escaping on…
10upsimon Oct 23, 2023
8f1d767
Update includes/classes/class-plugin-manager.php, include escaping on…
10upsimon Oct 23, 2023
c2ed639
Update includes/classes/class-plugin-manager.php, include escaping on…
10upsimon Oct 23, 2023
f5e39d6
Update includes/classes/class-plugin-manager.php, include escaping on…
10upsimon Oct 23, 2023
a75a44e
Update includes/classes/class-plugin-manager.php, replace usage of ec…
10upsimon Oct 23, 2023
0511d4f
Update includes/classes/class-plugin-manager.php, replace usage of ec…
10upsimon Oct 23, 2023
13db576
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Oct 23, 2023
4ba92e3
Update more details URL to be better escaped and constructed with add…
10upsimon Oct 23, 2023
9b3c413
Change access level of get_standalone_plugins method to private.
10upsimon Oct 23, 2023
3bb70fc
Update includes/classes/class-plugin-manager.php
10upsimon Nov 1, 2023
c135e06
Update includes/classes/class-plugin-manager.php
10upsimon Nov 1, 2023
41acf4a
Update includes/classes/class-plugin-manager.php
10upsimon Nov 1, 2023
7b118f0
Update includes/classes/class-plugin-manager.php
10upsimon Nov 1, 2023
994726d
Update admin/load.php
10upsimon Nov 1, 2023
f9d0715
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Nov 1, 2023
2cb8939
Remove unnecesary void return docblock statement.
10upsimon Nov 1, 2023
f2b134d
Update admin/load.php add conditional wrapper to wp_safe_redirect.
10upsimon Nov 1, 2023
b38a947
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Nov 1, 2023
bf99424
Rename admin script enqueue function and move into perflab_load_modul…
10upsimon Nov 1, 2023
9fd2536
Dissolve Plugin_Manager class into standalone functions.
10upsimon Nov 1, 2023
6248c3b
Remove autoloader require and replace prior method based plugin cards…
10upsimon Nov 1, 2023
b3e2236
Manually require new admin plugin files when admin, as opposed to pri…
10upsimon Nov 1, 2023
4b83a79
Remove no longer required includes/classes directory and said contents.
10upsimon Nov 1, 2023
822212d
Remove classmap property following removal of class based approach fo…
10upsimon Nov 1, 2023
6ea7a3c
Remove classmap property following removal of class based approach fo…
10upsimon Nov 1, 2023
bb58fc5
Split standalone plugin activation and deactivation into standalone a…
10upsimon Nov 2, 2023
ddaf667
Clean up activate and deactivate link generation.
10upsimon Nov 2, 2023
2583f3d
Clean up string concat for plugin action nonce checks.
10upsimon Nov 2, 2023
fe45bb5
Add admin/plugins.php to tests bootstrap.
10upsimon Nov 2, 2023
6010c91
Update admin/load.php use core wp input sanitisation functions.
10upsimon Nov 2, 2023
08f0a29
Update admin/load.php use core wp input sanitisation functions.
10upsimon Nov 2, 2023
f7be7d9
Update admin/plugins.php, formatting improvements.
10upsimon Nov 2, 2023
19358e2
Update admin/plugins.php, formatting enhancements.
10upsimon Nov 2, 2023
b2995cd
Return form plugin UI rendering if there are no standalone plugins.
10upsimon Nov 2, 2023
462b858
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Nov 2, 2023
0a20c0a
Remove unnecessary exit statements and return instead of exit on unde…
10upsimon Nov 2, 2023
2246e74
Update admin/load.php, more graceful error exiting if user lacks perm…
10upsimon Nov 8, 2023
a2e1c1d
Update admin/load.php, more graceful error exiting if user lacks perm…
10upsimon Nov 8, 2023
370281b
Update admin/load.php
10upsimon Nov 8, 2023
d8788d9
Update admin/load.php
10upsimon Nov 8, 2023
ee80a4a
Update admin/plugins.php
10upsimon Nov 8, 2023
9faf4cd
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Nov 8, 2023
e7417e6
Update admin/plugins.php, move cap check into switch condition.
10upsimon Nov 8, 2023
9453458
Update admin/plugins.php, move cap check into switch condition.
10upsimon Nov 8, 2023
69963f8
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Nov 8, 2023
dacbab7
Check admin referer spelling error correction.
10upsimon Nov 13, 2023
f7c0c29
Add new perflab_get_plugin_info() for separation of concerns, utilise…
10upsimon Nov 13, 2023
8010a42
Doc block 3rd person singular verb fix.
10upsimon Nov 13, 2023
1782a63
Remove wrapped check for install_plugins and activate_plugins cap che…
10upsimon Nov 13, 2023
d471dde
Remove plugin update ability and move update case into same activate …
10upsimon Nov 13, 2023
6c78993
Add plugin activate and deactivate URL params, raise admin notices as…
10upsimon Nov 14, 2023
86ef7bb
Update admin/plugins.php, better docblock description.
10upsimon Nov 14, 2023
fb33ff0
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Nov 14, 2023
f43d47c
Decouple retrieval of plugin info via API, pass plugin_data to plugin…
10upsimon Nov 14, 2023
dccc588
Merge pull request #882 from WordPress/trunk
felixarntz Nov 14, 2023
5ffd5ec
Merge branch 'feature/creating-standalone-plugins' into issue/651-pl-…
felixarntz Nov 14, 2023
1089fa3
Update parameter description.
felixarntz Nov 14, 2023
6eab09c
Update PHPCS violations ignore statements.
felixarntz Nov 14, 2023
07d87c3
Update PHPCS violations ignore statements.
felixarntz Nov 14, 2023
e9f078a
Update admin/load.php add wp_unslash() to plugin request var.
10upsimon Nov 16, 2023
fbce6f9
Update admin/plugins.php, add filter doc reference to docblock.
10upsimon Nov 16, 2023
7aa174e
Update admin/plugins.php, escaping fixes.
10upsimon Nov 16, 2023
b271368
Update admin/load.php, add wp_unslash() when obtaining plugin from re…
10upsimon Nov 16, 2023
0bf8650
Update admin/plugins.php, formatting fixes.
10upsimon Nov 16, 2023
db4c18f
Update admin/plugins.php, formatting fixes.
10upsimon Nov 16, 2023
b542aa4
Update admin/plugins.php, formatting fixes.
10upsimon Nov 16, 2023
ea7bea8
Update admin/plugins.php, add reference to core where code was lifted…
10upsimon Nov 16, 2023
60673d7
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Nov 20, 2023
8e9deb1
Clean up inline markup for wordpress and php version support annotati…
10upsimon Nov 20, 2023
8167002
Update admin/plugins.php, add escaping.
10upsimon Nov 20, 2023
2a4bf06
Update admin/plugins.php, add escaping.
10upsimon Nov 20, 2023
cee7509
Update admin/plugins.php, add escaping.
10upsimon Nov 20, 2023
f2293dd
Update admin/plugins.php, add escaping.
10upsimon Nov 20, 2023
182a458
Update admin/plugins.php, add filter docs reference.
10upsimon Nov 20, 2023
aa4fdb7
Update admin/plugins.php, comment formatting fix.
10upsimon Nov 20, 2023
e2f4ab4
Merge branch 'issue/651-pl-settings-screen-manage-standalone-plugins'…
10upsimon Nov 20, 2023
211c474
Fix precision alignment of 2 spaces linting error.
10upsimon Nov 20, 2023
e38877a
Update author 'By' output escaping to use wp_kses_post in order to no…
10upsimon Nov 21, 2023
bb33bbf
Remove escaping from author output.
10upsimon Nov 21, 2023
37d4d07
Undo package-lock updates, not needed.
10upsimon Nov 21, 2023
9dd7e91
Merge pull request #864 from WordPress/issue/651-pl-settings-screen-m…
felixarntz Nov 21, 2023
b7bed42
Issue 652 POC/WIP.
10upsimon Nov 30, 2023
13e3b0f
Fix minor UI and thickbox issue
mukeshpanchal27 Dec 5, 2023
dcc1d15
Merge pull request #896 from WordPress/fix/minor-issues
swissspidy Dec 6, 2023
3066022
Fix PHPStan
mukeshpanchal27 Dec 11, 2023
517d445
Merge branch 'feature/creating-standalone-plugins' into wip/652
mukeshpanchal27 Dec 11, 2023
b395690
Fix standalone plugin activation bug
mukeshpanchal27 Dec 12, 2023
db62070
Add inline CSS in admin head
mukeshpanchal27 Dec 13, 2023
bb71b49
Display admin notice in settings page
mukeshpanchal27 Dec 13, 2023
e45cc8e
Address review feedback
mukeshpanchal27 Dec 13, 2023
35a69fc
Address review feedback
mukeshpanchal27 Dec 13, 2023
01a2f21
Apply suggestions from code review
mukeshpanchal27 Dec 14, 2023
72c49c1
Address review feedback
mukeshpanchal27 Dec 14, 2023
5fed202
Apply suggestions from code review
mukeshpanchal27 Dec 14, 2023
0dd30f3
Address review feedback
mukeshpanchal27 Dec 14, 2023
abfc2f3
Remove client side validation
mukeshpanchal27 Dec 14, 2023
950dfca
Apply suggestions from code review
mukeshpanchal27 Dec 15, 2023
388be6a
Remove prompt
mukeshpanchal27 Dec 15, 2023
b1c7633
Fix JS lint
mukeshpanchal27 Dec 15, 2023
23e8d3d
Apply suggestions from code review
mukeshpanchal27 Dec 15, 2023
3efd1ed
Address review feedback
mukeshpanchal27 Dec 15, 2023
f884e85
Address review feedback
mukeshpanchal27 Dec 15, 2023
b936064
Fix multiple installation bug
mukeshpanchal27 Dec 15, 2023
84e4d93
Address review feedback
mukeshpanchal27 Dec 18, 2023
2bd591d
Use relative path in activate_plugin
mukeshpanchal27 Dec 18, 2023
ddfc72b
Apply suggestions from code review
mukeshpanchal27 Dec 18, 2023
ac00153
Apply suggestions from code review
mukeshpanchal27 Dec 18, 2023
fe313c7
Remove template literal, Fix PHPStan
mukeshpanchal27 Dec 18, 2023
b0ecb92
Add module migration pointer
mukeshpanchal27 Dec 18, 2023
ab6c25b
Update pointer heading
mukeshpanchal27 Dec 18, 2023
c8ac7e0
Remove string concatenation
mukeshpanchal27 Dec 18, 2023
3e0256c
Add decoding of the HTML entities in PHP
mukeshpanchal27 Dec 18, 2023
4d88d57
Merge pull request #899 from WordPress/wip/652
swissspidy Dec 18, 2023
eb5f7fb
Merge branch 'feature/creating-standalone-plugins' into fix/653-add-m…
mukeshpanchal27 Dec 18, 2023
c8de024
Merge branch 'feature/creating-standalone-plugins' into fix/880
mukeshpanchal27 Dec 18, 2023
1ee47e5
Fix lint
mukeshpanchal27 Dec 18, 2023
d717f68
Merge pull request #900 from WordPress/fix/880
swissspidy Dec 18, 2023
331d308
Merge branch 'feature/creating-standalone-plugins' into fix/653-add-m…
mukeshpanchal27 Dec 18, 2023
d855b9e
Address review feedback
mukeshpanchal27 Dec 19, 2023
deac9de
Remove duplicate admin notice call
mukeshpanchal27 Dec 19, 2023
461d741
Fix PHP Documentation Standards
mukeshpanchal27 Dec 19, 2023
d6dbecc
Move inline script in to JS
mukeshpanchal27 Dec 19, 2023
30f1679
Merge pull request #912 from WordPress/fix/followup-changes
felixarntz Dec 19, 2023
6d4cd74
Minor update to return doc.
felixarntz Dec 19, 2023
28b8905
Merge pull request #910 from WordPress/fix/653-add-module-migration-p…
felixarntz Dec 19, 2023
50b637f
un-dismiss the migration pointer
mukeshpanchal27 Dec 20, 2023
f56d804
improve code
mukeshpanchal27 Dec 21, 2023
17f773a
Rename variable.
felixarntz Dec 21, 2023
5a4cf83
Merge pull request #915 from WordPress/fix/un-dismiss-pointer
felixarntz Dec 21, 2023
9d1a435
Revise migration pointer un-dismissal to work for all admins
mukeshpanchal27 Dec 22, 2023
f4fcc72
Address slow query feedbacks
mukeshpanchal27 Jan 3, 2024
0dc84fa
Apply suggestions from code review
mukeshpanchal27 Jan 4, 2024
c580b15
Update function name
mukeshpanchal27 Jan 4, 2024
8e377d5
Merge pull request #917 from WordPress/fix/revise-migration-pointer
swissspidy Jan 4, 2024
a776953
Merge branch 'trunk' into feature/creating-standalone-plugins
felixarntz Jan 4, 2024
72c035a
Load migration script in settings page
mukeshpanchal27 Jan 5, 2024
abc39aa
Introduce perflab-plugin-management.js
mukeshpanchal27 Jan 8, 2024
8c6d56d
Merge pull request #920 from WordPress/load/migration-script-in-setti…
felixarntz Jan 8, 2024
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
50 changes: 50 additions & 0 deletions admin/js/perflab-module-migration-notice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
( function ( document ) {
document.addEventListener( 'DOMContentLoaded', function () {
document.addEventListener( 'click', function ( event ) {
if (
event.target.classList.contains(
'perflab-install-active-plugin'
)
) {
const target = event.target;
target.parentElement
.querySelector( 'span' )
.classList.remove( 'hidden' );

const data = new FormData();
data.append(
'action',
'perflab_install_activate_standalone_plugins'
);
data.append( 'nonce', perflab_module_migration_notice.nonce );

fetch( perflab_module_migration_notice.ajaxurl, {
method: 'POST',
credentials: 'same-origin',
body: data,
} )
.then( function ( response ) {
if ( ! response.ok ) {
throw new Error(
wp.i18n.__( 'Network response was not ok.', 'performance-lab' )
);
}
return response.json();
} )
.then( function ( result ) {
target.parentElement
.querySelector( 'span' )
.classList.add( 'hidden' );
if ( ! result.success ) {
alert( result.data.errorMessage );
}
window.location.reload();
} )
.catch( function ( error ) {
alert( error.errorMessage );
window.location.reload();
} );
}
} );
} );
} )( document );
38 changes: 38 additions & 0 deletions admin/js/perflab-plugin-management.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
( function ( $, document ) {
$( document ).ajaxComplete( function( event, xhr, settings ) {
// Check if this is the 'install-plugin' request.
if ( settings.data && typeof settings.data === 'string' && settings.data.includes( 'action=install-plugin' ) ) {
var params = new URLSearchParams( settings.data );
var slug = params.get('slug');

// Check if 'slug' was found and output the value.
if ( ! slug ) {
return;
}

var target_element = $( '.wpp-standalone-plugins a[data-slug="' + slug + '"]' );
if ( ! target_element ) {
return;
}

/*
* WordPress core uses a 1s timeout for updating the activation link,
* so we set a 1.5 timeout here to ensure our changes get updated after
* the core changes have taken place.
*/
setTimeout( function() {
var plugin_url = target_element.attr( 'href' );
if ( ! plugin_url ) {
return;
}
var nonce = target_element.attr( 'data-plugin-activation-nonce' );
var plugin_slug = target_element.attr( 'data-slug' );
var url = new URL( plugin_url );
url.searchParams.set( 'action', 'perflab_activate_plugin' );
url.searchParams.set( '_wpnonce', nonce );
url.searchParams.set( 'plugin', plugin_slug );
target_element.attr( 'href', url.href );
}, 1500 );
}
} );
} )( jQuery, document );
Loading