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

Opt in to receiving non-stable updates #3560

Open
wants to merge 51 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0c93dfd
Add scaffold for beta tester plugin
pierlon Oct 19, 2019
0715133
Fix error with PHPUnit bootstrapper determining plugin file to load.
pierlon Oct 21, 2019
e67e464
Hide beta-tester plugin update
pierlon Oct 21, 2019
03d1ec5
Show an error notice if AMP is not active
pierlon Oct 21, 2019
92ecf82
Modify the WP plugin update transient to show the latest AMP prerelease
pierlon Oct 21, 2019
34292f2
Replace AMP beta plugin 'version details' link with the one to the re…
pierlon Oct 21, 2019
d3a697c
Normalize composer.json
pierlon Oct 21, 2019
0c8b00d
Add test suite for beta tester plugin
pierlon Oct 21, 2019
97d3fdf
Display the version code in admin bar to act as a reminder that the p…
pierlon Oct 22, 2019
1afd2d5
Check for a new release upon activation of beta tester plugin
pierlon Oct 22, 2019
a1d98cc
Revert to bootstrapper from wp-dev-lib
pierlon Oct 22, 2019
9dbe30f
Remove amp-beta-tester text domain
pierlon Oct 22, 2019
1c44c9c
Include the 'RC' tag when determining a pre-release
pierlon Oct 22, 2019
d069fe5
Remove beta-tester test suite
pierlon Oct 22, 2019
e2615ca
Remove the 'missing AMP' notice as its no longer necessary
pierlon Oct 22, 2019
fc21cb5
Remind the user about the non-stable AMP plugin if its active
pierlon Oct 22, 2019
614ff2d
Hide AMP plugin update if running from source
pierlon Oct 22, 2019
2ddb7b3
Update tests
pierlon Oct 22, 2019
067e036
Include updating manifest if version code is the same
pierlon Oct 22, 2019
0d337a2
Replace version detail URL if it exists
pierlon Oct 22, 2019
3092e6d
Add test for `force_plugin_update_check`
pierlon Oct 22, 2019
f322111
Test that `admin_bar_menu` is hooked
pierlon Oct 22, 2019
d2f527a
Add test for `show_unstable_reminder`
pierlon Oct 22, 2019
8d60e12
Escape plugin 'version details' url
pierlon Oct 22, 2019
d4f2963
Add test for `get_amp_github_releases`
pierlon Oct 23, 2019
04c7901
Refactor `is_pre_release` test
pierlon Oct 23, 2019
0426acd
Refactor `replace_version_details_link` test
pierlon Oct 23, 2019
1d512ff
Refactor test for `get_amp_github_releases`
pierlon Oct 23, 2019
2362169
Add tests for `update_amp_manifest`
pierlon Oct 23, 2019
e147b1f
Sync beta tester version with AMP
pierlon Oct 23, 2019
552b16d
Use `wp_doing_cron()` instead of checking if `DOING_CRON` is defined
pierlon Oct 23, 2019
e6feafd
Refactor pre-release regex
pierlon Oct 23, 2019
a670aa4
Display the AMP version code as a submenu item under the top-level AM…
pierlon Oct 23, 2019
1a4b2d9
Cache GitHub releases
pierlon Oct 24, 2019
31dc721
Update plugin information used in the WP plugin API
pierlon Oct 24, 2019
22971f9
Add beta tester plugin to built release
pierlon Oct 24, 2019
3d91174
Rename folder to 'amp' upon an upgrade
pierlon Oct 25, 2019
a19eaeb
Bump beta tester version
pierlon Nov 27, 2019
0645f5e
Sort releases in descending when retrieved
pierlon Nov 30, 2019
b1214ee
Rename `restore_update_plugins_transient` function to `remove_plugin_…
pierlon Dec 5, 2019
700c1e6
Refactor code for updating AMP plugin update manifest
pierlon Dec 5, 2019
780fa54
Refactor code for updating AMP plugin version details
pierlon Dec 5, 2019
478e6ce
Allow plugin to be auto updated
pierlon Dec 6, 2019
6ad0294
Require a minimum WP and PHP version
pierlon Dec 6, 2019
1b9283e
Normalize constants
pierlon Dec 6, 2019
4f0bc79
Make check to identify plugin to update details for more robust
pierlon Dec 6, 2019
274e958
Remove unnecessary condition check when retrieving AMP plugin update …
pierlon Dec 6, 2019
871b09b
Make anonymous functions static
pierlon Dec 6, 2019
a73fbb4
Remove suggestion of using PHP JSON extension as its now required
pierlon Dec 6, 2019
f757ff8
Update tests
pierlon Dec 11, 2019
a62f439
Merge branch 'develop' into enhancement/2084-add-opt-in-to-beta-feature
pierlon Apr 1, 2020
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
1 change: 1 addition & 0 deletions .dev-lib
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PROJECT_SLUG=amp
README_MD_TITLE="AMP Plugin for WordPress"
DEV_LIB_SKIP="$DEV_LIB_SKIP,jshint"
CHECK_SCOPE=all
PLUGIN_FILE="$(pwd)/amp.php"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make this a bit more robust, it would probably be best if wp-dev-lib supplied the directory name and the environment variable here was only set as amp.php. Just thinking that as it stands right now, if the user is not currently in the plugin's root directory, then this could fail to work as expected. Granted this is unlikely. Nevertheless, it seems unnecessary to always require adding $(pwd)/ every time.


function after_wp_install {
if [[ "$WP_VERSION" != "4.9" ]]; then
Expand Down
11 changes: 7 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = function( grunt ) {
const productionIncludedRootFiles = [
'LICENSE',
'amp.php',
'amp-beta-tester.php',
'assets',
'back-compat',
'includes',
Expand Down Expand Up @@ -164,23 +165,25 @@ module.exports = function( grunt ) {
dest: 'build',
expand: true,
options: {
noProcess: [ '*/**', 'LICENSE' ], // That is, only process amp.php and readme.txt.
noProcess: [ '*/**', 'LICENSE', 'composer.*' ], // That is, only process amp.php, amp-beta-tester.php and readme.txt.
process( content, srcpath ) {
let matches, version, versionRegex;
if ( /amp\.php$/.test( srcpath ) ) {
const plugin = srcpath.match( /(amp|amp-beta-tester)\.php$/ );

if ( plugin ) {
versionRegex = /(\*\s+Version:\s+)(\d+(\.\d+)+-\w+)/;

// If not a stable build (e.g. 0.7.0-beta), amend the version with the git commit and current timestamp.
matches = content.match( versionRegex );
if ( matches ) {
version = matches[ 2 ] + '-' + versionAppend;
console.log( 'Updating version in amp.php to ' + version ); // eslint-disable-line no-console
console.log( 'Updating version in ' + plugin[ 0 ] + '.php to ' + version ); // eslint-disable-line no-console
content = content.replace( versionRegex, '$1' + version );
content = content.replace( /(define\(\s*'AMP__VERSION',\s*')(.+?)(?=')/, '$1' + version );
}

// Remove dev mode code blocks.
content = content.replace( /\n\/\/\s*DEV_CODE.+?\n}\n/s, '' );
content = content.replace( /\n\/\/\s*DEV_CODE.+?\n}\n/gs, '' );
}
return content;
},
Expand Down
Loading