Skip to content

Commit

Permalink
Contact Form: Removing deprecated Google Drive Helper file, and jetpa…
Browse files Browse the repository at this point in the history
…ck_form_register_pattern function (#38786)
  • Loading branch information
coder-karen authored Aug 9, 2024
1 parent c77c6ac commit d1a9ad5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 239 deletions.
4 changes: 1 addition & 3 deletions projects/plugins/jetpack/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// PhanNoopNew : 200+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 200+ occurrences
// PhanTypeMismatchReturn : 150+ occurrences
// PhanTypeMismatchReturnProbablyReal : 140+ occurrences
// PhanTypeMismatchReturnProbablyReal : 130+ occurrences
// PhanDeprecatedFunction : 120+ occurrences
// PhanTypePossiblyInvalidDimOffset : 95+ occurrences
// PhanRedundantCondition : 70+ occurrences
Expand Down Expand Up @@ -116,7 +116,6 @@
'_inc/lib/admin-pages/class-jetpack-redux-state-helper.php' => ['PhanParamTooMany', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanRedundantCondition', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimAssignment'],
'_inc/lib/admin-pages/class.jetpack-admin-page.php' => ['PhanDeprecatedProperty', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredProperty'],
'_inc/lib/class-jetpack-ai-helper.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchPropertyDefault'],
'_inc/lib/class-jetpack-google-drive-helper.php' => ['PhanTypeMismatchReturnProbablyReal'],
'_inc/lib/class-jetpack-instagram-gallery-helper.php' => ['PhanTypeMismatchArgument'],
'_inc/lib/class-jetpack-mapbox-helper.php' => ['PhanTypeMismatchArgumentNullable'],
'_inc/lib/class-jetpack-podcast-feed-locator.php' => ['PhanDeprecatedFunctionInternal'],
Expand Down Expand Up @@ -329,7 +328,6 @@
'modules/comments/base.php' => ['PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredProperty'],
'modules/comments/comments.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanRedundantCondition', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanUndeclaredFunction'],
'modules/comments/subscription-modal-on-comment/class-jetpack-subscription-modal-on-comment.php' => ['PhanTypeMismatchReturnNullable'],
'modules/contact-form.php' => ['PhanSuspiciousMagicConstant'],
'modules/copy-post.php' => ['PhanNoopNew'],
'modules/custom-css/csstidy/class.csstidy-ctype.php' => ['PhanRedefineFunctionInternal'],
'modules/custom-css/csstidy/class.csstidy-optimise.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginSimplifyExpressionBool', 'PhanTypeComparisonFromArray', 'PhanTypeConversionFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidRightOperandOfNumericOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchReturnProbablyReal'],
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/remove-google-drive-helper
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Contact Form: Removing deprecated functionality
103 changes: 0 additions & 103 deletions projects/plugins/jetpack/modules/contact-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,106 +24,3 @@
* Load the newer Jetpack Forms package.
*/
Jetpack_Forms::load_contact_form();

