wordpress-activitypub icon indicating copy to clipboard operation
wordpress-activitypub copied to clipboard

Erforderliche Klasse nicht gefunden oder lesbar: Activitypub\Model\Post

Open nesges opened this issue 1 year ago • 47 comments

Quick summary

After Updating to Version 2.0 the Browser only shows this error message. I did a fresh install (rm -r wp-content/plugins/activitypub/) but the error stays the same

image

Steps to reproduce

  1. Update to Version 2.0
  2. Visit Website

What you expected to happen

Not breaking the website

What actually happened

Broke website

Impact

All

Available workarounds?

No and the platform is unusable

Logs or notes

No response

nesges avatar Jan 09 '24 10:01 nesges

Can you send me a list of plugins you use besides the ActivityPub plugin?

The model class was removed in 2.0.0 but it is no longer in use since month, so it might be a third party plugin using it?!?

pfefferle avatar Jan 09 '24 11:01 pfefferle

Sure! Istalled but inactive is marked with brackets

root@gond:/var/www/html/d3/dnddeutsch.de/wordpress/wp-content/plugins# ls -la
total 296
drwxr-xr-x 72 www-data www-data 4096 Jan  9 11:31 .
drwxr-xr-x 14 www-data www-data 4096 Jan  9 12:27 ..
drwxr-xr-x  6 www-data www-data 4096 Sep 12 21:20 acf-better-search
drwxr-xr-x  5 www-data www-data 4096 Dec  8  2022 addquicktag
drwxr-xr-x  6 www-data www-data 4096 Nov 29 21:05 advanced-custom-fields
drwxr-xr-x  4 www-data www-data 4096 Sep 18 22:24 akismet
drwxr-xr-x  9 www-data www-data 4096 Dec  8  2022 amazon-polly
drwxr-xr-x  3 www-data www-data 4096 Dec  8  2022 amr-shortcode-any-widget
drwxr-xr-x  6 www-data www-data 4096 Jul  4  2023 audioigniter
( drwxr-xr-x  5 www-data www-data 4096 Jul  4  2023 autopost-to-mastodon )
( drwxr-xr-x  4 www-data www-data 4096 Nov 14 10:38 autoptimize )
drwxr-xr-x  6 www-data www-data 4096 Nov 14 10:38 blog2social
drwxr-xr-x  5 www-data www-data 4096 Jul  4  2023 cf7-database
drwxr-xr-x  3 www-data www-data 4096 Jul  4  2023 classic-editor
drwxr-xr-x  2 www-data www-data 4096 Dec  8  2022 classic-widgets
drwxr-xr-x  7 www-data www-data 4096 Dec  8  2022 cmb2
drwxr-xr-x  6 www-data www-data 4096 Sep 12 21:20 conditional-menus
drwxr-xr-x  7 www-data www-data 4096 Dec 19 14:42 contact-form-7
drwxr-xr-x  7 www-data www-data 4096 Nov  9 10:52 custom-post-type-ui
drwxr-xr-x  3 www-data www-data 4096 Nov  1 21:43 d3
drwxr-xr-x  6 www-data www-data 4096 Dec  8  2022 d3-chirp
drwxr-xr-x  4 www-data www-data 4096 Dec  8  2022 d3-drivel
drwxr-xr-x  2 www-data www-data 4096 Dec  8  2022 d3-external-ressources
drwxr-xr-x  8 www-data www-data 4096 Jul  7  2023 d3-mastodon-widget
drwxr-xr-x  2 www-data www-data 4096 Dec  8  2022 d3-patreon
drwxr-xr-x  6 www-data www-data 4096 Jul  4  2023 d3-planet
drwxr-xr-x  2 www-data www-data 4096 Nov  1 21:43 d3-shortcodes
drwxr-xr-x  2 www-data www-data 4096 Dec  8  2022 d3-sources
drwxr-xr-x  6 www-data www-data 4096 Dec  5 15:40 d3-top-news-widget
drwxr-xr-x  4 www-data www-data 4096 Mar 25  2023 d3-village
drwxr-xr-x  2 www-data www-data 4096 Jul 23 10:31 d3-widgets
drwxr-xr-x  5 www-data www-data 4096 Dec  8  2022 double-opt-in-for-cf7
drwxr-xr-x 10 www-data www-data 4096 Dec 12 09:10 easy-digital-downloads
drwxr-xr-x  5 www-data www-data 4096 Dec  8  2022 edd-auto-register
drwxr-xr-x 10 www-data www-data 4096 Dec 15 10:21 enable-media-replace
drwxr-xr-x  5 www-data www-data 4096 Jul  4  2023 flamingo
drwxr-xr-x  5 www-data www-data 4096 Dec  8  2022 gdpr-data-request-form
drwxr-xr-x  4 www-data www-data 4096 Jan  9 11:28 google-sitemap-generator
-rw-r--r--  1 www-data www-data 1285 Dec  8  2022 .htaccess
-rw-r--r--  1 www-data www-data   28 Dec  8  2022 index.php
drwxr-xr-x  7 www-data www-data 4096 Jan  3 11:50 iwp-client
drwxr-xr-x  5 www-data www-data 4096 Jan  9 11:28 list-category-posts
( drwxr-xr-x  2 www-data www-data 4096 Jul  4  2023 mathilda )
drwxr-xr-x  5 www-data www-data 4096 Nov 14 10:38 media-sync
( drwxr-xr-x  5 www-data www-data 4096 Nov 29 21:05 patreon-connect )
drwxr-xr-x  6 www-data www-data 4096 Oct 12 10:35 plugin-organizer
( drwxr-xr-x 10 www-data www-data 4096 Dec 21 23:13 podlove-web-player )
drwxr-xr-x  3 www-data www-data 4096 Dec  8  2022 public-post-preview
drwxr-xr-x  9 www-data www-data 4096 Jan  5 09:38 publishpress
( drwxr-xr-x 10 www-data www-data 4096 Nov 13 09:28 query-monitor )
( drwxr-xr-x 11 www-data www-data 4096 Jan  5 13:55 redirection )
drwxr-xr-x  3 www-data www-data 4096 Dec 11 09:32 restrict-categories
drwxr-xr-x  3 www-data www-data 4096 Dec  8  2022 reusable-text-blocks
drwxr-xr-x  7 www-data www-data 4096 Dec 16 22:38 schema-and-structured-data-for-wp
drwxr-xr-x  7 www-data www-data 4096 Mar 25  2023 simple-image-sizes
drwxr-xr-x  8 www-data www-data 4096 Dec  8  2022 simple-lightbox
drwxr-xr-x  7 www-data www-data 4096 Dec  8  2022 simple-links
drwxr-xr-x  4 www-data www-data 4096 Dec 13 22:13 simple-local-avatars
drwxr-xr-x  2 www-data www-data 4096 Dec  8  2022 tag-pages
drwxr-xr-x  3 www-data www-data 4096 Mar 25  2023 ultimate-category-excluder
drwxr-xr-x  7 www-data www-data 4096 Oct 24 23:46 user-role-editor
drwxr-xr-x  6 www-data www-data 4096 Mar 25  2023 view-admin-as
drwxr-xr-x  4 www-data www-data 4096 Nov 13 09:28 webfinger
drwxr-xr-x  7 www-data www-data 4096 Jan  3 11:50 webmention
drwxr-xr-x 11 www-data www-data 4096 Oct 22 15:31 webp-express
drwxr-xr-x  6 www-data www-data 4096 Aug 27 16:48 widget-options
drwxr-xr-x  6 www-data www-data 4096 Nov 29 21:05 wonderm00ns-simple-facebook-open-graph-tags
drwxr-xr-x  5 www-data www-data 4096 Jan  3 11:50 wp-dashboard-notes
drwxr-xr-x  3 www-data www-data 4096 Dec  8  2022 wp-discord-post
drwxr-xr-x  7 www-data www-data 4096 Dec 21 23:13 wp-smushit
drwxr-xr-x  6 www-data www-data 4096 Jan  3 11:50 wp-statistics
drwxr-xr-x 12 www-data www-data 4096 Nov  8 20:08 wp-super-cache
drwxr-xr-x  4 www-data www-data 4096 Jul  4  2023 wp-sweep
drwxr-xr-x 11 www-data www-data 4096 Mar 25  2023 wp-vgwort

