Risultati della ricerca per 'Script to wordpress'
-
-
Ciao a tutti, se analizzo la mia homepage http://www.backdoorpodcast.com (F12 sul browser) mi da l’errore che è aperto due volte il tag <script type=”text/javascript”> e ok, però non capisco in wordpress dove è il codice che lo genera.
riga 1355 della sorgente della pagina (<script type=”text/javascript”>).
MI potete aiutare sto impazzendo, ho scaricato il tema e cercato anche lì ma nulla.
Grazieee
La pagina su cui ho bisogno di aiuto: [devi essere connesso per vedere il link]
-
Ciao a tutti, lavoro da anni con WordPress ma non riesco a districarmi dal problema che vi sottopongo. Oltretutto non sono una sistemista e conosco poco gli arcani dell’uso delle risorse lato server.
Il problemaè il seguente: ho un’intsallazione di WP aggiornata 6.8.1 con una serie di plugin, anche’essi aggiornati e quasi tutti registrati (tranne toolset blocks che ancora non ha rilasciato indicazioni di compatinilità con l’ultima versione di WP). Il sito è appena stato messo online e funziona correttamente finché non si accede all’editor temi del back-end.
A quel punto (anche se non sempre e questo complica il debug) il sito inizia a rallentare fino a generare errori 500. Poi si riprende e si riesce anche a eseguire aggiornamenti e modifiche.
Ho fatto eseguire una serie di controlli e nei log di errori risulta che esiste uno script nella pagina site-editor che impiega più di 45 sec nell’esecuzione e (credo) questo causa il successivo errore del “output before headers”:
[Wed Jun 04 14:31:05.794107 2025] [fcgid:warn] [pid 4151244:tid 4151267] [client 94.95.234.18:0] mod_fcgid: read data timeout in 45 seconds, referer: https://xxxxxxxxx.it/wp-admin/site-editor.php?p=%2Ftemplate
[Wed Jun 04 14:31:05.990736 2025] [core:error] [pid 4151244:tid 4151268] [client 94.95.234.18:0] End of script output before headers: index.php, referer: https://xxxxxxxxx.it/wp-admin/site-editor.php?p=%2FtemplateMi chiedo se ci sia un numero di template che una volta superati crea “instabilità”, perché noi ne abbiamo poco meno di 60 (sono 3 pagine nella sezione dell’editor).
La cosa curiosa è che in fase di sviluppo il problema non si è mai presentato, anche navigando il frontend durante la creazione dei template non si generava alcun rallentamento o errore.
L’assistenza che gestisce l’hosting, a cui avevo chiesto se era il caso alzare il time out di esecuzione script per la variabile coinvolta in buona sostanza mi ha detto che no, non aveva senso e che dovevo capire dove stava il problema perché 45 sec sono troppi.
Qualcuno è in grado di aiutarmi a capire meglio per poter risolvere il problema?
Grazie a chi vorrà farlo.
La pagina su cui ho bisogno di aiuto: [devi essere connesso per vedere il link]
-
Ciao,
sto riscontrando un problema con WooCommerce riguardo l’invio delle email e la configurazione del campo “Email mittente”. Ecco una descrizione dettagliata del problema e le azioni già intraprese:Problema:
- Le email generate da WooCommerce, come quelle per “Nuovo account cliente”, non vengono inviate. Tuttavia:
- Le email di test inviate tramite WP Mail SMTP funzionano correttamente.
- Altre email del sito (es. recupero password di WordPress) vengono inviate correttamente.
- Il campo “Email mittente” nelle impostazioni delle email di WooCommerce rimane sempre vuoto, anche dopo aver inserito un indirizzo valido e salvato. Ad ogni aggiornamento, il valore sparisce.
Azioni già intraprese:
- Reinstallazione di WooCommerce:
Ho disattivato ed eliminato il plugin, poi l’ho reinstallato. Il problema persiste. - Disattivazione di tutti i plugin:
Ho disattivato tutti i plugin tranne WooCommerce e WP Mail SMTP per escludere conflitti, ma non è cambiato nulla. - Cambio temporaneo di tema:
Ho testato con un tema predefinito di WordPress (Twenty Twenty-Two), ma il problema si presenta ugualmente. - Configurazione di WP Mail SMTP:
- Le email di test funzionano perfettamente.
- Ho verificato che il server SMTP sia configurato correttamente e funzioni.
- Log di WooCommerce:
Non ci sono errori evidenti nei log delle email o negli strumenti diagnostici forniti da WooCommerce.
Ulteriori Informazioni:
- Il sito usa la versione più recente di WordPress e WooCommerce.
- Ho provato anche a disabilitare temporaneamente la cache, senza risultati.
Vi chiedo gentilmente di aiutarmi a identificare la causa di questo problema. Può essere legato a:
- Una configurazione anomala nel database?
- Un bug del plugin?
- Un problema di compatibilità non rilevato?
Allego il report dello stato del sistema per aiutarvi nella diagnosi.
Grazie mille per l’aiuto!
Stato del Sistema
WordPress Environment<br><br>WordPress address (URL): https://www.anekecandles.com<br>Site address (URL): https://www.anekecandles.com<br>WC Version: 9.4.3<br>Legacy REST API Package Version: Il plugin API REST legacy non è installato in questo sito.<br>Action Scheduler Version: ✔ 3.8.2<br>Log Directory Writable: ✔<br>WP Version: 6.7.1<br>WP Multisite: –<br>WP Memory Limit: 1 GB<br>WP Debug Mode: –<br>WP Cron: ✔<br>Language: it_IT<br>External object cache: – Server Environment<br><br>Server Info: Apache<br>PHP Version: 8.0.30<br>PHP Post Max Size: 128 MB<br>PHP Time Limit: 900<br>PHP Max Input Vars: 3000<br>cURL Version: 7.68.0<br>OpenSSL/1.1.1f<br><br>SUHOSIN Installed: –<br>MySQL Version: 8.0.36-28<br>Max Upload Size: 128 MB<br>Default Timezone is UTC: ✔<br>fsockopen/cURL: ✔<br>SoapClient: Active Plugins (21)<br><br>Advanced Custom Fields: di WP Engine – 6.3.11<br>Akismet Anti-spam: Spam Protection: di Automattic – Squadra antispam – 5.3.5<br>Aruba HiSpeed Cache: di Aruba.it – 2.0.20<br>Backuply: di Softaculous – 1.4.1<br>Contact Form 7: di Takayuki Miyoshi – 6.0.1<br>Elementor Pro: di Elementor.com – 3.25.4<br>Elementor: di Elementor.com – 3.25.10<br>Essential Addons for Elementor: di WPDeveloper – 6.0.10<br>Flexible Checkout Fields: di WP Desk – 4.1.15<br>GetResponseOfficial: di GetResponse – 1.3.9<br>Ultimate Addons for Elementor Lite: di Brainstorm Force<br>Nikhil Chavan – 2.0.0<br><br>Health Check & Troubleshooting: di The WordPress.org community – 1.7.1<br>Jetpack: di Automattic – 14.0<br>Checkout Field Editor for WooCommerce: di ThemeHigh – 2.0.6<br>Widgets for WooCommerce Products on Elementor: di Themelocation – 2.0.4<br>WooCommerce: di Automattic – 9.4.3<br>ShopLentor – WooCommerce Builder for Elementor & Gutenberg: di HasThemes – 3.0.1<br>Yoast SEO: di Team Yoast – 23.9<br>WP Mail SMTP: di WP Mail SMTP – 4.3.0<br>WPForms Lite: di WPForms – 1.9.2.3<br>YayMail – WooCommerce Email Customizer: di YayCommerce – 3.5.7 Inactive Plugins (2)<br><br>Softaculous Pro: di Softaculous – 2.1.5<br>WP Login and Logout Redirect: di Aminur Islam – 3.0 Must Use Plugins (1)<br><br>Health Check Troubleshooting Mode: di – 1.9.2 Settings<br><br>Legacy API Enabled: –<br>Force SSL: –<br>Currency: EUR (€)<br>Currency Position: right_space<br>Thousand Separator: .<br>Decimal Separator: ,<br>Number of Decimals: 2<br>Taxonomies: Product Types: external (external)<br>grouped (grouped)<br>simple (simple)<br>variable (variable)<br><br>Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)<br>exclude-from-search (exclude-from-search)<br>featured (featured)<br>outofstock (outofstock)<br>rated-1 (rated-1)<br>rated-2 (rated-2)<br>rated-3 (rated-3)<br>rated-4 (rated-4)<br>rated-5 (rated-5)<br><br>Connected to WooCommerce.com: –<br>Enforce Approved Product Download Directories: ✔<br>HPOS feature enabled: ✔<br>Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore<br>HPOS data sync enabled: – Logging<br><br>Enabled: ✔<br>Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2<br>Retention period: 30 giorni<br>Level threshold: –<br>Log directory size: 553 KB WC Pages<br><br>Shop base: #79 – /negozio/<br>Carrello: #80 – /carrello/ – Contiene il blocco woocommerce/cart<br>Pagamento: ❌ La pagina non contiene lo shortcode [woocommerce_checkout] o il blocco woocommerce/checkout.<br>Il mio account: ❌ La pagina non contiene lo shortcode [woocommerce_my_account].<br>Termini e condizioni: ❌ La pagina non è impostata Theme<br><br>Name: Hello Elementor Child<br>Version: 2.0.0<br>Author URL: https://elementor.com/<br>Child Theme: ✔<br>Parent Theme Name: Hello Elementor<br>Parent Theme Version: 3.1.1 – 3.2.0 è disponibile<br>Parent Theme Author URL: https://elementor.com/?utm_source=wp-themes&utm_campaign=author-uri&utm_medium=wp-dash<br>WooCommerce Support: ✔ Templates<br><br>Overrides: – Admin<br><br>Enabled Features: activity-panels<br>analytics<br>product-block-editor<br>coupons<br>core-profiler<br>customize-store<br>customer-effort-score-tracks<br>import-products-task<br>experimental-fashion-sample-products<br>shipping-smart-defaults<br>shipping-setting-tour<br>homescreen<br>marketing<br>mobile-app-banner<br>navigation<br>onboarding<br>onboarding-tasks<br>pattern-toolkit-full-composability<br>product-custom-fields<br>remote-inbox-notifications<br>remote-free-extensions<br>payment-gateway-suggestions<br>printful<br>shipping-label-banner<br>subscriptions<br>store-alerts<br>transient-notices<br>woo-mobile-welcome<br>wc-pay-promotion<br>wc-pay-welcome-page<br>launch-your-store<br><br>Disabled Features: product-data-views<br>experimental-blocks<br>minified-js<br>product-pre-publish-modal<br>settings<br>async-product-editor-category-field<br>product-editor-template-system<br>blueprint<br>reactify-classic-payments-settings<br>use-wp-horizon<br><br>Daily Cron: ✔ Next scheduled: 2024-12-16 15:09:51 +00:00<br>Options: ✔<br>Notes: 64<br>Onboarding: completed Action Scheduler<br><br>Completato: 5.078<br>Oldest: 2024-11-21 15:10:01 +0000<br>Newest: 2024-12-16 10:12:33 +0000<br><br>Operazione non riuscita: 16<br>Oldest: 2024-11-21 15:15:52 +0000<br>Newest: 2024-12-15 22:05:04 +0000<br><br>In attesa: 7<br>Oldest: 2024-12-16 22:05:04 +0000<br>Newest: 2024-12-23 14:00:00 +0000 Status report information<br><br>Generated at: 2024-12-16 11:37:19 +00:00<br>
- Le email generate da WooCommerce, come quelle per “Nuovo account cliente”, non vengono inviate. Tuttavia:
-
Ciao a tutti.
Sto provando ad integrare i widget di Cloudflare Turnstile in un sito WordPress con il seguente codice all’interno del file “functions.php” (ovviamente il codice non è completo, è solo la parte per integrare l’API):function enqueue_cloudflare_turnstile() {
wp_enqueue_script(
'cloudflare-turnstile',
'https://challenges.cloudflare.com/turnstile/v0/api.js',
array(),
null,
true
);
}
add_action('wp_enqueue_scripts', 'enqueue_cloudflare_turnstile');Ma non funziona. Ispezionando la pagina c’è il seguente errore nella console:
siteground-optimizer…fb9bdd456d273.js:47 Uncaught TurnstileError: [Cloudflare Turnstile] Could not find Turnstile script tag, some features may not be available.
at m (siteground-optimizer…456d273.js:47:10665)
at fr (siteground-optimizer…456d273.js:47:11122)
at siteground-optimizer…456d273.js:47:45957
at siteground-optimizer…456d273.js:47:47692
m @ siteground-optimizer…fb9bdd456d273.js:47
fr @ siteground-optimizer…fb9bdd456d273.js:47
(anonime) @ siteground-optimizer…fb9bdd456d273.js:47
(anonime) @ siteground-optimizer…fb9bdd456d273.js:47Ho provato a disattivare il plugin Siteground Speed Optimizer è l’errore scompare. Se lo riattivo si ripresenta. Ho attivato il plugin e disattivato la voce “Combina file JavaScript” il problema sparisce. Allora ho attivato la voce ed escluso dalla voce la voce “https://challenges.cloudflare.com/turnstile/v0/api.js” ma il problema rimane.
Qualcuno sa come aiutarmi?
Grazie in anticipo per tutti (se poi qualcuno ha già fatto questo tipo di integrazione, mi piacerebbe vedere il codice completo utilizzato per il corretto funzionamento).
-
Buongiorno,
la mia installazione di wordpress non crea più correttamente le risposte JSON in quanto viene aggiunto il tag <script></script> prima del file. Ho già provato a disattivare tutti i plugin, aggiornato la versione di wordpress ma il problema non viene risolto… sapete darmi indicazioni?
La pagina su cui ho bisogno di aiuto: [devi essere connesso per vedere il link]
-
Ciao a tutti,
dopo i due più recenti aggiornamenti di wordpress non mi funziona più un plugin che genera post di una determinata categoria derivante dalla compilazione di moduli di CF7.
L’ho controllato e ricontrollato eppure niente da fare, con il debug di wordpress mi esce il seguente errore:Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function “add_author_support_to_posts” not found or invalid function name in /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-includes/class-wp-hook.php:324
Stack trace: 0 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 1 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-includes/plugin.php(517): WP_Hook->do_action() 2 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-settings.php(643): do_action() 3 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-config.php(82): require_once(‘…’) 4 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-load.php(50): require_once(‘…’) 5 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-blog-header.php(13): require_once(‘…’) 6 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/index.php(17): require(‘…’) 7 {main} thrown in /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-includes/class-wp-hook.php on line 324
Questo di seguito alla fine è il codice php del plugin, so che è lunghetto ma se qualcuno gentilmente mi aiuta a trovar l’errore gliene sarei molto grato.
Grazie infinite
Enrico<?php if (!defined('ABSPATH')) { exit; } /** * Our main plugin class */ class CF7_To_WP { /** * The single instance of cf7_to_wp. * @var object */ private static $_instance = null; /** * Settings class object * @var object */ public $settings = null; /** * The version number. * @var string */ public $_version; /** * The token. * @var string */ public $_token; /** * The main plugin file. * @var string */ public $file; /** * The main plugin directory. * @var string */ public $dir; /** * The plugin assets directory. * @var string */ public $assets_dir; /** * The plugin assets URL. * @var string */ public $assets_url; /** * Our post type slug. * * @var string */ private $post_type = 'cf7_form_messages'; /** * Constructor function. * @access public */ public function __construct($file = '', $version = '0.1') { $this->_version = $version; $this->_token = 'cf7_to_wp'; // Load plugin environment variables $this->file = $file; $this->dir = dirname($this->file); $this->assets_dir = trailingslashit($this->dir) . 'assets'; $this->assets_url = esc_url(trailingslashit(plugins_url('/assets/', $this->file))); // Handle localization $this->load_plugin_textdomain(); add_action('init', array($this, 'load_localization'), 0); } /** * Initialize all the things! */ public function init() { // Register Messages post type. add_action('init', array($this, 'register_form_msg_post_type')); add_filter('add_menu_classes', array($this, 'menu_msg_form_bubble')); add_filter('post_row_actions', array($this, 'action_row_for_msg_posts'), 10, 2); add_action('admin_init', [$this, 'maybe_mark_form_message_as_read']); add_filter('wpcf7_verify_nonce', '__return_true'); // Hook into CF7 actions. add_filter('wpcf7_editor_panels', array($this, 'add_cf7_panel')); add_action('wpcf7_after_save', array($this, 'save_cf7_data'), 50, 1); add_action('wpcf7_mail_sent', array($this, 'create_post_on_form_submission'), 50, 1); add_action('wpcf7_mail_failed', array($this, 'create_post_on_form_submission'), 50, 1); add_action('init', 'add_author_support_to_posts'); add_filter('wpcf7_verify_nonce', '__return_true'); } /** * Load plugin localisation */ public function load_localization() { load_plugin_textdomain('cf7_to_wp', false, dirname(plugin_basename($this->file)) . '/lang/'); } /** * Load plugin textdomain */ public function load_plugin_textdomain() { $domain = 'cf7_to_wp'; $locale = apply_filters('plugin_locale', get_locale(), $domain); load_textdomain($domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo'); load_plugin_textdomain($domain, false, dirname(plugin_basename($this->file)) . '/lang/'); } /** * Register our post type to store messages. */ public function register_form_msg_post_type() { register_post_type( $this->post_type, array( 'labels' => array( 'name' => __('Pratiche', 'cf7_to_wp'), 'singular_name' => __('Pratica', 'cf7_to_wp'), 'add_new' => __('Aggiungi nuova', 'cf7_to_wp'), 'add_new_item' => __('Aggiungi nuova pratica', 'cf7_to_wp'), 'edit' => __('Modifica', 'cf7_to_wp'), ), 'description' => 'Pratiche e Servizi', 'has_archive' => true, 'publicly_queryable' => true, 'capability_type' => 'post', 'menu_position' => 32, 'show_ui' => true, 'show_in_menu' => true, 'public' => true, 'query_var' => true, 'menu_icon' => 'dashicons-buddicons-pm', 'taxonomies' => array('category'), 'supports' => array( 'author', 'title', 'category', 'editor', 'excerpt', 'trackbacks', 'page-attributes', 'custom-fields', 'thumbnail', 'sticky', ), ) ); } /** * Add bubble to admin menu * * @param array $menu * @return array $menu */ public function menu_msg_form_bubble($menu) { $form_messages_count = wp_count_posts($this->post_type); $pending_count = $form_messages_count->draft + $form_messages_count->pending; foreach ($menu as $menu_key => $menu_data) { if ("edit.php?post_type={$this->post_type}" !== $menu_data[2]) { continue; } $menu[$menu_key][0] .= " <span class='update-plugins count-$pending_count'><span class='plugin-count'>" . number_format_i18n($pending_count) . '</span></span>'; } return $menu; } /** * Add "Mark as read" action for our post type * * @param array $actions * @param WP_Post $post * @return array $actions */ public function action_row_for_msg_posts($actions, $post) { if ($post->post_type === $this->post_type && $post->post_status !== 'publish') { $actions['mark_as_read'] = sprintf( '<a href="%s" class="aria-button-if-js" aria-label="%s">%s</a>', wp_nonce_url("edit.php?post_type={$this->post_type}&action=mark_as_read&message_id={$post->ID}", "mark_message_as_read_{$post->ID}"), esc_attr(__('Mark as read', 'cf7_to_wp')), __('Mark as read', 'cf7_to_wp') ); } return $actions; } /** * Mark form message as read */ public function maybe_mark_form_message_as_read() { if (isset($_GET['action']) && $_GET['action'] == 'mark_as_read' && isset($_GET['message_id'])) { $message_id = (int) $_GET['message_id']; if (isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], "mark_message_as_read_{$message_id}")) { $updated_post = wp_update_post( array( 'ID' => $message_id, 'post_status' => 'publish', ) ); wp_redirect(wp_get_referer()); exit(); } } } /** * Add new panel to CF7 form settings * * @param array $panels * @return array */ public function add_cf7_panel($panels) { $panels['cf7-to-wp'] = array( 'title' => __('Salva messaggi', 'cf7_to_wp'), 'callback' => array($this, 'cf7_to_wp_form_metabox'), ); return $panels; } /** * Output the content of our panel/metabox * * @param WPCF7_ContactForm $post CF7 object */ public function cf7_to_wp_form_metabox($post) { $id = $post->id(); $cf7towp = get_post_meta($id, '_cf7towp', true); $cf7towp = wp_parse_args( $cf7towp, array( 'active' => 0, 'title' => '', 'content' => '', 'category' => 0, ) );?> <p style="margin-bottom:1em; font-size:1.25em;"> <?php _e('Abilitando la casella sottostante ogni modulo inviato compilato verrà pubblicato come nuovo articolo "Pratiche" privato.', 'cf7_to_wp');?> </p> <div class="mail-field" style="margin-bottom:1em;"> <label for="cf7towp-active"> <input type="checkbox" id="cf7towp-active" name="wpcf7-cf7towp-active" value="1" <?php checked($cf7towp['active'], 1);?> /> <strong><?php echo esc_html(__('Salvare i moduli compilati come articoli "Pratiche"?', 'cf7_to_wp')); ?></strong> </label> </div> <div class="pseudo-hr"></div> <div class="mail-field"> <p class="description"> <label for="cf7towp-category"><?php echo esc_html(__('Categoria dell\'articolo', 'cf7_to_wp')); ?></label> <select id="cf7towp-category" name="wpcf7-cf7towp-category"> <?php $this->get_category_options($id)?> </select> </p> </div> <div class="mail-field"> <p class="description"> <label for="cf7towp-title"><?php echo esc_html(__('Titolo dell\'articolo', 'cf7_to_wp')); ?></label> <input type="text" id="cf7towp-title" name="wpcf7-cf7towp-title" class="large-text" value="<?php echo esc_attr($cf7towp['title']); ?>" /> </p> </div> <div class="mail-field"> <p class="description"> <label for="cf7towp-content"><?php echo esc_html(__('Contenuto dell\'articolo', 'cf7_to_wp')); ?></label> <textarea id="cf7towp-content" name="wpcf7-cf7towp-content" cols="100" rows="10" class="large-text"><?php echo esc_attr($cf7towp['content']); ?></textarea> </p> </div> <hr> <p class="description" style="margin-top:.5em;"> <span style="float:left; width:60%;"> <?php _e('Usa i classici CF7 [mail-tag] per i contenuti dinamici nel titolo e nel contenuto (li trovi sulla tab Mail).', 'cf7_to_wp');?> </span> <span style="text-align:right; float:right; width:40%;"> <?php $credits_link = '<a target="_blank" href="https://github.com/psaikali/contact-form-to-wp-posts">Fonte</a>'; printf(__('A Contact Form 7 addon by %1$s', 'cf7_to_wp'), $credits_link); ?> </span> </p> <hr> <?php } /** * Get category field data */ public function get_category_options($id) { $cf7towp = get_post_meta($id, '_cf7towp', true); $cf7towp = wp_parse_args( $cf7towp, array( 'active' => 0, 'title' => '', 'content' => '', 'category' => 0, ) ); $args = array( 'taxonomy' => 'category', 'hide_empty' => false, ); $terms = get_terms($args); foreach ($terms as $term) { $options .= '<option value="' . $term->term_id . '" ' . selected($cf7towp['category'], $term->term_id, true) . '>' . $term->name . '</option>'; } echo $options; } /** * Save metabox/tab data when CF7 form settings page is saved. * * @param WPCF7_ContactForm $contact_form */ public function save_cf7_data($contact_form) { global $user_id; $user_id = get_current_user_id(); $id = $contact_form->id(); $cf7towp = array(); $cf7towp['active'] = (!empty($_POST['wpcf7-cf7towp-active'])); if (isset($_POST['wpcf7-cf7towp-title'])) { $cf7towp['title'] = sanitize_text_field($_POST['wpcf7-cf7towp-title']); } if (isset($_POST['wpcf7-cf7towp-content'])) { $cf7towp['content'] = wp_kses_post($_POST['wpcf7-cf7towp-content']); } if (isset($_POST['wpcf7-cf7towp-category'])) { $cf7towp['category'] = wp_kses_post($_POST['wpcf7-cf7towp-category']); } update_post_meta($id, '_cf7towp', $cf7towp); } /** * Create a Messages post when form is submitted * * @param WPCF7_ContactForm $contact_form */ public function get_current_user_id() { if (class_exists('Jwt_Auth_Public')) { $jwt = new \Jwt_Auth_Public('jwt-auth', '1.1.0'); $token = $jwt->validate_token(false); if (\is_wp_error($token)) { return false; } return $token->data->user->id; } else { return false; } } public function create_post_on_form_submission($contact_form) { $form_post = $contact_form->id(); $cf7towp_data = get_post_meta($form_post, '_cf7towp', true); if ($cf7towp_data['active'] === true) { $submission = WPCF7_Submission::get_instance(); if ($submission) { $meta = array(); $meta['ip'] = $submission->get_meta('remote_ip'); $meta['ua'] = $submission->get_meta('user_agent'); $meta['url'] = $submission->get_meta('url'); $meta['date'] = date_i18n(get_option('date_format'), $submission->get_meta('timestamp')); $meta['time'] = date_i18n(get_option('time_format'), $submission->get_meta('timestamp')); } $post_title_template = $cf7towp_data['title']; $post_content_template = $cf7towp_data['content']; $post_category[] = $cf7towp_data['category']; $post_title = wpcf7_mail_replace_tags( $post_title_template, array( 'html' => true, 'exclude_blank' => true, 'has_archive' => true, ) ); $post_content = wpcf7_mail_replace_tags( $post_content_template, array( 'html' => true, 'exclude_blank' => true, 'has_archive' => true, ) ); $new_form_msg = wp_insert_post( array( 'post_type' => $this->post_type, 'post_title' => $post_title, 'post_content' => $post_content, 'post_author' => $current_user -> ID, 'post_status' => 'private', 'has_archive' => true, 'post_category' => $post_category, ) ); if ($submission) { update_post_meta($new_form_msg, 'cf7towp_meta', $meta, ); } } } /** * Main cf7_to_wp singleton instance * * Ensures only one instance of cf7_to_wp is loaded or can be loaded. * * @static * @see cf7_to_wp() * @return Main cf7_to_wp instance */ public static function instance($file = '', $version = '0.1') { if (is_null(self::$_instance)) { self::$_instance = new self($file, $version); } return self::$_instance; } /** * Cloning is forbidden. * */ public function __clone() { _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?'), $this->_version); } /** * Unserializing instances of this class is forbidden. * */ public function __wakeup() { _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?'), $this->_version); } }
-
Buongiorno,
dopo aggiornamento a WordPress 5.1.18, è presente questo messaggio: Errore fatale: la sintassi di accesso all’offset di array e stringhe con parentesi graffe non è più supportata in /home/mhd-01/www.avvocatomatricardi.it/htdocs/wp-includes/script-loader.php alla riga 706.
Come posso risolvere? Grazie mille
La pagina su cui ho bisogno di aiuto: [devi essere connesso per vedere il link]
-