/**
* Register Jetpack Form patterns
*
* @deprecated 13.4 Use Automattic\Jetpack\Forms\ContactForm\Util::register_pattern
*/
function jetpack_form_register_pattern() {
_deprecated_function( __METHOD__, 'jetpack-13.4', 'Automattic\Jetpack\Forms\ContactForm\Util::register_pattern' );
$category_slug = 'forms';
register_block_pattern_category( $category_slug, array( 'label' => __( 'Forms', 'jetpack' ) ) );

$patterns = array(
'contact-form' => array(
'title' => 'Contact Form',
'blockTypes' => array( 'jetpack/contact-form' ),
'categories' => array( $category_slug ),
'content' => '<!-- wp:jetpack/contact-form {"style":{"spacing":{"padding":{"top":"16px","right":"16px","bottom":"16px","left":"16px"}}}} -->
<div class="wp-block-jetpack-contact-form" style="padding-top:16px;padding-right:16px;padding-bottom:16px;padding-left:16px">
<!-- wp:jetpack/field-name {"required":true} /-->
<!-- wp:jetpack/field-email {"required":true} /-->
<!-- wp:jetpack/field-textarea /-->
<!-- wp:jetpack/button {"element":"button","text":"Contact Us","lock":{"remove":true}} /-->
</div>
<!-- /wp:jetpack/contact-form -->',
),
'newsletter-form' => array(
'title' => 'Newsletter Subscription Form',
'blockTypes' => array( 'jetpack/contact-form' ),
'categories' => array( $category_slug ),
'content' => '<!-- wp:jetpack/contact-form {"style":{"spacing":{"padding":{"top":"16px","right":"16px","bottom":"16px","left":"16px"}}}} -->
<div class="wp-block-jetpack-contact-form" style="padding-top:16px;padding-right:16px;padding-bottom:16px;padding-left:16px">
<!-- wp:jetpack/field-name {"required":true} /-->
<!-- wp:jetpack/field-email {"required":true} /-->
<!-- wp:jetpack/field-consent /-->
<!-- wp:jetpack/button {"element":"button","text":"Subscribe","lock":{"remove":true}} /-->
</div>
<!-- /wp:jetpack/contact-form -->',
),
'rsvp-form' => array(
'title' => 'RSVP Form',
'blockTypes' => array( 'jetpack/contact-form' ),
'categories' => array( $category_slug ),
'content' => '<!-- wp:jetpack/contact-form {"subject":"A new RSVP from your website","style":{"spacing":{"padding":{"top":"16px","right":"16px","bottom":"16px","left":"16px"}}}} -->
<div class="wp-block-jetpack-contact-form" style="padding-top:16px;padding-right:16px;padding-bottom:16px;padding-left:16px">
<!-- wp:jetpack/field-name {"required":true} /-->
<!-- wp:jetpack/field-email {"required":true} /-->
<!-- wp:jetpack/field-radio {"label":"Attending?","required":true,"options":["Yes","No"]} /-->
<!-- wp:jetpack/field-textarea {"label":"Other Details"} /-->
<!-- wp:jetpack/button {"element":"button","text":"Send RSVP","lock":{"remove":true}} /-->
</div>
<!-- /wp:jetpack/contact-form -->',
),
'registration-form' => array(
'title' => 'Registration Form',
'blockTypes' => array( 'jetpack/contact-form' ),
'categories' => array( $category_slug ),
'content' => '<!-- wp:jetpack/contact-form {"subject":"A new registration from your website","style":{"spacing":{"padding":{"top":"16px","right":"16px","bottom":"16px","left":"16px"}}}} -->
<div class="wp-block-jetpack-contact-form" style="padding-top:16px;padding-right:16px;padding-bottom:16px;padding-left:16px">
<!-- wp:jetpack/field-name {"required":true} /-->
<!-- wp:jetpack/field-email {"required":true} /-->
<!-- wp:jetpack/field-telephone {"label":"Phone Number"} /-->
<!-- wp:jetpack/field-select {"label":"How did you hear about us?","options":["Search Engine","Social Media","TV","Radio","Friend or Family"]} /-->
<!-- wp:jetpack/field-textarea {"label":"Other Details"} /-->
<!-- wp:jetpack/button {"element":"button","text":"Send","lock":{"remove":true}} /-->
</div>
<!-- /wp:jetpack/contact-form -->',
),
'appointment-form' => array(
'title' => 'Appointment Form',
'blockTypes' => array( 'jetpack/contact-form' ),
'categories' => array( $category_slug ),
'content' => '<!-- wp:jetpack/contact-form {"subject":"A new appointment booked from your website","style":{"spacing":{"padding":{"top":"16px","right":"16px","bottom":"16px","left":"16px"}}}} -->
<div class="wp-block-jetpack-contact-form" style="padding-top:16px;padding-right:16px;padding-bottom:16px;padding-left:16px">
<!-- wp:jetpack/field-name {"required":true} /-->
<!-- wp:jetpack/field-email {"required":true} /-->
<!-- wp:jetpack/field-telephone {"required":true} /-->
<!-- wp:jetpack/field-date {"label":"Date","required":true} /-->
<!-- wp:jetpack/field-radio {"label":"Time","required":true,"options":["Morning","Afternoon"]} /-->
<!-- wp:jetpack/field-textarea {"label":"Notes"} /-->
<!-- wp:jetpack/button {"element":"button","text":"Book Appointment","lock":{"remove":true}} /-->
</div>
<!-- /wp:jetpack/contact-form -->',
),
'feedback-form' => array(
'title' => 'Feedback Form',
'blockTypes' => array( 'jetpack/contact-form' ),
'categories' => array( $category_slug ),
'content' => '<!-- wp:jetpack/contact-form {"subject":"New feedback received from your website","style":{"spacing":{"padding":{"top":"16px","right":"16px","bottom":"16px","left":"16px"}}}} -->
<div class="wp-block-jetpack-contact-form" style="padding-top:16px;padding-right:16px;padding-bottom:16px;padding-left:16px">
<!-- wp:jetpack/field-name {"required":true} /-->
<!-- wp:jetpack/field-email {"required":true} /-->
<!-- wp:jetpack/field-radio {"label":"Please rate our website","required":true,"options":["1 - Very Bad","2 - Poor","3 - Average","4 - Good","5 - Excellent"]} /-->
<!-- wp:jetpack/field-textarea {"label":"How could we improve?"} /-->
<!-- wp:jetpack/button {"element":"button","text":"Send Feedback","lock":{"remove":true}} /-->
</div>
<!-- /wp:jetpack/contact-form -->',
),
);

foreach ( $patterns as $name => $pattern ) {
register_block_pattern( $name, $pattern );
}
}

0 comments on commit d1a9ad5

Please sign in to comment.