kevinthom
Forum Replies Created
-
Forum: Reviews
In reply to: [Edit Image Thumbnails Separately] Thanks, but FFS…EXACTLY! This is what happens when you let engineers decide everything lol
Forum: Plugins
In reply to: [Bulk NoIndex & NoFollow Toolkit] Compatible with PHP 8.1?Yes seems to be working again. Thanks!
@plasmax Good to hear you’re not affected by the problem anymore. I used ChatGPT to fix the other error as well, but in the end, the dev quietly released a new version that seems to have fixed it altogether, which is great. Now I don’t need to use my little hack anymore!
Update: Deleting a page from the Nested Pages list of pages now causes a “Critical Error” screen, but it doesn’t seem to do any real damage. I can just reload the list and see that the page has been deleted.
@plasmax I have a potential fix here… I fed the error message and the file /app/Entities/Listing/ListingRepository.php into ChatGPT about it and asked it to resolve the incompatibility with PHP8. In approximately 5 seconds it wrote back:
The problem is happening in the
visiblePages($post_type)
function when trying tounserialize()
an array. If the user meta ‘np_visible_posts’ is not ‘1’, the code attempts to unserialize the value without confirming it’s a string.We can resolve this issue by first checking if the data returned from
get_user_meta()
is a serialized string or an array before attempting to unserialize it. Here’s how you can modify thevisiblePages($post_type)
method:/** * User's Toggled Pages */ public function visiblePages($post_type) { $meta = get_user_meta(get_current_user_id(), 'np_visible_posts', true); if ( $meta == '1' ) return []; if ( is_serialized($meta) ) { $visible = unserialize($meta); } elseif ( is_array($meta) ) { $visible = $meta; } else { $visible = []; } if ( !isset($visible[$post_type]) ) $visible[$post_type] = []; return $visible[$post_type]; }
This code first checks if the
get_user_meta()
result$meta
is ‘1’. If so, it returns an empty array. If not, it then checks if$meta
is a serialized string with theis_serialized()
function. If it is, it unserializes the string into the$visible
variable. If$meta
is already an array, it assigns it to the$visible
variable. If$meta
is neither a serialized string nor an array, it assigns an empty array to$visible
. It then checks if$visible[$post_type]
is set, if not it assigns an empty array to it, and finally returns$visible[$post_type]
.This change should fix the TypeError that’s been raised in your application.
All I had to do after that was to disable Nested Pages, comment out the original visiblePages($post_type) function in /app/Entities/Listing/ListingRepository.php and paste in the replacement, and then re-enable Nested Pages. It seems to be working again. I haven’t experienced the error again.
It’s not perfect because it doesn’t seem to remember the toggle state of my nested pages list anymore when I leave the All Pages list and come back to it, but at least it doesn’t crash.
I discovered this error too and found it was related to my OPcache plugin Docket Cache. If I disable OPcache then Nested Pages starts working again. I didn’t have this problem in PHP 7.4 but it appeared after updating to 8.1. It’s unfortunate because I want to use OPcache for the overall performance of my site, but Nested Pages makes managing the site so much easier.
WordPress version 6.2 Active theme: Theme Name (version 17.0) Current plugin: Nested Pages (version 3.2.3) PHP version 8.1.17 Error Details ============= An error of type E_ERROR was caused in line 39 of the file /path/to/site/wp-content/plugins/wp-nested-pages/app/Entities/Listing/ListingRepository.php. Error message: Uncaught TypeError: unserialize(): Argument #1 ($data) must be of type string, array given in /path/to/site/wp-content/plugins/wp-nested-pages/app/Entities/Listing/ListingRepository.php:39 Stack trace: #0 /path/to/site/wp-content/plugins/wp-nested-pages/app/Entities/Listing/ListingRepository.php(39): unserialize(Array) #1 /path/to/site/wp-content/plugins/wp-nested-pages/app/Entities/Listing/Listing.php(317): NestedPages\Entities\Listing\ListingRepository->visiblePages('page') #2 /path/to/site/wp-content/plugins/wp-nested-pages/app/Entities/Listing/Listing.php(392): NestedPages\Entities\Listing\Listing->listOpening(Array, 0) #3 /path/to/site/wp-content/plugins/wp-nested-pages/app/Entities/Listing/Listing.php(369): NestedPages\Entities\Listing\Listing->listPostLevel() #4 /path/to/site/wp-content/plugins/wp-nested-pages/app/Views/listing.php(98): NestedPages\Entities\Listing\Listing->getPosts() #5 /path/to/site/wp-content/plugins/wp-nested-pages/app/Entities/Listing/Listing.php(280): include('/home/soulartst...') #6 /path/to/site/wp-includes/class-wp-hook.php(308): NestedPages\Entities\Listing\Listing->listPosts('') #7 /path/to/site/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #8 /path/to/site/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /path/to/site/wp-admin/admin.php(259): do_action('toplevel_page_n...') #10 {main} thrown
I am new to this plugin, but I found that it will not auto-restrict child pages that already exist for that page. It will only add the restriction to new pages that are created.
Seems to have cleared itself after a day or so. Now it’s working as expected.
I’m also experiencing this issue. I rolled back to 2.7.3 and the next/previous buttons work as expected. Thanks!
Forum: Plugins
In reply to: [PW WooCommerce Bulk Edit] Change Column OrderThanks for the quick response. I have a few custom views set up, and that’s great. Looking forward to the ability to change column order.
Also, another request would be the ability to save a new version of an existing view (like “Save as…” in Windows).
I am also seeing this issue. I can go into “moderate comments” and see both comments, but only the first one will show on the list.
Thanks for your reply @renehermi. I don’t see any javascript errors on the site:
Forum: Plugins
In reply to: [Insert Html Snippet] Version 1.2.1 breaks WPYes looks like 1.2.2 fixes the problem.
Forum: Plugins
In reply to: [Insert Html Snippet] Version 1.2.1 breaks WPGlad you got it working. Definitely check out the Rollback plugin. It has made the task of troubleshooting so much easier.
Forum: Plugins
In reply to: [Insert Html Snippet] Version 1.2.1 breaks WPI just used the WP Rollback plugin that lets you easily roll back to previous versions. There is a way to manually download older versions too, but that takes some googling ??