84% activitypub

Code Review | ActivityPub

WordPress plugin ActivityPub scored84%from 54 tests.

About plugin

  • Plugin page: activitypub
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Sep 24, 2018
  • Latest release: Nov 18, 2023
  • Number of updates: 105
  • Update frequency: every 18.2 days
  • Top authors: pfefferle (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

4,000+ active /75,062 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▲3.04ms] Passed 4 tests

A check of server-side resources used by ActivityPub
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1439.45 ▼2.25
Dashboard /wp-admin3.45 ▲0.1448.15 ▲0.27
Posts /wp-admin/edit.php3.56 ▲0.2048.42 ▲3.63
Add New Post /wp-admin/post-new.php6.08 ▲0.20101.20 ▲10.49
Media Library /wp-admin/upload.php3.37 ▲0.1443.19 ▲12.12
Followers /wp-admin/users.php?page=activitypub-followers-list3.4237.69
ActivityPub /wp-admin/options-general.php?page=activitypub3.4336.25

Server storage [IO: ▲0.35MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 72 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
activitypub_db_version
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for ActivityPub
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲6914.72 ▲0.371.75 ▲0.0937.64 ▼7.94
Dashboard /wp-admin2,206 ▲265.60 ▼0.0594.30 ▼8.9842.75 ▼1.71
Posts /wp-admin/edit.php2,108 ▲82.03 ▲0.0138.89 ▲1.1336.33 ▲2.59
Add New Post /wp-admin/post-new.php1,709 ▲18021.78 ▼1.36701.81 ▲92.6137.52 ▼17.87
Media Library /wp-admin/upload.php1,411 ▲84.15 ▼0.0194.59 ▼4.4743.16 ▲2.07
Followers /wp-admin/users.php?page=activitypub-followers-list9762.0226.8028.17
ActivityPub /wp-admin/options-general.php?page=activitypub1,2862.3529.0932.64

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • activitypub_db_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 21× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Activitypub\\Collection\\Users' not found in wp-content/plugins/activitypub/templates/user-settings.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/activitypub/includes/table/class-followers.php on line 9
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/activitypub/includes/table/class-followers.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/activitypub/includes/table/class-followers.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'Activitypub\\Activity\\Actor' not found in wp-content/plugins/activitypub/includes/model/class-user.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Activitypub\\Model\\Blog_User' not found in wp-content/plugins/activitypub/templates/blog-json.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/activitypub/templates/post-json.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Activitypub\\Collection\\Users' not found in wp-content/plugins/activitypub/templates/author-json.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Activitypub\\Model\\Blog_User' not found in wp-content/plugins/activitypub/includes/model/class-application-user.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Activitypub\\Activity\\Base_Object' not found in wp-content/plugins/activitypub/includes/activity/class-activity.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: activitypub, fediverse, ostatus, activitystream

activitypub/activitypub.php 92% from 13 tests

The main file in "ActivityPub" v. 1.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected6,366 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP571,3953,1216,064
CSS3280173
JSON200104
JavaScript52125

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity15.05
▷ Minimum class complexity1.00
▷ Maximum class complexity70.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes39
▷ Abstract classes00.00%
▷ Concrete classes39100.00%
▷ Final classes00.00%
Methods323
▷ Static methods21265.63%
▷ Public methods30092.88%
▷ Protected methods195.88%
▷ Private methods41.24%
Functions47
▷ Named functions3165.96%
▷ Anonymous functions1634.04%
Constants18
▷ Global constants1372.22%
▷ Class constants527.78%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/wp-logo.png11.56KB8.15KB▼ 29.45%