Update causes bad website format problem
-
The new update is causing a major problem. For some reason, on a desktop, all the pages look like they’re formatted for a phone. When the plugin is deactivated, the pages look normal again. Also, images are not showing.
- This topic was modified 5 months, 1 week ago by jamminjames.
-
Hi @rweigmann ,
can you provide some more details? The version of your WordPress? And the whole error message (Please mask all path information above the WordPress directory).Thanks and kind regards,
RalfHey Ralf,
I get the error only for three of my WordPress instances (all 6.5.4. / PHP 8.1.28). All other PHP 8.1/8.2 instances are OK. Settings for CryptX are “standard”. Cache plugin is disabled. It’s not a theme based problem because in TwentyTwentyFour the error still occurs.
PHP message: PHP Fatal error: Uncaught TypeError: CryptX\CryptX::findEmailAddressesInContent(): Argument #1 ($content) must be of type string, null given, called in /xxx.xxx/httpdocs/wp-includes/class-wp-hook.php on line 324 and defined in /xxx.xxx/httpdocs/wp-content/plugins/cryptx/classes/CryptX.php:442\nStack trace:\n#0 /xxx.xxx/httpdocs/wp-includes/class-wp-hook.php(324): CryptX\CryptX->findEmailAddressesInContent()\n#1 /xxx.xxx/httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters()\n#2 /xxx.xxx/httpdocs/wp-includes/formatting.php(3992): apply_filters()\n#3 /xxx.xxx/httpdocs/wp-includes/class-wp-hook.php(324): wp_trim_excerpt()\n#4 /xxx.xxx/httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters()\n#5 /xxx.xxx/httpdocs/wp-includes/post-templat…’
Regards
RalphHi.
Should be fixed in version 3.4.4.
I’m still getting the same behavior after updating to 3.4.4. Flushed website and browser caches.
- This reply was modified 5 months, 1 week ago by jamminjames.
Same weird formatting on a desktop.
- This reply was modified 5 months, 1 week ago by jamminjames.
Sorry, my bad. We had a child function that used the following code, which used to work, to disguise an email address in the footer:
echo (function_exists('encryptx'))? encryptx($content, $args) : $content;
It stopped working, causing a fatal error. The
encryptx
function previously accepted an array for the second value, but now wants a string.Once I removed that code, everything was fine.
Same here. But the $args thing is a function that the plugin should provide… See:
<?php $content = "[email protected]"; // with this values the link text will be replaced by 'example', otherwise set $args = array(); $args = array( 'alt_linktext' => 'example', 'opt_linktext' => 1 ); echo (function_exists('encryptx'))? encryptx($content, $args) : $content; ?>
We need the fix that includes the $args, i can’t change dozens of website because of that…
True, that should not have been changed, it affects what people have previously set up, like on our site.
- This reply was modified 5 months, 1 week ago by jamminjames.
- This reply was modified 5 months, 1 week ago by jamminjames.
You are of course right and it was a mistake on my part. I will correct the function as soon as possible so that the old behavior and calling works again. I can only apologize.
The “encryptx” template function has been revised so that it accepts arguments again, as in previous versions.
When used in the template using the “encryptx” function, it is now possible to use square brackets for the values. For example: $args = array( ‘alt_linktext’ => ‘[ click here ]’, ‘opt_linktext’ => 1 );
When calling the shortcode directly with arguments containing square brackets in the values, this is not possible due to limitations of WordPress itself and can lead to unpredictable errors.
I hope I was able to restore functionality with version 3.4.5 and that I have not introduced any new problems.
I am looking forward to your feedback ??.
Kind regards
RalfHi Ralf,
the error still occurs (Theme Twenty Twenty-Four, latest version; but only in combination with Yoast SEO):
PHP message: PHP Fatal error: Uncaught TypeError: CryptX\CryptX::replaceEmailInContent(): Argument #1 ($content) must be of type string, null given, called in /xxx.xxx/httpdocs/wp-includes/class-wp-hook.php on line 324 and defined in /xxx.xxx/httpdocs/wp-content/plugins/cryptx/classes/CryptX.php:288\nStack trace:\n#0 /xxx.xxx/httpdocs/wp-includes/class-wp-hook.php(324): CryptX\CryptX->replaceEmailInContent()\n#1 /xxx.xxx/httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters()\n#2 /xxx.xxx/httpdocs/wp-includes/formatting.php(3992): apply_filters()\n#3 /xxx.xxx/httpdocs/wp-includes/class-wp-hook.php(324): wp_trim_excerpt()\n#4 /xxx.xxx/httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters()\n#5 /xxx.xxx/httpdocs/wp-includes/post-template.php(434): …’
Regards,
RalphCan you tell me how you use CryptX here? In the template with the encryptx function, as a shortcode in the Gutenberg editor or just a “normal” email address somewhere in the text? I’m trying to recreate it right now.
As for us, we use it two ways, on the backend, checking the box for a particular page or post, and in the instance that is causing the problems, inserted into the footer via:
<?php echo(function_exists('encryptx'))? encryptx($content, $args) : $content; ?>
… with the $args array like so:
$args = array( 'alt_linktext' => 'office [at] website [dot] net', 'opt_linktext' => 1 );
It is working again, thanks!
- This reply was modified 5 months, 1 week ago by jamminjames.
critical error again. WTF? Do you test it before you do release an update? That’s really not serious working for a plugin who is installed on 10k+ websites!
An error of type E_ERROR was caused in line 44 of the file /wp-content/plugins/cryptx/cryptx.php. Error message: Uncaught ArgumentCountError: Too few arguments to function encryptx(), 1 passed in /wp-content/themes/brisa/footer.php on line 14 and exactly 2 expected in /wp-content/plugins/cryptx/cryptx.php:44
Had to do changes on most of the websites to get it back working with the last version. Now, most of my clients websites are offline, because of your fault. Fix that, or i will talk with my lawyer!
It do not work with and without the $args… Really anoying… If there will not fix by update today (sunday), will to have to remove your plugin from all of my projects, give you a one star rating, tell my customers to do the same and i’m still thinking about charging you for the effort i will have…
i understand that this is a “hobby project” and free of charge, but with so many installations and years of operation, there is also a responsibility on your part to ensure that this does not happen.
- The topic ‘Update causes bad website format problem’ is closed to new replies.