علت خطا
سلام، قطعا براتون پیش اومده ویرایشگر المنتور رو باز کردید و با خطای no route was found matching the url and request method. مواجه شدید .
اصلا جای نگرانی نیست، گاهی پیش میاد که المنتور نمیتونه به سرورهای خودش درخواستی ارسال کنه و با این ارور مواجه میشید و دلیلشم میتونه ، تداخل و تحریم و مشکلات سرویس هاست باشه که بالاخره رفع میشه.
آموزش رفع خطا
حالا برای اینکه این خطا را رفع کنیم ، کافیه ارتباط المنتور رو با سرورهاش قطع کنیم.
کد زیر رو به فایل فانکشن (function.php) قالبتون اضافه کنید .
مشکلتون رفع میشه.
موفق باشید.
php
Copied to clipboard!
1// Prevent Elementor from connecting to my.elementor.com
2add_filter('elementor/connect/additional-connect-info', '__return_empty_array');
3add_filter('elementor/connect/connect-url', '__return_empty_string');
4add_filter('elementor/connect/remote-info-data', '__return_empty_array');
5
6// Handle the base-app.php errors by providing default values
7add_filter('elementor/connect/apps/get_client_data', function($client_data) {
8 if (is_wp_error($client_data)) {
9 return [
10 'client_id' => '',
11 'auth_secret' => '',
12 'redirect_uri' => '',
13 'callback' => '',
14 'admin_notice' => '',
15 ];
16 }
17 return $client_data;
18}, 10, 1);
19
20// Prevent connection attempts entirely without showing error
21add_filter('pre_http_request', function($pre, $parsed_args, $url) {
22 if (strpos($url, 'my.elementor.com') !== false) {
23 // Return a valid response to avoid the error
24 return [
25 'body' => '',
26 'response' => [
27 'code' => 200,
28 ],
29 'headers' => [],
30 'cookies' => [],
31 ];
32 }
33 return $pre;
34}, 10, 3);
35
36// Disable Elementor Connect Library
37add_action('elementor/init', function() {
38 if (class_exists('\Elementor\Core\Common\Modules\Connect\Module')) {
39 remove_action('elementor/editor/before_enqueue_scripts', [
40 \Elementor\Core\Common\Modules\Connect\Module::class,
41 'enqueue_connect_scripts'
42 ]);
43 }
44});
45
46// Remove Connect menu item
47add_action('admin_menu', function() {
48 remove_submenu_page('elementor', 'elementor-connect');
49}, 99);
50
51// Disable library sync
52add_filter('elementor/api/get_templates/body_args', '__return_empty_array');
53
54// Prevent 404 errors on API routes
55add_filter('elementor/api/get_info_data', '__return_empty_array');
56
57// Suppress specific WP_Error notices
58add_action('init', function() {
59 remove_action('admin_notices', [\Elementor\Core\Common\Modules\Connect\Module::class, 'admin_notice']);
60});
2 نظر
ممنون
مشکلم حل شد.
سلام
موفق باشید.