Skip to content

Commit

Permalink
Merge branch 'trunk' into ux_improve
Browse files Browse the repository at this point in the history
  • Loading branch information
jakaria-istauk committed Feb 18, 2024
2 parents 6b206e8 + 7c3f6d4 commit 45dc653
Show file tree
Hide file tree
Showing 124 changed files with 1,978 additions and 771 deletions.
41 changes: 41 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.git
.github
.idea
.wordpress-org
build
build-cs
build-phpunit
docs
node_modules
patches
tests

*.DS_Store
.DS_Store
.distignore
.editorconfig
.eslintrc.js
.gitattributes
.gitignore
.nvmrc
.phpunit.result.cache
.wp-env.json
.wp-env.override.json
behat.yml
CODE_OF_CONDUCT.md
codecov.yml
composer.json
composer.lock
CONTRIBUTING.md
package.json
package-lock.json
phpcs.xml
phpcs.xml.dist
phpmd.xml
phpstan.neon
phpstan.neon.dist
phpunit.xml
phpunit.xml.dist
plugin-check.iml
README.md
SECURITY.md
9 changes: 3 additions & 6 deletions .github/workflows/behat-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,15 @@ jobs:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
wordpress: [ 'latest' ]
include:
- php: '8.0'
- php: '8.2'
wordpress: 'latest'
coverage: true
- php: '8.0'
- php: '7.0'
wordpress: '6.3'
- php: '8.2'
wordpress: 'trunk'
experimental: true
- php: '8.3'
wordpress: 'trunk'
experimental: true
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6
with:
composer-options: '--prefer-dist --no-progress --no-interaction --no-dev'

- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
#SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
#SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}

- name: Upload release asset
uses: actions/upload-release-asset@v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Plugin Check is a WordPress.org tool which provides checks to help plugins meet
* Static checks, which analyze the code, either using PHPCodeSniffer sniffs or custom logic e.g. using regular expressions.
* Runtime checks, which actually execute certain parts of the code, such as running specific WordPress hooks with the plugin active.
* Allows customizing which checks are run, either via a list of individual check identifiers, or specific check categories.
* Comes with an ever-growing list of checks for various plugin development requirements and best practices. Please see the [`Abstract_Check_Runner::register_checks()` method](/includes/Checker/Abstract_Check_Runner.php#L358) for a quick overview of currently available checks.
* Comes with an ever-growing list of checks for various plugin development requirements and best practices. Please see the [`Default_Check_Repository::register_default_checks()` method](/includes/Checker/Default_Check_Repository.php#L31) for a quick overview of currently available checks.

### For developers

Expand Down
36 changes: 17 additions & 19 deletions assets/js/plugin-check-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
/**
* Reset the results container.
*
* @since n.e.x.t
* @since 1.0.0
*/
function resetResults() {
// Empty the results container.
Expand All @@ -99,7 +99,7 @@
/**
* Resets the form controls once checks have completed or failed.
*
* @since n.e.x.t
* @since 1.0.0
*/
function resetForm() {
spinner.classList.remove( 'is-active' );
Expand All @@ -122,7 +122,7 @@
/**
* Setup the runtime environment if needed.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {Object} data Data object with props passed to form data.
*/
Expand Down Expand Up @@ -162,7 +162,7 @@
/**
* Cleanup the runtime environment.
*
* @since n.e.x.t
* @since 1.0.0
*
* @return {Object} The response data.
*/
Expand Down Expand Up @@ -195,7 +195,7 @@
/**
* Get the Checks to run.
*
* @since n.e.x.t
* @since 1.0.0
*/
function getChecksToRun() {
const pluginCheckData = new FormData();
Expand Down Expand Up @@ -239,7 +239,7 @@
/**
* Run Checks.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {Object} data The response data.
*/
Expand Down Expand Up @@ -268,7 +268,7 @@
/**
* Renders result message.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {boolean} isSuccessMessage Whether the message is a success message.
*/
Expand All @@ -278,19 +278,17 @@
? pluginCheck.successMessage
: pluginCheck.errorMessage;

resultsContainer.innerHTML += renderTemplate(
'plugin-check-results-complete',
{
resultsContainer.innerHTML =
renderTemplate( 'plugin-check-results-complete', {
type: messageType,
message: messageText,
}
);
} ) + resultsContainer.innerHTML;
}

/**
* Run a single check.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {string} plugin The plugin to check.
* @param {string} check The check to run.
Expand Down Expand Up @@ -325,7 +323,7 @@
/**
* Handles any errors in the data returned from the response.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {Object} data The response data.
* @return {Object} The response data.
Expand All @@ -351,7 +349,7 @@
/**
* Renders results for each check on the page.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {Object} results The results object.
*/
Expand All @@ -376,7 +374,7 @@
/**
* Renders the file results table.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {string} file The file name for the results.
* @param {Object} errors The file errors.
Expand Down Expand Up @@ -408,7 +406,7 @@
/**
* Checks if there are any links in the results object.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {Object} results The results object.
* @return {boolean} True if there are links, false otherwise.
Expand All @@ -429,7 +427,7 @@
/**
* Renders a result row onto the file table.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {string} type The result type. Either ERROR or WARNING.
* @param {Object} results The results object.
Expand Down Expand Up @@ -465,7 +463,7 @@
/**
* Renders the template with data.
*
* @since n.e.x.t
* @since 1.0.0
*
* @param {string} templateSlug The template slug
* @param {Object} data Template data.
Expand Down
12 changes: 6 additions & 6 deletions cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* This is necessary to setup the environment to perform runtime checks.
*
* @package plugin-check
* @since n.e.x.t
* @since 1.0.0
*/

use WordPress\Plugin_Check\Checker\CLI_Runner;
use WordPress\Plugin_Check\Plugin_Context;
use WordPress\Plugin_Check\CLI\Plugin_Check_Command;
use WordPress\Plugin_Check\Plugin_Context;

if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) {
return;
Expand All @@ -29,7 +29,7 @@
}

if ( ! isset( $context ) ) {
$context = new Plugin_Context( __DIR__ . '/plugin-check.php' );
$context = new Plugin_Context( __DIR__ . '/plugin.php' );
}

// Create the CLI command instance and add to WP CLI.
Expand All @@ -40,14 +40,14 @@
/**
* Adds hook to set up the object-cache.php drop-in file.
*
* @since n.e.x.t
* @since 1.0.0
*/
WP_CLI::add_hook(
'before_wp_load',
function() {
function () {
if ( CLI_Runner::is_plugin_check() ) {
if ( ! file_exists( ABSPATH . 'wp-content/object-cache.php' ) ) {
if ( ! copy( __DIR__ . '/drop-ins/object-cache.copy.php', ABSPATH . 'wp-content/object-cache.php' ) ) {
if ( ! copy( __DIR__ . '/drop-ins/object-cache.copy.php', ABSPATH . 'wp-content/object-cache.php' ) ) {
WP_CLI::error( 'Unable to copy object-cache.php file.' );
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require-dev": {
"wp-cli/extension-command": "^2.1",
"wp-cli/wp-cli": "^2.8",
"wp-cli/wp-cli-tests": "^v4.2.2"
"wp-cli/wp-cli-tests": "^v4.2.9"
},
"scripts": {
"behat": "BEHAT_FEATURES_FOLDER=tests/behat/features run-behat-tests",
Expand Down
Loading

0 comments on commit 45dc653

Please sign in to comment.