(I’m aware have spammed these forums with my posts lately. I apologize for that. Just don’t know how else to document things, so the Author might look at these issues at some point.)
When trying various Face Recognition plugins, like My Eyes are Up Here, I get a fatal error: wp_basename(Object(WP_Error))
during attempt to do image face detection on a given singular image. The error happens because wp_basename
is unable to handle a WP_Error object that arises from some kind of incompatibility, so we’d need to tweak a bit the logic of the eval code in class.wppp_dynamic_images.php
to avoid such showstoppers. Namely:
eval ("
class WPPP_$editor extends $editor {
public function make_subsize( \$size_data ) {
if ( ! isset( \$size_data['width'] ) && ! isset( \$size_data['height'] ) ) {
return new WP_Error( 'image_subsize_create_error', __( 'Cannot resize the image. Both width and height are not set.' ) );
}
\$orig_size = \$this->size;
if ( ! isset( \$size_data['width'] ) ) {
\$size_data['width'] = null;
}
if ( ! isset( \$size_data['height'] ) ) {
\$size_data['height'] = null;
}
if ( ! isset( \$size_data['crop'] ) ) {
\$size_data['crop'] = false;
}
\$dims = image_resize_dimensions( \$this->size['width'], \$this->size['height'], \$size_data['width'], \$size_data['height'], \$size_data['crop'] );
if ( \$dims ) {
list( \$dst_x, \$dst_y, \$src_x, \$src_y, \$dst_w, \$dst_h, \$src_w, \$src_h ) = \$dims;
\$this->update_size( \$dst_w, \$dst_h );
list( \$filename, \$extension, \$mime_type ) = \$this->get_output_format( null, null );
#alx359-->
/*
Handle gracefully fatal error 'wp_basename(Object(WP_Error))' during image face detection,
happening during use of face-Recognition plugins like 'My Eyes Are Up Here' and others.
Issue tested with both: Compatible & Fast rewrite
if ( ! \$filename )
\$filename = \$this->generate_filename( null, null, \$extension );
\$metadata = array(
'file' => wp_basename( apply_filters( 'image_make_intermediate_size', \$filename ) ),
*/
\$filename = apply_filters( 'image_make_intermediate_size', \$filename );
if ( !is_string(\$filename) ) {
\$filename = \$this->generate_filename( null, null, \$extension );
}
\$metadata = array(
'file' => wp_basename( \$filename ),
#<--alx359
'width' => \$this->size['width'],
'height' => \$this->size['height'],
'mime-type' => \$mime_type,
);
\$this->size = \$orig_size;
return \$metadata;
} else {
return new WP_Error( 'image_subsize_create_error', __( 'Cannot resize the image. Both width and height are not set.' ) );
}
}
}
");
} else {
eval ("
class WPPP_$editor extends $editor {
public function multi_resize( \$sizes ) {
\$metadata = array();
/*\$orig_size = \$this->size;
foreach ( \$sizes as \$size => \$size_data ) {
if ( ! isset( \$size_data['width'] ) && ! isset( \$size_data['height'] ) ) {
continue;
}
if ( ! isset( \$size_data['width'] ) ) {
\$size_data['width'] = null;
}
if ( ! isset( \$size_data['height'] ) ) {
\$size_data['height'] = null;
}
if ( ! isset( \$size_data['crop'] ) ) {
\$size_data['crop'] = false;
}
\$dims = image_resize_dimensions( \$this->size['width'], \$this->size['height'], \$size_data['width'], \$size_data['height'], \$size_data['crop'] );
if ( \$dims ) {
list( \$dst_x, \$dst_y, \$src_x, \$src_y, \$dst_w, \$dst_h, \$src_w, \$src_h ) = \$dims;
\$this->update_size( \$dst_w, \$dst_h );
list( \$filename, \$extension, \$mime_type ) = \$this->get_output_format( null, null );
#alx359-->
/*
For the sake of consistency with the code change above
if ( ! \$filename )
\$filename = \$this->generate_filename( null, null, \$extension );
\$metadata[\$size] = array(
'file' => wp_basename( apply_filters( 'image_make_intermediate_size', \$filename ) ),
*/
\$filename = apply_filters( 'image_make_intermediate_size', \$filename );
if ( !is_string(\$filename) ) {
\$filename = \$this->generate_filename( null, null, \$extension );
}
\$metadata[\$size] = array(
'file' => wp_basename( \$filename ),
#<--alx359
'width' => \$this->size['width'],
'height' => \$this->size['height'],
'mime-type' => \$mime_type,
);
\$this->size = \$orig_size;
}
}*/
return \$metadata;
}
}
");
HTH.
]]>In our gallery, there are a number of images of people with an unpleasant tendency of getting their heads cut-off in the thumbnails. WP offers the ability of changing the crop position through an array that usually defaults to ['center', 'center']
. For cases like the aforementioned, this would require ['center', 'top']
instead, but WPPP doesn’t seem to expose ways to change the default behavior for individual thumbnails, unfortunately.
As a side note, there are quite more elaborate solutions based on face-recognition (like My Eyes Are Up Here), but WPPP isn’t compatible with any of those I’ve tested, in any of the rewrite modes (even crashes badly). Anyway, they’re resource-intensive and won’t fit well with the need for max. speed during on-the-fly thumbnail generation.
I’ve already become aware the “Fast rewrite” mode imposes many limitations, as entire parts of core have been disabled in the name of greater performance. That’s fine, but there’s still a non-detrimental way to address the need to keep all heads in place, with the addition of a new filter. Namely:class.wppp_serve_image.php
~210
foreach ( $sizes as $size => $size_data ) {
$size_data[ 'crop' ] = apply_filters('wppp_dynimg_crop_position', $size_data[ 'crop' ], $this->localfilename );
Making this filter work in SHORTINIT would imply the implementation of this another change request regarding sharpening support first.
From the filter’s end, I fixed the issue by keeping a list of those images names that needed the different positioning. (For SHORTINIT to work, the filter code has to be inside a plugin.)
I’m writing with hope the Author would implement his way to this at some point. Thanks in advance for your consideration, Bjoern.
]]>No plugins want to activate from the plugins page. The message “Plugin activated” is displayed, but nothing really happens. When WPPP is not active they activate just fine. The culprit seems with the firing of the plugin_load_first()
function. Tried various things and what finally worked for me was changing the hook from wp_loaded
to the latest possible one: wp_dashboard_setup
, according this reference. Most tests were performed with Autoptimize (de)activation.
wp-performance-pack.php
~line 271 modified like this:
add_action( 'wp_dashboard_setup', array( $this, 'plugin_load_first' ) );
The issue was happening on a Linux VPS. Interestingly, I don’t have the issue with a local copy of that same website on WAMP.
]]>When temporarily deactivating wppp all settings are lost. Specifically I care for the dynamic_images module. Skimming through the code makes apparent the issue is in a lack of differentiation between deactivation vs uninstall, which are 2 separate hooks. The fix that currently worked for me:
wp-performance-pack.php
~line 459 add:
register_deactivation_hook( __FILE__, array( $wp_performance_pack, 'deactivate' ) );
register_uninstall_hook( __FILE__, 'uninstall' ); // added
wp-performance-pack.php
~line 364 comment out the block of code below in deactivate()
:
public function deactivate() {
if ( $this->options['dynamic_images'] ) {
// Delete rewrite rules from htaccess
WPPP_Dynamic_Images::static_disable_rewrite_rules();
}
/*
if ( is_multisite() && isset( $_GET['networkwide'] ) && 1 == $_GET['networkwide'] ) {
delete_site_option( self::wppp_options_name );
} else {
delete_option( self::wppp_options_name );
}
delete_option( 'wppp_dynimg_sizes' );
delete_option( 'wppp_version' );
*/
// restore static links
WPPP_CDN_Support::restore_static_links();
}
performance-pack.php
~line 378 move the commented out code above to a new function uninstall()
:
#alx359-->
public function uninstall() {
if ( is_multisite() && isset( $_GET['networkwide'] ) && 1 == $_GET['networkwide'] ) {
delete_site_option( self::wppp_options_name );
} else {
delete_option( self::wppp_options_name );
}
delete_option( 'wppp_dynimg_sizes' );
delete_option( 'wppp_version' );
}
#<--alx359
(This of course is just an example that seems to suit me atm. Bjoern would have to implement a throughout fix.)
]]>Everything is setup and working smoothly so far with dynamic_images, but there’s one last thing I’d like to improve, before putting it on a live site.
Fast Rewrite (FR) feels sensibly faster than Compatible Rewrite, but produces blurrier images. FR doesn’t seem to fire other hooks, like image_make_intermediate_size
. Have modded a tiny plugin that improves sharpening dramatically for our kind of usage, but it doesn’t work in FR as it’s attached to the aforementioned hook. Would you consider integrating some sharpening abilities to wppp, or perhaps better, enable a (limited) set of filters so one could hook into them? I looked into this but couldn’t figure it out. Thanks!
I’m getting hit by a 404 Unknown image size
that doesn’t render some thumbnails at all. As it happens in the frontpage, this is becoming a showstopper if not addressed.
Skimming through the code, the culprit seems to start at line 202 of class.wppp_serve_image.php
that says:
WPPP only serves “known” image sizes to prevent filling up server space
I’m not sure why not serving an alternate image, even if not optimal, isn’t a more sensible approach than not serving anything at all.
Anyway, as adding a filter there isn’t firing for me, a slight code change about line 207 would do:
// always check, even if size is in meta data, as the size could have changed since it was saved to meta data
$new_size = image_resize_dimensions( $imgsize[ 'width' ], $imgsize[ 'height' ], $size_data[ 'width' ], $size_data[ 'height' ], //-->
$the_size = $size;
$crop = $size_data[ 'crop' ]; // needed later if not 404//<--
// added '$new_size &&' check, as image_resize_dimensions() may also return false
if ( $new_size && ( abs( $new_size[ 4 ] - $this->width ) <= 1 ) && ( abs( $new_size[ 5 ] - $this->height ) <= 1 ) ) {
Indeed, some more thumbnails get generated with that tweak (97 instead of 94 in the frontpage), but at least said frontpage renders correctly.
Thanks for your consideration.
]]>I got a lot of these warnings in debug.log
PHP Warning: Trying to access array offset on value of type bool in \wp-content\plugins\wp-performance-pack\modules\dynamic_images\class.wppp_serve_image.php on line 211
In line 207 of said page, function image_resize_dimensions
can return false instead of array, so an extra check for $new_size
is required next line:
if ( $new_size && ( abs( $new_size[ 4 ] - $this->width ) <= 1 ) && ( abs( $new_size[ 5 ] - $this->height ) <= 1 ) ) {
Hello,
Thank you for your latest version! I’m glad you’re back. ??
Regarding the exit404 function, my previous suggestion wasn’t more than a thought. As a matter of fact, just as it is, almost nothing is loaded and this doesn’t work.
So I suggest something else -that I actually use- that would be to modify this function as follow (even if this could have a frontend to activate or select 404 behavior…):
function exit404( $message ) {
header( 'Cache-Control:?no-cache,?must-revalidate' ); // HTTP/1.1
header( 'Expires:?Sat,?26?Jul?1997?05:00:00?GMT' ); // past date
if ( WP_DEBUG ) {
header( $_SERVER[ 'SERVER_PROTOCOL' ] . ' 404 Not Found' );
echo $message;
} else {
header ('HTTP/1.1 301 Moved Permanently');
header ("Location: /404"); // Or any page that doesn't exist...
}
exit();
}
Redirecting offers an easy way to get the WordPress 404 page.
HTTP redirection code could be either 301 or 302, as selected by the webmaster (302 could help if the error was not meant to be…).
What do you think about it?
]]>Hello,
I had a problem that I solved my way (read here). But it wasn’t the good solution.
To me, at least, I found that in fact I had problem with sizes in general as I also got “Unknown image size” error with some “resized” images asked that were in fact of a template size BIGGER than the original.
So I finally modified fuction filter_wp_get_attachment_metadata
in /wp-performance-pack/trunk/modules/dynamic_images/class.wppp_dynamic_images.php as follow:
function filter_wp_get_attachment_metadata( $data ) {
if ( !isset( $data[ 'file' ] ) )
return $data;
$ext = strtolower( pathinfo( $data[ 'file' ], PATHINFO_EXTENSION ) );
if ( ( $ext === 'jpg' ) || ( $ext === 'jpeg' ) || ( $ext === 'gif' ) || ( $ext === 'png' ) ) { // MR - Added "jpeg" extension as it is found in all regexp inside plugin
$name = wp_basename( $data[ 'file' ], ".$ext" );
$sizes = get_option( 'wppp_dynimg_sizes' );
foreach ( $sizes as $size => $sizeinfo ) {
if ( !isset( $data[ 'sizes' ][ $size ] ) ) {
// MR - Following check should be done inside image_resize_dimensions, but it is not. Don't know why...
// Maybe because of the early applied filter 'image_resize_dimensions' inside the core function? No arm done double-checking!
if ( ($sizeinfo[ 'width' ] > $data[ 'width' ]) || ($sizeinfo[ 'height' ] > $data[ 'width' ]) ) continue;
if ( isset( $sizeinfo[ 'crop' ] ) )
$newsize = image_resize_dimensions( $data[ 'width' ], $data[ 'height' ], $sizeinfo['width'], $sizeinfo['height'], $sizeinfo['crop'] );
else
$newsize = image_resize_dimensions( $data[ 'width' ], $data[ 'height' ], $sizeinfo['width'], $sizeinfo['height'], false );
if ( $newsize !== false ) {
$data[ 'sizes' ][ $size ] = array (
'width' => $newsize[ 4 ],
'height' => $newsize[ 5 ],
'file' => $name . '-' . $newsize[ 4 ] . 'x' . $newsize[ 5 ] . '.' . $ext,
);
}
}
}
}
return $data;
}
Maybe my problem is related to some other plugin (as always suspected). But now, as I’ve checked image_resize_dimensions returns (and read its code too), I now this was my problem and I’ve solved it without really “changing” the plugin’s behavior for other users.
Hope it helps
]]>Hello,
I just noticed that the medium_large WordPress size seems not be registered globally. It seems this size is generated automatically when needed.
As a result, it can be found in the attachement’s sizes array, but WPPP do not recognize this size (it’s not set in its specific option containing WPPP known sizes).
So I had to modify function serve_image so that in the try statement, if WPPP do not find a valide size, a secpnd chance it taken as follow:
// 2ND CHANCE START - Try to get attachement's specific sizes
if ( $the_size === '' ) {
$size_pattern = '/-[0-9]+x[0-9]+\.(jpe?g|png|gif)/';
$repl_pattern = '.$1';
$request_uri = $_SERVER['HTTPS'] ? 'https://' : 'https://';
$request_uri .= $_SERVER['SERVER_NAME'];
$request_uri .= preg_replace ($size_pattern, $repl_pattern, $request);
$postid = attachment_url_to_postid($request_uri);
if ( $postid > 0 ) {
$meta_d = wp_get_attachment_metadata($postid);
$sizes = $meta_d['sizes'];
foreach ( $sizes as $size => $size_data ) {
// always check, even if size is in meta data, as the size could have changed since it was saved to meta data
$new_size = image_resize_dimensions( $imgsize[ 'width' ], $imgsize[ 'height' ], $size_data[ 'width' ], $size_data[ 'height' ], $size_data[ 'crop' ] );
if ( ( abs( $new_size[ 4 ] - $this->width ) <= 1 ) && ( abs( $new_size[ 5 ] - $this->height ) <= 1 ) ) {
// allow size to vary by one pixel to catch rounding differences in size calculation
$the_size = $size;
$crop = $size_data[ 'crop' ];
break;
}
}
}
}
// 2ND CHANCE END
I know it may not be the proper solution, but this kludge manages the 768x… medium_large size some images have.
I’m sure you’ll find a better way to do that.
Just to share and help your plugin improve. ??
Thank you
]]>Hello,
I am using your localization optimization and I am currently translating a plugin.
But some parts of it weren’t translated as they should be in pop-ups in the back end. At first I blamed this plugin…
In fact, it turns out that the not translated strings are multi-line ones, and that they are not translated only when WPPP’s Use gettext
or Use alternative MO reader
option is enabled.
With those localization optimizations disabled, wordpress translation mechanism works with those multi-line strings.
A sample of such multi-line strings should:
sprintf(__( 'Here is a dynamic multi-line test string with replacement as="%s"
Could you find why it is not translated
by [gettext] nor [mo-dynamic]?
I sincerely hope. Thx!' , 'my-test-plugin-text-domain' ),
$this) );
Of course, I delete WPPP’s localization cache dir after enabling each option before testing and reporting this, just to be sure everything was in sync.
Hope it helps.
]]>For dynamic images management, your exit404 function is great for debugging, but maybe you should modify your function to:
function exit404( $message ) {
global $wp_query;
$wp_query->set_404();
status_header(404);
}
This way, you’ll redirect to the site global 404 management system and page.
As a webmaster, I think it’s way better for the website and the brand image than a one line “debug” error…
Or maybe could you propose a debug mode to switch between both behaviors?
Not meaning to be rude at all, just wanting to participate improving your great plugin by sharing my needs and ideas.
Currently, for dynamic images handling, the Rewrite conditions and rules are the following:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} /wp-content/uploads(.*)$
RewriteCond %{DOCUMENT_ROOT}/wp-content/wppp/images/%1 -f
RewriteRule .* /wp-content/wppp/images/%1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)-([0-9]+)x([0-9]+)?\.((?i)jpeg|jpg|png|gif) /wp-content/plugins/wp-performance-pack/modules/dynamic_images/serve-dynamic-images.php [QSA,L]
Meaning:
But with such rules, you match and call /wp-content/plugins/wp-performance-pack/modules/dynamic_images/serve-dynamic-images.php, potentially encountering errors for bad calls…
For instance:
This way I could try: wp-content//uploads/test/fakeimg-1x.gifdie() or wp-content//uploads/test/fakeimg-1x.gifphpinfo() and get the image…
On other tries (such as (-1x.jpg.pdf) I got the plugin error message.
So I suggest ot secure a little more those rules like that:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} /wp-content/uploads(.*)\.((?i)jpeg|jpg|png|gif)$
RewriteCond %{DOCUMENT_ROOT}/wp-content/wppp/images/%1.%2 -f
RewriteRule .* /wp-content/wppp/images/%1.%2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)-([0-9]+x[0-9]+)\.((?i)jpeg|jpg|png|gif)$ /wp-content/plugins/wp-performance-pack/modules/dynamic_images/serve-dynamic-images.php [QSA,L]
This way, on line 2 we check only for files with the jpeg, jpg, png or gif CASE INSENSITIVE extension. Not interfering with other plugins (such as webp ones…).
On line 6, we now avoid :
On most test cases, I now get the system 404 page. Better as it dosn’t concern WPPP.
Finally, I’m not aware about any [0-9]x[0-9]
only generated thumbnails, so maybe regex on line 6 could be:
^(.+)-([0-9]{2,}x[0-9]{2,})\.((?i)jpeg|jpg|png|gif)$
but let’s keep it as is for now, there could be specific usages (FB or other tracking pixel?).
So, are you interested in changing that this way?
]]>While trying your plugin, with DEBUG ON (PHP 7.4), I get, when deactivating it whereas image module was loaded with Fast rewrite:
PHP Deprecated: Non-static method WPPP_Dynamic_Images::flush_rewrite_rules() should not be called statically in /my_wordpress/wp-content/plugins/wp-performance-pack/wp-performance-pack.php [...]
As you can read, it’s because of:
public function deactivate() {
if ( $this->options['dynamic_images'] ) {
// Delete rewrite rules from htaccess
WPPP_Dynamic_Images::flush_rewrite_rules( false );
}
My workaround was to add the following static function inside class.wppp_dynamic_images.php
:
public static function static_flush_rewrite_rules() {
// init is called prior to options update
// so add or remove rules before flushing
global $wp_rewrite;
if ( $wp_rewrite && isset( $wp_rewrite->non_wp_rules['(.*)-([0-9]+)x([0-9]+)?c?\.((?i)jpeg|jpg|png|gif)'] ) ) {
unset( $wp_rewrite->non_wp_rules['(.*)-([0-9]+)x([0-9]+)?c?\.((?i)jpeg|jpg|png|gif)'] );
}
flush_rewrite_rules();
}
And modify accordingly wp-performance-pack.php
by switching to it:
public function deactivate() {
if ( $this->options['dynamic_images'] ) {
// Delete rewrite rules from htaccess
WPPP_Dynamic_Images::static_flush_rewrite_rules();
}
Just to share with you.
Great plugin by the way ??
]]>Hi
When uploading images featured in wordpress 5.5 they are blank
Thanks for support
]]>Hello, thanks for the plugin
I am try for image resizing, but doesn’t seem to be working
When I am testing with gtmetrix.com show a lot of images with an inappropriate escalation
Thanks for support
]]>I want to enable to use getext but have the error message “Gettext test failed. Activate WPPP debugging for additional info.”
When checking WPPP debugging it shows;
OS Linux 6D18DE3 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64
PHP gettext extension is Available
WordPress locale en_GB
LC_MESSAGES defined? Yes
System locales (LC_MESSAGES) C
Putenv available? Yes
Locale writeable? (en_GB) No
Directory /xxxxx/wordpress/wp-content/wppp/localize/en_GB/LC_MESSAGES Exists
Is the issue because locale is not writable and if so what is the fix please?
I am using PHP-FPM if that makes any difference.
Thanks
]]>Do this plugin is capable of doing image resizing, depending on screen-resolution of the browsing device? Thanks.
]]>Undefined index: dyn_links in wp-performance-pack/wp-performance-pack.php
Installed it clean and loaded it as a must use plugin. Then it gave this notice.
Saved the settings and it was gone.
If you have a public Github repo, I gladdly send a PR to add a “array key exists” to the check.
]]>Hi, i have two sites… one test and one live (www..)
Dynamic image resizing/generating is functioning on the test-site (https://test.johannaengelina.nl/de-historie-van-dit-charterschip-en-zeilklipper-2/)
but not on the live-site.
I copied all the settings and plug-ins from the test-site… The only difference is that the www-site is running with SSL (through a plug-in called Really Simple SSL)
When i look in the error-log, i find erros for all the images that need to be generated (because missing) Ofcourse the originals exist! One of the errors (all are similar) is:
[Sat Apr 11 00:41:03.454035 2020] [proxy_fcgi:error] [pid 107905:tid 139734873532160] [client 92.108.202.79:34062] AH01071: Got error ‘PHP message: PHP Warning: filemtime(): stat failed for /home/johannaengelina.nl/public_html/wordpress/wp-content/uploads/wordpress/Historisch/danaadrianarev.jpg in /home/johannaengelina.nl/public_html/wordpress/wp-content/plugins/wp-performance-pack/modules/dynamic_images/class.wppp_serve_image.php on line 71\n’, referer: https://www.johannaengelina.nl/de-historie-van-dit-charterschip-en-zeilklipper-2/
What can be wrond? I tried to debug the plug-in, but get errors when i change anything in class.wppp_serve_image.php
Thanks in advance, DJ
]]>
wp-performance-pack/modules/l10n_improvements/class.wppp_mo_dynamic.php
Line 562
Fixes notice for undefined nplurals
if ( $t !== false ) {
$ts = isset($this->_nplurals) ? explode( self::PLURAL_SEP, $t, $this->_nplurals ) : null;
$i = $this->gettext_select_plural_form( $count );
if ( $ts && isset( $ts[ $i ] ) ) {
return $ts[ $i ];
} else {
return $default;
}
} else {
$this->translations[$s] = $singular . self::PLURAL_SEP . $plural;
$this->modified = true;
return $default;
}
]]>
class.wppp_mo_dynamic.php
line 347
if(!$moitem) { // handle null items
continue;
}
line 404
$orig_idx = isset($moitem->hash_table[$idx]) ? $moitem->hash_table[$idx] : 0; // this
while ( $orig_idx != 0 ) {
$orig_idx--; // index adjustment
]]>
When only activating Localization and visiting the tab I get a 502 Bad Gateway error:
https://xyz.local/wp-admin/options-general.php?page=wppp_options_page&tab=l10n_improvements
Other tabs do work.
WPPP: v2.2.5
WP: 5.3.2
PHP 7.2 – NGinx
Local development enviroment: Local Lightning: 5.2.4
Hope you have enough information, if you need more, please let me know.
Ciao Jaime!
]]>Hello, I just installed your module to see if it does what I need and I noticed this notice in the log/debug bar:
NOTICE : wp-content\plugins\wp-performance-pack\modules\l10n_improvements\class.wppp_mo_dynamic.php:515 – substr() expects parameter 2 to be int, string given
require_once(‘wp-admin/admin.php’), require_once(‘wp-admin/admin-header.php’), do_action(‘in_admin_header’), WP_Hook->do_action, WP_Hook->apply_filters, wp_admin_bar_render, do_action_ref_array(‘admin_bar_menu’), WP_Hook->do_action, WP_Hook->apply_filters, wp_admin_bar_updates_menu, wp_get_update_data, _n, apply_filters(‘ngettext’), WP_Hook->apply_filters, WPML\ST\MO\Plural->handle_plural, __, translate, WPPP_MO_dynamic_Debug->translate, WPPP_MO_dynamic->translate, substr
I guess that solving it is as simple as replacing self::PLURAL_SEP with 0 on the given line.
]]>In the current implementation this plugin doesn’t save previews created out of scaled (edited inside wordpress) images. It creates them though. It just doesn’t save them which is interesting.
Example on my server: img1.jpg -> img1-600×338.jpg – works
Example2 on my server: img1.jpg + img1-scaled.jpg -> img1-600×338.jpg – doesn’t work / no file created
Why i noticed this: I always recieved two images of my previews a tad bit late. These were generated on demand, but i could not find them acessing my ftp server.
How i temporarily fixed this: I downloaded the images in question via the link, uploaded them via ftp in the corresponding folder und voila, they get served fast again.
(This is all before working with webp express which i disabled for this test)
Thank you!
wimsjohn
Hi Bjoern,
I’m fighting with PHP7.2-FPM (under Apache, but I presume it’ll be the same under Nginx) and I’m getting an error related to your plugin.
Most probably this happens because PHP7.2-FPM is not loaded as Apache module.
Check this https://stackoverflow.com/questions/2916232/call-to-undefined-function-apache-request-headers
Error below:
AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to undefined function apache_request_headers() in /PATH/TO/SITE/FOLDER/wp-content/plugins/wp-performance-pack/modules/dynamic_images/class.wppp_serve_image.php:216\nStack trace:\n#0 /PATH/TO/SITE/FOLDER/wp-content/plugins/wp-performance-pack/modules/dynamic_images/class.wppp_serve_image.php(332): WPPP_Serve_Image->check_cache_headers()\n#1 /PATH/TO/SITE/FOLDER/wp-content/plugins/wp-performance-pack/modules/dynamic_images/serve-dynamic-images.php(101): WPPP_Serve_Image->serve_image()\n#2 {main}\n thrown in /PATH/TO/SITE/FOLDER/wp-content/plugins/wp-performance-pack/modules/dynamic_images/class.wppp_serve_image.php on line 216\nPHP message: PHP Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in /PATH/TO/SITE/FOLDER/wp-includes/formatting.php:4316\nStack trace:\n#0 /PATH/TO/SITE/FOLDER/wp-includes/class-wp-fatal-error-handler.php(190): esc_url(‘https://wordpre…’)\n#1 /PATH/TO/SITE/FOLDER/wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false)\n#2 /PATH/TO/SITE/FOLDER/wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false)\n#3 [internal function]: WP_Fatal_Error_Handler->handle()\n#4 {main}\n thrown in /PATH/TO/SITE/FOLDER/wp-includes/formatting.php on line 4316\n’, referer: https://MYSITE.URL/CATEGOERY/POST
]]>Hi Bjoern,
just to let you know that your last update doesn’t clean entries when plugin disabled without prior disabling image options.
Still kudos because it puts entries in .htaccess in a correct way (like many don’t).
Best,
– Luca
]]>Hi,
We have used WP Performance Pack Plugin but it’s not generating the thumbnail. We have followed the given screenshot for the settings. but we need to know more about any other option to enable.
Thanks.
]]>I just found this plugin and it is amazing! Sadly it broke compatibility to Webp Express. Maybe you can do sth about this?
Thanks
wimsjohn
I’m on Ubuntu 18 with Apache 2.4.29 and PHP 7.2.24 (proxy__fcgi) with both GD and imagick installed but when I try to regenerate thumbs it says “No editor could be selected”.
I’ve already enabled the rt integration via the config panel and tried all possible solutions but still it doesn’t work-
Help, please?