nesges avatar Jan 09 '24 11:01 nesges

The model class was removed in 2.0.0 but it is no longer in use since month, so it might be a third party plugin using it?!?

root@gond:/var/www/html/d3/dnddeutsch.de/wordpress/wp-content/plugins# grep -irl 'ActivityPub' .
./webmention/includes/class-receiver.php
./autopost-to-mastodon/instanceList.php
./webfinger/readme.txt
root@gond:/var/www/html/d3/dnddeutsch.de/wordpress/wp-content/plugins# grep -ir 'ActivityPub' ./webmention/includes/class-receiver.php
                        // This would catch incoming activitypub matches, which uses source_url

autopost-to-mastodon is inactive and webmention, well you know it better than me, I guess ;-) What else would I grep the plugins for?

nesges avatar Jan 09 '24 11:01 nesges

can you try to clear all caches and then re-check? it seems that no plugin is using the class 😳

pfefferle avatar Jan 09 '24 11:01 pfefferle

I tried clearing WP Super Cache and restarting Apache2 but still no luck. One thing has changed: The error appears on activation of ActivityPub only, which then fails and leaves the plugin inactive. So it doesn't break the site anymore

nesges avatar Jan 09 '24 11:01 nesges

some more greping over the whole installation:

root@gond:/var/www/html/d3/dnddeutsch.de/wordpress# grep -irl 'ActivityPub' . | grep -v '/plugins/activitypub/'
./wp-content/plugins/webmention/includes/class-receiver.php
./wp-content/plugins/webfinger/readme.txt
./wp-content/languages/plugins/activitypub-de_DE.po
./wp-content/languages/plugins/activitypub-de_DE.mo
root@gond:/var/www/html/d3/dnddeutsch.de/wordpress#

