Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rocklobster-in/contact-form-7
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.9.3
Choose a base ref
...
head repository: rocklobster-in/contact-form-7
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Mar 23, 2024

  1. Bump webpack-dev-middleware from 5.3.3 to 5.3.4

    Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4.
    - [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
    - [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md)
    - [Commits](webpack/webpack-dev-middleware@v5.3.3...v5.3.4)
    
    ---
    updated-dependencies:
    - dependency-name: webpack-dev-middleware
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 23, 2024
    Copy the full SHA
    767e549 View commit details

Commits on Mar 24, 2024

  1. Merge pull request #1413 from rocklobster-in/dependabot/npm_and_yarn/…

    …webpack-dev-middleware-5.3.4
    
    Bump webpack-dev-middleware from 5.3.3 to 5.3.4
    takayukister authored Mar 24, 2024
    Copy the full SHA
    bcc3420 View commit details

Commits on Mar 29, 2024

  1. Bump express from 4.18.2 to 4.19.2

    Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
    - [Release notes](https://github.com/expressjs/express/releases)
    - [Changelog](https://github.com/expressjs/express/blob/master/History.md)
    - [Commits](expressjs/express@4.18.2...4.19.2)
    
    ---
    updated-dependencies:
    - dependency-name: express
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 29, 2024
    Copy the full SHA
    fb595ec View commit details
  2. Merge pull request #1415 from rocklobster-in/dependabot/npm_and_yarn/…

    …express-4.19.2
    
    Bump express from 4.18.2 to 4.19.2
    takayukister authored Mar 29, 2024
    Copy the full SHA
    2867463 View commit details

Commits on May 6, 2024

  1. Copy the full SHA
    0d7d753 View commit details
  2. Copy the full SHA
    5236ec8 View commit details
  3. Copy the full SHA
    006c01e View commit details
  4. Update packages

    takayukister committed May 6, 2024
    Copy the full SHA
    7127f7d View commit details

Commits on May 7, 2024

  1. Prepare for 5.9.4 release

    takayukister committed May 7, 2024
    Copy the full SHA
    cea2c82 View commit details
  2. Copy the full SHA
    6be9633 View commit details

Commits on May 12, 2024

  1. Copy the full SHA
    001df40 View commit details
  2. Merge pull request #1423 from rocklobster-in/dev/5.9

    Update block registration process
    takayukister authored May 12, 2024
    Copy the full SHA
    435b39d View commit details

Commits on May 18, 2024

  1. Block invalid action URL

    Fixes #1424
    takayukister committed May 18, 2024
    Copy the full SHA
    66678f8 View commit details
  2. Merge pull request #1425 from rocklobster-in/dev/5.9

    Block invalid action URL
    takayukister authored May 18, 2024
    Copy the full SHA
    c29a675 View commit details

Commits on May 21, 2024

  1. Update packages

    takayukister committed May 21, 2024
    Copy the full SHA
    d136423 View commit details
  2. Prepare for 5.9.5 release

    takayukister committed May 21, 2024
    Copy the full SHA
    7cdb5af View commit details
  3. Merge pull request #1428 from rocklobster-in/dev/5.9

    Prepare for 5.9.5 release
    takayukister authored May 21, 2024
    Copy the full SHA
    8f86673 View commit details

Commits on Jun 13, 2024

  1. Copy the full SHA
    6ddc993 View commit details
  2. Merge pull request #1433 from rocklobster-in/dev/5.9

    Set siteverify link for www.recaptcha.net
    takayukister authored Jun 13, 2024
    Copy the full SHA
    fa24b73 View commit details

Commits on Jun 14, 2024

  1. Copy the full SHA
    b0732e4 View commit details
  2. Merge pull request #1436 from rocklobster-in/dev/5.9

    Set implicit maxlength for text fields
    takayukister authored Jun 14, 2024
    Copy the full SHA
    36c3bae View commit details

Commits on Jun 16, 2024

  1. Rename $args to $options

    takayukister committed Jun 16, 2024
    Copy the full SHA
    1887964 View commit details
  2. Rename $args to $l10n

    takayukister committed Jun 16, 2024
    Copy the full SHA
    c23f47d View commit details
  3. Rename $args

    takayukister committed Jun 16, 2024
    Copy the full SHA
    4b25e80 View commit details
  4. Rename $args to $options

    takayukister committed Jun 16, 2024
    Copy the full SHA
    18ff5b6 View commit details
  5. Rename $args to $options

    takayukister committed Jun 16, 2024
    Copy the full SHA
    0026126 View commit details
  6. Rename $args to $options

    takayukister committed Jun 16, 2024
    Copy the full SHA
    e2a56a2 View commit details
  7. Rename $args to $options

    takayukister committed Jun 16, 2024
    Copy the full SHA
    73ab83c View commit details
  8. Rename $args

    takayukister committed Jun 16, 2024
    Copy the full SHA
    25a1e1a View commit details
  9. Merge pull request #1437 from rocklobster-in/dev/5.9

    Rename $args
    takayukister authored Jun 16, 2024
    Copy the full SHA
    582cc06 View commit details
  10. Rename $args to $data

    takayukister committed Jun 16, 2024
    Copy the full SHA
    4421d9a View commit details
  11. Rename $args to $options

    takayukister committed Jun 16, 2024
    Copy the full SHA
    0424a6e View commit details
  12. Rename $args to $options

    takayukister committed Jun 16, 2024
    Copy the full SHA
    66d0d42 View commit details
  13. Rename $args to $options

    takayukister committed Jun 16, 2024
    Copy the full SHA
    e9dcfcf View commit details
  14. Rename $args to $options

    takayukister committed Jun 16, 2024
    Copy the full SHA
    edf8fa2 View commit details

Commits on Jun 17, 2024

  1. Update packages

    takayukister committed Jun 17, 2024
    Copy the full SHA
    7f5b16e View commit details
  2. npm audit fix

    takayukister committed Jun 17, 2024
    Copy the full SHA
    6dac489 View commit details
  3. Merge pull request #1439 from rocklobster-in/dev/5.9

    Update node_modules
    takayukister authored Jun 17, 2024
    Copy the full SHA
    d3b0455 View commit details
  4. Prepare for 5.9.6 release

    takayukister committed Jun 17, 2024
    Copy the full SHA
    43c7f94 View commit details
  5. Merge pull request #1440 from rocklobster-in/dev/5.9

    Prepare for 5.9.6 release
    takayukister authored Jun 17, 2024
    Copy the full SHA
    5994a71 View commit details

Commits on Jun 26, 2024

  1. Copy the full SHA
    5ba998b View commit details

Commits on Jun 27, 2024

  1. Merge pull request #1444 from rocklobster-in/dev/5.9

    Detect form-in-form situation and give warning
    takayukister authored Jun 27, 2024
    Copy the full SHA
    994a7ce View commit details

Commits on Jun 28, 2024

  1. Apply maxitems=1 validation

    Fixes #1445
    takayukister committed Jun 28, 2024
    Copy the full SHA
    89de571 View commit details
  2. Merge pull request #1446 from rocklobster-in/dev/5.9

    Apply maxitems=1 validation
    takayukister authored Jun 28, 2024
    Copy the full SHA
    1f423da View commit details

Commits on Jul 4, 2024

  1. Increase default maxlength

    Closes #1435
    takayukister committed Jul 4, 2024
    Copy the full SHA
    7e1a14d View commit details
  2. Merge pull request #1448 from rocklobster-in/dev/5.9

    Increase default maxlength
    takayukister authored Jul 4, 2024
    Copy the full SHA
    2bd1d78 View commit details

Commits on Jul 17, 2024

  1. Update packages

    takayukister committed Jul 17, 2024
    Copy the full SHA
    ada6874 View commit details
  2. Rebuild all

    takayukister committed Jul 17, 2024
    Copy the full SHA
    7edcee9 View commit details
  3. Prepare for 5.9.7 release

    takayukister committed Jul 17, 2024
    Copy the full SHA
    c159492 View commit details
  4. Merge pull request #1450 from rocklobster-in/dev/5.9

    Prepare for 5.9.7 release
    takayukister authored Jul 17, 2024
    Copy the full SHA
    28be832 View commit details
Showing with 11,584 additions and 9,144 deletions.
  1. +6 −4 CONTRIBUTING.md
  2. +112 −120 admin/admin.php
  3. +176 −127 admin/edit-contact-form.php
  4. +7 −7 admin/includes/class-contact-forms-list-table.php
  5. +11 −8 admin/includes/config-validator.php
  6. +15 −8 admin/{ → includes}/css/styles-rtl.css
  7. +201 −91 admin/{ → includes}/css/styles.css
  8. +69 −30 admin/includes/editor.php
  9. +9 −0 admin/includes/js/index.asset.php
  10. +1 −0 admin/includes/js/index.js
  11. +68 −0 admin/includes/js/src/before-unload.js
  12. +232 −0 admin/includes/js/src/config-errors.js
  13. +110 −0 admin/includes/js/src/index.js
  14. +91 −0 admin/includes/js/src/tabs.js
  15. +161 −0 admin/includes/js/src/tag-generator-v1.js
  16. +153 −0 admin/includes/js/src/tag-generator-v2.js
  17. +79 −0 admin/includes/js/src/tag-generator.js
  18. +34 −0 admin/includes/js/src/utils.js
  19. +59 −0 admin/includes/js/src/welcome-panel.js
  20. +458 −19 admin/includes/tag-generator.php
  21. +7 −8 admin/includes/welcome-panel.php
  22. +0 −319 admin/js/scripts.js
  23. +0 −249 admin/js/tag-generator.js
  24. +1 −74 includes/block-editor/block-editor.php
  25. +1 −1 includes/block-editor/block.json
  26. +1 −1 includes/block-editor/index.asset.php
  27. +1 −1 includes/block-editor/index.js
  28. +8 −2 includes/block-editor/src/edit.js
  29. +0 −4 includes/block-editor/src/index.js
  30. +8 −8 includes/config-validator/mail.php
  31. +12 −12 includes/config-validator/validator.php
  32. +22 −22 includes/contact-form-functions.php
  33. +4 −4 includes/contact-form-template.php
  34. +87 −74 includes/contact-form.php
  35. +14 −9 includes/controller.php
  36. +11 −16 includes/file.php
  37. +9 −9 includes/form-tag.php
  38. +3 −5 includes/form-tags-manager.php
  39. +58 −14 includes/formatting.php
  40. +92 −88 includes/functions.php
  41. +25 −25 includes/html-formatter.php
  42. +5 −5 includes/integration.php
  43. +3 −1 includes/js/index.asset.php
  44. +1 −1 includes/js/index.js
  45. +2 −2 includes/js/src/helpers.js
  46. +17 −0 includes/js/src/index.js
  47. +1 −1 includes/l10n.php
  48. +42 −46 includes/mail.php
  49. +2 −2 includes/pipe.php
  50. +4 −4 includes/rest-api.php
  51. +1 −1 includes/shortcodes.php
  52. +24 −1 includes/special-mail-tags.php
  53. +18 −18 includes/submission.php
  54. +1 −1 includes/swv/js/index.js
  55. +1 −0 includes/swv/php/rules/date.php
  56. +1 −0 includes/swv/php/rules/dayofweek.php
  57. +1 −0 includes/swv/php/rules/email.php
  58. +13 −1 includes/swv/php/rules/enum.php
  59. +1 −0 includes/swv/php/rules/maxdate.php
  60. +1 −0 includes/swv/php/rules/maxitems.php
  61. +1 −0 includes/swv/php/rules/maxlength.php
  62. +1 −0 includes/swv/php/rules/maxnumber.php
  63. +1 −0 includes/swv/php/rules/mindate.php
  64. +1 −0 includes/swv/php/rules/minitems.php
  65. +1 −0 includes/swv/php/rules/minlength.php
  66. +1 −0 includes/swv/php/rules/minnumber.php
  67. +1 −0 includes/swv/php/rules/number.php
  68. +1 −0 includes/swv/php/rules/required.php
  69. +50 −0 includes/swv/php/rules/stepnumber.php
  70. +1 −0 includes/swv/php/rules/tel.php
  71. +1 −0 includes/swv/php/rules/time.php
  72. +1 −0 includes/swv/php/rules/url.php
  73. +1 −1 includes/swv/script-loader.php
  74. +9 −1 includes/swv/swv.php
  75. +21 −2 includes/validation-functions.php
  76. +1 −1 includes/validation.php
  77. +1 −1 license.txt
  78. +1 −1 load.php
  79. +82 −51 modules/acceptance.php
  80. +2 −2 modules/akismet/akismet.php
  81. +1 −1 modules/akismet/service.php
  82. +94 −86 modules/checkbox.php
  83. +2 −2 modules/constant-contact/constant-contact.php
  84. +1 −0 modules/constant-contact/contact-form-properties.php
  85. +4 −4 modules/constant-contact/contact-post-request.php
  86. +21 −15 modules/constant-contact/service.php
  87. +1 −1 modules/count.php
  88. +62 −73 modules/date.php
  89. +1 −0 modules/disallowed-list.php
  90. +105 −59 modules/file.php
  91. +5 −5 modules/flamingo.php
  92. +62 −78 modules/number.php
  93. +76 −47 modules/quiz.php
  94. +17 −110 modules/really-simple-captcha.php
  95. +45 −22 modules/recaptcha/recaptcha.php
  96. +22 −12 modules/recaptcha/service.php
  97. +54 −62 modules/select.php
  98. +1 −0 modules/sendinblue/contact-form-properties.php
  99. +15 −8 modules/sendinblue/sendinblue.php
  100. +23 −17 modules/sendinblue/service.php
  101. +2 −2 modules/stripe/api.php
  102. +15 −12 modules/stripe/service.php
  103. +10 −10 modules/stripe/stripe.php
  104. +50 −36 modules/submit.php
  105. +98 −104 modules/text.php
  106. +65 −59 modules/textarea.php
  107. +7,949 −6,766 package-lock.json
  108. +9 −7 package.json
  109. +34 −39 readme.txt
  110. +2 −0 uninstall.php
  111. +4 −4 wp-contact-form-7.php
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -7,13 +7,15 @@ Thank you for considering contributing to Contact Form 7. This document explains
Contributing by reporting issues
--------------------------------

If you find a bug, please report it to our GitHub repository by creating an issue. For minor issues like correction of a typo, you can start by creating a pull request instead of an issue.
If you find a bug, please report it to our GitHub repository unless it is about a security vulnerability. Creating an issue is always recommended, but for minor issues like correction of a typo, you can create a pull request instead of an issue.

If you can fix an issue, create a pull request that links to the target issue. We have our own [coding standards](https://contactform7.com/coding-standards/) for the plugin's development, and we ask that you respect the standards in your coding, too.
If you can fix an issue, create a pull request that links to the target issue. For WordPress plugin development, we have our own [coding standards](https://contactform7.com/coding-standards/). We ask you to respect the standards in your coding as well.

Security issues should not be discussed publicly, so when an issue is about a security vulnerability, please use the [contact form](https://contactform7.com/contact/) to inform the developers privately.
Security issues should not be discussed publicly, so please don't publish it through GitHub or other channels when the issue is about a security vulnerability. For security vulnerabilities, it is recommended you use the [Wordfence vulnerability submission form](https://www.wordfence.com/threat-intel/vulnerabilities/submit).

In any case, before reporting an issue, please double-check if the issue was caused purely due to a bug seen in the latest version of Contact Form 7. Reporting issues that have little to do with this plugin negatively impacts the motivation of the developers. If you are uncertain, posting it to the [support forum](https://wordpress.org/support/plugin/contact-form-7/) is advised.
In any case, prior to reporting an issue, please double-check if the issue is caused purely due to a bug of the plugin's latest version. Confirm that the problem occurs even in a vanilla environment where only the WordPress core, the default theme, and the plugin itself are activated.

Receiving reports of issues that have little to do with the plugin negatively impacts the motivation of the developers. If you are uncertain, posting to the [support forum](https://wordpress.org/support/plugin/contact-form-7/) is advised.


Contributing by helping other users
232 changes: 112 additions & 120 deletions admin/admin.php
Original file line number Diff line number Diff line change
@@ -116,67 +116,92 @@ function wpcf7_admin_enqueue_scripts( $hook_suffix ) {
}

wp_enqueue_style( 'contact-form-7-admin',
wpcf7_plugin_url( 'admin/css/styles.css' ),
wpcf7_plugin_url( 'admin/includes/css/styles.css' ),
array(), WPCF7_VERSION, 'all'
);

if ( wpcf7_is_rtl() ) {
wp_enqueue_style( 'contact-form-7-admin-rtl',
wpcf7_plugin_url( 'admin/css/styles-rtl.css' ),
wpcf7_plugin_url( 'admin/includes/css/styles-rtl.css' ),
array(), WPCF7_VERSION, 'all'
);
}

$assets = include wpcf7_plugin_path( 'admin/includes/js/index.asset.php' );

$assets = wp_parse_args( $assets, array(
'dependencies' => array(),
'version' => WPCF7_VERSION,
) );

wp_enqueue_script( 'wpcf7-admin',
wpcf7_plugin_url( 'admin/js/scripts.js' ),
array( 'jquery', 'jquery-ui-tabs' ),
WPCF7_VERSION,
wpcf7_plugin_url( 'admin/includes/js/index.js' ),
$assets['dependencies'],
$assets['version'],
array( 'in_footer' => true )
);

$args = array(
wp_set_script_translations( 'wpcf7-admin', 'contact-form-7' );

$wpcf7_obj = array(
'apiSettings' => array(
'root' => sanitize_url( rest_url( 'contact-form-7/v1' ) ),
'namespace' => 'contact-form-7/v1',
'nonce' => ( wp_installing() && ! is_multisite() )
? '' : wp_create_nonce( 'wp_rest' ),
),
'pluginUrl' => wpcf7_plugin_url(),
'saveAlert' => __(
"The changes you made will be lost if you navigate away from this page.",
'contact-form-7' ),
'activeTab' => (int) ( $_GET['active-tab'] ?? 0 ),
'configValidator' => array(
'errors' => array(),
'howToCorrect' => __( "How to resolve?", 'contact-form-7' ),
'oneError' => __( '1 configuration error detected', 'contact-form-7' ),
'manyErrors' => __( '%d configuration errors detected', 'contact-form-7' ),
'oneErrorInTab' => __( '1 configuration error detected in this tab panel', 'contact-form-7' ),
'manyErrorsInTab' => __( '%d configuration errors detected in this tab panel', 'contact-form-7' ),
'docUrl' => WPCF7_ConfigValidator::get_doc_link(),
/* translators: screen reader text */
'iconAlt' => __( '(configuration error)', 'contact-form-7' ),
),
);

if ( $post = wpcf7_get_current_contact_form()
and current_user_can( 'wpcf7_edit_contact_form', $post->id() )
and wpcf7_validate_configuration() ) {
$config_validator = new WPCF7_ConfigValidator( $post );
$config_validator->restore();
$args['configValidator']['errors'] =
$config_validator->collect_error_messages();
}
$post = wpcf7_get_current_contact_form();

wp_localize_script( 'wpcf7-admin', 'wpcf7', $args );
if ( $post ) {
$wpcf7_obj = array_merge( $wpcf7_obj, array(
'nonce' => array(
'save' => wp_create_nonce(
sprintf(
'wpcf7-save-contact-form_%s',
$post->initial() ? -1 : $post->id()
)
),
'copy' => wp_create_nonce(
sprintf(
'wpcf7-copy-contact-form_%s',
$post->initial() ? -1 : $post->id()
)
),
'delete' => wp_create_nonce(
sprintf(
'wpcf7-delete-contact-form_%s',
$post->initial() ? -1 : $post->id()
)
),
),
'configValidator' => array(
'errors' => array(),
'docUrl' => WPCF7_ConfigValidator::get_doc_link(),
),
) );

add_thickbox();
if (
current_user_can( 'wpcf7_edit_contact_form', $post->id() ) and
wpcf7_validate_configuration()
) {
$config_validator = new WPCF7_ConfigValidator( $post );
$config_validator->restore();

wp_enqueue_script( 'wpcf7-admin-taggenerator',
wpcf7_plugin_url( 'admin/js/tag-generator.js' ),
array( 'jquery', 'thickbox', 'wpcf7-admin' ),
WPCF7_VERSION,
array( 'in_footer' => true )
$wpcf7_obj['configValidator'] = array_merge(
$wpcf7_obj['configValidator'],
array(
'errors' => $config_validator->collect_error_messages(),
)
);
}
}

wp_add_inline_script( 'wpcf7-admin',
sprintf(
'var wpcf7 = %s;',
wp_json_encode( $wpcf7_obj, JSON_PRETTY_PRINT )
),
'before'
);
}

@@ -188,7 +213,7 @@ static function ( $result, $option, $value ) {
'wpcf7_contact_forms_per_page',
);

if ( in_array( $option, $wpcf7_screens ) ) {
if ( in_array( $option, $wpcf7_screens, true ) ) {
$result = $value;
}

@@ -243,12 +268,12 @@ function wpcf7_load_contact_form_admin() {

$query = array(
'post' => $contact_form ? $contact_form->id() : 0,
'active-tab' => (int) ( $_POST['active-tab'] ?? 0 ),
'active-tab' => wpcf7_canonicalize_name( $_POST['active-tab'] ?? '' ),
);

if ( ! $contact_form ) {
$query['message'] = 'failed';
} elseif ( -1 == $id ) {
} elseif ( -1 === (int) $id ) {
$query['message'] = 'created';
} else {
$query['message'] = 'saved';
@@ -378,7 +403,7 @@ function wpcf7_admin_management_page() {
return;
}

if ( 'validate' == wpcf7_current_action()
if ( 'validate' === wpcf7_current_action()
and wpcf7_validate_configuration()
and current_user_can( 'wpcf7_edit_contact_forms' ) ) {
wpcf7_admin_bulk_validate_page();
@@ -525,7 +550,7 @@ function wpcf7_admin_integration_page() {
add_action( 'wpcf7_admin_notices', 'wpcf7_admin_updated_message', 10, 3 );

function wpcf7_admin_updated_message( $page, $action, $object ) {
if ( ! in_array( $page, array( 'wpcf7', 'wpcf7-new' ) ) ) {
if ( ! in_array( $page, array( 'wpcf7', 'wpcf7-new' ), true ) ) {
return;
}

@@ -534,72 +559,53 @@ function wpcf7_admin_updated_message( $page, $action, $object ) {
}

if ( 'created' === $_REQUEST['message'] ) {
$updated_message = __( "Contact form created.", 'contact-form-7' );
$message = __( "Contact form created.", 'contact-form-7' );
} elseif ( 'saved' === $_REQUEST['message'] ) {
$updated_message = __( "Contact form saved.", 'contact-form-7' );
$message = __( "Contact form saved.", 'contact-form-7' );
} elseif ( 'deleted' === $_REQUEST['message'] ) {
$updated_message = __( "Contact form deleted.", 'contact-form-7' );
$message = __( "Contact form deleted.", 'contact-form-7' );
}

if ( ! empty( $updated_message ) ) {
echo sprintf(
'<div id="message" class="notice notice-success"><p>%s</p></div>',
esc_html( $updated_message )
);

return;
if ( ! empty( $message ) ) {
wp_admin_notice( esc_html( $message ), array( 'type' => 'success' ) );
}

if ( 'failed' === $_REQUEST['message'] ) {
$updated_message =
$message =
__( "There was an error saving the contact form.", 'contact-form-7' );

echo sprintf(
'<div id="message" class="notice notice-error"><p>%s</p></div>',
esc_html( $updated_message )
);

return;
wp_admin_notice( esc_html( $message ), array( 'type' => 'error' ) );
}

if ( 'validated' === $_REQUEST['message'] ) {
$bulk_validate = WPCF7::get_option( 'bulk_validate', array() );
$count_invalid = isset( $bulk_validate['count_invalid'] )
? absint( $bulk_validate['count_invalid'] ) : 0;
$count_invalid = absint( $bulk_validate['count_invalid'] ?? 0 );

if ( $count_invalid ) {
$updated_message = sprintf(
$message = sprintf(
/* translators: %s: number of contact forms */
_n(
/* translators: %s: number of contact forms */
"Configuration validation completed. %s invalid contact form was found.",
"Configuration validation completed. %s invalid contact forms were found.",
$count_invalid, 'contact-form-7'
),
number_format_i18n( $count_invalid )
);

echo sprintf(
'<div id="message" class="notice notice-warning"><p>%s</p></div>',
esc_html( $updated_message )
);
wp_admin_notice( esc_html( $message ), array( 'type' => 'warning' ) );
} else {
$updated_message = __( "Configuration validation completed. No invalid contact form was found.", 'contact-form-7' );
$message = __( "Configuration validation completed. No invalid contact form was found.", 'contact-form-7' );

echo sprintf(
'<div id="message" class="notice notice-success"><p>%s</p></div>',
esc_html( $updated_message )
);
wp_admin_notice( esc_html( $message ), array( 'type' => 'success' ) );
}

return;
}
}


add_filter( 'plugin_action_links', 'wpcf7_plugin_action_links', 10, 2 );

function wpcf7_plugin_action_links( $links, $file ) {
if ( $file != WPCF7_PLUGIN_BASENAME ) {
if ( WPCF7_PLUGIN_BASENAME !== $file ) {
return $links;
}

@@ -623,23 +629,17 @@ function wpcf7_plugin_action_links( $links, $file ) {
function wpcf7_old_wp_version_error( $page, $action, $object ) {
$wp_version = get_bloginfo( 'version' );

if ( ! version_compare( $wp_version, WPCF7_REQUIRED_WP_VERSION, '<' ) ) {
return;
}
if ( version_compare( $wp_version, WPCF7_REQUIRED_WP_VERSION, '<' ) ) {
$message = sprintf(
/* translators: 1: version of Contact Form 7, 2: version of WordPress, 3: URL */
__( '<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> Please <a href="%3$s">update WordPress</a> first.', 'contact-form-7' ),
WPCF7_VERSION,
WPCF7_REQUIRED_WP_VERSION,
admin_url( 'update-core.php' )
);

?>
<div class="notice notice-warning">
<p><?php
echo sprintf(
/* translators: 1: version of Contact Form 7, 2: version of WordPress, 3: URL */
__( '<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> Please <a href="%3$s">update WordPress</a> first.', 'contact-form-7' ),
WPCF7_VERSION,
WPCF7_REQUIRED_WP_VERSION,
admin_url( 'update-core.php' )
);
?></p>
</div>
<?php
wp_admin_notice( $message, array( 'type' => 'warning' ) );
}
}


@@ -652,32 +652,22 @@ function wpcf7_not_allowed_to_edit( $page, $action, $object ) {
return;
}

if ( current_user_can( 'wpcf7_edit_contact_form', $contact_form->id() ) ) {
return;
}

$message = __( "You are not allowed to edit this contact form.", 'contact-form-7' );
if ( ! current_user_can( 'wpcf7_edit_contact_form', $contact_form->id() ) ) {
$message = __( "You are not allowed to edit this contact form.", 'contact-form-7' );

echo sprintf(
'<div class="notice notice-warning"><p>%s</p></div>',
esc_html( $message )
);
wp_admin_notice( esc_html( $message ), array( 'type' => 'warning' ) );
}
}


add_action( 'wpcf7_admin_warnings', 'wpcf7_outdated_php_warning', 10, 3 );

function wpcf7_outdated_php_warning( $page, $action, $object ) {
if ( ! version_compare( PHP_VERSION, '7.4', '<' ) ) {
return;
}
if ( version_compare( PHP_VERSION, '7.4', '<' ) ) {
$message = __( "The next major release of Contact Form 7 will discontinue support for outdated PHP versions. If you don't upgrade PHP, you will not be able to upgrade the plugin.", 'contact-form-7' );

$message = __( "The next major release of Contact Form 7 will discontinue support for outdated PHP versions. If you don't upgrade PHP, you will not be able to upgrade the plugin.", 'contact-form-7' );

echo sprintf(
'<div class="notice notice-warning"><p>%s</p></div>',
esc_html( $message )
);
wp_admin_notice( esc_html( $message ), array( 'type' => 'warning' ) );
}
}


@@ -686,14 +676,16 @@ function wpcf7_outdated_php_warning( $page, $action, $object ) {
function wpcf7_ctct_deprecated_warning( $page, $action, $object ) {
$service = WPCF7_ConstantContact::get_instance();

if ( ! $service->is_active() ) {
return;
}

$message = __( "The Constant Contact integration is deprecated. It is not recommended to continue using the feature.", 'contact-form-7' );
if ( $service->is_active() ) {
$message = wp_kses(
__( 'The Constant Contact integration is deprecated and planned to be <a href="https://contactform7.com/2025/01/08/complete-removal-of-constant-contact-integration/">completely removed</a> anytime soon. Contact Form 7 recommends <a href="https://contactform7.com/sendinblue-integration/">Brevo</a> as an alternative.', 'contact-form-7' ),
array(
'a' => array( 'href' => true ),
'strong' => array(),
),
array( 'http', 'https' )
);

echo sprintf(
'<div class="notice notice-warning"><p>%s</p></div>',
esc_html( $message )
);
wp_admin_notice( $message, array( 'type' => 'warning' ) );
}
}
Loading