Pregunta sobre PHP/MySQL CPU performance statistics de Wordpress:

Errores de PHP: se debe usar la API HTTP, no file_get_contents ()

Un usuario pregunt贸 馃憞

Probamos el plugin y descubrimos que lo est谩 utilizando. file_get_contents() funci贸n para solicitar URL.

Los siguientes errores se encienden:


/XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 654
PHP Warning:  file_get_contents(http://static.webhosting.dk/1mbfile): failed to open stream: no suitable wrapper could be found in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 654
PHP Warning:  file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 655
PHP Warning:  file_get_contents(http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js): failed to open stream: no suitable wrapper could be found in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 655
PHP Warning:  file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 658
PHP Warning:  file_get_contents(http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js): failed to open stream: no suitable wrapper could be found in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 658
PHP Warning:  file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 659
PHP Warning:  file_get_contents(http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js): failed to open stream: no suitable wrapper could be found in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 659
PHP Warning:  file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 660
PHP Warning:  file_get_contents(http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js): failed to open stream: no suitable wrapper could be found in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 660
PHP Warning:  file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 661
PHP Warning:  file_get_contents(http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js): failed to open stream: no suitable wrapper could be found in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 661
PHP Warning:  file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 662
PHP Warning:  file_get_contents(http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js): failed to open stream: no suitable wrapper could be found in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 662
PHP Warning:  file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 663
PHP Warning:  file_get_contents(http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js): failed to open stream: no suitable wrapper could be found in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 663
PHP Warning:  file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 671
PHP Warning:  file_get_contents(http://static.webhosting.dk/1mbfile): failed to open stream: no suitable wrapper could be found in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 671

Lamento ser franco, solo uso file_get_contents() recuperar URL es una mala pr谩ctica de codificaci贸n por compatibilidad y seguridad.

Seguridad:

Podr铆a poner en peligro los sitios web de los usuarios si utiliza el file_get_contents() funci贸n para recuperar URL. Esta es probablemente la peor forma de recuperar archivos / URL remotos. Para mayor seguridad, los servidores deben ser reparados allow_url_fopen y allow_url_include opciones a Off (o 0) en su php.ini configuraciones, que evitar谩n que los scripts de URL remotas recuperen o incluyan m茅todos inseguros, reduciendo as铆 el riesgo de m煤ltiples beneficios.

Adem谩s, dado que desea URL inseguras (que no sean https), esto abre sitios que usan su plugin hasta ataques Man in the Middle. SSL / TLS no solo encripta los datos, sino que tambi茅n proporciona verificaci贸n de que el sitio solicitado es leg铆timo y no un refuerzo. Siempre que un plugin o un script solicite datos de un sitio externo, debe hacerlo a trav茅s de HTTPS. Si desea darle al usuario la opci贸n de usar HTTPS o HTTP, entonces debe establecer el valor predeterminado en seguro y cambiar indefinidamente si el usuario ha hecho una elecci贸n espec铆fica, y debe proporcionar una advertencia de seguridad si se selecciona la opci贸n indeterminada.

Compatibilidad:

Como se mencion贸 anteriormente, muchos conjuntos allow_url_fopen y allow_url_include un apagado ina php.ini arreglos por razones de seguridad. Esto requiere las mejores pr谩cticas de seguridad Si conf铆a en el file_get_contents() funci贸n, su plugin no ser谩 muy compatible.

Ser铆a incluso mejor usar CURL file_get_contents(), pero llamar a CURL directamente no es una buena pr谩ctica de codificaci贸n de WordPress, por lo que no se recomienda. Los desarrolladores de plugins deben usar la API HTTP de WordPress para recuperar URL remotas, ya que proporciona un marco seguro y se ocupa de posibles problemas de compatibilidad. M谩s informaci贸n sobre la API HTTP en los documentos para desarrolladores.

Adem谩s, se grab贸 el siguiente error:


PHP Notice:  Undefined variable: headertext in /XXXXXX/wp-content/plugins/mywebtonet-performancestats/mywebtonet-performancestats.php on line 363

Si bien una variable t茅cnicamente no especificada no es un problema importante, sigue siendo una buena pr谩ctica iniciar todas las variables para evitar resultados inesperados.

Solucione estos problemas evidentes.

(@mywebtonet)

Hace 3 a帽os, 8 meses

Hola

Esto se ha solucionado hace alg煤n tiempo, todo en orden.

Rgds

(@mywebtonet)

Hace 3 a帽os, 3 meses

Hola Blackhawk

este problema se resolvi贸 hace 5 meses y a煤n no ha cambiado su calificaci贸n para este plugin, entendemos que lo ha estado viendo y el problema que inform贸 se ha corregido, 驴podemos pedirle que actualice su revisi贸n?

Rgds

(@mywebtonet)

Hace 3 a帽os, 3 meses

Hola Blackhawk

Resolver como ahora se resolvi贸.

Rgds

驴Solucion贸 tu problema??

0 / 0

Deja una respuesta 1

Tu direcci贸n de correo electr贸nico no ser谩 publicada.