nesges avatar Jan 09 '24 11:01 nesges

Can you run the grep one folder above (wp-content) to also check mu-plugins and themes?

pfefferle avatar Jan 09 '24 15:01 pfefferle

And can you maybe also search directly for Activitypub\Model\Post in the ActivityPub plugin folder?

pfefferle avatar Jan 09 '24 15:01 pfefferle

root@gond:/var/www/html/d3/dnddeutsch.de/wordpress# grep -irl 'Activitypub.*Model.*Post' .
root@gond:/var/www/html/d3/dnddeutsch.de/wordpress#

This is odd. It should have found any mention of "Activitypub Model Post" including "Activitypub\Model\Post", ""Activitypub:Model:Post" etc. pp. anywhere in my installation, including wp-content/mu-plugins and themes but it just isn't there 🤔

nesges avatar Jan 09 '24 16:01 nesges

Can you run the grep one folder above (wp-content) to also check mu-plugins and themes?

they were already included since grep startet at the installation base (/var/www/html/d3/dnddeutsch.de/wordpress)

nesges avatar Jan 09 '24 16:01 nesges

Maybe anything in the database? I could search a dump 🤷

nesges avatar Jan 09 '24 16:01 nesges

today, i stumbled across the same error. I have these plugins installed:

/home/theragnarbay/public_html/wp-content/plugins# sudo -u www-data wp plugin list
+-----------------------------------+----------+--------+----------+
| name                              | status   | update | version  |
+-----------------------------------+----------+--------+----------+
| child-theme-configurator          | active   | none   | 2.6.3    |
| classic-editor                    | active   | none   | 1.6.3    |
| disable-remove-google-fonts       | active   | none   | 1.5.8    |
| disable-comments                  | active   | none   | 2.4.5    |
| easy-table-of-contents            | active   | none   | 2.0.61   |
| enable-mastodon-apps              | active   | none   | 0.6.2    |
| friends                           | active   | none   | 2.8.3    |
| head-meta-data                    | active   | none   | 20231026 |
| health-check                      | active   | none   | 1.7.0    |
| kirki                             | active   | none   | 5.0.0    |
| nodeinfo                          | active   | none   | 2.3.0    |
| photo-gallery                     | active   | none   | 1.8.19   |
| redirection                       | active   | none   | 5.4.1    |
| svg-support                       | active   | none   | 2.5.5    |
| webfinger                         | active   | none   | 3.2.7    |
| widget-css-classes                | active   | none   | 1.5.4.1  |
| wordfence                         | active   | none   | 7.11.1   |
| wp-geshi-highlight                | active   | none   | 1.4.3    |
| health-check-troubleshooting-mode | must-use | none   | 1.9.1    |
+-----------------------------------+----------+--------+----------+

