Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../public_h.../clone/wp-conte.../plugins/wpforms-.../src/Tasks/Actions
File: FormsLocatorScanTask.php
* @return array
[500] Fix | Delete
*/
[501] Fix | Delete
private function search_in_standalone_forms(): array {
[502] Fix | Delete
[503] Fix | Delete
global $wpdb;
[504] Fix | Delete
[505] Fix | Delete
$location_types = [];
[506] Fix | Delete
[507] Fix | Delete
foreach ( Locator::STANDALONE_LOCATION_TYPES as $location_type ) {
[508] Fix | Delete
$location_types[] = '"' . $location_type . '_enable":"1"';
[509] Fix | Delete
}
[510] Fix | Delete
[511] Fix | Delete
$regexp = implode( '|', $location_types );
[512] Fix | Delete
[513] Fix | Delete
$post_statuses = wpforms_wpdb_prepare_in( $this->locator->get_post_statuses() );
[514] Fix | Delete
[515] Fix | Delete
// phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
[516] Fix | Delete
$standalone_forms = $wpdb->get_results(
[517] Fix | Delete
"SELECT ID, post_content, post_status
[518] Fix | Delete
FROM $wpdb->posts
[519] Fix | Delete
WHERE post_status IN ( $post_statuses ) AND
[520] Fix | Delete
post_type = 'wpforms' AND
[521] Fix | Delete
post_content REGEXP '$regexp';"
[522] Fix | Delete
);
[523] Fix | Delete
// phpcs:enable WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
[524] Fix | Delete
[525] Fix | Delete
$locations = [];
[526] Fix | Delete
[527] Fix | Delete
foreach ( $standalone_forms as $standalone_form ) {
[528] Fix | Delete
$form_data = json_decode( $standalone_form->post_content, true );
[529] Fix | Delete
[530] Fix | Delete
$locations[] = $this->locator->build_standalone_location(
[531] Fix | Delete
(int) $standalone_form->ID,
[532] Fix | Delete
$form_data,
[533] Fix | Delete
$standalone_form->post_status
[534] Fix | Delete
);
[535] Fix | Delete
}
[536] Fix | Delete
[537] Fix | Delete
return $locations;
[538] Fix | Delete
}
[539] Fix | Delete
[540] Fix | Delete
/**
[541] Fix | Delete
* Get form location metas.
[542] Fix | Delete
*
[543] Fix | Delete
* @param array $locations Locations.
[544] Fix | Delete
*
[545] Fix | Delete
* @since 1.7.4
[546] Fix | Delete
*
[547] Fix | Delete
* @return array
[548] Fix | Delete
*/
[549] Fix | Delete
private function get_form_location_metas( $locations ) {
[550] Fix | Delete
[551] Fix | Delete
$metas = [];
[552] Fix | Delete
[553] Fix | Delete
foreach ( $locations as $location ) {
[554] Fix | Delete
[555] Fix | Delete
if ( empty( $location['form_id'] ) ) {
[556] Fix | Delete
continue;
[557] Fix | Delete
}
[558] Fix | Delete
[559] Fix | Delete
$metas[ $location['form_id'] ][] = $location;
[560] Fix | Delete
}
[561] Fix | Delete
[562] Fix | Delete
return $metas;
[563] Fix | Delete
}
[564] Fix | Delete
[565] Fix | Delete
/**
[566] Fix | Delete
* Log message to WPForms logger and standard debug.log file.
[567] Fix | Delete
*
[568] Fix | Delete
* @since 1.7.4
[569] Fix | Delete
*
[570] Fix | Delete
* @param string $message The error message that should be logged.
[571] Fix | Delete
*
[572] Fix | Delete
* @noinspection ForgottenDebugOutputInspection
[573] Fix | Delete
* @noinspection PhpUndefinedConstantInspection
[574] Fix | Delete
*/
[575] Fix | Delete
private function log( $message ) {
[576] Fix | Delete
[577] Fix | Delete
if ( defined( 'WPFORMS_DEBUG' ) && WPFORMS_DEBUG ) {
[578] Fix | Delete
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
[579] Fix | Delete
error_log( $message );
[580] Fix | Delete
wpforms_log( 'Forms Locator', $message, [ 'type' => 'log' ] );
[581] Fix | Delete
}
[582] Fix | Delete
}
[583] Fix | Delete
}
[584] Fix | Delete
[585] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function