Is there anything i can do to help?

ragnar76 avatar Jan 10 '24 00:01 ragnar76

Can you update the enable-mastodon-apps to the latest version?

pfefferle avatar Jan 10 '24 05:01 pfefferle

Last night, all plugins where uptodate, this morning there was indeed an update for enable-mastodon-apps. will do the update, reinstall Activitypub and test again

ragnar76 avatar Jan 10 '24 10:01 ragnar76

Nope, no luck :(

grafik

ragnar76 avatar Jan 10 '24 10:01 ragnar76

Do you use some kind of PHP cache like opcache for example? Can you try clearing that too?

pfefferle avatar Jan 10 '24 10:01 pfefferle

I don't use a caching system

grafik

ragnar76 avatar Jan 10 '24 12:01 ragnar76

I just tried deactivating all plugins, restarting apache2 and activating only ActivityPub, but the error stays. After that I even emptied the plugin-folder wp-content/plugins/ completely and tried activating ActivityPub with the same result. Please let me know if I can test something else!

nesges avatar Jan 10 '24 13:01 nesges

PS: can send phpinfo() via Mastodon-DM if it's of interest

nesges avatar Jan 10 '24 14:01 nesges

@ragnar76 can you try to deactivate the friends plugin and re-check?

pfefferle avatar Jan 10 '24 15:01 pfefferle

Yes, i did. No luck. It still breaks down

ragnar76 avatar Jan 10 '24 15:01 ragnar76

can one of you try to create the following file includes/model/class-post.php with this content:

<?php
namespace Activitypub\Model;

class Post {

}

pfefferle avatar Jan 10 '24 15:01 pfefferle

That did the trick, the plugin is active now on my site!

nesges avatar Jan 10 '24 15:01 nesges

can you browse one of your posts and add ?activitypub at the end of the URL... does it show proper JSON?

pfefferle avatar Jan 10 '24 15:01 pfefferle

looking good! https://www.dnddeutsch.de/adventsbasteln-mit-dd/?activitypub

nesges avatar Jan 10 '24 15:01 nesges

this is so weird 🤔

pfefferle avatar Jan 10 '24 16:01 pfefferle

can one of you try to create the following file includes/model/class-post.php with this content:

<?php
namespace Activitypub\Model;

class Post {

}

it's ok here, too https://www.informapirata.it/ https://www.informapirata.it/?activitypub

mauriziomarini avatar Jan 10 '24 16:01 mauriziomarini

can one of you try to create the following file includes/model/class-post.php with this content:

Hallo Matteo! Ich hatte gestern Abend das gleiche Problem mit der Informapirata.it-Site, direkt nach der Aktualisierung des Plugins.

Mein Blog war zuvor perfekt innerhalb der Föderation integriert, wie Sie hier sehen können: https://lemmy.world/post/10356319 aber dann wurde es unerreichbar

Bisher bestand die einzige Möglichkeit, das Problem zu lösen, darin, den Ordner „activity_pub“ mit dem Plugin zu löschen, das den Fehler verursachte, aber dank der von Ihnen vorgeschlagenen Änderung funktioniert die Site jetzt endlich

informapirata avatar Jan 10 '24 16:01 informapirata

Can you tell me which PHP version you use?

pfefferle avatar Jan 10 '24 16:01 pfefferle

8.0.2 thx

On Wed, Jan 10, 2024 at 5:49 PM Matthias Pfefferle @.***> wrote:

Can you tell me which PHP version you use?

— Reply to this email directly, view it on GitHub https://github.com/Automattic/wordpress-activitypub/issues/639#issuecomment-1885223528, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEABVOW3JYTZUWF3ILX4CTDYN3BBNAVCNFSM6AAAAABBS37OR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBVGIZDGNJSHA . You are receiving this because you commented.Message ID: @.***>

-- Maurizio Marini GSM +39-335-8259739

mauriziomarini avatar Jan 10 '24 16:01 mauriziomarini